]> git.pld-linux.org Git - packages/systemd.git/commitdiff
- revert last change, ${TMPDIR:-/tmp} is on a read only / at the time of boot auto/th/udev-182-2
authorJan Rękorajski <baggins@pld-linux.org>
Thu, 29 Mar 2012 16:06:08 +0000 (16:06 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
  http://lists.pld-linux.org/mailman/pipermail/pld-devel-en/2012-March/022561.html

Changed files:
    start_udev -> 1.48

start_udev

index 5b03b4b2051ce363d4ca441cb47f09268a4c2b5b..ab451ab233c5029ec585008483d97fd8c82f2da6 100644 (file)
@@ -62,18 +62,6 @@ set_hotplug_handler() {
        echo "" > /proc/sys/kernel/hotplug
 }
 
-# find subdirs mounted under $udev_root
-get_dev_mounts() {
-       awk -vudev_root="$udev_root/" '
-       BEGIN {
-         len = length(udev_root);
-       }
-
-       substr($2, 1, len) == udev_root {
-         print substr($2, len + 1)
-       }' /proc/mounts
-}
-
 export ACTION=add
 prog=udev
 ret=0
@@ -82,18 +70,30 @@ busy
 
 # mount the devtmpfs on $udev_root, if not already done
 awk "\$2 == \"$udev_root\" && \$3 == \"devtmpfs\" { exit 1 }" /proc/mounts && {
-       # mount to temporary location to be able to move submounts, if any
-       devdir=$(mktemp -d ${TMPDIR:-/tmp}/tmpXXXXXX)
-       mount -n -o mode=0755 -t devtmpfs devtmpfs "$devdir"
-       ret=$(( $ret + $? ))
 
-       # relocate submounts
-       for dir in $(get_dev_mounts); do
-               mount -n --move $udev_root/$dir $devdir/$dir
-               ret=$(( $ret + $? ))
-       done
+       if grep -qF "none $udev_root/pts " /proc/mounts; then
+               PTSDIR=$(mktemp -d ${TMPDIR:-/tmp}/tmpXXXXXX)
+               mount --move $udev_root/pts "$PTSDIR"
+       fi
 
-       mount -n --move $devdir $udev_root
+       if grep -qF "none $udev_root/shm " /proc/mounts; then
+               SHMDIR=$(mktemp -d ${TMPDIR:-/tmp}/tmpXXXXXX)
+               mount --move $udev_root/shm "$SHMDIR"
+       fi
+
+       mount -n -o mode=0755 -t devtmpfs devtmpfs "$udev_root"
+       mkdir -m 0755 $udev_root/pts
+       mkdir -m 0755 $udev_root/shm
+       if [ -n "$PTSDIR" ]; then
+               mount --move "$PTSDIR" $udev_root/pts
+               rmdir "$PTSDIR"
+       fi
+       if [ -n "$SHMDIR" ]; then
+               mount --move "$SHMDIR" $udev_root/shm
+               rmdir "$SHMDIR"
+       fi
+
+       ret=$(( $ret + $? ))
 }
 
 kill_udevd > "$udev_root/null" 2>&1
This page took 0.049468 seconds and 4 git commands to generate.