]> git.pld-linux.org Git - projects/geninitrd.git/commitdiff
$UDEV_TMPFS dropped, $tmpfs_dev indicates that /dev is with tmpfs.
authorElan Ruusamäe <glen@pld-linux.org>
Tue, 17 Oct 2006 22:46:48 +0000 (22:46 +0000)
committerElan Ruusamäe <glen@pld-linux.org>
Tue, 17 Oct 2006 22:46:48 +0000 (22:46 +0000)
svn-id: @7864

geninitrd

index 1a5ad8aa57a21b9349b6e6e0a9f9ed6f2eaded80..e36f720b9ef6d9dc32df3c6f09e4ae3031468e78 100755 (executable)
--- a/geninitrd
+++ b/geninitrd
@@ -42,9 +42,11 @@ rootdev_nr=0
 # default bootsplash is off, if it have to be on, install bootsplash package
 BOOT_SPLASH=no
 
+# is /dev on tmpfs. internal variable
+tmpfs_dev=
+
 if [ -f /etc/udev/udev.conf -a -x /sbin/initrd-udev ]; then
        USE_UDEV="yes"
-       UDEV_TMPFS="yes"
        . /etc/udev/udev.conf
 fi
 
@@ -909,7 +911,6 @@ if [ "$pack_version" -lt "002006" ] ; then
        USE_UDEV=
        USE_DMRAID=
 fi
-[ -z "$USE_UDEV" ] && UDEV_TMPFS=
 
 if [ "$pack_version" -ge "002005" ] ; then
        modext=".ko"
@@ -1140,6 +1141,19 @@ umount /proc
 EOF
 }
 
+initrd_gen_tmpfs_dev() {
+       tmpfs_dev=yes
+       cat <<-EOF
+: 'Creating /dev'
+mount -o mode=0755 -t tmpfs none /dev
+mknod /dev/console c 5 1
+mknod /dev/null c 1 3
+mknod /dev/zero c 1 5
+mkdir /dev/pts
+mkdir /dev/shm
+EOF
+}
+
 initrd_gen_udev() {
        [ -n "$verbose" ] && echo "Setting up udev..."
        mkdir -p $MNTIMAGE/sbin
@@ -1154,17 +1168,7 @@ initrd_gen_udev() {
        ln -s udev $MNTIMAGE/sbin/hotplug
 
        if is_yes "$USE_UDEV"; then
-               if is_yes "$UDEV_TMPFS"; then
-                       cat >> "$s" <<-EOF
-: 'Creating /dev'
-mount -o mode=0755 -t tmpfs none /dev
-mknod /dev/console c 5 1
-mknod /dev/null c 1 3
-mknod /dev/zero c 1 5
-mkdir /dev/pts
-mkdir /dev/shm
-EOF
-               fi
+               initrd_gen_tmpfs_dev >> "$s"
                cat >> "$s" <<-EOF
 mount -t proc none /proc
 mount -t sys none /sys
@@ -1317,7 +1321,7 @@ initrd_gen_lvm() {
        mkdir -p $MNTIMAGE/tmp
        mkdir -p $MNTIMAGE/proc
        mkdir -p $MNTIMAGE/newroot
-       if ! is_yes "$USE_UDEV"; then
+       if ! is_yes "$tmpfs_dev"; then
                mkdir -p $MNTIMAGE/dev/mapper
                mknod $MNTIMAGE/dev/mapper/control c 10 63
                for device in $PVDEVICES; do
This page took 0.047181 seconds and 4 git commands to generate.