From b57e8b5e9de55efe90fabaad4d0c6d01f3ddb3e8 Mon Sep 17 00:00:00 2001 From: Aditya Date: Mon, 9 Jan 2023 11:14:30 +0530 Subject: [PATCH] Add 6.5 - Build coreutils --- scripts/chapter6/6.5-coreutils.sh | 33 +++++++++++++++++++++++++++++++ scripts/main.sh | 11 +++++++++++ 2 files changed, 44 insertions(+) create mode 100644 scripts/chapter6/6.5-coreutils.sh diff --git a/scripts/chapter6/6.5-coreutils.sh b/scripts/chapter6/6.5-coreutils.sh new file mode 100644 index 0000000..c3ff1d7 --- /dev/null +++ b/scripts/chapter6/6.5-coreutils.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +cd $LFS/sources +tar xf coreutils-9.1.tar.xz +cd coreutils-9.1 + +./configure --prefix=/usr \ + --host=$LFS_TGT \ + --build=$(build-aux/config.guess) \ + --enable-install-program=hostname \ + --enable-no-install-program=kill,uptime + +if [ $? -ne 0 ] +then + exit 1 +fi + +make -j5 + +if [ $? -ne 0 ] +then + exit 1 +fi + +make DESTDIR=$LFS install + +mv -v $LFS/usr/bin/chroot $LFS/usr/sbin +mkdir -pv $LFS/usr/share/man/man8 +mv -v $LFS/usr/share/man/man1/chroot.1 $LFS/usr/share/man/man8/chroot.8 +sed -i 's/"1"/"8"/' $LFS/usr/share/man/man8/chroot.8 + +cd $LFS/sources +rm -rf coreutils-9.1 diff --git a/scripts/main.sh b/scripts/main.sh index 417266e..e98c225 100644 --- a/scripts/main.sh +++ b/scripts/main.sh @@ -227,4 +227,15 @@ then stop_script "chapter6/6.4-bash.sh" fi +# Chapter 6.5 +# =========== +echo "Building coreutils" +su - lfs -c "bash $PWD/chapter6/6.5-coreutils.sh" + +# Exit on error +check_exit_code +if [ $exit_status -ne 0 ] +then + stop_script "chapter6/6.5-ncurses.sh" +fi