[arch-projects] [mkinitcpio][PATCH 4/5] install/base: use private API call to add config

Dave Reisner d at falconindy.com
Sun Jun 26 20:32:15 EDT 2011


We can't let add_file get its hands on the config file, because we need
to be sure that an absolute path is honored. As a side effect, ensure
that $BASEDIR is appended to the config file during preset processing.

Thanks-to: Gerardo Exequiel Pozzi <vmlinuz386 at yahoo.com.ar>
Signed-off-by: Dave Reisner <dreisner at archlinux.org>
---
 install/base |    4 +++-
 mkinitcpio   |    2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/install/base b/install/base
index d5fcef7..446167c 100644
--- a/install/base
+++ b/install/base
@@ -11,8 +11,10 @@ build() {
 
     add_file "/lib/initcpio/init_functions" "/init_functions"
     add_file "/lib/initcpio/init" "/init"
-    add_file "$CONFIG" "/config"
     add_file "/etc/modprobe.d/usb-load-ehci-first.conf"
+
+    # private API call is required here
+    _add_file "/config" "$CONFIG" 644
 }
 
 help() {
diff --git a/mkinitcpio b/mkinitcpio
index 7a30be0..5389aca 100755
--- a/mkinitcpio
+++ b/mkinitcpio
@@ -209,7 +209,7 @@ if [[ $PRESET ]]; then
 
             preset_config=${p}_config
             if [[ ${!preset_config:-$ALL_config} ]]; then
-              preset_cmd+=(-c "${!preset_config:-$ALL_config}")
+              preset_cmd+=(-c "$BASEDIR${!preset_config:-$ALL_config}")
             else
                 warning "No configuration file specified. Skipping image '%s'" "$p"
                 continue
-- 
1.7.5.4



More information about the arch-projects mailing list