]> git.pld-linux.org Git - packages/systemd.git/blobdiff - start_udev
- pull updates to subpackages when main package is updated
[packages/systemd.git] / start_udev
index 5b03b4b2051ce363d4ca441cb47f09268a4c2b5b..a2d20c0e1c89c0513472a1825f415d5e676063fc 100644 (file)
@@ -35,6 +35,8 @@ udevd_timeout=8
 prog=udev
 bin=/sbin/udev
 udevd=/lib/udev/udevd
+# trim traling slash, code expects it not to be there
+udev_root=${udev_root%/}
 
 make_extra_nodes () {
        grep '^[^#]' /etc/udev/links.conf | \
@@ -82,18 +84,29 @@ 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)
+       submounts=$(get_dev_mounts)
+
+       if [ "$submounts" ]; then
+               # mount to temporary location to be able to move submounts
+               # this needs writable TMPDIR:-/tmp, so it won't work in early boot
+               # but fix is simple: use initramfs instead of romfs
+               devdir=$(mktemp -d ${TMPDIR:-/tmp}/tmpXXXXXX)
+       else
+               devdir=$udev_root
+       fi
        mount -n -o mode=0755 -t devtmpfs devtmpfs "$devdir"
        ret=$(( $ret + $? ))
 
        # relocate submounts
-       for dir in $(get_dev_mounts); do
+       for dir in $submounts; do
                mount -n --move $udev_root/$dir $devdir/$dir
                ret=$(( $ret + $? ))
        done
 
-       mount -n --move $devdir $udev_root
+       if [ "$submounts" ]; then
+               mount -n --move $devdir $udev_root
+               rmdir $devdir
+       fi
 }
 
 kill_udevd > "$udev_root/null" 2>&1
This page took 0.07216 seconds and 4 git commands to generate.