-#!/bin/sh
+#!/bin/bash
set -o errexit
# Reading system configuration informations, functions and package versions.
exit 1
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
+ # 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 boot tools cross-tools; do
+for subdir in tmp var tools cross-tools; do
dir=${LFS}/${subdir}
if [ ! -d ${dir} ]; then
install -dv ${dir}
ln -sfvT ${LFS}/${subdir} /${subdir}
done
-# 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
-fi
-
cat > /home/lfs/.bashrc << "EOF"
# Setting up the environment
set +h
umask 022
LC_ALL=POSIX
PATH=/cross-tools/bin:/bin:/usr/bin
-CLFS_BUILDFLAGS=_CLFS_BUILDFLAGS_
-CLFS_HOST="$(echo $MACHTYPE | \
- sed "s/$(echo $MACHTYPE | cut -d- -f2)/cross/")"
-CLFS_TARGET=_CLFS_TARGET_
HVMAKE="make -j ${MAKEJOBS}"
unset CFLAGS
unset CXXFLAGS
-export LC_ALL PATH CLFS_BUILDFLAGS CLFS_HOST CLFS_TARGET HVMAKE
+export LC_ALL PATH HVMAKE
EOF
-sed -i -e "s!_CLFS_BUILDFLAGS_!${CLFS_BUILDFLAGS}!g" /home/lfs/.bashrc
-sed -i -e "s!_CLFS_TARGET_!${CLFS_TARGET}!g" /home/lfs/.bashrc
-
chown lfs:lfs /home/lfs/.bashrc
exit $?