-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sd-image: FAT free /boot #62462
sd-image: FAT free /boot #62462
Conversation
be50d6f
to
cdeb028
Compare
I removed the only controversial change from the PR, it wasn't worth it in the end. Furthermore, the only advantage that it brought still is present by moving |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't been able to test this yet, but it looks good 👍
The current FAT32 partition is kept as it is required for the Raspberry Pi family of hardware. It is where the firmware is kept. The partition is kept bootable, and the boot files kept in there until the following commits, to keep all commits of this series individually bootable.
This will allow adding /boot files to the rootfs.
The slack, seemingly, accounted for more than the minimum required for slack plus the two partitions. This change makes the gap a somewhat abstracted amount, but is not configurable within the derivation.
This will keep configuration configuring the size of the /boot partition still build, while showing the deprecation warning. In 99.9% of cases I assume ignoring the configuration is better, as the sd-image builder already is pretty opinionated in that matter.
cdeb028
to
288118c
Compare
Added |
I wonder whether it would be possible (/ worthwhile) to remove the firmware partition from the generic sd-image but make it so that the raspberry pi derivation could override the necessary parts. |
@Thra11 it should be possible, though in the interest of ease of use, not worthwhile, we end up putting that partition as "a" default firmware, which is for the most popular aarch64 platform. We would still need to reserve the same amount of space in front of the system. So there would be no gain, other than removing a partition that isn't used by the system anymore. |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/raspberry-pi-3b-doesnt-boot-without-a-screen/6802/9 |
Motivation for this change
A. Booting from ext4
Fixes #51924
This fixes one annoyance and allows recovering a bit of space.
The annoyance is that there is about 100MiB free for the generations on the
/boot
partition in the current state of the SD images. This is not much whenplaying around with kernels and this limit is often hit.
By using the FAT32 partition as a "firmware-only" partition for the Raspberry
Pi, we can reduce its size to a minimum required to hold the firmware-esque
bits required for boot. This allows us to cut ~100MiB of space.
B. Review "firmware" setup
By treating the FAT32 partition exactly as if it was a firmware bit, we can:
This is not entirely useful, but this makes it easier to allow bigger firmwares
to be fused to the SD image as a user only has to remove the FAT32
partition to gain more space if needed (e.g. with some Rockchip firmwares).
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
nix path-info -S
nix path-info -s
before and after)Here's the diff of the size of the image; the closure itself doesn't really change more.
All commits in the series should be independently good and able to build and boot. I verified boot at each step.
This was verified on:
fusing: I am using "fusing" as the term for the usual
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=1024 seek=8
for SoCs that read the firmware off the storage at a specific offset.