[arch-projects] [mkinitcpio][PATCH 3/4] move all binaries to /usr/bin

Tom Gundersen teg at jklm.no
Sat Nov 26 06:17:51 EST 2011


Add compat symlinks from /bin, /sbin and /usr/sbin, so nothing is lost.

This will make sure that it is not possibly to install two different
versions of the same binary in PATH.

The main usecase of this is that we want to be able to override any
symlink provided by busybox by adding a binary by the same name. With
this patch we don't have to worry in case the busybox symlink and the
binary we add are in different directories; the last binary to be added
always takes precedence.

Signed-off-by: Tom Gundersen <teg at jklm.no>
---
 init         |    5 ++---
 install/base |    6 +++++-
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/init b/init
index 7f809cc..4c07f9d 100644
--- a/init
+++ b/init
@@ -1,6 +1,5 @@
-#!/bin/busybox ash
-# Install busybox's applets as symlinks
-PATH=/usr/sbin:/usr/bin:/sbin:/bin
+#!/usr/bin/ash
+PATH=/usr/bin
 
 /bin/busybox --install -s
 
diff --git a/install/base b/install/base
index 84e7f02..c0c19d2 100644
--- a/install/base
+++ b/install/base
@@ -1,10 +1,14 @@
 #!/bin/bash
 
 build() {
-    for dir in new_root proc sys dev run usr/{bin,sbin}; do
+    for dir in new_root proc sys dev run usr/bin; do
         add_dir "/$dir"
     done
 
+    add_symlink /sbin usr/bin
+    add_symlink /bin usr/bin
+    add_symlink /usr/sbin bin
+
     add_binary /lib/initcpio/busybox /bin/busybox
     add_binary /sbin/modprobe
     add_binary /sbin/blkid
-- 
1.7.7.4



More information about the arch-projects mailing list