[packages/efi-boot-update] @EFI_PLATFORM_PATH@ macro for us in $ARGS

jajcus jajcus at pld-linux.org
Thu Oct 24 21:38:35 CEST 2013


commit 3c17787a5f80be54394a2fb95c54af32002f713d
Author: Jacek Konieczny <jajcus at jajcus.net>
Date:   Thu Oct 24 21:20:34 2013 +0200

    @EFI_PLATFORM_PATH@ macro for us in $ARGS
    
    Linux kernel EFI stub requires absolute EFI path to the initrd,
    this way we can set it without hardcoding the $PLATFORM_DIR

 README          | 6 +++++-
 efi-boot-update | 9 ++++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/README b/README
index 19d147d..38e2640 100644
--- 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).
+    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
 .................................
@@ -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
-  * 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
@@ -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
+
   * 'update_file' function – copies a file to the EFI partition
 
     Usage:
diff --git a/efi-boot-update b/efi-boot-update
index 2e55aa9..5da37eb 100755
--- a/efi-boot-update
+++ b/efi-boot-update
@@ -268,7 +268,14 @@ for bootloader_conf in /etc/efi-boot/update.d/*.conf ; do
     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..."
================================================================

---- gitweb:

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



More information about the pld-cvs-commit mailing list