[arch-projects] [mkinitcpio][PATCH 07/10] avoid absolute paths in add_binary calls

Dave Reisner d at falconindy.com
Sat Jan 28 15:39:43 EST 2012


This makes us more resilient against path changes -- add_binary is smart
enough to resolve the path for us.

Signed-off-by: Dave Reisner <dreisner at archlinux.org>
---
 install/base   |    8 ++++----
 install/fsck   |    6 +++---
 install/keymap |    2 +-
 install/udev   |    2 +-
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/install/base b/install/base
index 3faf368..3b7632f 100644
--- a/install/base
+++ b/install/base
@@ -21,10 +21,10 @@ build() {
         add_symlink "/usr/bin/$applet" kmod
     done
 
-    add_binary /sbin/blkid
-    add_binary /bin/mount
-    add_binary /sbin/switch_root
-    add_binary /bin/findmnt
+    add_binary blkid
+    add_binary mount
+    add_binary switch_root
+    add_binary findmnt
 
     add_symlink "/etc/mtab" "/proc/self/mounts"
 
diff --git a/install/fsck b/install/fsck
index e4927fc..f613c5b 100644
--- a/install/fsck
+++ b/install/fsck
@@ -5,10 +5,10 @@ build() {
 
     if (( ! fs_autodetect_failed )) && [[ $rootfstype$usrfstype ]]; then
         if [[ $rootfstype ]]; then
-            add_binary /sbin/fsck.$rootfstype && (( ++added ))
+            add_binary fsck.$rootfstype && (( ++added ))
         fi
         if [[ $usrfstype && $usrfstype != $rootfstype ]]; then
-            add_binary /sbin/fsck.$rootfstype && (( ++added ))
+            add_binary fsck.$rootfstype && (( ++added ))
         fi
     else
         for fsck in "$BASEDIR"/sbin/fsck.*; do
@@ -18,7 +18,7 @@ build() {
     fi
 
     if (( added )); then
-        add_binary /sbin/fsck
+        add_binary fsck
     else
         warning "No fsck helpers found. fsck will not be run on boot."
     fi
diff --git a/install/keymap b/install/keymap
index 1c53c4a..51bb1a2 100644
--- a/install/keymap
+++ b/install/keymap
@@ -10,7 +10,7 @@ build() {
                 touch "$BUILDROOT/keymap.utf8"
                 uc=-u
             fi
-            /bin/loadkeys -q $uc $KEYMAP -b > "$BUILDROOT/keymap.bin"
+            loadkeys -q $uc $KEYMAP -b > "$BUILDROOT/keymap.bin"
         fi
     )
 
diff --git a/install/udev b/install/udev
index e7cb901..a3e5ca3 100644
--- a/install/udev
+++ b/install/udev
@@ -5,7 +5,7 @@ build() {
     SCRIPT="udev"
 
     add_binary /lib/udev/udevd
-    add_binary /sbin/udevadm
+    add_binary udevadm
 
     for rules in 50-udev-default.rules 60-persistent-storage.rules 80-drivers.rules; do
         add_file "/lib/udev/rules.d/$rules"
-- 
1.7.8.4



More information about the arch-projects mailing list