Skip to content

add losetup-rootfs-img script: boot from rootfs image files

this script sets up a loop device for the root filesystem image stored in a drive. I wrote this script initially for mobian to achieve dualbooting without external-sdcard or re-partitioning android storage.

I've tested this script in PC as well.

Example:

  • In the context of Android, if we've stored the rootfs image in the eMMC path (e.g., /sdcard/myrootfs.img), we can provide the following cmdline value to boot the OS from the rootfs image:
rootimg=sda3/{path_to_the_rootfs.img_file}
rootimg=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/{path_to_the_rootfs.img_file}
rootimg=PARTUUID={value}/{path_to_the_rootfs.img_file}
rootimg=PARTLABEL={value}/{path_to_the_rootfs.img_file}
Edited by Shubham Vishwakarma

Merge request reports

Loading