Closed winny- closed 7 months ago
I'm currently dealing with this. The 100MB partition blocked all of my upgrades... I'm using your repo temporarily, which is working great; thanks!
IMHO to introduce a new environment variable would be a better idea, as it allows compatibility for clouds and images that does have a ESP at /boot
:
mv -v /boot /boot.bak || { cp -a /boot /boot.bak ; rm -rf /boot/* ; umount /boot ; }
if isEFI; then
- mkdir -p /boot
- mount "$esp" /boot
- find /boot -depth ! -path /boot -exec rm -rf {} +
+ INFECT_EFI_PATH=${INFECT_EFI_PATH:-/boot}
+ mkdir -p $INFECT_EFI_PATH
+ mount "$esp" $INFECT_EFI_PATH
+ find $INFECT_EFI_PATH -depth ! -path $INFECT_EFI_PATH -exec rm -rf {} +
fi
Here's my understanding of how this works:
/boot
was always discarded, except in the case that EFI is being used to boot the system. In this case /boot
was being taken over for ESP and storing kernels./
, thereby ensuring there is free space for kernels, regardless of the original /boot
size./boot
. If EFI is needed, this partition is repurposed. Otherwise it's just an unused partition.Based on this understanding, is there still a use case for an environment variable? Is there a cloud hosting provider that doesn't work with this PR?
Maybe I'm not fully getting the problem or solution, or maybe I'm just biased towards using /boot and not /boot/efi as the mount point, but I'm reticent to have this change affect all providers. If it's rewritten to take effect on only the providers that need it, I'll merge it.
Hi there, I've been spending less time on NixOS projects and this is one of those places I've been reducing involvement. If anybody else wants to create a new PR based off this work, please feel free to reuse my work in any capacity.
Best, Winny
This seems to be a safer approach for infecting UEFI-based hosts. Test case:
To work around this, this PR uses the ESP partition strictly for ESP activities. Kernels and initramfs instead live on /boot within the rootfs. This should eliminate the space constraints on small ESP partitions that were being repurposed for kernel/initramfs.