OSDN Git Service

1-install: create device node if not exists
authorChih-Wei Huang <cwhuang@linux.org.tw>
Thu, 25 Jan 2018 02:53:25 +0000 (10:53 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Thu, 25 Jan 2018 02:53:25 +0000 (10:53 +0800)
After re-partition, sometimes the device node is not re-created
automatically. I'm not sure why.

Regenerate the uevent to force creating it.

install/scripts/1-install

index d83f056..398cf8f 100644 (file)
@@ -292,7 +292,12 @@ get_part_info()
 
 install_to()
 {
-       [ -b /dev/$1 ] || return 1
+       local t=`echo /sys/block/*/$1/partition`
+       [ -f "$t" ] || return 1
+       until [ -b /dev/$1 ]; do
+               echo add > `dirname $t`/uevent
+               sleep 1
+       done
        cd /
        mountpoint -q /hd && umount /hd
        while [ 1 ]; do