]> git.pld-linux.org Git - packages/efi-boot-update.git/blobdiff - efi-boot-update
xen.conf removed
[packages/efi-boot-update.git] / efi-boot-update
index 930e93628fac224dac4d98729cd8ecbe8f1fff69..0684182c8b82f9a464b52a651c2590809dc30c0a 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 _SCRIPT_NAME=efi-boot-update
-_SCRIPT_VERSION=0.0
+_SCRIPT_VERSION=0.1
 
 . /etc/rc.d/init.d/functions
 
@@ -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
@@ -247,7 +254,7 @@ for bootloader_conf in /etc/efi-boot/update.d/*.conf ; do
     local efi_arch
     if [[ "$ARCH" = i?86 || "$ARCH" = pentium[45] || "$ARCH" = "athlon" ]] ; then
         # %ix86
-        efi_arch=x32
+        efi_arch=ia32
     elif [[ "$ARCH" = "x86_64" || "$ARCH" = "amd64" || "$ARCH" = "ia32e" ]] ; then
         # %x8664
         efi_arch=x64
@@ -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
This page took 0.084044 seconds and 4 git commands to generate.