Skip to content

Instantly share code, notes, and snippets.

@akihiro
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akihiro/cb7af7ec6865da577a68 to your computer and use it in GitHub Desktop.
Save akihiro/cb7af7ec6865da577a68 to your computer and use it in GitHub Desktop.
Debian jessie gummiboot multi esp patch
--- update-gummiboot 2014-07-21 20:38:50.000000000 +0900
+++ update-gummiboot.new 2015-02-01 16:10:59.329668858 +0900
@@ -29,14 +30,16 @@
}
install_kernel() {
- install -D /boot/vmlinuz-$KERNEL $GUMMIBOOT_EFI/$MACHINE_ID/$KERNEL/linux
+ esp=$1
+ install -D /boot/vmlinuz-$KERNEL $esp/$MACHINE_ID/$KERNEL/linux
if [ -e /boot/initrd.img-$KERNEL ]; then
- install -D /boot/initrd.img-$KERNEL $GUMMIBOOT_EFI/$MACHINE_ID/$KERNEL/initrd
+ install -D /boot/initrd.img-$KERNEL $esp/$MACHINE_ID/$KERNEL/initrd
fi
}
install_entry() {
- dir="$GUMMIBOOT_EFI/loader/entries/"
+ esp=$1
+ dir="$esp/loader/entries/"
entry="$dir/$MACHINE_ID-$KERNEL.conf"
options="root=$GUMMIBOOT_ROOT $GUMMIBOOT_OPTIONS"
@@ -49,7 +52,7 @@
options $options
linux /$MACHINE_ID/$KERNEL/linux
EOF
- if [ -e $GUMMIBOOT_EFI/$MACHINE_ID/$KERNEL/initrd ]; then
+ if [ -e $esp/$MACHINE_ID/$KERNEL/initrd ]; then
echo "initrd /$MACHINE_ID/$KERNEL/initrd" >> $entry
fi
}
@@ -70,15 +73,21 @@
echo " /etc/default/gummiboot" >&2
exit 1
fi
- echo "Install $KERNEL to ESP" >&2
- install_kernel
- install_entry
+ IFS=':'
+ for esp in $GUMMIBOOT_EFI; do
+ echo "Install $KERNEL to $esp" >&2
+ install_kernel $esp
+ install_entry $esp
+ done
}
do_remove() {
- echo "Remove $KERNEL from ESP" >&2
- rm -r $GUMMIBOOT_EFI/$MACHINE_ID/$KERNEL/ || true
- rm $GUMMIBOOT_EFI/loader/entries/$MACHINE_ID-$KERNEL.conf || true
+ IFS=':'
+ for esp in $GUMMIBOOT_EFI; do
+ echo "Remove $KERNEL from $esp" >&2
+ rm -r $esp/$MACHINE_ID/$KERNEL/ || true
+ rm $esp/loader/entries/$MACHINE_ID-$KERNEL.conf || true
+ done
}
if [ -e /boot/vmlinuz-$KERNEL ]; then
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment