Changes to fix population of the /dev directory in a
authorJohn Bowler <jbowler@nslu2-linux.org>
Sun, 12 Jun 2005 08:32:23 +0000 (08:32 +0000)
committerJohn Bowler <jbowler@nslu2-linux.org>
Sun, 12 Jun 2005 08:32:23 +0000 (08:32 +0000)
turnup system on first boot.

BKrev: 42abf317-VPTABChzjck-YWWY6OEdA

packages/initscripts/initscripts-1.0/openslug/banner [new file with mode: 0644]
packages/initscripts/initscripts-1.0/openslug/devices.patch
packages/initscripts/initscripts-openslug_1.0.bb
packages/openslug-init/openslug-init-0.10/turnup
packages/openslug-init/openslug-init_0.10.bb

diff --git a/packages/initscripts/initscripts-1.0/openslug/banner b/packages/initscripts/initscripts-1.0/openslug/banner
new file mode 100644 (file)
index 0000000..e69de29
index e69de29..26b1841 100644 (file)
@@ -0,0 +1,52 @@
+#
+# Patch to allow /dev to reside permanently in the file
+# system.
+#
+--- old/devices        2005-05-28 21:51:39.012078699 -0700
++++ new/devices        2005-06-12 00:16:29.222686303 -0700
+@@ -6,7 +6,7 @@
+ . /etc/default/rcS
+ # exit without doing anything if udev is active
+-if test -e /dev/.udevdb; then
++if test -e /dev/.udevdb -o -e /dev/.permanent; then
+       exit 0
+ fi
+@@ -37,12 +37,20 @@
+       mknod /dev/ppp c 108 0
+       if test "$VERBOSE" != "no"; then echo "done"; fi
+ else
+-      if test "$VERBOSE" != "no"; then echo -n "Mounting /dev ramdisk: "; fi
+-      mount -t ramfs ramfs /dev || mount -t tmpfs ramfs /dev
+-      if test $? -ne 0; then
+-              if test "$VERBOSE" != "no"; then echo "failed"; fi
++      if test -e /dev/.noram
++      then
++              # There should be no files, any files will damage the
++              # makedevs script below.
++              rm $(find /dev -type f -print)
++              :>/dev/.noram
+       else
+-              if test "$VERBOSE" != "no"; then echo "done"; fi
++              if test "$VERBOSE" != "no"; then echo -n "Mounting /dev ramdisk: "; fi
++              mount -t ramfs ramfs /dev || mount -t tmpfs ramfs /dev
++              if test $? -ne 0; then
++                      if test "$VERBOSE" != "no"; then echo "failed"; fi
++              else
++                      if test "$VERBOSE" != "no"; then echo "done"; fi
++              fi
+       fi
+       if test "$VERBOSE" != "no"; then echo -n "Populating /dev: "; fi
+       cd /
+@@ -60,6 +68,10 @@
+               if test "$VERBOSE" != "no"; then echo "failed"; fi
+       else
+               if test "$VERBOSE" != "no"; then echo "done"; fi
++              if test -e /dev/.noram
++              then
++                      :>/dev/.permanent
++              fi
+       fi
+ fi
index aaff5bc..ba8d548 100644 (file)
@@ -9,6 +9,9 @@ include initscripts_${PV}.bb
 MAINTAINER = "John Bowler <jbowler@acm.org>"
 RCONFLICTS = "initscripts"
 # All other standard definitions inherited from initscripts
+# Except the PR which is hacked here.  The format used is
+# a suffix
+PR := "${PR}.1"
 
 FILESPATH = "${@base_set_filespath([ '${FILE_DIRNAME}/${P}', '${FILE_DIRNAME}/initscripts-${PV}', '${FILE_DIRNAME}/files', '${FILE_DIRNAME}' ], d)}"
 
index a33a58a..c6d422a 100644 (file)
@@ -118,26 +118,21 @@ copy_rootfs() {
 
 #
 # setup_dev new device_table
-#  Populates the /dev directory, removes the ramfs mount of /dev by
-#  removing the links to the devices startup file.
+#  In flash file systems /dev is in ramfs, in disk systems /dev
+#  can be populated permanently.  This is done by creating a
+#  single entry '.noram' in /dev - the devices init script will
+#  then populate the directory.  The passed in device_table is
+#  not currently used.
 setup_dev() {
        test -n "$1" -a -d "$1"/dev -a -r "$2" || {
                echo "turnup: setup_dev($1,$2): expected a directory and a file" >&2
                return 1
        }
        # at present the device_table is not used because it is incomplete,
-       # /etc/init.d/devices adds extra stuff.  So this script copies the
-       # existing /dev.  FIXME.
-       echo "turnup: copying dev file system" >&2
-       (       cd /
-               find dev -print0 | cpio -p -0 -d -m -u "$1"
-       ) || {
-               echo "turnup: rootfs: cpio /dev $1 failed" >&2
-               return 1
-       }
-       echo "done" >&2
-       # now prevent this being done each time
-       :>"$1"/dev/.permanent
+       # /etc/init.d/devices adds extra stuff, it seems fine to leave
+       # things this way
+       echo "turnup: initialising dev file system" >&2
+       :>"$1"/dev/.noram
        return 0
 }
 
index 7b366b2..ee619f0 100644 (file)
@@ -3,7 +3,7 @@ SECTION = "console/network"
 LICENSE = "GPL"
 DEPENDS = "base-files devio"
 RDEPENDS = "busybox devio"
-PR = "r29"
+PR = "r30"
 
 SRC_URI = "file://linuxrc \
           file://boot/flash \