Created
September 7, 2017 05:51
-
-
Save snazzybunny/d2bf911b4c72eeb397233ac953d0a432 to your computer and use it in GitHub Desktop.
recreate initramfs and update grub entries
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
KERNEL_VERSION=$(ls -t /lib/modules/ |grep 'bootstrap\|jwrdegoede' |head -n 1) | |
# recreate initramfs image | |
if [ -f /usr/sbin/update-initramfs ]; then | |
update-initramfs -c -k ${KERNEL_VERSION} || update-initramfs -u -k ${KERNEL_VERSION} | |
elif [ -f /usr/bin/dracut ]; then | |
dracut -f /boot/initrd.img-${KERNEL_VERSION} ${KERNEL_VERSION} | |
elif [ -f /usr/bin/mkinitcpio ]; then | |
mkinitcpio -c /etc/mkinitcpio.conf -g /boot/initrd.img-${KERNEL_VERSION} -k ${KERNEL_VERSION} || true | |
fi | |
# Update grub config | |
if [ -f /usr/bin/grub-mkconfig ]; then | |
grub-mkconfig -o /boot/grub/grub.cfg | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment