Last active
May 15, 2018 19:51
-
-
Save superboum/60fa6551707829b8bfdc6bf63efb83bf to your computer and use it in GitHub Desktop.
Boot Linux EFI without intermediate bootloader
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
#!/usr/bin/bash | |
# How to add a UEFI entry | |
# efibootmgr \ | |
# --disk /dev/sda \ | |
# --create \ | |
# --label 'Choisis moi' \ | |
# --loader '\EFI\efistub\vmlinuz' \ | |
# --unicode 'root=UUID=50200856-c21a-4bea-9412-bd2f7b27b8b5 ro rootflags=subvol=root rhgb quiet initrd=\EFI\efistub\initramfs' \ | |
# --verbose | |
VMLINUZ=$(ls /boot/|grep "vmlinuz"|grep -v "rescue"|tail -n1) | |
INITRAMFS=$(ls /boot/|grep "initram"|grep -v "rescue"|tail -n1) | |
EFIPART="/dev/sda1" | |
EFIMOUNT="/mnt/ssd-efi" | |
echo "Selected kernel: $VMLINUZ" | |
echo "Selected ramfs: $INITRAMFS" | |
mkdir -p $EFIMOUNT | |
mount $EFIPART $EFIMOUNT | |
echo "Start copy" | |
cp /boot/$VMLINUZ $EFIMOUNT/EFI/efistub/vmlinuz | |
cp /boot/$INITRAMFS $EFIMOUNT/EFI/efistub/initramfs | |
echo "Copy terminated" | |
umount -l $EFIMOUNT | |
echo "Done. Have fun." |
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
[Unit] | |
Description=Update Kernel | |
[Service] | |
Type=oneshot | |
RemainAfterExit=true | |
ExecStop=/usr/local/sbin/update-kernel | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment