Hi

The previously submitted patch missed properly indenting one of the 
hunks (I'm more used to using tabs), this uses the proper indentation 
levels but is otherwise identical to the previously submitted patch.
This builds upon the patch submitted in #755975 fixing a syntax error
in update-gummiboot, but doesn't depend on it semantically.

Regards
        Stefan Lippers-Hollmann
From 0239ea69e443402540613399abfddf8a3100d0f6 Mon Sep 17 00:00:00 2001
From: Stefan Lippers-Hollmann <s....@gmx.de>
Date: Fri, 25 Jul 2014 03:08:11 +0200
Subject: [PATCH 2/2] allow using multiple target locations for $GUMMIBOOT_EFI

This is useful for keeping multiple EFI system partitions in sync,
e.g. for a RAID setup using multiple disks. The EFI system partitions
must not be on the RAID array itself.

With this patch, it's possible to configure this in
/etc/default/gummiboot using this syntax:

GUMMIBOOT_EFI="/boot/efi /boot/efi1"

As before, gummiboot and efibootmgr need to be installed manually.

Signed-off-by: Stefan Lippers-Hollmann <s....@gmx.de>
---
 debian/gummiboot.postinst |  4 +++-
 debian/update-gummiboot   | 34 ++++++++++++++++++++--------------
 2 files changed, 23 insertions(+), 15 deletions(-)

diff --git a/debian/gummiboot.postinst b/debian/gummiboot.postinst
index 02fb99e..441837e 100644
--- a/debian/gummiboot.postinst
+++ b/debian/gummiboot.postinst
@@ -12,7 +12,9 @@ if [ "$1" = "configure" -a "$2" = "" ]; then
 fi
 
 if [ "$1" = "configure" ]; then
-    gummiboot update --path="$GUMMIBOOT_EFI" || :
+    for GUMMIBOOT_EFI_TARGET in $GUMMIBOOT_EFI; do
+        gummiboot update --path="$GUMMIBOOT_EFI_TARGET" || :
+    done
 fi
 
 #DEBHELPER#
diff --git a/debian/update-gummiboot b/debian/update-gummiboot
index 055742c..65973d0 100755
--- a/debian/update-gummiboot
+++ b/debian/update-gummiboot
@@ -29,29 +29,33 @@ determine_root() {
 }
 
 install_kernel() {
-    install -D /boot/vmlinuz-$KERNEL $GUMMIBOOT_EFI/$MACHINE_ID/$KERNEL/linux
-    if [ -e /boot/initrd.img-$KERNEL ]; then
-        install -D /boot/initrd.img-$KERNEL $GUMMIBOOT_EFI/$MACHINE_ID/$KERNEL/initrd
-    fi
+    for GUMMIBOOT_EFI_TARGET in $GUMMIBOOT_EFI; do
+        install -D /boot/vmlinuz-$KERNEL $GUMMIBOOT_EFI_TARGET/$MACHINE_ID/$KERNEL/linux
+        if [ -e /boot/initrd.img-$KERNEL ]; then
+            install -D /boot/initrd.img-$KERNEL $GUMMIBOOT_EFI_TARGET/$MACHINE_ID/$KERNEL/initrd
+        fi
+    done
 }
 
 install_entry() {
-    dir="$GUMMIBOOT_EFI/loader/entries/"
-    entry="$dir/$MACHINE_ID-$KERNEL.conf"
-    options="root=$GUMMIBOOT_ROOT $GUMMIBOOT_OPTIONS"
+    for GUMMIBOOT_EFI_TARGET in $GUMMIBOOT_EFI; do
+        dir="$GUMMIBOOT_EFI_TARGET/loader/entries/"
+        entry="$dir/$MACHINE_ID-$KERNEL.conf"
+        options="root=$GUMMIBOOT_ROOT $GUMMIBOOT_OPTIONS"
 
-    [ -e $dir ] || mkdir -p $dir
+        [ -e $dir ] || mkdir -p $dir
 
-    cat > $entry << EOF
+        cat > $entry << EOF
 title $PRETTY_NAME
 version $KERNEL
 machine-id $MACHINE_ID
 options $options
 linux /$MACHINE_ID/$KERNEL/linux
 EOF
-    if [ -e $GUMMIBOOT_EFI/$MACHINE_ID/$KERNEL/initrd ]; then
-        echo "initrd /$MACHINE_ID/$KERNEL/initrd" >> $entry
-    fi
+        if [ -e $GUMMIBOOT_EFI_TARGET/$MACHINE_ID/$KERNEL/initrd ]; then
+            echo "initrd /$MACHINE_ID/$KERNEL/initrd" >> $entry
+        fi
+    done
 }
 
 
@@ -77,8 +81,10 @@ do_install() {
 
 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
+    for GUMMIBOOT_EFI_TARGET in $GUMMIBOOT_EFI; do
+        rm -r $GUMMIBOOT_EFI_TARGET/$MACHINE_ID/$KERNEL/ || true
+        rm $GUMMIBOOT_EFI_TARGET/loader/entries/$MACHINE_ID-$KERNEL.conf || true
+    done
 }
 
 if [ -e /boot/vmlinuz-$KERNEL ]; then
-- 
2.0.1

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to