diff options
author | William Harrington <kb0iic@berzerkula.org> | 2021-03-23 14:04:35 -0500 |
---|---|---|
committer | William Harrington <kb0iic@berzerkula.org> | 2021-03-23 14:04:35 -0500 |
commit | a9998650875c122d505c3046b23dc5f8590857f7 (patch) | |
tree | 68a96d364fbc8a28166d2b61a34ef424650d44d9 /lfs.sh | |
parent | ddc24ed59f6ad9f0e36258ece20bd3e04e88e5e0 (diff) |
Use printf instead of echo.
Diffstat (limited to 'lfs.sh')
-rwxr-xr-x | lfs.sh | 28 |
1 files changed, 14 insertions, 14 deletions
@@ -2,48 +2,48 @@ clear -echo "Sourcing colors..." +printf "%b" "Sourcing colors...\n" # Colors defined for text source colors.sh -echo "Sourcing environment variables..." +printf "%b" "Sourcing environment variables...\n" # LFS build environment settings source env.sh -echo "Sourcing spinner..." +printf "%b" "Sourcing spinner...\n" # Spinner function (returns an exit value) source spinner.sh # Version check script #source versioncheck.sh -echo -e "\n\n\n${CYN}BUILDING ${YLW}${LFS_VER} $(uname -m)${CYN} at \ +printf "%b" "\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}" +printf "%b" "${IGRN}CONTINUE ${IWHTB}(C)${RST} / ${IRED}ABORT ${IWHTB}(OTHER)${RST}\n" if read -r -n 1 contabort; then if [ "$contabort" == "C" ] || [ "$contabort" == "c" ]; then - echo -e "\b${IWHT}Build is ${IGRN}CONTINUING${RST}" + printf "%b" "\b${IWHT}Build is ${IGRN}CONTINUING${RST}\n" else - echo -e "\b${IWHT}Build ${IRED}ABORTED!" + printf "%b" "\b${IWHT}Build ${IRED}ABORTED!\n" exit 0 fi else - echo -e "\b${IWHT}Selection ${IRED}FAILURE!${RST}" + printf "%b" "\b${IWHT}Selection ${IRED}FAILURE!${RST}\n" exit 1 fi -echo -e "${GRN}Creating LFS directory at ${YLW}${LFS}${GRN} if it does not exist...${RST}" +printf "%b" "${GRN}Creating LFS directory at ${YLW}${LFS}${GRN} if it does not exist...${RST}\n" # Create LFS directory if it doesn't exist [[ -d /mnt/lfs ]] || sudo mkdir "${LFS}" # Setup partition, filesystem, format and mount if # LFS filesystem is not previously mounted if ! grep -q "${LFS}" /proc/mounts; then - echo -e "${GRN}Setting up partition on ${YLW}${LFS_DISK} ${GRN}\ + printf "%b" "${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}..." +and mounting at ${YLW}${LFS}${RST}...\n" source setupdisk.sh "${LFS_DISK}" "${LFS_PART}" sudo mount "${LFS_DISK}${LFS_PART}" "${LFS}" @@ -68,7 +68,7 @@ esac #sudo groupadd lfs #sudo useradd -s /bin/bash -g lfs -m -k /dev/null lfs -#echo -e "${LFS_PWD}\n${LFS_PWD}\n" | sudo passwd lfs +#printf "%b" "${LFS_PWD}\n${LFS_PWD}\n" | sudo passwd lfs # Copy scripts and csv files to LFS sources target cp -rf ./*.sh chapter* ./*.csv "${LFS}/sources" @@ -104,9 +104,9 @@ done chmod ugo+x preparechroot.sh chmod ugo+x insidechroot.sh -echo -e "${CYN}PREPARING CHROOT ENVIRONMENT...${RST}" +printf "%b" "${CYN}PREPARING CHROOT ENVIRONMENT...${RST}\n" sudo ./preparechroot.sh "${LFS}" -echo -e "${CYN}ENTERING CHROOT ENVIRONMENT...${RST}" +printf "%b" "${CYN}ENTERING CHROOT ENVIRONMENT...${RST}\n" sleep 3 sudo chroot "${LFS}" /usr/bin/env \ |