From 691d94a482f50ab50e573c4a6c35aec89d4947a9 Mon Sep 17 00:00:00 2001 From: Aditya Date: Thu, 12 Jan 2023 14:52:05 +0530 Subject: [PATCH] Add 8.54 - Build coreutls --- scripts/chapter8/8.54-coreutils.sh | 38 ++++++++++++++++++++++++++++++ scripts/main.sh | 12 ++++++++++ 2 files changed, 50 insertions(+) create mode 100644 scripts/chapter8/8.54-coreutils.sh diff --git a/scripts/chapter8/8.54-coreutils.sh b/scripts/chapter8/8.54-coreutils.sh new file mode 100644 index 0000000..74dc289 --- /dev/null +++ b/scripts/chapter8/8.54-coreutils.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +cd /sources +tar xf coreutils-9.1.tar.xz +cd coreutils-9.1 + +patch -Np1 -i ../coreutils-9.1-i18n-1.patch + +autoreconf -fiv +FORCE_UNSAFE_CONFIGURE=1 ./configure \ + --prefix=/usr \ + --enable-no-install-program=kill,uptime + +make -j5 + +if [ $? -ne 0 ] +then + exit 1 +fi + +make NON_ROOT_USERNAME=tester check-root + +echo "dummy:x:102:tester" >> /etc/group + +chown -Rv tester . + +su tester -c "PATH=$PATH make RUN_EXPENSIVE_TESTS=yes check" + +sed -i '/dummy/d' /etc/group + +make install + +mv -v /usr/bin/chroot /usr/sbin +mv -v /usr/share/man/man1/chroot.1 /usr/share/man/man8/chroot.8 +sed -i 's/"1"/"8"/' /usr/share/man/man8/chroot.8 + +cd /sources +rm -rf coreutils-9.1 diff --git a/scripts/main.sh b/scripts/main.sh index ac4993f..ae3de95 100644 --- a/scripts/main.sh +++ b/scripts/main.sh @@ -1186,3 +1186,15 @@ then stop_script "chapter8/8.53-meson.sh" fi +# Chapter 8.54 +# ============ +echo "Building coreutils" +su -c "bash $SCRIPT/chapter8/8.54-coreutils.sh" + +# Exit on error +check_exit_code +if [ $exit_status -ne 0 ] +then + stop_script "bash $SCRIPT/chapter8/8.54-coreutils.sh" +fi +