mirror of
https://github.com/armbian/build.git
synced 2026-11-28 19:16:37 +00:00
On a board whose /boot is FAT32 there are no symlinks, so the kernel postinst
puts the image in place by moving it:
mv -v /boot/vmlinuz-<ver> /boot/Image
That consumes the source, and this postinst is re-run in normal operation: a
failing postinst.d hook (typically a DKMS build still waiting on its
linux-headers) is deliberately re-surfaced at the end of the script so apt
retries it. On the retry the mv finds nothing, aborts under set -e, and the
package can never leave iF. Seen on Radxa Cubie A5E, trunk.57.
Copying instead of moving is the obvious fix -- it is what every other board
already does -- but it needs /boot to hold a second copy of the image, and
FAT32 /boot was 256 MiB or less on 39 of the 50 fat boards. So rather than
choosing between copy and move at run time based on measured free space, give
the partition the room and copy unconditionally:
- DEFAULT_BOOTSIZE_FAT=512 MiB, used when BOOTFS_TYPE=fat and no size is set
(32 boards). ext4 /boot keeps DEFAULT_BOOTSIZE=256; it links rather than
copies, so it does not need the space.
- the 7 fat boards that set BOOTSIZE explicitly below 512 are bumped:
aml-s805-mxq 200, easepi-r2 256, longanpi-4b 256, microzed 128, odroidc1 200,
onecloud 256, imx8ulp family 128 (maaxboard-8ulp).
All 50 fat boards are now at 512 MiB or more.
The copy goes to a temp name and is renamed into place. A rename within one
filesystem is atomic, so an interrupted write cannot leave a torn image for
u-boot to try to boot -- which matters because the preinst has already removed
the previous kernel, so there is nothing to fall back on. The preinst cleanup
also removes a stale temp left by an interrupted earlier copy.
Signed-off-by: Igor Pecovnik <igor@armbian.com>
|
||
|---|---|---|
| .. | ||
| compress-checksum.sh | ||
| fingerprint.sh | ||
| initrd.sh | ||
| loop.sh | ||
| partitioning.sh | ||
| rootfs-to-image.sh | ||
| write-device.sh | ||