[packages/efi-boot-update] --auto cmd-line option and ALLOW_AUTO flag added

jajcus jajcus at pld-linux.org
Wed Oct 31 15:19:22 CET 2012


commit fe76538b0123a15d456543e9e860796cf282898b
Author: Jacek Konieczny <j.konieczny at eggsoft.pl>
Date:   Wed Oct 31 15:18:18 2012 +0100

    --auto cmd-line option and ALLOW_AUTO flag added
    
    We don't want efi-boot-update run automatically whenever it is
    installed. It can break things if run e.g. during a chroot install.

 efi-boot-update | 14 +++++++++++++-
 update.conf     | 11 +++++++++++
 2 files changed, 24 insertions(+), 1 deletion(-)
---
diff --git a/efi-boot-update b/efi-boot-update
index e718db8..0684182 100755
--- a/efi-boot-update
+++ b/efi-boot-update
@@ -15,6 +15,7 @@ usage () {
     echo "  --mount, -m    Try to mount /boot/efi first"
     echo "  --verbose, -v  Verbose output"
     echo "  --force        Force file updates"
+    echo "  --auto         Automatic run from packages %post"
 }
 
 msg () {
@@ -149,14 +150,16 @@ safe_string () {
     echo -n "$*" | tr -c '[a-zA-Z0-9_]' '_'
 }
 
+ALLOW_AUTO="no"
 FORCE_UPDATES="no"
 MOUNT_EFI_PARTITION="no"
 LABEL_PREFIX=""
-DEFAULT=""
 VERBOSE="no"
 
 [ -e /etc/efi-boot/update.conf ] && . /etc/efi-boot/update.conf
 
+AUTO_RUN=no
+
 while [ -n "$*" ] ; do
     local arg
     arg="$1"
@@ -179,6 +182,10 @@ while [ -n "$*" ] ; do
         --force)
             FORCE_UPDATES="yes"
             ;;
+        --auto)
+            is_yes "$ALLOW_AUTO" || exit 0
+            AUTO_RUN=yes
+            ;;
         *)
             usage >&2
             exit 2
@@ -284,4 +291,9 @@ if [ -n "$ORDER" -a "$EFIBOOTMGR" != "/bin/true" ] ; then
     fi
 fi
 
+if ! is_yes "$ALLOW_AUTO" && ! is_yes "$AUTO_RUN"; then
+    msg "ALLOW_AUTO is not enabled in /etc/efi-boot/update.conf,"
+    msg "files will not be automatically updated on upgrades."
+fi
+
 # vi: ft=sh sw=4 sts=4 et
diff --git a/update.conf b/update.conf
index 4289c6b..b3a608c 100644
--- a/update.conf
+++ b/update.conf
@@ -1,3 +1,14 @@
+
+# Set to 'yes' to allow efi-boot-update being run automatically
+ALLOW_AUTO=no
+
+# Prefix for all module labels
 LABEL_PREFIX="PLD "
+
+# Preferred boot order
 ORDER="grub shellx64"
+
+# subdirectory on the EFI system partition to put files in
 PLATFORM_DIR="pld-linux/@ARCH@"
+
+# vi: ft=sh
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/efi-boot-update.git/commitdiff/fe76538b0123a15d456543e9e860796cf282898b



More information about the pld-cvs-commit mailing list