2024-10-02 11:07:28 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
2024-10-06 06:16:22 +08:00
|
|
|
source ../versions.sh
|
2024-10-02 11:07:28 +08:00
|
|
|
|
|
|
|
GLSOURCES="${LFS}/sources"
|
|
|
|
|
|
|
|
if [ "`whoami`" != "lfs" ]; then
|
|
|
|
myfail "Must run this script as lfs user"
|
|
|
|
fi
|
|
|
|
|
2024-10-08 15:33:13 +08:00
|
|
|
pushd ${GLSOURCES} > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}"
|
2024-10-02 11:07:28 +08:00
|
|
|
|
2024-10-04 01:04:58 +08:00
|
|
|
[ -d coreutils-${coreutils_version} ] && rm -rf coreutils-${coreutils_version}
|
|
|
|
|
2024-10-02 11:07:28 +08:00
|
|
|
tar -Jxf ${coreutils_tarball}
|
|
|
|
|
|
|
|
cd coreutils-${coreutils_version}
|
|
|
|
|
|
|
|
./configure --prefix=/usr \
|
|
|
|
--host=${LFS_TGT} \
|
|
|
|
--build=$(build-aux/config.guess) \
|
|
|
|
--enable-install-program=hostname \
|
|
|
|
--enable-no-install-program=kill,uptime
|
|
|
|
|
|
|
|
make
|
|
|
|
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
myfail "Failed building coreutils"
|
|
|
|
fi
|
|
|
|
|
|
|
|
make DESTDIR=${LFS} install
|
|
|
|
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
myfail "Failed installing coreutils"
|
|
|
|
fi
|
|
|
|
|
|
|
|
mv ${LFS}/usr/bin/chroot ${LFS}/usr/sbin
|
|
|
|
mkdir -p ${LFS}/usr/share/man/man8
|
|
|
|
mv ${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
|
|
|
|
|
2024-10-08 15:33:13 +08:00
|
|
|
popd
|
2024-10-02 11:07:28 +08:00
|
|
|
|
2024-10-08 15:33:13 +08:00
|
|
|
# cleanup
|
2024-10-02 11:07:28 +08:00
|
|
|
|
2024-10-08 15:33:13 +08:00
|
|
|
pushd ${GLSOURCES}
|
|
|
|
|
|
|
|
rm -rf coreutils-${coreutils_version}
|
|
|
|
|
|
|
|
popd
|