diff options
author | William Harrington <kb0iic@berzerkula.org> | 2021-03-22 19:33:52 -0500 |
---|---|---|
committer | William Harrington <kb0iic@berzerkula.org> | 2021-03-22 19:33:52 -0500 |
commit | 431010c012faddb2a8b4a69469dd03bdcb566cfc (patch) | |
tree | 66b6874c636045f2c4fb83ca10f1f0ef55a2ea42 | |
parent | 4eaa89556390bd2e608fd3e16e94d9a8915d1d4b (diff) |
Add some build features.
-rwxr-xr-x | lfs.sh | 55 |
1 files changed, 41 insertions, 14 deletions
@@ -2,41 +2,66 @@ clear +echo "Sourcing colors..." +# Colors defined for text +source colors.sh + +echo "Sourcing environment variables..." # LFS build environment settings source env.sh +echo "Sourcing spinner..." # Spinner function (returns an exit value) source spinner.sh -# Colors defined for text -source colors.sh - # Version check script #source versioncheck.sh +echo -e "\n\n\n${CYN}BUILDING ${YLW}${LFS_VER} $(uname -m)${CYN} at \ +${PRP}${LFS}${CYN} on ${PRP}${LFS_DISK}${LFS_PART}${RST}\n\n\n" + +# Continue or Abort +echo -e "${IGRN}CONTINUE ${IWHTB}(C)${RST} / ${IRED}ABORT ${IWHTB}(OTHER)${RST}" +read -n 1 contabort +if [ $? == 0 ]; then + if [ "$contabort" == "C" ] || [ "$contabort" == "c" ]; then + echo -e "\b${IWHT}Build is ${IGRN}CONTINUING${RST}" + else + echo -e "\b${IWHT}Build ${IRED}ABORTED!" + exit 0 + fi +else + echo -e "\b${IWHT}Selection ${IRED}FAILURE!${RST}" + exit 1 +fi + +echo -e "${GRN}Creating LFS directory at ${YLW}${LFS}${GRN} if it does not exist...${RST}" # Create LFS directory if it doesn't exist [[ -d /mnt/lfs ]] || sudo mkdir ${LFS} +echo -e "${GRN}Setting up partition on ${YLW}${LFS_DISK} ${GRN}\ +with ${YLW}ext4${GRN} filesystem at ${YLW}${LFS_DISK}${LFS_ROOT} ${GRN}\ +and mounting at ${YLW}${LFS}${RST}..." # Setup partition, filesystem, format and mount if # LFS filesystem is not previously mounted if ! grep -q "${LFS}" /proc/mounts; then - source setupdisk.sh "${LFS_DISK}" "${LFS_ROOT}" - sudo mount "${LFS_DISK}${LFS_ROOT}" "${LFS}" + source setupdisk.sh "${LFS_DISK}" "${LFS_PART}" + sudo mount "${LFS_DISK}${LFS_PART}" "${LFS}" sudo chown -v ${USER} "${LFS}" fi # Create limited directory layout -mkdir -pv ${LFS_SRC} -mkdir -pv ${LFS}/tools -mkdir -pv ${LFS}/bin -mkdir -pv ${LFS}/etc -mkdir -pv ${LFS}/lib -mkdir -pv ${LFS}/sbin -mkdir -pv ${LFS}/usr -mkdir -pv ${LFS}/var +mkdir -p ${LFS}/sources +mkdir -p ${LFS}/tools +mkdir -p ${LFS}/bin +mkdir -p ${LFS}/etc +mkdir -p ${LFS}/lib +mkdir -p ${LFS}/sbin +mkdir -p ${LFS}/usr +mkdir -p ${LFS}/var case $(uname -m) in - x86_64) mkdir -pv ${LFS}/lib64 ;; + x86_64) mkdir -p ${LFS}/lib64 ;; esac # Will use normal user and not special lfs user @@ -89,4 +114,6 @@ sudo chroot "${LFS}" /usr/bin/env \ TERM=${TERM} \ PS1='(lfs chroot) \u:\w\$ ' \ PATH=/bin:/usr/bin:/sbin:/usr/sbin \ + NUMPROCS=${NUMPROCS} \ + MAKEFLAGS="${MAKEFLAGS}" \ /bin/bash --login +h -c "/sources/insidechroot.sh" |