Skip to content
Rowan Decker edited this page Jun 14, 2013 · 6 revisions

Intro

Kernel_Chooser is able to boot any kernel and intrd. With some configuration, this allows almost any OS to be booted.

Kernel_Chooser

Kernel_Chooser will load its menu items from the '/data/.kernel.d/' folder.

If '/data/.kernel' exists, it will automatically be booted after 10 seconds (pressing any key will still display the menu).

Each config file has the following format:

title
blkdev:kernel:initrd
cmdline
  • title is the label to be displayed in the menu (can be blank)
  • blkdev is the "block device" containing the following boot files (ex: /dev/mmcblk0p8)
  • kernel is the path to the kernel to load (ex: /boot/zImage)
  • initrd is the path to an initial ram disk to load (optional, ex: /boot/initrd.img)
  • cmdline is the command line to be passed to the new kernel (optional)

If no cmdline is passed, the default one will be used. If it begins with a + it will be appended to the default. Otherwise, it will be used directly as the command line.

Note: each "guest" kernel must support kexec-hardboot in order to be booted. See Misc.

Android_Chooser

Android_Chooser will modify the fstab of an android initrd. This means multiple android installations can boot from different locations. Ever wanted to switch between Asus Stock and CyanogenMod AOSP with a reboot? Now you can :D

In your root_chooser config, add the following to your 'cmdline'

newandroid=blkdev:initd:fstab
  • blkdev is the partition containing the following files (ex: /dev/mmcblk0p8)
  • initrd is the path to the real android init (ex: /boot/android_init.img)
  • fstab is the path to the 'fstab' (ex: /boot/android_fstab.img)

The 'fstab' file will tell android_chooser how to mount the android rom. Its format is as follows:

source destination
  • source is the blkdir/directory/file to be mounted (ex: /data/system.img)
  • destination is the mount to override (ex: /system)

Note: Any errors will be stored in /data/android_chooser.log

Root_Chooser

Root_Chooser will chroot before starting an init. This means a (Linux) install can now run from a folder or "image" (.img) file.

In your root_chooser config, add the following to your 'cmdline'

newroot=blkdev:root:init,args...
  • blkdev is the partition containing the rootfs directory or file (ex: /dev/mmclk0p8)
  • root is the path to the rootfs (ex: /media/linux)
  • init is the path to the init file (ex: /sbin/init)
  • args is a list of arguments to pass to init (optional, ex: 'single')

Note: Any errors will be stored in /root_chooser.log


Samples

The following are some sample configuration files to guide you in the right direction.

Android

This will boot the normal android installation on your device (like it did before installing kernel_chooser).

/data/.kernel.d/android

Android
/dev/mmcblk0p8:/boot/android_zImage:/boot/android_initrd


Where /data/boot/android_zImage and /data/boot/android_initrd are your android boot files (NOTE TO SELF: Add "See here" page)

Dual Boot Android

This will boot a second android installation from ext4 formatted image files.

/data/.kernel.d/dualboot

Android (Second install)
/dev/mmcblk0p8:/boot/android2_zImage:/boot/android_chooser
+newandroid=/dev/mmcblk0p8:/boot/android2_initrd/:/boot/android2_fstab

/data/boot/android2_fstab

/system /boot/android2_system.img
/cache /boot/android2_cache.img
/data /boot/android2_data.img

Linux on sdcard

Linux (sdcard)
/dev/mmcblk0p8:/boot/linux_zImage:/boot/root_chooser
+newroot=/dev/mmcblk1p1:/:/sbin/init

Linux on USB

Linux (usb)
/dev/mmcblk0p8:/boot/linux_zImage:/boot/root_chooser
+newroot=/dev/sda1:/:/sbin/init

Linux in folder

Linux (dir)
/dev/mmcblk0p8:/boot/linux_zImage:/boot/root_chooser
+newroot=/dev/mmcblk0p8:/media/linux:/sbin/init

Linux in file (ext4 image)

Linux (file)
/dev/mmcblk0p8:/boot/linux_zImage:/boot/root_chooser
+newroot=/dev/mmcblk0p8:/media/linux.img:/sbin/init
Clone this wiki locally