-# 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 partition is mounted
-if ! mount | awk '{ print "x" $3 "x" }' | grep "x${LFS}x" 1> /dev/null 2>&1; then
- echo "LFS partition is not mounted. Please mount it."
- exit 1
-fi
-
-# Creating basic directories
-for subdir in tmp var boot tools; do
- dir=${LFS}/${subdir}
- if [ ! -d ${dir} ]; then
- install -dv ${dir} || exit 1
- fi
- chown lfs:lfs ${dir} || exit 1
-done
-
-# Creating a link from the host root directory to LFS tools directory
-ln -sf ${LFS}/tools / &&
-
-# Testing for the presence of the lfs user
-# We cannot 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
- # 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 || exit 1
-fi &&