summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <d@falconindy.com>2011-06-08 23:04:58 +0200
committerThomas Bächler <thomas@archlinux.org>2011-06-25 12:25:45 +0200
commit074ab58c616a00374c828d1d388880521bab6183 (patch)
tree05f99fdd99b9074db8912c3d28920fa47a831b3a
parenta80f8a25871c807af64641ef364ceea852853233 (diff)
downloadmkinitcpio-074ab58c616a00374c828d1d388880521bab6183.tar.gz
mkinitcpio-074ab58c616a00374c828d1d388880521bab6183.tar.xz
install/base: cleanup and simplify
* Create only the directories that are necessary. If others are needed, they'll be created along the way. As part of this, we create /new_root sooner in init, so it's less jarring to the user if they request a break. Signed-off-by: Dave Reisner <d@falconindy.com>
-rw-r--r--init2
-rw-r--r--install/base34
2 files changed, 13 insertions, 23 deletions
diff --git a/init b/init
index b9ea04e..332b4de 100644
--- a/init
+++ b/init
@@ -4,6 +4,7 @@
. /init_functions
+mkdir -p /new_root
/bin/mount -t proc proc /proc -o nosuid,noexec,nodev
/bin/mount -t sysfs sys /sys -o nosuid,noexec,nodev
if grep -q devtmpfs /proc/filesystems 2>/dev/null; then
@@ -81,7 +82,6 @@ if [ "${break}" = "y" ]; then
fi
# Mount root at /new_root
-mkdir -p /new_root
${mount_handler} /new_root
[ -z "${init}" ] && init="/sbin/init"
diff --git a/install/base b/install/base
index 40f9c25..d5fcef7 100644
--- a/install/base
+++ b/install/base
@@ -1,18 +1,9 @@
-# vim:set ft=sh:
+#!/bin/bash
-build()
-{
- add_dir "/proc"
- add_dir "/sys"
- add_dir "/dev"
- add_dir "/bin"
- add_dir "/sbin"
- add_dir "/lib"
- add_dir "/usr"
- add_dir "/usr/bin"
- add_dir "/usr/lib"
- add_dir "/usr/sbin"
- add_dir "/run"
+build() {
+ for dir in proc sys dev run /usr/{bin,sbin}; do
+ add_dir "/$dir"
+ done
add_binary /lib/initcpio/busybox /bin/busybox
add_binary /sbin/modprobe
@@ -20,16 +11,15 @@ build()
add_file "/lib/initcpio/init_functions" "/init_functions"
add_file "/lib/initcpio/init" "/init"
- add_file "${CONFIG}" "/config"
+ add_file "$CONFIG" "/config"
add_file "/etc/modprobe.d/usb-load-ehci-first.conf"
- SCRIPT=""
}
-help ()
-{
-cat <<HELPEOF
- This hook sets up all initial directories and installs base
- utilities. DO NOT remove this one unless you know what you're
- doing.
+help() {
+ cat <<HELPEOF
+This hook sets up all initial directories and installs base utilities. DO NOT
+remove this one unless you know what you're doing.
HELPEOF
}
+
+# vim: set ft=sh ts=4 sw=4 et: