initscripts: mountall.sh: Create roots home directory on boot if it is missing, closi...
authorMatthias Hentges <oe@hentges.net>
Tue, 5 Jun 2007 02:14:10 +0000 (02:14 +0000)
committerMatthias Hentges <oe@hentges.net>
Tue, 5 Jun 2007 02:14:10 +0000 (02:14 +0000)
packages/initscripts/initscripts-1.0/mountall.sh
packages/initscripts/initscripts_1.0.bb

index b5cb85a..65d5d26 100755 (executable)
@@ -41,5 +41,17 @@ then
        swapon -a 2> /dev/null
 fi
 
+# A missing homedirectory for root can cause all sorts of problems.
+# This can happen after user formats his /home partition for example
+
+if test -e /etc/passwd
+then
+       ROOT_HOME="`cat /etc/passwd|grep ^root | awk '{split($0,x,":");printf("%s\n",x[6])}'`"
+       
+       if test -n "$ROOT_HOME"
+       then
+               ! test -d "$ROOT_HOME" && mkdir -p "$ROOT_HOME"
+       fi
+fi
 : exit 0
 
index d814e93..f979a50 100644 (file)
@@ -4,7 +4,7 @@ PRIORITY = "required"
 DEPENDS = "makedevs"
 RDEPENDS = "makedevs"
 LICENSE = "GPL"
-PR = "r91"
+PR = "r92"
 
 SRC_URI = "file://halt \
            file://ramdisk \