aboutsummaryrefslogtreecommitdiffstats
path: root/chapter8/glibc.sh
diff options
context:
space:
mode:
authorWilliam Harrington <kb0iic@berzerkula.org>2021-04-06 14:09:59 -0500
committerWilliam Harrington <kb0iic@berzerkula.org>2021-04-06 14:09:59 -0500
commitaf28b78b8e659f995b39a5dde2ce2cef0da9fbe0 (patch)
treea80d4cfef7713f7aa26137c0da553358af4cd7b2 /chapter8/glibc.sh
parent783a4c48e04e81783848f0cb0f757f6a836d7f6e (diff)
Add chapter8 script commands.
Diffstat (limited to 'chapter8/glibc.sh')
-rw-r--r--chapter8/glibc.sh75
1 files changed, 75 insertions, 0 deletions
diff --git a/chapter8/glibc.sh b/chapter8/glibc.sh
index 7a693aa..21289b1 100644
--- a/chapter8/glibc.sh
+++ b/chapter8/glibc.sh
@@ -1,3 +1,78 @@
#!/bin/bash
+patch -Np1 -i ../glibc-"${VERSION}"-fhs-1.patch
+sed -e '402a\ *result = local->data.services[database_index];' \
+ -i nss/nss_database.c
+
+mkdir -v build
+cd build || exit 1
+
+../configure --prefix=/usr \
+ --disable-werror \
+ --enable-kernel=5.10.0 \
+ --enable-stack-protector=strong \
+ --with-headers=/usr/include \
+ libc_cv_slibdir=/lib
+
+make PARALLELMFLAGS="${MAKEFLAGS}"
+
+touch /etc/ld.so.conf
+
+sed '/test-installation/s@$(PERL)@echo not running@' -i ../Makefile
+
+make -j1 install
+
+cp -v ../nscd/nscd.conf /etc/nscd.conf
+mkdir -pv /var/cache/nscd
+
+make localedata/install-locales
+
+cat > /etc/nsswitch.conf << "EOF"
+# Begin /etc/nsswitch.conf
+
+passwd: files
+group: files
+shadow: files
+
+hosts: files dns
+networks: files
+
+protocols: files
+services: files
+ethers: files
+rpc: files
+
+# End /etc/nsswitch.conf
+EOF
+
+tar -xf ../../tzdata2021a.tar.gz
+
+ZONEINFO=/usr/share/zoneinfo
+mkdir -pv "${ZONEINFO}"/{posix,right}
+
+for tz in etcetera southamerica northamerica europe africa antarctica \
+ asia australasia backward; do
+ zic -L /dev/null -d "${ZONEINFO}" "${tz}"
+ zic -L /dev/null -d "${ZONEINFO}"/posix "${tz}"
+ zic -L leapseconds -d "${ZONEINFO}"/right "${tz}"
+done
+
+cp -v zone.tab zone1970.tab iso3166.tab "${ZONEINFO}"
+zic -d "${ZONEINFO}" -p America/New_York
+
+ln -sfv /usr/share/zoneinfo/America/Chicago /etc/localtime
+
+cat > /etc/ld.so.conf << "EOF"
+# Begin /etc/ld.so.conf
+/usr/local/lib
+/opt/lib
+
+EOF
+
+cat >> /etc/ld.so.conf << "EOF"
+# Add an include directory
+include /etc/ld.so.conf.d/*.conf
+
+EOF
+mkdir -pv /etc/ld.so.conf.d