Monday, January 2, 2012

Multiboot Android for Debugging/Testing

This post will contain notes on setting up a multiboot environment on your Epic 4G, allowing you to boot different kernels and Android userspace "ROM's" stored on the sdcard.  This makes it faster and safer to test new builds.

<mkasick> EI22 on sdcard is just putting /system, /data, and /cache as mmcblk0p2-4 ext4-formatted partitions respectively
<mkasick> first, you'll need to flash back to EI22
<mkasick> and make a tar of /system to preserve uid and permission bits
<mkasick> "cd /system; busybox tar cf /sdcard/system.tar ." is what I use, you can run it from a root shell either in recovery (when /system is mounted) or while in Android since /system is always mounted read-only
<mkasick> and keep that guy around since it's very handy to have a properly-permissioned /system dump (which ironically, I don't have, at least not unmodified)
<mkasick> the instructions for formatting the sdcard are here:
<mkasick> the one difference is you'll have to use "mkfs.ext4 -O ^has_journal /dev/sdb2" (or device equivalent) to format the system partition for EI22 since it's large enough that the 8 MB journal takes too much space
<mkasick> or you can make the partition larger, but the journal doesn't matter sine it's never mounted rw after the first write
<mkasick> warren, and
<mkasick> the first is an EI22 custom kernel that runs EI22 installed on SD, the second are the patches against the kernel and a README with build instructions and how to prep the SD card
<mkasick> the patches are fairly minimal, it's a few to "better support" being kexec'd, and the userdebug patch which enables "adb root" to run adbd as root (if you don't already have a rooted /system), and the testkey public key if you use _its_ recovery to flash update.zips
<mkasick> which is unlikely, and you'd need to kexec into its recovery, but it's there
<mkasick> the kernel has partial BML support, it uses Samsung's param.ko and mounts /mnt/.lfs, but doesn't include rfs or attempts to mount /system,/data,/cache from OneNAND, so it will work fine on MTD devices.  

  • EI22 as root, tar the contents of /system in at tarball in order to preserve permissions.
mount -t vfat /dev/block/mmcblk0p1 /sdcard
cat /sdcard/busybox-armv6l > /tmp/busybox
chmod 755 /tmp/busybox
cd /system
rm etc/ recovery-from-boot.p
mount -ro remount /dev/block/stl9 /system
/tmp/busybox tar cvf /sdcard/system.tar .
umount /sdcard
  • Install CWM5 BML (for 3 finger boot recovery)
  • Install CM7 MTD.
  • Install CWM5 BML again.  This kernel supports kexec, so you can most easily boot into alternate ROM's from here.
  • Use this in CWM5 BML to reboot into CWM5 MTD if you want to modify your CM7 installation.
  • Something like this from CWM5 BML will allow you to boot into alternate ROM's.

No comments:

Post a Comment