Useless/confusing `boot.img` in `/boot` on Android devices
Describe your issue
I've been trying to understand the boot process a bit better, and have read some of the relevant bits from the wiki:
- https://wiki.postmarketos.org/wiki/Boot_process#LK_.28Android.29
- https://wiki.postmarketos.org/wiki/Partition_Layout
The first article linked above indicates that boot.img
is copied into a dedicated android partition as a raw file (e.g.: the partition is not formatted with a filesystem).
Most of the boot process described makes sense, but then I kept seeing /boot/boot.img
and couldn't really make heads or tails of where it fit into the boot process. As someone wanting to tinker with this process, I need to understand where this fits.
After inspecting and reading and scratching my head for a whole day, I took a leap of faith make an educated guess: "maybe it's not used at all and it's presence is a distraction?". I deleted the file and rebooted. The system booted fine, which confirmed my hypothesis that this file is not used.
This file should not be here; it's a distraction to anyone trying to understand or debug the process. E.g.: someone wanting to change the cmdline
might rebuild this file and go crazy trying to figure out why the updated cmdline
doesn't pick up.
What's the expected behaviour?
Unused/confusing/distracting file should be present.
What's the current behaviour?
File is present but useless and confusing.
How to reproduce your issue?
Install the edge image on a OnePlus 6. I don't quite know if this is an issue on other Android-based devices.
What device are you using?
oneplus-enchilada
On what postmarketOS version did you encounter the issue?
-
edge ( master
branch) -
v22.12
-
I confirm that the issue still is present after running sudo apk upgrade -a
On what environment did you encounter the issue?
Environments
-
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)
20230322-0344
Additional information
This file is not owned by any package. I tried ag boot.img
on pmaports
, but also can't find anything that would save this file into this location.
I do see that main/postmarketos-update-kernel/update-kernel.sh
copies the file into the "raw" boot partition, so my impression is that /boot
is used as a temporary staging area at some point, and the file is a leftover as a side effect.