X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=stage0%2Fpre-install;h=0d72afd7b92ce0012200b289406dd1b81529fe4b;hb=4e78d26dd7f5e46a21cdc916e031f1b4a68578c0;hp=aa336844088ccb35f45113347a4c3e1ca7a11f40;hpb=f920c7ef750f2163b9e407cc453b192ede2c185a;p=hvlinux.git diff --git a/stage0/pre-install b/stage0/pre-install index aa33684..0d72afd 100755 --- a/stage0/pre-install +++ b/stage0/pre-install @@ -1,16 +1,7 @@ #!/bin/bash set -o errexit -# Reading system configuration informations, functions and package versions. -source ../config/sysinfos -source ../functions -source ../config/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 @@ -22,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). @@ -30,7 +21,7 @@ if ! grep "lfs" /etc/passwd 1> /dev/null 2>&1; then 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} @@ -39,17 +30,12 @@ done chown -R lfs:lfs ${LFS} -# Creating a link from the host root directory to LFS cross-tools directories -for subdir in tools cross-tools; do - ln -sfvT ${LFS}/${subdir} /${subdir} -done - cat > /home/lfs/.bashrc << "EOF" # Setting up the environment set +h umask 022 LC_ALL=POSIX -PATH=/cross-tools/bin:/bin:/usr/bin +PATH=_CLFS_CROSS_TOOLS_PATH_/bin:/bin:/usr/bin HVMAKE="make -j ${MAKEJOBS}" unset CFLAGS @@ -58,6 +44,8 @@ unset CXXFLAGS export LC_ALL PATH HVMAKE EOF +sed -e "s@_CLFS_CROSS_TOOLS_PATH_@${CROSS_TOOLS_DIR}@" -i /home/lfs/.bashrc + chown lfs:lfs /home/lfs/.bashrc exit $?