Unable to install prebuilt images to SD card.
Describe your issue
What's the expected behaviour?
I want to install postmarketOS to SD card to dualboot it with android. My phone has A/B so I want to install pmOS to second slot to dualboot. I think If I flash lk2nd and boot.img to second slot boot partition and rootfs image to SD card it should boot and work normaly.
I do not have SD card adapter for pc.
What's the current behaviour?
lk2nd boots and then after bit of loading it shows something like: ERROR: boot partition not found, retrying... Linux 6.7.9
It shows that infinitely and reboot does change anything.
How to reproduce your issue?
- Download prebuilt images to pc
- uncompress them on pc
- send rootfs image to android phone
- I tried without and with this step: convert sparse rootfs image to regular using simg2img.
-
dd if=rootfs.img of=/dev/block/mmcblk1 bs=4M status=progress
flash rootfs image to sdcard using dd - reboot phone to fastboot
-
fastboot --set-active=b
switch to second slot -
fastboot flash boot lk2nd.img
flash lk2nd to boot -
fastboot reboot
and hold volume down button when androidone logo apears to get into lk2nd menu -
fastboot flash boot boot.img
flash boot.img to boot from lk2nd fastboot reboot
I tried to use simg2img on rootfs image as one Matrix user suggested. I compiled simg2img from github source.
What device are you using?
xiaomi-daisy / Xiaomi MI A2 Lite
On what postmarketOS version did you encounter the issue?
-
edge ( master
branch) -
v23.12
-
v23.06
(supported until 2024-01-18) -
I confirm that the issue still is present after running sudo apk upgrade -a
On what environment did you encounter the issue?
Environments
-
GNOME Shell on Mobile -
Phosh -
Plasma Mobile -
Sxmo (Wayland/Sway) Please post the output of sxmo_version.sh
-
Other: Please fill out
How did you get postmarketOS image?
-
from https://images.postmarketos.org -
I built it using pmbootstrap -
It was preinstalled on my device
What's the build date of the image? (in yyyy-mm-dd format)
20240327
Additional information
Output of unchanged file rootfs.img
:
Android sparse image, version: 1.0, Total of 431360 4096-byte output blocks in 3763 input chunks.
Output of converted file rootfs.img:
DOS/MBR boot sector; partition 1 : ID=0x83, active, start-CHS (0x4,4,1), end-CHS (0x3d3,210,2), startsector 2048, 497664 sectors; partition 2 : ID=0x83, start-CHS (0x3d3,211,1), end-CHS (0x3ff,254,2), startsector 499712, 2951168 sectors
Outputs of some commands ran in rooted Android termux, with conversion from sparse to regular rootfs image:
sudo fdisk /dev/block/mmcblk1
and then p
:
Disk /dev/block/mmcblk1: 116.58 GiB, 125174808576 bytes, 244482048 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x3fadf813
Device Boot Start End Sectors Size Id Type
/dev/block/mmcblk1p1 * 2048 499711 497664 243M 83 Linux
/dev/block/mmcblk1p2 499712 3450879 2951168 1.4G 83 Linux
sudo blkid
:
/dev/block/mmcblk1p1: LABEL="pmOS_boot" UUID="176c3dbc-ac1f-45e6-a708-ff82a9a328bf" BLOCK_SIZE="1024" TYPE="ext2" PARTUUID="3fadf813-01"
/dev/block/mmcblk1p2: LABEL="pmOS_root" UUID="9a98c65e-c503-4948-9b55-2124748140d4" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="3fadf813-02"
I have checked sha256 checksums of downloaded files and they are okay. Also output image of simg2img I did on Android Termux and one I did on my OpenSUSE Tumbleweed pc have same checksums.
I do not want to buy adapter for SD card and I need android. Waydroid doesn't really work.
If I did something wrong please provide me with correct way and provide commands as I do not know much about pmOS, Linux, Android and etc. If it is a bug please fix it and provide with workaround
I do not know how to assign labels to this issue. I want to assing "help wanted" and "difficulty easy".