[TABLET Z COMPETITION ENTRY]Multiboot solution [Updated 31/07/2013]

Search This thread

rayman

Senior Recognized Developer
May 1, 2008
278
1,399
About:
The end-goal is to allow a graphical menu (similar to grub on PC's) that lets you boot different kernels (and ROMs - requires the ROM's to support it) from various media. This includes on-flash, SD based and USB but could theoretically also include network booting as well.

Method:
My current plan is to base the solution on the kexec-hardboot patches my mkasick. I've previously ported those patches to ASUS TF201 and my changes have then been adapted to Nexus 7 and is being used quite extensively.

At present time there is one big disadvantage to this method: It puts requirements on the target kernel. One of my goals in this project is to remove those requirements, so it will also work with stock unmodified kernels.

As far as the graphical part is concerned, the original plan was an extended KxecBoot(.org) or MultiBoot (based on TWRP).
After investigating the available solutions, I decided that I'd (shock-horror) implement my own. The current solutions seem overcomplicated to use and not exactly pretty to look at.

My solution, dubbed Hydra, is a simple - true-and-tried - grid of icons. It's based on recovery's minui graphics and the grid automatically aligns based on how many boot images are present. At present it is limited to 10 boot images, but this will be changed later.
The graphics rendering is optimized and will be improved further, possibly allowing for simple animations and such - but lets leave that for a v2 ;)

See screenshots in second post.
It works by reading a simple boot.ini, specifying name, icon, boot.img or raw kernel + ramdisk + cmdline. The device-specific commandline arguments required to boot the kernel will all features are automatically appended to the given cmdline, similarly to how the bootloader does it.
It is going to support multiple boot.ini's which are then merged to give the final set of images. This allows storing a boot.ini on e.g. microsd or usb storage and automatically get a suitable boot icon.

Source and images will come soon, there are a few minor issues that needs to be finished first.

Progress:
  • Tablet arrived!
  • 06/07/13: Kexec patches tested successfully! Kexec booting is a go!
  • 31/07/13: Multiboot solution is nearly done

Links:
Stock kernel with patches
CM Kernel with patches
Kexec tools with hardboot patches

Credits:
Mike Kasick for thinking up the original kexec hardboot patches
 
Last edited:

rayman

Senior Recognized Developer
May 1, 2008
278
1,399
Screenshots:
Actual example of boot images loaded from a boot.ini:
attachment.php


Test with 5 icons
attachment.php


Test with 10 icons:
attachment.php
 

Attachments

  • hydra_debian.jpg
    hydra_debian.jpg
    13.8 KB · Views: 4,133
  • hydra5.jpg
    hydra5.jpg
    16.4 KB · Views: 4,138
  • hydra16.jpg
    hydra16.jpg
    26.8 KB · Views: 4,124
Last edited:

rayman

Senior Recognized Developer
May 1, 2008
278
1,399
Frequently Asked Questions

FAQ:

How does it work?
In essence, it works by replacing kernel/bootimage in RAM while booting.

What does it allow booting from?
It allows booting from any media the linux kernel can access on the device. This includes internal flash (any partition), external SD card and USB Storage. In theory, it can also be extended to support booting over network

Are there any limitations?
No! Or yes. Due to the way android images mount filesystems, the image needs to be modified in order to boot a full system from e.g. SD. For regular linux this is not the case, because they support the 'root' commandline argument and loads filesystem information from that root.

Will it replace e.g. TWRP or CWM
Yes and no. It will replace the primary boot image of the tablet. This means that whenever the tablet boot, the multiboot solution runs. It can be setup to automatically boot an image after a configurable timeout, e.g. a few seconds usually and as such will add some seconds to the total bootup time. But really, how often do you turn off your tablet? :)
I'm looking at possibly including a CWM or TWRP image in the flashed image, to always have a backup recovery at hand.
 
Last edited:

juanyunis

Senior Member
Dec 21, 2010
152
41
Somewhere
Indeed, having a multiple boot options is something amazing, imaging having ubuntu touch and android running on 1 single device.
 

theZest

Senior Member
Oct 27, 2010
246
63
Vladivostok
Please take a look on Boot Menu Manager for Moto RAZR XT910. I guess it would help you somehow. At least for overall concept.

Carved in this thread with my RAZR HD
 
Last edited:

skiwong20

Senior Member
Nov 29, 2011
651
747
Google Pixel 4
Google Pixel 4 XL
i would like to see the multiboot option b used. i have a nexus 7 and love multiboot. i have like 5 roms in my list. i also have a droid razr and have tried BMM as mentioned but still think multiboot is the way to go. thanks for this project Rayman can't wait to see it evolve!
i get my tablet tmrw can't wait
 

rayman

Senior Recognized Developer
May 1, 2008
278
1,399
Good news! Tablet is here and the work can begin :)
Once I've tested my changes, I'll post the kernel changes required for initial version.
 
  • Like
Reactions: WythDryden

rayman

Senior Recognized Developer
May 1, 2008
278
1,399
The basic kexec-hardboot port works - sources pushed to github (See original post).
Basic howto for using it while I work on the remaining parts will come later.
 

rayman

Senior Recognized Developer
May 1, 2008
278
1,399
nice! good to see big progress already. question are you looking to make this project work with LK bootloader?

Eventually, yes.
Lilstevie and I have discussed this possibility (even before we found out we were both selected).
There are definitely advantages in having LK detect the kexec instead and boot the kernel in question instead of the kernel itself handling it.
 
  • Like
Reactions: skiwong20

DooMLoRD

Inactive Recognized Developer
Jul 27, 2010
13,187
39,710
Pune
The basic kexec-hardboot port works - sources pushed to github (See original post).
Basic howto for using it while I work on the remaining parts will come later.

so just to confirm,

you have tested the kexec booting to boot a custom kernel over stock kernel of xperia tablet z?

also the most recent patch is over a year old, so you mean to say that no other modifications were required to get this working on the apq8064 kernel of sony?

just saw the sources... from what i understand this will only work with a base kernel which has these patches, meaning it will be of no use on locked bootloader devices... if we are able to create this for locked bootloader i believe this will be much more useful...
 
Last edited:

rayman

Senior Recognized Developer
May 1, 2008
278
1,399
so just to confirm,

you have tested the kexec booting to boot a custom kernel over stock kernel of xperia tablet z?
I have tested booting a ram-loaded kernel from a custom kernel using the source I provide.
also the most recent patch is over a year old, so you mean to say that no other modifications were required to get this working on the apq8064 kernel of sony?
No. There were modifications - I just failed at cherrypicking the changes from my private tree. (wrong order)

just saw the sources... from what i understand this will only work with a base kernel which has these patches, meaning it will be of no use on locked bootloader devices... if we are able to create this for locked bootloader i believe this will be much more useful...
That was never part of this task. "Regular" Kexec is a lot harder to get working because you have to actually deinitialize a lot of hardware and reinitialize it without trouble. Not even always possible without a power cycle.
Personally, I'm not interested in solutions for locked bootloaders. The purpose of this is multi boot. In particular being able to boot something like e.g. ubuntu touch or Mer/Nemomobile by just selecting a menu item and the same for android.
At the moment is also requires modifications to the target kernel, but this is one of the issues I plan to address.
 
  • Like
Reactions: spoonymoon

Sacob

Senior Member
Jan 8, 2011
918
84
do you think it will be possible, one day, to dual boot android and ubuntu touch with this tablet?
 

Sacob

Senior Member
Jan 8, 2011
918
84
i could only find dual boot with android and ubuntu, not ubuntu touch.. does the rom have to be modded to work with multiROM?

i'm asking all this questions because i'm considering to buy this tablet. does the roms differ from 16gb/32gb version?
 

skiwong20

Senior Member
Nov 29, 2011
651
747
Google Pixel 4
Google Pixel 4 XL
well i am pretty sure ubuntu touch can b dual booted with android. ubuntu touch is built off CM base for most of the devices that have a ubuntu touch port. to multiboot any rom the kernel need a patch that rayman will have on github.
16 nd 32 g dont matter for build, but there are wifi only model: Sgp311= 16g Sgp312=32g . which the nickname for those is pollux_windy. and they have a 3g model=SGP321= nickenamed pollux. u have to make sure when u choose a aosp rom u r getting the right nickname build for the device u buy

Sent from my SGP311 using xda app-developers app
 
  • Like
Reactions: Sacob

rayman

Senior Recognized Developer
May 1, 2008
278
1,399
i could only find dual boot with android and ubuntu, not ubuntu touch.. does the rom have to be modded to work with multiROM?

i'm asking all this questions because i'm considering to buy this tablet. does the roms differ from 16gb/32gb version?

well i am pretty sure ubuntu touch can b dual booted with android. ubuntu touch is built off CM base for most of the devices that have a ubuntu touch port. to multiboot any rom the kernel need a patch that rayman will have on github.
16 nd 32 g dont matter for build, but there are wifi only model: Sgp311= 16g Sgp312=32g . which the nickname for those is pollux_windy. and they have a 3g model=SGP321= nickenamed pollux. u have to make sure when u choose a aosp rom u r getting the right nickname build for the device u buy

Sent from my SGP311 using xda app-developers app


The ROM has to be modded to allow multi boot - primarily, the issue is that android mounts system, cache, data etc from a static configuration.
This means a multi-booted rom needs to somehow know where to mount these partitions from. It's a minor change and I'll certainly look into if I can find a good way to do this.

Ubuntu touch on the other hand will probably work unmodified, especially with the recent developments towards running the minimal android environment inside an lxc container.

I'm also hoping to eliminate the need to patch the target kernel (the on-flash kernel needs my patches!), but no guarantees there.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 8
    About:
    The end-goal is to allow a graphical menu (similar to grub on PC's) that lets you boot different kernels (and ROMs - requires the ROM's to support it) from various media. This includes on-flash, SD based and USB but could theoretically also include network booting as well.

    Method:
    My current plan is to base the solution on the kexec-hardboot patches my mkasick. I've previously ported those patches to ASUS TF201 and my changes have then been adapted to Nexus 7 and is being used quite extensively.

    At present time there is one big disadvantage to this method: It puts requirements on the target kernel. One of my goals in this project is to remove those requirements, so it will also work with stock unmodified kernels.

    As far as the graphical part is concerned, the original plan was an extended KxecBoot(.org) or MultiBoot (based on TWRP).
    After investigating the available solutions, I decided that I'd (shock-horror) implement my own. The current solutions seem overcomplicated to use and not exactly pretty to look at.

    My solution, dubbed Hydra, is a simple - true-and-tried - grid of icons. It's based on recovery's minui graphics and the grid automatically aligns based on how many boot images are present. At present it is limited to 10 boot images, but this will be changed later.
    The graphics rendering is optimized and will be improved further, possibly allowing for simple animations and such - but lets leave that for a v2 ;)

    See screenshots in second post.
    It works by reading a simple boot.ini, specifying name, icon, boot.img or raw kernel + ramdisk + cmdline. The device-specific commandline arguments required to boot the kernel will all features are automatically appended to the given cmdline, similarly to how the bootloader does it.
    It is going to support multiple boot.ini's which are then merged to give the final set of images. This allows storing a boot.ini on e.g. microsd or usb storage and automatically get a suitable boot icon.

    Source and images will come soon, there are a few minor issues that needs to be finished first.

    Progress:
    • Tablet arrived!
    • 06/07/13: Kexec patches tested successfully! Kexec booting is a go!
    • 31/07/13: Multiboot solution is nearly done

    Links:
    Stock kernel with patches
    CM Kernel with patches
    Kexec tools with hardboot patches

    Credits:
    Mike Kasick for thinking up the original kexec hardboot patches
    3
    Screenshots:
    Actual example of boot images loaded from a boot.ini:
    attachment.php


    Test with 5 icons
    attachment.php


    Test with 10 icons:
    attachment.php
    3
    Hi, any progress with this, is it still under development?
    3
    Any chance to see a working multiboot in the next time ??

    On xda are so many very nice proof of concept Images for Tablet-Z but up to now nothing for release....

    Original 4.2.2 seems to be the best at this time > With GPS and HDMI ... ;)

    Therefore it would be great to have a stable multiboot to use Original but test and play with PacMan and Ubuntu.... without flashing 3times a day..
    2
    this one is interesting...

    if u can get the kexec to work getting the menu to work is easy... i had created someting similar WAY BACK for the Xperia X10: