Deactivate subversion server in default config
[hvlinux.git] / stage0 / pre-install
index 5183a23..5ff17d2 100755 (executable)
@@ -1,16 +1,7 @@
 #!/bin/bash
 set -o errexit
 
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# 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
+source ../functions/main
 
 # Making sure that the LFS directory is accessible
 if [ ! -d ${LFS} ]; then
@@ -19,19 +10,18 @@ if [ ! -d ${LFS} ]; then
 fi
 
 # Testing for the presence of the lfs user
-# 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
+# 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 -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).
-    groupadd lfs
     useradd -s /bin/bash -g lfs -m -k /dev/null lfs
 fi
 
 # Creating basic directories
-for subdir in tmp var tools cross-tools; do
+for subdir in etc tmp var tools cross-tools; do
     dir=${LFS}/${subdir}
     if [ ! -d ${dir} ]; then
         install -dv ${dir}