-
-
Save HiFiPhile/e0c7e79df8ca8ab85c74a6c38447a027 to your computer and use it in GitHub Desktop.
efi-hooks-arch
This file contains hidden or 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
# /etc/pacman.d/hooks/999-kernel-efi-copy.hook | |
[Trigger] | |
Type = File | |
Operation = Install | |
Operation = Upgrade | |
Target = boot/vmlinuz* | |
Target = usr/lib/initcpio/* | |
Target = boot/*-ucode.img | |
[Action] | |
Description = Copying linux and initramfs to EFI directory... | |
When = PostTransaction | |
Exec = /usr/local/bin/kernel-efi-copy.sh |
This file contains hidden or 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/env bash | |
# | |
# Copy kernel and initramfs images to EFI directory | |
# /usr/local/bin/kernel-efi-copy.sh | |
ESP_DIR="/boot/efi/EFI/arch" | |
for file in /boot/vmlinuz* | |
do | |
cp -af "$file" "$ESP_DIR/$(basename "$file").efi" | |
[[ $? -ne 0 ]] && exit 1 | |
done | |
for file in /boot/initramfs* | |
do | |
cp -af "$file" "$ESP_DIR/" | |
[[ $? -ne 0 ]] && exit 1 | |
done | |
[[ -e /boot/intel-ucode.img ]] && cp -af /boot/intel-ucode.img "$ESP_DIR/" | |
[[ -e /boot/amd-ucode.img ]] && cp -af /boot/amd-ucode.img "$ESP_DIR/" | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment