74 lines
1.7 KiB
Bash
74 lines
1.7 KiB
Bash
fetch $TZDATA_URL
|
|
|
|
sudo chroot "$SYSROOT" /usr/bin/env -i MAKEFLAGS="$MAKEFLAGS" PATH=/usr/bin:/usr/sbin SOURCES=/sources GLIBC_VERSION=$GLIBC_VERSION LINUX_VERSION=$LINUX_VERSION TZDATA_VERSION=$TZDATA_VERSION /usr/bin/bash <<- "EOF"
|
|
set -euo pipefail
|
|
|
|
cd "$SOURCES" && tar xf glibc-$GLIBC_VERSION.tar.xz && cd glibc-$GLIBC_VERSION
|
|
|
|
patch -Np1 -i "$SOURCES/glibc-fhs-1.patch"
|
|
|
|
mkdir -p build && cd build
|
|
|
|
echo "rootsbindir=/usr/sbin" > configparms
|
|
|
|
../configure \
|
|
--prefix=/usr \
|
|
--disable-werror \
|
|
--disable-nscd \
|
|
libc_cv_slibdir=/usr/lib \
|
|
--enable-stack-protector=strong \
|
|
--enable-kernel= \
|
|
--disable-nls \
|
|
--enable-kernel=$LINUX_VERSION \
|
|
--silent \
|
|
--quiet
|
|
|
|
make && make install
|
|
|
|
touch /etc/ld.so.conf
|
|
sed '/RTLDLIST=/s@/usr@@g' -i /usr/bin/ldd
|
|
|
|
cat > /etc/nsswitch.conf <<- "END_OF_FILE"
|
|
passwd: files
|
|
group: files
|
|
shadow: files
|
|
|
|
hosts: files dns
|
|
networks: files
|
|
|
|
protocols: files
|
|
services: files
|
|
ethers: files
|
|
rpc: files
|
|
END_OF_FILE
|
|
|
|
tar xf $SOURCES/tzdata$TZDATA_VERSION.tar.gz
|
|
|
|
ZONEINFO=/usr/share/zoneinfo
|
|
|
|
mkdir -p $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 zone.tab zone1970.tab iso3166.tab $ZONEINFO
|
|
|
|
zic -d $ZONEINFO -p Africa/Johannesburg
|
|
|
|
unset ZONEINFO tz
|
|
|
|
ln -sf /usr/share/zoneinfo/Africa/Johannesburg /etc/localtime
|
|
|
|
cat > /etc/ld.so.conf <<- "END_OF_FILE"
|
|
/usr/local/lib
|
|
/opt/lib
|
|
include /etc/ld.so.conf.d/*.conf
|
|
END_OF_FILE
|
|
|
|
mkdir -p /etc/ld.so.conf.d
|
|
|
|
cd "$SOURCES" && rm -rf glibc-$GLIBC_VERSION
|
|
EOF |