Let’s describe my current dual boot setup between postmarketOS and android on my shift6mq shift-phone.
- Slot A: postmarketOS /boot with rootfs on SD card (mmcblk0)
- Slot B: android (shiftOS-G 5)
Installation:
I’ve followed the instructions at https://wiki.postmarketos.org/wiki/SHIFT_SHIFT6mq_(shift-axolotl).
Enter Fastbootd and ensure it is working as expected:
$ # Set "a" as active slot and reboot to fastbootd
$ fastboot --set-active=a
$ fastboot reboot fastboot
$ # Verify current slot is "a"
$ fastboot getvar current-slot
After you verified fastbootd works in the slot you have selected, you can install postmarketOS:
$ # Flash rootfs to system_a partition
$ pmbootstrap flasher flash_rootfs --partition system_a
$ # Flash kernel to boot
$ pmbootstrap flasher flash_kernel --partition boot_a
$ # Reboot to bootloader, as erasing dtbo is not working in fastbootd
$ fastboot reboot bootloader
$ # Erase dtbo_a partition, as it conflicts with our mainline kernel
$ # Note: this operation takes some time to complete
$ fastboot erase dtbo_a
$ # Reboot into postmarketOS
$ fastboot reboot
After rebooting, the shift6mq boots into postmarketOS, but the available space is very limited. So, I installed postmarketOS for a second time on a SD card with:
$ pmbootstrap init
$ pmbootstrap install --sdcard=/dev/mmcblk1
I’ve put that sdcard in my shift6mq and booted into postmarketOS and altered
/etc/fstab so it points to the /rootfs partition on the SD card instead of
the internal storage.
# <file system> <mount point> <type> <options> <dump> <pass>
# / on mmcblk0p2 (sdcard)
UUID=4540a2ee-6dc5-4294-8b24-a479b95836df / ext4 defaults 0 0
# /boot via boot_a
#mmcblk0p1: UUID=cb3d185d-4eb3-40b6-97e7-b6844e9493f7 /boot ext2 nodev,nosuid,noexec 0 0
UUID=82b9205c-2815-42ea-890a-aa15d1e50633 /boot ext2 nodev,nosuid,noexec 0 0
Then I ran the command mkinitfs. After rebooting, the shift6mq boots, but
with / on the SD card.
s6sxmo:~$ duf -hide special
╭─────────────────────────────────────────────────────────────────────╮
│ 1 local device │
├────────────┬────────┬───────┬───────┬───────┬──────┬────────────────┤
│ MOUNTED ON │ SIZE │ USED │ AVAIL │ USE% │ TYPE │ FILESYSTEM │
├────────────┼────────┼───────┼───────┼───────┼──────┼────────────────┤
│ / │ 116.4G │ 20.3G │ 90.1G │ 17.5% │ ext4 │ /dev/mmcblk0p2 │
╰────────────┴────────┴───────┴───────┴───────┴──────┴────────────────╯
Problem:
Nice, lot’s of free space and able to switch to slot B to start android. This seems perfect… but is it? No!
Strange, /boot isn’t mounted anymore and I’m not able to mount it again. Because of this mkinitfs
will fail. Doing an apk upgrade where a new kernel is installed will fail. So,
everytime there is a kernel upgrade I have to do:
$ pmbootstrap init
$ pmbootstrap install
$ pmbootstrap flasher flash_rootfs --partition system_a
$ pmbootstrap flasher flash_kernel --partition boot_a
$ vim /etc/fstab
$ mkinitfs
Not tested:
This isn’t tested very well. Lately I’m able to break things a lot, so this will probably not be different ;)