Results 1 to 7 of 7

Thread: Multi-boot system for Recovery

  1. [translate]    #1
    Senior Member
    Join Date
    Jul 2010
    Location
    Hungary
    Posts
    766

    Post Multi-boot system for Recovery

    I have developed this for froyo dual-booting, but I think it's worth a separate thread, because this can be used for any other android(in fact, I think for any linux os).

    A little summary of the functions:
    • It supports up to 20 OS’s on SD Card
    • If there is at least one installed, a boot loader comes up before recovery and let you choose which OS you want to manage.
    • If there isn't, the recovery for internal memory comes up
    • Every OS can be managed by the recovery
    • That means you can install update packages, wipe data and cache, make and restore backups on any of the installed Operating Systems.
    • You can choose between operating system in recovery without having to reboot
    • You can boot every OS, except the internal one, with the Boot menu.


    My idea behind this, is to use the standard android init as a second init inside recovery. In other words, the android system will start inside the recovery system.

    Source:

    The required changes for initramfs can be found here: Xmister's i5700-leshak-initramfs at froyo - GitHub
    And the recovery changes here: Xmister's i5700-leshak-recovery2 at master - GitHub

    And here is a precompiled kernel by myself(for Odin): Xmister_PDA.tar at master from Xmister's i5700-leshak-kernel - GitHub (View raw to download)

    The changes in recovery was started by mik_os, and almost completely rewritten by me.(Different idea, different functionality.)

    Some kind of "specification":

    If you want to create a new boot line in the menu, you should create a directory for it on SD-card with the following structure:
    Code:
    data.img - Recommended ext4 FS and completely free
    system.img - Recommended ext4 FS and should contain the system files of the new OS
    init.sh - Explained later
    init.rc - Delete mount commands for system,data and sd card, and replace "symlink /mnt/sdcard /sdcard" with "symlink /sdcard /mnt/sdcard"(for froyo)
    Then add a line of the directory name to /sdcard/.bootlst
    Example shell command:
    Code:
    echo "froyo" >> /sdcard/.bootlst
    Example of init.sh:
    Code:
    #!/xbin/ash
    LOG="boot_os.log"
    mknod /dev/loop0 b 7 0
    echo $? > $LOG
    mknod /dev/loop1 b 7 1
    echo $? >> $LOG
    echo "Mounting data..." >> $LOG
    mount -t ext4 -o loop,rw,noatime,nodiratime,nosuid,nodev,data=ordered,barrier=1 data.img /data
    echo $? >> $LOG
    echo "Mounting system..." >> $LOG
    mount -t ext4 -o loop,ro,noatime,nodiratime,nosuid,nodev,data=ordered,barrier=1 system.img /system
    echo $? >> $LOG
    cp init.rc /init.rc
    echo $? >> $LOG
    Note: Don't forget the cp init.rc /init.rc !

    The Method of the booting:
    0. User selects which OS to manage. (running update zips, formatting, etc).
    1. After the finish of managing, the user selects "Boot <os>" menu, where <os> is the name of the os
    2. Recovery runs init.sh inside the given directory, and waits until it's finish.
    3. Recovery executing /init_new, which is a standard android init and thus capable of booting a system inside recovery with the actual init.rc (Which has been overwritten for the session by init.sh).
    Last edited by Xmister; 10-30-2010 at 03:10 AM.
    EXT ModMulti-Boot System
    Ultimate Spica Recovery
    My newest kernel+recovery for Odin can always be found here
    If you would like to help me a little, register at Xpango, and complete a free offer. (By the way, if you complete enough offer you will get a Galaxy SII for free)
    Or you can simply DONATE, if you like my work! PayPal address: xmisterhu@gmail.com

  2. [translate]    #2
    Senior Member
    Join Date
    Jun 2010
    Location
    Kiev
    Posts
    761

    Default

    Quote Originally Posted by Xmister View Post
    3. Recovery steps into a infinite loop to avoid interference with the started OS.
    and have a nice day to your battery

  3. [translate]    #3
    Senior Member
    Join Date
    Jul 2010
    Location
    Hungary
    Posts
    766

    Default

    Quote Originally Posted by Yuna View Post
    and have a nice day to your battery
    Not exactly, it sleeps for 15 minutes before restarting the loop. So it's almost zero extra load.

    Proof:
    Code:
    uptime
     11:10:48 up 24 min, load average: 0.00, 0.13, 0.47
    Last edited by Xmister; 10-07-2010 at 01:12 PM.
    EXT ModMulti-Boot System
    Ultimate Spica Recovery
    My newest kernel+recovery for Odin can always be found here
    If you would like to help me a little, register at Xpango, and complete a free offer. (By the way, if you complete enough offer you will get a Galaxy SII for free)
    Or you can simply DONATE, if you like my work! PayPal address: xmisterhu@gmail.com

  4. [translate]    #4
    Senior Member
    Join Date
    Jul 2010
    Location
    Hungary
    Posts
    766

    Default

    Updated recovery to be able to manage the systems separately!
    EXT ModMulti-Boot System
    Ultimate Spica Recovery
    My newest kernel+recovery for Odin can always be found here
    If you would like to help me a little, register at Xpango, and complete a free offer. (By the way, if you complete enough offer you will get a Galaxy SII for free)
    Or you can simply DONATE, if you like my work! PayPal address: xmisterhu@gmail.com

  5. [translate]    #5
    Moderator
    Join Date
    Jun 2010
    Location
    Warsaw, Poland
    Posts
    3,706

    Default

    Quote Originally Posted by Xmister View Post
    3. Recovery steps into a infinite loop to avoid interference with the started OS.
    Looks a bit unprofessional to me... Maybe just call execve to run the original init. You can read about it here: execve(2): execute program - Linux man page
    Follow me on twitter.
    My projects: CyanogenMod 7.x Nightly for Spica | Kernel 3.0 | OpenFIMG | Others
    In case of problems with CM7 for Spica: Troubleshooting thread
    Samsung is a registered trademark of Samsung Group, Samsung Electronics and it's listed subsidiaries.
    Views expressed herein are my own and do not necessarily represent the views of my employer.

  6. [translate]    #6
    Senior Member
    Join Date
    Jul 2010
    Location
    Hungary
    Posts
    766

    Default

    Quote Originally Posted by tom3q View Post
    Looks a bit unprofessional to me... Maybe just call execve to run the original init. You can read about it here: execve(2): execute program - Linux man page
    I'm sorry, that was an old version, it's not using loop now since a few version for this now
    I'm fixing the first post.
    EXT ModMulti-Boot System
    Ultimate Spica Recovery
    My newest kernel+recovery for Odin can always be found here
    If you would like to help me a little, register at Xpango, and complete a free offer. (By the way, if you complete enough offer you will get a Galaxy SII for free)
    Or you can simply DONATE, if you like my work! PayPal address: xmisterhu@gmail.com

  7. [translate]    #7
    Moderator
    Join Date
    Jun 2010
    Location
    Warsaw, Poland
    Posts
    3,706

    Default

    Quote Originally Posted by Xmister View Post
    I'm sorry, that was an old version, it's not using loop now since a few version for this now
    I'm fixing the first post.
    Ok. Sorry about bothering you then. Nice work.
    Follow me on twitter.
    My projects: CyanogenMod 7.x Nightly for Spica | Kernel 3.0 | OpenFIMG | Others
    In case of problems with CM7 for Spica: Troubleshooting thread
    Samsung is a registered trademark of Samsung Group, Samsung Electronics and it's listed subsidiaries.
    Views expressed herein are my own and do not necessarily represent the views of my employer.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •