Author: adamg
Date: Sat Nov  3 15:34:33 2007
New Revision: 8980

Modified:
   geninitrd/trunk/geninitrd
Log:
- create /proc, /sys, /etc only once

Modified: geninitrd/trunk/geninitrd
==============================================================================
--- geninitrd/trunk/geninitrd   (original)
+++ geninitrd/trunk/geninitrd   Sat Nov  3 15:34:33 2007
@@ -908,8 +908,6 @@
        local firmware_files="$2"
 
        debug "Adding Firmwares ($firmware_files) to initrd for module $module"
-       inst_d /proc
-       inst_d /sys
        # firmware not yet installed
        if [ ! -f "$MNTIMAGE/lib/firmware/firmware.sh" ]; then
                inst_d /lib/firmware
@@ -1309,7 +1307,8 @@
 chmod a+rx "$RCFILE"
 ln -s linuxrc $MNTIMAGE/init
 
-inst_d /{lib,bin,etc,dev,loopfs,var}
+# create dirs that we really need
+inst_d /{lib,bin,etc,dev{,/pts,/shm},loopfs,var,proc,sys}
 
 modules_install "$MODULES"
 
@@ -1318,7 +1317,6 @@
 mknod "$MNTIMAGE/dev/console" c 5 1
 mknod "$MNTIMAGE/dev/null" c 1 3
 mknod "$MNTIMAGE/dev/zero" c 1 5
-inst_d /dev/pts /dev/shm
 
 inst /bin/initrd-busybox /bin/initrd-busybox
 ln -s initrd-busybox $MNTIMAGE/bin/sh
@@ -1383,7 +1381,6 @@
        if [ ! -x /usr/${_lib}/suspend/resume -a ! -x /usr/sbin/resume ]; then
                die "/usr/${_lib}/suspend/resume is missing!"
        fi
-       inst_d /etc /dev
        resume_dev="$(awk '/^resume device =/ { print $4 } ' /etc/suspend.conf)"
        mknod $MNTIMAGE/dev/snapshot c 10 231
        inst $resume_dev /dev
@@ -1397,7 +1394,6 @@
 }
 
 initrd_gen_tuxonice() {
-       inst_d /sys /proc
        mount_sys
        add_linuxrc <<-'EOF'
                if [ "$(echo "$CMDLINE" | awk ' /resume2=/  { print "yes"; } ' 
/proc/cmdline)" = "yes" ]; then
@@ -1410,7 +1406,7 @@
 
 initrd_gen_udev() {
        debug "Setting up udev..."
-       inst_d /sbin /proc /etc/udev /sys
+       inst_d /sbin /etc/udev
 
        if [ ! -x /sbin/initrd-udevd ]; then
                die "/sbin/initrd-udevd not present"
@@ -1441,7 +1437,7 @@
 }
 
 initrd_gen_multipath() {
-       inst_d /proc /sys /sbin /lib/udev /etc
+       inst_d /sbin /lib/udev
        inst_exec /sbin/kpartx /sbin
        inst_exec /sbin/multipath /sbin
        # for udev callouts
@@ -1475,7 +1471,7 @@
                die "/sbin/dmraid-initrd is missing!"
        fi
 
-       inst_d /sbin /sys
+       inst_d /sbin
        inst /sbin/dmraid-initrd /sbin/dmraid
 
        mount_dev
@@ -1669,7 +1665,7 @@
 
 initrd_gen_lvm() {
        debug "Adding LVM support to initrd"
-       inst_d /etc /tmp /proc /newroot
+       inst_d /tmp /newroot
        inst /sbin/initrd-lvm /bin/lvm.static
 
        # always make /dev on tmpfs for LVM2
@@ -1766,7 +1762,6 @@
 
 initrd_gen_procdata() {
        debug "Adding rootfs finding based on root= option support."
-       inst_d /proc
        add_linuxrc <<-'EOF'
                root="$(busybox awk ' /root=\/dev\// { 
gsub(/.*root=\/dev\//,NIL,$0); gsub(/ .*/,NIL,$0); print $0; } ' /proc/cmdline)"
                if [ -n "$root" ]; then
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to