Fix bug preventing clean unmounting of rootfs
[hvlinux.git] / stage0 / pre-install
index c07c163..27b810d 100755 (executable)
@@ -3,12 +3,6 @@ set -o errexit
 
 source ../functions/main
 
-# Making sure that this script was executed by the root user
-if [ "x${USER}" != "xroot" ]; then
-    echo "You must be the superuser to install hvlinux."
-    exit 1
-fi
-
 # Making sure that the LFS directory is accessible
 if [ ! -d ${LFS} ]; then
     echo "LFS destination directory not found."
@@ -19,7 +13,7 @@ fi
 # We cannot always automatically create the user 'lfs' because the installation
 # media can be a CD-ROM (read-only) If installing from some kind of live-CD,
 # simply install as root without the LFS user :)
-if ! grep "lfs" /etc/passwd 1> /dev/null 2>&1; then
+if ! grep -q "lfs" /etc/passwd; then
     groupadd -f lfs
     # The option '-k /dev/null' prevents possible copying of files from a
     # skeleton directory (default is /etc/skel).