]> git.pld-linux.org Git - packages/efi-boot-update.git/commitdiff
@EFI_PLATFORM_PATH@ macro for us in $ARGS
authorJacek Konieczny <jajcus@jajcus.net>
Thu, 24 Oct 2013 19:20:34 +0000 (21:20 +0200)
committerJacek Konieczny <jajcus@jajcus.net>
Thu, 24 Oct 2013 19:30:13 +0000 (21:30 +0200)
Linux kernel EFI stub requires absolute EFI path to the initrd,
this way we can set it without hardcoding the $PLATFORM_DIR

README
efi-boot-update

diff --git a/README b/README
index 19d147dad2c3b711608203a297672e5533764c42..38e264011529474f0847fb8051bd076b8dec1a94 100644 (file)
--- a/README
+++ b/README
@@ -68,6 +68,8 @@ Following variables can be set there:
     architecture ('x64' or 'x32') for which the application was built (boot
     loaders may have both 32-bit and 64-bit versions and it may be different
     architecture that the one Linux is running).
     architecture ('x64' or 'x32') for which the application was built (boot
     loaders may have both 32-bit and 64-bit versions and it may be different
     architecture that the one Linux is running).
+    EFI path to this directory (\EFI\...) will be available as
+    '@EFI_PLATFORM_PATH@' for setting the $ARGS module parameter.
 
 modules in /etc/efi-boot/update.d
 .................................
 
 modules in /etc/efi-boot/update.d
 .................................
@@ -83,7 +85,8 @@ Following variables can be be set for each module:
     name)
   * BINARY – name of the EFI binary installed in /boot/efi/EFI/$PLATFORM_DIR
     or a path to any EFI binary existing on the EFI system partition
     name)
   * BINARY – name of the EFI binary installed in /boot/efi/EFI/$PLATFORM_DIR
     or a path to any EFI binary existing on the EFI system partition
-  * ARGS – command line arguments for the EFI application
+  * ARGS – command line arguments for the EFI application (can contain
+    '@EFI_PLATFORM_PATH@' and '@ARCH@' macros)
   * ARCH – architecture the binary is built for
 
 The module may define more configurable variables, but should use own unique
   * ARCH – architecture the binary is built for
 
 The module may define more configurable variables, but should use own unique
@@ -97,6 +100,7 @@ For convenience following are defined:
 
   * '$DESTDIR' variable – defines the directory where the files should be
     copied to that will be /boot/efi/EFI/$PLATFORM_DIR
 
   * '$DESTDIR' variable – defines the directory where the files should be
     copied to that will be /boot/efi/EFI/$PLATFORM_DIR
+
   * 'update_file' function – copies a file to the EFI partition
 
     Usage:
   * 'update_file' function – copies a file to the EFI partition
 
     Usage:
index 2e55aa9257eb71136b5dbbb6c0445b72173c58f6..5da37eb56b00ab3f6ef1fbe5b1df237cd5b0afd7 100755 (executable)
@@ -268,7 +268,14 @@ for bootloader_conf in /etc/efi-boot/update.d/*.conf ; do
     else
         efi_arch="$ARCH"
     fi
     else
         efi_arch="$ARCH"
     fi
-    DESTDIR="/boot/efi/EFI/$(echo -n "$PLATFORM_DIR"|sed -e's/@ARCH@/'"$efi_arch"'/')"
+
+    PLATFORM_PATH="EFI/$(echo -nE "$PLATFORM_DIR"|sed -e's/@ARCH@/'"$efi_arch"'/')"
+    local escaped_EFI_PLATFORM_PATH="$(echo -nE "$PLATFORM_PATH"|sed -e's;/;\\\\;g')"
+    DESTDIR="/boot/efi/$PLATFORM_PATH"
+    ARGS="$(echo -nE "$ARGS"|sed -e's/@ARCH@/'"$efi_arch"'/;s/@EFI_PLATFORM_PATH@/'"$escaped_EFI_PLATFORM_PATH"'/g')"
+
+    verbose "ARGS: '$ARGS'"
+
     mkdir -p "$DESTDIR"
 
     verbose "Updating $LABEL..."
     mkdir -p "$DESTDIR"
 
     verbose "Updating $LABEL..."
This page took 0.075409 seconds and 4 git commands to generate.