Before running all the commands below, you must be sure about what you are doing. A single error will render your whole system unable to boot anymore.
We won't be responsible if you break your system by running them.
We've used them to debug issues related to boot partitions being too small to be used to store the compiled custom kernel.
If your /boot
partition size is smaller than 2GB but still bigger than 1GB, you can try the following (and dangerous) workarounds in the next sections.
- Create temporary boot folder
mkdir -v /tmp/boot
- Copy
/boot
partition content
cp -rav /boot/* /tmp/boot/
- Create
initramfs
file
sudo update-initramfs -v -c -k <version> -b /tmp/boot/
- Check created
initrd
files
ls -halF /tmp/boot
- Copy created
initrd
files to original/boot
partition
cp -rauv /tmp/boot/* /boot/
- Get the device behind the
/boot
partition
BOOT_DEVICE=$(mount | grep -v /efi | grep /boot | cut -d" " -f1) ; echo "$BOOT_DEVICE"
- Get the mount options of the
/boot
partition
BOOT_MNT_OPTS=$(mount | grep -v /efi | grep /boot | cut -d" " -f6) ; BOOT_MNT_OPTS="${BOOT_MNT_OPTS/\(/}" ; BOOT_MNT_OPTS="${BOOT_MNT_OPTS/\)/}" ; echo "$BOOT_MNT_OPTS"
- Create temporary boot folder
mkdir -v /tmp/boot
- Copy
/boot
partition content
cp -rav /boot/* /tmp/boot/
- Unmount
/boot
partition
sudo umount -v /boot
- Create
bind
mount
sudo mount -v --bind /tmp/boot /boot
- Create
initramfs
file
sudo update-initramfs -v -c -k <version>
- Remove
bind
mount
sudo umount -v /boot
- Mount original
/boot
partition
sudo mount -v $BOOT_DEVICE /boot -o $BOOT_MNT_OPTIONS
- Check created
initrd
files
ls -halF /tmp/boot
- Copy created
initrd
files to original/boot
partition
cp -rauv /tmp/boot/* /boot/
If everything went well until there, you can reboot and you should normally see and boot onto your custom kernel.