#!/bin/sh tce-load -i compiletc perl5 ncurses-dev bash mpc-dev libudev-dev texinfo coreutils glibc_apps rsync gettext python3.8 squashfs-tools SRCNAM= WRKDIR=glibc-2.32 EXTNAM=glibc TMPDIR=/tmp/$EXTNAM cd $WRKDIR patch -Np1 -i ../glibc-2.32-fhs-1.patch mkdir build cd build echo "CFLAGS += -march=armv8-a+crc -mtune=cortex-a72 -Os -pipe" > configparms ../configure --prefix=/usr --disable-werror --libexecdir=/usr/lib/glibc --enable-kernel=5.4 \ --enable-stack-protector=strong --with-headers=/usr/include libc_cv_slibdir=/lib --enable-obsolete-rpc find . -name config.make -type f -exec sed -i 's/-g -O2//g' {} \; find . -name config.status -type f -exec sed -i 's/-g -O2//g' {} \; make [8m57.738s] make install install_root=$TMPDIR cp ../nscd/nscd.conf $TMPDIR/etc/nscd.conf cp /etc/ld.so.conf $TMPDIR/etc/ld.so.conf cp /etc/nsswitch.conf $TMPDIR/etc/nsswitch.conf # strip binaries find $TMPDIR | xargs file | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded ##Remove info rm -rf ${TMPDIR}/usr/share/info ##Move glibc_add_lib mkdir -p ${TMPDIR}_add_lib/lib mkdir -p ${TMPDIR}_add_lib/usr/lib mv ${TMPDIR}/lib/libnss_hesiod* ${TMPDIR}_add_lib/lib mv ${TMPDIR}/lib/libBrokenLocale* ${TMPDIR}_add_lib/lib mv ${TMPDIR}/lib/libpcprofile* ${TMPDIR}_add_lib/lib mv ${TMPDIR}/lib/libnss_compat* ${TMPDIR}_add_lib/lib mv ${TMPDIR}/lib/libmemusage* ${TMPDIR}_add_lib/lib mv ${TMPDIR}/lib/libthread_db* ${TMPDIR}_add_lib/lib mv ${TMPDIR}/lib/libnss_db* ${TMPDIR}_add_lib/lib mv ${TMPDIR}/lib/libSegFault* ${TMPDIR}_add_lib/lib mv ${TMPDIR}/usr/lib/libBrokenLocale.so ${TMPDIR}_add_lib/usr/lib mv ${TMPDIR}/usr/lib/libnss_compat.so ${TMPDIR}_add_lib/usr/lib mv ${TMPDIR}/usr/lib/libthread_db.so ${TMPDIR}_add_lib/usr/lib mv ${TMPDIR}/usr/lib/libnss_hesiod.so ${TMPDIR}_add_lib/usr/lib mv ${TMPDIR}/usr/lib/libnss_db.so ${TMPDIR}_add_lib/usr/lib mv ${TMPDIR}/usr/lib/audit ${TMPDIR}_add_lib/usr/lib ##Move glibc_apps mkdir -p ${TMPDIR}_apps/usr/lib mv ${TMPDIR}/usr/bin ${TMPDIR}_apps/usr mkdir -p ${TMPDIR}/usr/bin mv ${TMPDIR}_apps/usr/bin/locale ${TMPDIR}/usr/bin mv ${TMPDIR}/usr/sbin ${TMPDIR}_apps/usr mv ${TMPDIR}/usr/lib/glibc ${TMPDIR}_apps/usr/lib ##Move glibc_base-dev mkdir -p ${TMPDIR}_base-dev/usr/lib mv ${TMPDIR}/usr/include ${TMPDIR}_base-dev/usr mv ${TMPDIR}/usr/lib/*.o ${TMPDIR}_base-dev/usr/lib mv ${TMPDIR}/usr/lib/*.a ${TMPDIR}_base-dev/usr/lib ##Move glibc_gconv mkdir -p ${TMPDIR}_gconv/usr/lib mv ${TMPDIR}/usr/lib/gconv ${TMPDIR}_gconv/usr/lib ##Move glibc_i18n_locales mkdir -p ${TMPDIR}_i18n_locale/usr/share mv ${TMPDIR}/usr/share/i18n ${TMPDIR}_i18n_locale/usr/share ################################################### # Create base archive in temp dir # ################################################### cd $TMPDIR tar zcvf glibc_base.tar.gz * # Cleanup temp directory rm -r -f usr rm -r -f etc rm -r -f lib rm -r -f var rm -r -f sbin ################################################### # Create add_lib extension in temp dir # ################################################### cd ${TMPDIR}_add_lib cd .. mksquashfs ${TMPDIR}_add_lib ${EXTNAM}_add_lib.tcz cd ${TMPDIR}_add_lib find * -not -type d > ${EXTNAM}_add_lib.tcz.list mv ../${EXTNAM}_add_lib.tcz . # Create md5 file md5sum ${EXTNAM}_add_lib.tcz > ${EXTNAM}_add_lib.tcz.md5.txt # Cleanup temp directory rm -r -f usr rm -r -f lib ################################################### # Create _apps extension in temp dir # ################################################### cd ${TMPDIR}_apps cd .. mksquashfs ${TMPDIR}_apps ${EXTNAM}_apps.tcz cd ${TMPDIR}_apps find usr -not -type d > ${EXTNAM}_apps.tcz.list mv ../${EXTNAM}_apps.tcz . # Create md5 file md5sum ${EXTNAM}_apps.tcz > ${EXTNAM}_apps.tcz.md5.txt # Cleanup temp directory rm -r -f usr ################################################### # Create _base-dev extension in temp dir # ################################################### cd ${TMPDIR}_base-dev cd .. mksquashfs ${TMPDIR}_base-dev ${EXTNAM}_base-dev.tcz cd ${TMPDIR}_base-dev find usr -not -type d > ${EXTNAM}_base-dev.tcz.list mv ../${EXTNAM}_base-dev.tcz . # Create md5 file md5sum ${EXTNAM}_base-dev.tcz > ${EXTNAM}_base-dev.tcz.md5.txt # Cleanup temp directory rm -r -f usr ################################################### # Create _gconv extension in temp dir # ################################################### cd ${TMPDIR}_gconv cd .. mksquashfs ${TMPDIR}_gconv ${EXTNAM}_gconv.tcz cd ${TMPDIR}_gconv find usr -not -type d > ${EXTNAM}_gconv.tcz.list mv ../${EXTNAM}_gconv.tcz . # Create md5 file md5sum ${EXTNAM}_gconv.tcz > ${EXTNAM}_gconv.tcz.md5.txt # Cleanup temp directory rm -r -f usr ################################################### # Create _i18n_locale extension in temp dir # ################################################### cd ${TMPDIR}_i18n_locale cd .. mksquashfs ${TMPDIR}_i18n_locale ${EXTNAM}_i18n_locale.tcz cd ${TMPDIR}_i18n_locale find usr -not -type d > ${EXTNAM}_i18n_locale.tcz.list mv ../${EXTNAM}_i18n_locale.tcz . # Create md5 file md5sum ${EXTNAM}_i18n_locale.tcz > ${EXTNAM}_i18n_locale.tcz.md5.txt # Cleanup temp directory rm -r -f usr