SOLVED - Custom rootfs.img breaks SD installer

Evening,

I followed the scripts from @daniel-hung available here:

To create my own SD card image. It works flawlessly when using the pre-built boot.img and rootfs.img. I can even swap in my own custom kernel boot.img and it will install.

Leaving the build directories untouched and literally just swapping out my own custom rootfs.img for a linaro pre-built one and the installer breaks when trying to flash. I was able to do this last week but I swapped to a different dragonboard 410c and for some reason…

Logging into the booted installer image I’m seeing this in the console and syslog when installing successfully the linaro pre-built.

root@linaro-installer:~# [   56.991789]  mmcblk0: p1
[   58.537644]  mmcblk0: p1 p2
[   58.682873] blk_update_request: I/O error, dev loop0, sector 0
[   59.859961]  mmcblk0: p1 p2 p3
[   61.088999]  mmcblk0: p1 p2 p3 p4
[   61.230785] blk_update_request: I/O error, dev loop0, sector 0
[   62.424996]  mmcblk0: p1 p2 p3 p4 p5
[   63.685819]  mmcblk0: p1 p2 p3 p4 p5 p6
[   64.801180]  mmcblk0: p1 p2 p3 p4 p5 p6 p7
[   64.930209] blk_update_request: I/O error, dev loop0, sector 0
[   66.123696]  mmcblk0: p1 p2 p3 p4 p5 p6 p7 p8
[   68.331009]  mmcblk0: p1 p2 p3 p4 p5 p6 p7 p8 p9
[   70.295071]  mmcblk0: p1 p2 p3 p4 p5 p6 p7 p8 p9 p10
[   76.085188] random: crng init done

And when trying to install my custom rootfs.img:

[  357.174211] random: crng init done
[  379.760079]  mmcblk0: p1
[  381.321826]  mmcblk0: p1 p2
[  382.525689]  mmcblk0: p1 p2 p3
[  382.627490] blk_update_request: I/O error, dev loop0, sector 0
[  383.721720]  mmcblk0: p1 p2 p3 p4
[  383.879656] blk_update_request: I/O error, dev loop0, sector 0
[  384.993637]  mmcblk0: p1 p2 p3 p4 p5
[  386.136437]  mmcblk0: p1 p2 p3 p4 p5 p6
[  387.277063]  mmcblk0: p1 p2 p3 p4 p5 p6 p7
[  387.447637] blk_update_request: I/O error, dev loop0, sector 0
[  388.639639]  mmcblk0: p1 p2 p3 p4 p5 p6 p7 p8
[  390.714145]  mmcblk0: p1 p2 p3 p4 p5 p6 p7 p8 p9
[  391.946512]  mmcblk0: p1 p2 p3 p4 p5 p6 p7 p8 p9 p10

I’d love to troubleshoot this further but don’t know where to look. I think the installer is a compiled binary called ‘recovery’ which is running on the system. I don’t know how to invoke it from the command line or where it’s configuration is stored. I’d like to find out what in my rootfs is breaking the install script.

When I fastboot flash my rootfs to the dragonboard, it runs. So there is something that the installer does not like…

Thoughts?

hi,

can you please explain how you built your custom.img image? Is it an android sparse image? the flashing script expects a sparse image, and won’t work well otherwise.

The recovery app is a very simple Qt GUI, and it’s only purpose is to launch the flashing script which you can find here:

https://git.linaro.org/landing-teams/working/qualcomm/db-boot-tools.git/tree/flash

The GUI is used to choose an OS to install, and then it does:

QProcess burn;
burn.setWorkingDirectory(folder);
qDebug() << "Working folder: " << folder;
qDebug() << "Flavour: " << flavour;
burn.start(_root + "/flash -o /dev/mmcblk0");

You can easily run the flashing process manually by running the same command on the serial console.

1 Like

That fixed it! I was building a ext4 rootfs using debootstrap and I had some limited success flashing somehow. Perhaps with very small images it worked… Not worth tracking down as the sparse images work properly.

Thank you so much @anon91830841.

For anyone else, I’m using this fork of simg2img in my build script now. Easier than dealing with AOSP makes on the build machine.

great. thanks for the feedback.

note that ext4 image can work, but you would need to edit the file partitions.txt in the OS folder and remove the ‘fastboot’ attribute on the rootfs partition. e.g.

rootfs,0,fastboot,-rootfs.img

rootfs,0,-rootfs.img

Good to know. Six of one of half dozen of the other now…

I’m going to be looking to build an non-interactive SD flasher based off of these scripts, so this and going through other CI/Build scripts has been extremely helpful.

there is an (old) enhancement request to add support for non interactive SD flasher, see https://bugs.96boards.org/show_bug.cgi?id=58. Well, it’s non GUI, but if you end up doing something non interactive, I am sure it can be designed/used for non GUI, and serial console based as well. I hope you can share your work with everyone. If so, I could include it into our releases.

Sounds like a plan. I’ll make a post with what I stumble through with.