#!/bin/sh -e # $Id$ . ./bootstrap export ROOT="`pwd`" export MUSL_GCC_ROOT="`pwd`/build/$ARCH-linux-musl-cross" export SYS_ROOT="$ROOT/sys-root" OLDDIR="" CURDIR="" ENTER () { OLDDIR="`pwd`" CURDIR="$1" echo "Construct: Entering $1" cd "$1" } LEAVE () { echo "Construct: Leaving $CURDIR" cd "$OLDDIR" } START="`date`" echo "Construct started at: $START" echo "--- Log" echo -n "MUSLCC... " if [ -e build/$ARCH-linux-musl-cross/installed ]; then echo "skipped" else echo "needed" mkdir -p $SYS_ROOT/usr touch build/$ARCH-linux-musl-cross/installed fi echo -n "MUSL... " if [ -e build/musl-$MUSL_VER/installed ]; then echo "skipped" else echo "needed" export CC=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-gcc export CXX=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-g++ export LD=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ld export CFLAGS="--sysroot=$ROOT/build/$ARCH-linux-musl-cross -D__USE_LARGEFILE64 -O2" export CXXFLAGS="--sysroot=$ROOT/build/$ARCH-linux-musl-cross -D__USE_LARGEFILE64 -O2" export LDFLAGS="--sysroot=$ROOT/build/$ARCH-linux-musl-cross -O2" ENTER $ROOT/build/musl-$MUSL_VER mkdir -p build cd build cp $ROOT/source/sbrk.c ../src/linux/sbrk.c if [ ! -e configured ]; then ../configure --build=$ARCH-linux-musl --host=$ARCH-linux-musl --target=$ARCH-linux-musl --prefix=/usr touch configured fi make -j $(nproc) make install DESTDIR=$SYS_ROOT/ -j $(nproc) cd .. LEAVE touch build/musl-$MUSL_VER/installed fi if [ "0" = "1" ]; then echo -n "GMP... " if [ -e build/gmp-$GMP_VER/installed ]; then echo "skipped" else echo "needed" export CC=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-gcc export CXX=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-g++ export LD=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ld export CFLAGS="--sysroot=$SYS_ROOT -D__USE_LARGEFILE64 -O2" export CXXFLAGS="--sysroot=$SYS_ROOT -D__USE_LARGEFILE64 -O2" export LDFLAGS="--sysroot=$SYS_ROOT -O2" ENTER $ROOT/build/gmp-$GMP_VER mkdir -p build cd build if [ ! -e configured ]; then ../configure --build=$ARCH-linux-musl --host=$ARCH-linux-musl --target=$ARCH-linux-musl --prefix=/usr touch configured fi make -j $(nproc) make install DESTDIR=$SYS_ROOT/ -j $(nproc) cd .. LEAVE touch build/gmp-$GMP_VER/installed fi echo -n "MPFR... " if [ -e build/mpfr-$MPFR_VER/installed ]; then echo "skipped" else echo "needed" export CC=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-gcc export CXX=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-g++ export LD=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ld export CFLAGS="--sysroot=$SYS_ROOT -D__USE_LARGEFILE64 -O2" export CXXFLAGS="--sysroot=$SYS_ROOT -D__USE_LARGEFILE64 -O2" export LDFLAGS="--sysroot=$SYS_ROOT -O2" ENTER $ROOT/build/mpfr-$MPFR_VER mkdir -p build cd build if [ ! -e configured ]; then ../configure --build=$ARCH-linux-musl --host=$ARCH-linux-musl --target=$ARCH-linux-musl --prefix=/usr touch configured fi make -j $(nproc) make install DESTDIR=$SYS_ROOT/ -j $(nproc) cd .. LEAVE touch build/mpfr-$MPFR_VER/installed fi echo -n "MPC... " if [ -e build/mpc-$MPC_VER/installed ]; then echo "skipped" else echo "needed" export CC=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-gcc export CXX=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-g++ export LD=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ld export CFLAGS="--sysroot=$SYS_ROOT -D__USE_LARGEFILE64 -O2" export CXXFLAGS="--sysroot=$SYS_ROOT -D__USE_LARGEFILE64 -O2" export LDFLAGS="--sysroot=$SYS_ROOT -O2" ENTER $ROOT/build/mpc-$MPC_VER mkdir -p build cd build if [ ! -e configured ]; then ../configure --build=$ARCH-linux-musl --host=$ARCH-linux-musl --target=$ARCH-linux-musl --prefix=/usr touch configured fi make -j $(nproc) make install DESTDIR=$SYS_ROOT/ -j $(nproc) cd .. LEAVE touch build/mpc-$MPC_VER/installed fi fi # ------------ # Dependencies # ------------ echo -n "OpenSSL... " if [ -e build/openssl-$OPENSSL_VER/installed ]; then echo "skipped" else echo "needed" export CC=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-gcc export CXX=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-g++ export LD=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ld export CFLAGS="--sysroot=$SYS_ROOT -O2" export CXXFLAGS="--sysroot=$SYS_ROOT -O2" export LDFLAGS="--sysroot=$SYS_ROOT -O2" ENTER build/openssl-$OPENSSL_VER if [ ! -e "configured" ]; then ./Configure --prefix=/usr --openssldir=/etc/openssl --sysroot=$SYS_ROOT -Wl,--sysroot=$SYS_ROOT touch configured fi make -j $(nproc) make install DESTDIR=$SYS_ROOT/ -j $(nproc) LEAVE touch build/openssl-$OPENSSL_VER/installed fi echo -n "NCurses... " if [ -e build/ncurses-$NCURSES_VER/installed ]; then echo "skipped" else echo "needed" export CC=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-gcc export CXX=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-g++ export LD=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ld export AR=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ar export AS=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-as export RANLIB=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ranlib export CFLAGS="--sysroot=$SYS_ROOT -O2" export CXXFLAGS="--sysroot=$SYS_ROOT -O2" export LDFLAGS="--sysroot=$SYS_ROOT -O2" ENTER build/ncurses-$NCURSES_VER if [ ! -e "configured" ]; then ./configure --prefix=/usr --with-shared --without-tests --disable-widec --with-termlib touch configured fi make -j $(nproc) make install DESTDIR=$SYS_ROOT/ -j $(nproc) LEAVE touch build/ncurses-$NCURSES_VER/installed fi echo -n "KRB5... " if [ -e build/krb5-$KRB5_VER/installed ]; then echo "skipped" else echo "needed" ENTER build/krb5-$KRB5_VER/src export CC=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-gcc export CXX=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-g++ export LD=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ld export AR=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ar export AS=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-as export RANLIB=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ranlib export CFLAGS="--sysroot=$SYS_ROOT -O2" export LDFLAGS="--sysroot=$SYS_ROOT -O2" if [ ! -e configured ]; then ./configure --prefix=/usr --with-sysroot=$SYS_ROOT --host=$(uname -m)-linux-musl --sysconfdir=/etc touch configured fi make -j $(nproc) make install DESTDIR=$SYS_ROOT/ -j $(nproc) LEAVE touch build/krb5-$KRB5_VER/installed fi echo -n "TIRPC... " if [ -e build/libtirpc-$TIRPC_VER/installed ]; then echo "skipped" else echo "needed" ENTER build/libtirpc-$TIRPC_VER export CC=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-gcc export CXX=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-g++ export LD=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ld export AR=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ar export AS=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-as export RANLIB=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ranlib export CFLAGS="--sysroot=$SYS_ROOT -O2" export LDFLAGS="--sysroot=$SYS_ROOT -O2" if [ ! -e configured ]; then path="$PATH" export PATH=$PATH:$SYS_ROOT/usr/bin ./configure --prefix=/usr --with-sysroot=$SYS_ROOT --host=$(uname -m)-linux-musl --sysconfdir=/etc PATH="$path" touch configured fi make -j $(nproc) make install DESTDIR=$SYS_ROOT/ -j $(nproc) LEAVE touch build/libtirpc-$TIRPC_VER/installed fi echo -n "NSL... " if [ -e build/libnsl-$NSL_VER/installed ]; then echo "skipped" else echo "needed" ENTER build/libnsl-$NSL_VER export CC=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-gcc export CXX=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-g++ export LD=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ld export AR=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ar export AS=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-as export RANLIB=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ranlib export CFLAGS="--sysroot=$SYS_ROOT -O2" export LDFLAGS="--sysroot=$SYS_ROOT -O2" if [ ! -e configured ]; then ./configure --prefix=/usr --with-sysroot=$SYS_ROOT --host=$(uname -m)-linux-musl --sysconfdir=/etc touch configured fi make -j $(nproc) make install DESTDIR=$SYS_ROOT/ -j $(nproc) LEAVE touch build/libnsl-$NSL_VER/installed fi echo -n "PAM... " if [ -e build/Linux-PAM-$PAM_VER/installed ]; then echo "skipped" else echo "needed" ENTER build/Linux-PAM-$PAM_VER export CC=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-gcc export CXX=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-g++ export LD=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ld export AR=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ar export AS=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-as export RANLIB=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ranlib export CFLAGS="--sysroot=$SYS_ROOT -O2" export LDFLAGS="--sysroot=$SYS_ROOT -O2" if [ ! -e configured ]; then ./configure --prefix=/usr --with-sysroot=$SYS_ROOT --host=$(uname -m)-linux-musl --sysconfdir=/etc --libdir=/usr/lib --enable-securedir=/usr/lib/security --sbindir=/usr/sbin touch configured fi make -j $(nproc) make install DESTDIR=$SYS_ROOT/ -j $(nproc) LEAVE touch build/Linux-PAM-$PAM_VER/installed fi echo -n "Shadow... " if [ -e build/shadow-$SHADOW_VER/installed ]; then echo "skipped" else echo "needed" ENTER build/shadow-$SHADOW_VER export CC=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-gcc export CXX=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-g++ export LD=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ld export AR=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ar export AS=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-as export RANLIB=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ranlib export CFLAGS="--sysroot=$SYS_ROOT -O2" export CXXFLAGS="--sysroot=$SYS_ROOT -O2" export LDFLAGS="--sysroot=$SYS_ROOT -O2" if [ ! -e configured ]; then ./configure --prefix=/usr --with-sysroot=$SYS_ROOT --host=$(uname -m)-linux-musl --sysconfdir=/etc --without-libbsd --with-bcrypt --with-yescrypt sed -iE 's/^global_symbol_pipe=""/global_symbol_pipe="cat"/g' libtool touch configured fi make -j $(nproc) make install DESTDIR=$SYS_ROOT/ -j $(nproc) LEAVE touch build/shadow-$SHADOW_VER/installed fi echo -n "SQLite... " if [ -e build/sqlite-version-$SQLITE_VER/installed ]; then echo "skipped" else echo "needed" ENTER build/sqlite-version-$SQLITE_VER export CC=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-gcc export CXX=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-g++ export LD=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ld export AR=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ar export AS=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-as export RANLIB=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ranlib export CFLAGS="--sysroot=$SYS_ROOT -O2" export CXXFLAGS="--sysroot=$SYS_ROOT -O2" export LDFLAGS="--sysroot=$SYS_ROOT -O2" if [ ! -e configured ]; then ./configure --prefix=/usr --with-sysroot=$SYS_ROOT --host=$(uname -m)-linux-musl --disable-tcl --disable-readline touch configured fi make all -j $(nproc) make install DESTDIR=$SYS_ROOT/ -j $(nproc) LEAVE touch build/sqlite-version-$SQLITE_VER/installed fi echo -n "TCSH... " if [ -e build/tcsh-TCSH$TCSH_VER/installed ]; then echo "skipped" else echo "needed" ENTER build/tcsh-TCSH$TCSH_VER export CC=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-gcc export CXX=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-g++ export LD=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ld export AR=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ar export AS=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-as export RANLIB=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ranlib export CFLAGS="--sysroot=$SYS_ROOT -O2" export CXXFLAGS="--sysroot=$SYS_ROOT -O2" export LDFLAGS="--sysroot=$SYS_ROOT -O2" if [ ! -e configured ]; then ./configure --prefix=/usr --with-sysroot=$SYS_ROOT --build=$(uname -m)-linux-musl --target=$(uname -m)-linux-musl --host=$(uname -m)-linux-musl --disable-rpath --disable-nls # sed -i 's/#define HAVE_SBRK 1//g' config.h touch configured fi make all -j $(nproc) make install DESTDIR=$SYS_ROOT/ -j $(nproc) LEAVE ln -sf ../usr/bin/tcsh sys-root/bin/tcsh ln -sf ../usr/bin/tcsh sys-root/bin/csh touch build/tcsh-TCSH$TCSH_VER/installed fi echo -n "KSH... " if [ -e build/ksh-$KSH_VER/installed ]; then echo "skipped" else echo "needed" ENTER build/ksh-$KSH_VER path="$PATH" export PATH=$PATH:$ROOT/build/$ARCH-linux-musl-cross/usr/bin export CC=$ARCH-linux-musl-gcc export LD=$ARCH-linux-musl-ld export CCFLAGS="--sysroot=$SYS_ROOT -O2" export LDFLAGS="--sysroot=$SYS_ROOT -O2" sed -i "s/typedef long fd_set;//g" src/cmd/ksh93/features/poll || true sed -Ei 's/typ\s+socklen_t\s+.+$//g' src/cmd/ksh93/features/poll || true ./bin/package make HOSTTYPE="linux.$ARCH" CC="$CC" CCFLAGS="$CCFLAGS" PATH="$path" cp arch/linux.$ARCH/bin/ksh $SYS_ROOT/bin/ksh93 cp arch/linux.$ARCH/bin/ksh $SYS_ROOT/bin/ksh cp arch/linux.$ARCH/bin/ksh $SYS_ROOT/bin/sh LEAVE touch build/ksh-$KSH_VER/installed fi echo -n "ZLib... " if [ -e build/zlib-$ZLIB_VER/installed ]; then echo "skipped" else echo "needed" ENTER build/zlib-$ZLIB_VER export CC=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-gcc export CXX=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-g++ export LD=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ld export AR=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ar export AS=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-as export RANLIB=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ranlib export CFLAGS="--sysroot=$SYS_ROOT -O2" export LDFLAGS="--sysroot=$SYS_ROOT -O2" if [ ! -e "configured" ]; then ./configure --prefix=/usr touch configured fi make -j $(nproc) make install DESTDIR=$SYS_ROOT/ -j $(nproc) LEAVE touch build/zlib-$ZLIB_VER/installed fi echo -n "pigz... " if [ -e build/pigz-$PIGZ_VER/installed ]; then echo "skipped" else echo "needed" ENTER build/pigz-$PIGZ_VER export CC=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-gcc export CXX=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-g++ export LD=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ld export AR=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ar export AS=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-as export RANLIB=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ranlib export CFLAGS="--sysroot=$SYS_ROOT -O2" export LDFLAGS="--sysroot=$SYS_ROOT -O2" make CC="$CC" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" -j $(nproc) cp pigz $SYS_ROOT/usr/bin/gzip LEAVE touch build/pigz-$PIGZ_VER/installed fi echo -n "SysVInit... " if [ -e build/sysvinit-$SYSVINIT_VER/installed ]; then echo "skipped" else echo "needed" ENTER build/sysvinit-$SYSVINIT_VER export CC=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-gcc export CXX=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-g++ export LD=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ld export AR=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ar export AS=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-as export RANLIB=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ranlib export CFLAGS="--sysroot=$SYS_ROOT -O2" export LDFLAGS="--sysroot=$SYS_ROOT -O2" make -j $(nproc) make install ROOT=$SYS_ROOT/ -j $(nproc) LEAVE touch build/sysvinit-$SYSVINIT_VER/installed fi echo -n "KMOD... " if [ -e build/kmod-$KMOD_VER/installed ]; then echo "skipped" else echo "needed" ENTER build/kmod-$KMOD_VER export CC=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-gcc export CXX=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-g++ export LD=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ld export AR=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ar export AS=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-as export RANLIB=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ranlib export CFLAGS="--sysroot=$SYS_ROOT -O2" export LDFLAGS="--sysroot=$SYS_ROOT -O2" if [ ! -e "configured" ]; then ./configure --prefix=/usr --sysconfdir=/etc touch configured fi make -j $(nproc) make install DESTDIR=$SYS_ROOT/ -j $(nproc) LEAVE touch build/kmod-$KMOD_VER/installed fi echo -n "sysklogd... " if [ -e build/sysklogd-$SYSKLOGD_VER/installed ]; then echo "skipped" else echo "needed" ENTER build/sysklogd-$SYSKLOGD_VER export CC=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-gcc export CXX=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-g++ export LD=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ld export AR=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ar export AS=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-as export RANLIB=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ranlib export CFLAGS="--sysroot=$SYS_ROOT -O2" export LDFLAGS="--sysroot=$SYS_ROOT -O2" if [ ! -e "configured" ]; then ./configure --prefix=/usr --sysconfdir=/etc --runstatedir=/run --without-logger touch configured fi make -j $(nproc) make install DESTDIR=$SYS_ROOT/ -j $(nproc) LEAVE touch build/sysklogd-$SYSKLOGD_VER/installed fi echo -n "DHCP... " if [ -e build/dhcp-$DHCP_VER/installed ]; then echo "skipped" else echo "needed" ENTER build/dhcp-$DHCP_VER export CC=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-gcc export CXX=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-g++ export LD=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ld export AR=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ar export AS=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-as export RANLIB=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ranlib export CFLAGS="--sysroot=$SYS_ROOT -O2" export LDFLAGS="--sysroot=$SYS_ROOT -O2" if [ ! -e "configured" ]; then ./configure --prefix=/usr --sysconfdir=/etc --runstatedir=/run --localstatedir=/var --enable-bind-install touch configured fi make -j $(nproc) BUILD_CC="cc" make install DESTDIR=$SYS_ROOT/ -j $(nproc) LEAVE touch build/dhcp-$DHCP_VER/installed fi echo -n "net-tools... " if [ -e build/net-tools-$NETTOOLS_VER/installed ]; then echo "skipped" else echo "needed" ENTER build/net-tools-$NETTOOLS_VER export CC=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-gcc export CXX=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-g++ export LD=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ld export AR=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ar export AS=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-as export RANLIB=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ranlib export CFLAGS="--sysroot=$SYS_ROOT -O2" export LDFLAGS="--sysroot=$SYS_ROOT -O2" export BINDIR='/usr/net/bin' SBINDIR='/usr/net/sbin' yes | make config sed -Ei 's/#define (HAVE_AFECONET|HAVE_HWSTRIP|HAVE_HWTR|HAVE_SELINUX|HAVE_AFBLUETOOTH|HAVE_AFDECnet) 1//g' config.h sed -Ei 's/(HAVE_AFECONET|HAVE_HWSTRIP|HAVE_HWTR|HAVE_SELINUX|HAVE_AFBLUETOOTH|HAVE_AFDECnet)=1/\1=0/g' config.make make -j $(nproc) make install DESTDIR=$SYS_ROOT/ -j $(nproc) rm $SYS_ROOT/usr/net/bin/nisdomainname rm $SYS_ROOT/usr/net/bin/ypdomainname rm $SYS_ROOT/usr/net/bin/dnsdomainname rm $SYS_ROOT/usr/net/bin/domainname rm $SYS_ROOT/usr/net/bin/ifconfig rm $SYS_ROOT/usr/net/bin/hostname LEAVE touch build/net-tools-$NETTOOLS_VER/installed fi echo -n "inetutils... " if [ -e build/inetutils-$INETUTILS_VER/installed ]; then echo "skipped" else echo "needed" ENTER build/inetutils-$INETUTILS_VER export CC=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-gcc export CXX=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-g++ export LD=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ld export AR=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ar export AS=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-as export RANLIB=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ranlib export CFLAGS="--sysroot=$SYS_ROOT -O2" export LDFLAGS="--sysroot=$SYS_ROOT -O2" if [ ! -e "configured" ]; then ./configure --prefix=/usr/inet --sysconfdir=/etc --runstatedir=/run --localstatedir=/var --disable-hostname --enable-rlogin --mandir=/usr/share/man touch configured fi make -j $(nproc) make install DESTDIR=$SYS_ROOT/ -j $(nproc) LEAVE touch build/inetutils-$INETUTILS_VER/installed fi echo -n "inih... " if [ -e build/inih-r$INIH_VER/installed ]; then echo "skipped" else echo "needed" ENTER build/inih-r$INIH_VER export CC=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-gcc export CXX=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-g++ export LD=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ld export AR=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ar export AS=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-as export RANLIB=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ranlib export CFLAGS="--sysroot=$SYS_ROOT -O2" export CXXFLAGS="--sysroot=$SYS_ROOT -O2" export LDFLAGS="--sysroot=$SYS_ROOT -O2" mkdir -p build cd build if [ ! -e "configured" ]; then meson setup --cross-file $ROOT/meson.txt --prefix /usr .. touch configured fi ninja DESTDIR=$SYS_ROOT ninja install cd .. LEAVE touch build/inih-r$INIH_VER/installed fi echo -n "urcu... " if [ -e build/userspace-rcu-$URCU_VER/installed ]; then echo "skipped" else echo "needed" ENTER build/userspace-rcu-$URCU_VER export CC=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-gcc export CXX=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-g++ export LD=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ld export AR=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ar export AS=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-as export RANLIB=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ranlib export CFLAGS="--sysroot=$SYS_ROOT -O2" export CXXFLAGS="--sysroot=$SYS_ROOT -O2" export LDFLAGS="--sysroot=$SYS_ROOT -O2" if [ ! -e "configured" ]; then ./configure --prefix=/usr --disable-static touch configured fi make -j $(nproc) make install DESTDIR=$SYS_ROOT/ -j $(nproc) LEAVE touch build/userspace-rcu-$URCU_VER/installed fi echo -n "xfsprogs... " if [ -e build/xfsprogs-$XFSPROGS_VER/installed ]; then echo "skipped" else echo "needed" ENTER build/xfsprogs-$XFSPROGS_VER export CC=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-gcc export CXX=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-g++ export LD=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ld export AR=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ar export AS=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-as export RANLIB=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ranlib export CFLAGS="--sysroot=$SYS_ROOT -O2 -I$SYS_ROOT/usr/linux/include" export LDFLAGS="--sysroot=$SYS_ROOT -O2 -L$SYS_ROOT/usr/linux/lib" if [ ! -e "configure" ]; then autoreconf -fvi fi if [ ! -e "configured" ]; then ./configure --prefix=/usr --sysconfdir=/etc --runstatedir=/run --localstatedir=/var --mandir=/usr/share/man --enable-libicu=no touch configured fi make -j $(nproc) make install DESTDIR=$SYS_ROOT/ -j $(nproc) LEAVE touch build/xfsprogs-$XFSPROGS_VER/installed fi echo -n "dosfstools... " if [ -e build/dosfstools-$DOSFSTOOLS_VER/installed ]; then echo "skipped" else echo "needed" ENTER build/dosfstools-$DOSFSTOOLS_VER export CC=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-gcc export CXX=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-g++ export LD=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ld export AR=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ar export AS=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-as export RANLIB=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ranlib export CFLAGS="--sysroot=$SYS_ROOT -O2 -I$SYS_ROOT/usr/linux/include" export LDFLAGS="--sysroot=$SYS_ROOT -O2 -L$SYS_ROOT/usr/linux/lib" if [ ! -e "configure" ]; then autoreconf -fvi fi if [ ! -e "configured" ]; then ./configure --prefix=/usr --sysconfdir=/etc --runstatedir=/run --localstatedir=/var --mandir=/usr/share/man touch configured fi make -j $(nproc) make install DESTDIR=$SYS_ROOT/ -j $(nproc) LEAVE touch build/dosfstools-$DOSFSTOOLS_VER/installed fi echo -n "Limine... " if [ -e build/limine-$LIMINE_VER/installed ]; then echo "skipped" else echo "needed" ENTER build/limine-$LIMINE_VER export CC=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-gcc export CXX=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-g++ export LD=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ld export AR=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ar export AS=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-as export RANLIB=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ranlib export CFLAGS="--sysroot=$SYS_ROOT -O2 -I$SYS_ROOT/usr/linux/include" export LDFLAGS="--sysroot=$SYS_ROOT -O2 -L$SYS_ROOT/usr/linux/lib" if [ ! -e "configure" ]; then autoreconf -fvi fi if [ ! -e "configured" ]; then ./configure --prefix=/usr --sysconfdir=/etc --runstatedir=/run --localstatedir=/var --mandir=/usr/share/man --enable-uefi-x86-64 --enable-bios --enable-bios-cd --enable-uefi-cd touch configured fi make -j $(nproc) make install DESTDIR=$SYS_ROOT/ -j $(nproc) LEAVE touch build/limine-$LIMINE_VER/installed fi echo -n "libfetch... " if [ -e libfetch/installed ]; then echo "skipped" else echo "needed" ENTER libfetch export CC=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-gcc export CXX=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-g++ export LD=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ld export AR=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ar export AS=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-as export RANLIB=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ranlib export CFLAGS="--sysroot=$SYS_ROOT -O2 -I$SYS_ROOT/usr/linux/include" export LDFLAGS="--sysroot=$SYS_ROOT -O2 -L$SYS_ROOT/usr/linux/lib" make -j $(nproc) make install DESTDIR=$SYS_ROOT/ -j $(nproc) LEAVE touch libfetch/installed fi echo -n "pkg... " if [ -e pkg/installed ]; then echo "skipped" else echo "needed" ENTER pkg export CC=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-gcc export CXX=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-g++ export LD=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ld export AR=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ar export AS=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-as export RANLIB=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ranlib export CFLAGS="--sysroot=$SYS_ROOT -O2 -I$SYS_ROOT/usr/linux/include" export LDFLAGS="--sysroot=$SYS_ROOT -O2 -L$SYS_ROOT/usr/linux/lib" make -j $(nproc) make install DESTDIR=$SYS_ROOT/ -j $(nproc) LEAVE touch pkg/installed fi echo -n "urlget... " if [ -e urlget/installed ]; then echo "skipped" else echo "needed" ENTER urlget export CC=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-gcc export CXX=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-g++ export LD=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ld export AR=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ar export AS=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-as export RANLIB=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ranlib export CFLAGS="--sysroot=$SYS_ROOT -O2 -I$SYS_ROOT/usr/linux/include" export LDFLAGS="--sysroot=$SYS_ROOT -O2 -L$SYS_ROOT/usr/linux/lib" make -j $(nproc) make install DESTDIR=$SYS_ROOT/ -j $(nproc) LEAVE touch urlget/installed fi echo -n "util-linux... " if [ -e build/util-linux-$UTILLINUX_VER/installed ]; then echo "skipped" else echo "needed" ENTER build/util-linux-$UTILLINUX_VER if [ ! -e configure ]; then ./autogen.sh fi export CC=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-gcc export CXX=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-g++ export LD=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ld export AR=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ar export AS=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-as export RANLIB=$ROOT/build/$ARCH-linux-musl-cross/bin/$ARCH-linux-musl-ranlib export SQLITE3_CFLAGS=" " export SQLITE3_LIBS=" " export CFLAGS="--sysroot=$SYS_ROOT -O2" export LDFLAGS="--sysroot=$SYS_ROOT -O2" if [ ! -e configured ]; then ./configure --prefix=/usr/linux --with-sysroot=$SYS_ROOT --host=$(uname -m)-linux-musl --without-systemd --without-python --without-ncursesw touch configured fi make -j $(nproc) make install DESTDIR=$SYS_ROOT/ -j $(nproc) LEAVE touch build/util-linux-$UTILLINUX_VER/installed fi echo -n "devtools... " if [ -e devtools/installed ]; then echo "skipped" else echo "needed" ENTER devtools make -j $(nproc) make install ROOT=$SYS_ROOT/ -j $(nproc) LEAVE touch devtools/installed fi echo -n "pkgtools... " if [ -e pkgtools/installed ]; then echo "skipped" else echo "needed" ENTER pkgtools make -j $(nproc) make install ROOT=$SYS_ROOT/ -j $(nproc) LEAVE touch pkgtools/installed fi echo -n "toolchest... " if [ -e toolchest/installed ]; then echo "skipped" else echo "needed" ENTER toolchest make make install ROOT=$SYS_ROOT/ -j $(nproc) LEAVE touch toolchest/installed fi echo -n "doctools... " if [ -e doctools/installed ]; then echo "skipped" else echo "needed" ENTER doctools make make install ROOT=$SYS_ROOT/ -j $(nproc) LEAVE touch doctools/installed fi echo -n "vi... " if [ -e vi/installed ]; then echo "skipped" else echo "needed" ENTER vi make -j $(nproc) make install DESTDIR=$SYS_ROOT/ -j $(nproc) LEAVE touch vi/installed fi ENTER initrd LINUX_VER=`wget -O - "$SLACKWARE_ROOT/slackware$BITS-current/kernels/VERSIONS.TXT" | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+'` echo Using Linux verison $LINUX_VER mkdir -p proc sys tmp dev newroot bin mkdir -p lib/modules/$LINUX_VER/kernel/drivers/usb mkdir -p lib/modules/$LINUX_VER/kernel/drivers/scsi mkdir -p lib/modules/$LINUX_VER/kernel/fs mkdir -p lib/modules/$LINUX_VER/kernel/lib mkdir -p lib/modules/$LINUX_VER/kernel/arch mkdir -p lib/modules/$LINUX_VER/kernel/crypto mkdir -p lib/modules/$LINUX_VER/kernel/block cp -rf $SYS_ROOT/lib/modules/$LINUX_VER/modules.* lib/modules/$LINUX_VER/ cp -rf $SYS_ROOT/lib/modules/$LINUX_VER/kernel/drivers/scsi/* lib/modules/$LINUX_VER/kernel/drivers/scsi/ cp -rf $SYS_ROOT/lib/modules/$LINUX_VER/kernel/drivers/usb/* lib/modules/$LINUX_VER/kernel/drivers/usb/ cp -rf $SYS_ROOT/lib/modules/$LINUX_VER/kernel/fs/* lib/modules/$LINUX_VER/kernel/fs/ cp -rf $SYS_ROOT/lib/modules/$LINUX_VER/kernel/lib/* lib/modules/$LINUX_VER/kernel/lib/ cp -rf $SYS_ROOT/lib/modules/$LINUX_VER/kernel/arch/* lib/modules/$LINUX_VER/kernel/arch/ cp -rf $SYS_ROOT/lib/modules/$LINUX_VER/kernel/block/* lib/modules/$LINUX_VER/kernel/block/ cp -rf $SYS_ROOT/lib/modules/$LINUX_VER/kernel/crypto/* lib/modules/$LINUX_VER/kernel/crypto/ cp $SYS_ROOT/lib/libc.so lib/ cp $SYS_ROOT/lib/libtinfo.so.* lib/ cp $SYS_ROOT/lib/libc.so lib/ld-musl-$ARCH.so.1 cp $SYS_ROOT/usr/linux/bin/dmesg bin/ cp $SYS_ROOT/bin/sh bin/ cp $SYS_ROOT/usr/svr42/bin/echo bin/ cp $SYS_ROOT/usr/svr42/bin/find bin/ cp $SYS_ROOT/usr/bin/cat bin/ cp $SYS_ROOT/usr/bin/modprobe bin/ $MUSL_GCC_ROOT/usr/bin/$ARCH-linux-musl-gcc -O2 --sysroot=$SYS_ROOT --static -o init $ROOT/source/init.c -I $SYS_ROOT/usr/linux/include $SYS_ROOT/usr/linux/lib/libblkid.a $MUSL_GCC_ROOT/usr/bin/$ARCH-linux-musl-gcc -O2 --sysroot=$SYS_ROOT --static -o popdev $ROOT/source/popdev.c cp popdev $SYS_ROOT/sbin/ cat > loadmod << EOF #!/bin/sh /bin/echo "Loading modules" /bin/find /sys -name "modalias" | while read a; do /bin/modprobe \`/bin/cat \$a\` >/dev/null 2>&1 done /bin/modprobe uas EOF chmod +x loadmod find . | cpio -o -H newc | gzip -c > ../ramfs.gz LEAVE cp ramfs.gz $SYS_ROOT/ $MUSL_GCC_ROOT/usr/bin/$ARCH-linux-musl-gcc -O2 --sysroot=$SYS_ROOT -o $SYS_ROOT/etc/rcorder $ROOT/source/rcorder.c install -v -m755 -d $SYS_ROOT/etc/pam.d cat > $SYS_ROOT/etc/pam.d/other << EOF auth required pam_warn.so auth required pam_deny.so account required pam_warn.so account required pam_deny.so password required pam_warn.so password required pam_deny.so session required pam_warn.so session required pam_deny.so EOF cat > $SYS_ROOT/etc/pam.d/system-account << EOF account required pam_unix.so EOF cat > $SYS_ROOT/etc/pam.d/system-auth << EOF auth required pam_unix.so EOF cat > $SYS_ROOT/etc/pam.d/system-session << EOF session required pam_unix.so EOF cat > $SYS_ROOT/etc/pam.d/system-password << EOF password required pam_unix.so sha512 shadow try_first_pass EOF cat > $SYS_ROOT/etc/pam.d/login << EOF # Set failure delay before next prompt to 3 seconds auth optional pam_faildelay.so delay=3000000 # Check to make sure that the user is allowed to login auth requisite pam_nologin.so # Check to make sure that root is allowed to login # Disabled by default. You will need to create /etc/securetty # file for this module to function. See man 5 securetty. #auth required pam_securetty.so # Additional group memberships - disabled by default #auth optional pam_group.so # include system auth settings auth include system-auth # check access for the user account required pam_access.so # include system account settings account include system-account # Set default environment variables for the user session required pam_env.so # Set resource limits for the user session required pam_limits.so # Display the message of the day - Enabled by default session optional pam_motd.so # Check user's mail - Enabled by default session optional pam_mail.so standard quiet # include system session and password settings session include system-session password include system-password EOF cat > $SYS_ROOT/etc/pam.d/passwd << EOF password include system-password EOF cat > $SYS_ROOT/etc/pam.d/su << EOF # always allow root auth sufficient pam_rootok.so # Allow users in the wheel group to execute su without a password # disabled by default #auth sufficient pam_wheel.so trust use_uid # include system auth settings auth include system-auth # limit su to users in the wheel group # disabled by default #auth required pam_wheel.so use_uid # include system account settings account include system-account # Set default environment variables for the service user session required pam_env.so # include system session settings session include system-session EOF cat > $SYS_ROOT/etc/pam.d/chpasswd << EOF # always allow root auth sufficient pam_rootok.so # include system auth and account settings auth include system-auth account include system-account password include system-password EOF cat > $SYS_ROOT/etc/pam.d/newusers << EOF # always allow root auth sufficient pam_rootok.so # include system auth and account settings auth include system-auth account include system-account password include system-password EOF cat > $SYS_ROOT/etc/pam.d/chage << EOF # always allow root auth sufficient pam_rootok.so # include system auth and account settings auth include system-auth account include system-account EOF for PROGRAM in chfn chgpasswd chsh groupadd groupdel groupmems groupmod useradd userdel usermod; do install -v -m644 $SYS_ROOT/etc/pam.d/chage $SYS_ROOT/etc/pam.d/${PROGRAM} sed -i "s/chage/$PROGRAM/" $SYS_ROOT/etc/pam.d/${PROGRAM} done for FUNCTION in FAIL_DELAY \ FAILLOG_ENAB \ LASTLOG_ENAB \ MAIL_CHECK_ENAB \ OBSCURE_CHECKS_ENAB \ PORTTIME_CHECKS_ENAB \ QUOTAS_ENAB \ CONSOLE MOTD_FILE \ FTMP_FILE NOLOGINS_FILE \ ENV_HZ PASS_MIN_LEN \ SU_WHEEL_ONLY \ CRACKLIB_DICTPATH \ PASS_CHANGE_TRIES \ PASS_ALWAYS_WARN \ CHFN_AUTH ENCRYPT_METHOD \ ENVIRON_FILE do sed -i "s/^${FUNCTION}/# &/" $SYS_ROOT/etc/login.defs done chroot $SYS_ROOT /usr/sbin/groupadd -g 0 root || true chroot $SYS_ROOT /usr/sbin/useradd -p x -g 0 -u 0 -d /root -s /bin/sh root || true chroot $SYS_ROOT /usr/sbin/groupadd -g 100 users || true chroot $SYS_ROOT /usr/sbin/useradd -m -p x -g 100 -u 100 -d /home/charlie -s /bin/sh charlie || true echo "root:`mkpasswd -m sha512crypt root`:0::::::" > $SYS_ROOT/etc/shadow echo "charlie:`mkpasswd -m sha512crypt charlie`:0::::::" >> $SYS_ROOT/etc/shadow echo root:root | chroot $SYS_ROOT /usr/sbin/chpasswd -c SHA512 echo charlie:charlie | chroot $SYS_ROOT /usr/sbin/chpasswd -c SHA512 chmod 644 $SYS_ROOT/etc/passwd chmod 644 $SYS_ROOT/etc/group chmod 600 $SYS_ROOT/etc/shadow chmod 4755 $SYS_ROOT/usr/sbin/unix_chkpwd ln -sf ../proc/mounts $SYS_ROOT/etc/mtab ln -sf ../tmp/resolv.conf $SYS_ROOT/etc/resolv.conf echo "openware" > $SYS_ROOT/etc/nodename mkdir -p $SYS_ROOT/etc/rc.d cat > $SYS_ROOT/etc/issue << EOF Welcome to SVR4/OpenWare - The Linux Distribution from Nishi System name: \n EOF cat > $SYS_ROOT/etc/motd << EOF SVR4/OpenWare Release $RELEASE, Version $VERSION Copyright (C) 2024 Nishi Copyright (C) The Regents of the University of California Copyright (C) AT&T EOF cat > $SYS_ROOT/etc/os-release << EOF NAME="SVR4/OpenWare" ID=openware PRETTY_NAME="SVR4/OpenWare $VERSION" VERSION_ID="$VERSION" EOF cat > $SYS_ROOT/etc/lsb-release << EOF NAME="SVR4/OpenWare" ID=openware PRETTY_NAME="SVR4/OpenWare $VERSION" VERSION_ID="$VERSION" EOF cat > $SYS_ROOT/etc/syslog.conf << EOF auth,authpriv.* -/var/log/auth.log *.*;auth,authpriv.none -/var/log/sys.log daemon.* -/var/log/daemon.log kern.* -/var/log/kern.log mail.* -/var/log/mail.log user.* -/var/log/user.log *.emerg * secure_mode 2 EOF cp $SYS_ROOT/usr/lib/tmac/tmac.an $SYS_ROOT/usr/lib/tmac/tmac.andoc cp /etc/services $SYS_ROOT/etc/ for i in `ls -d components/*`; do DEST="`cat $i | grep -E '^#[ \t]*TO:[ \t]*' | sed -E 's/^#[ \t]*TO:[ \t]*//g'`" cp $i $SYS_ROOT/$DEST done echo -n "efiboot... " if [ -e build/efiboot/installed ]; then echo "skipped" else echo "needed" mkdir -p build/efiboot ENTER build/efiboot fallocate -l 32m efiboot.img mkfs.msdos efiboot.img mmd -i efiboot.img ::/EFI mmd -i efiboot.img ::/EFI/BOOT mcopy -i efiboot.img ../../refind.conf ::/EFI/BOOT/REFIND.CONF mcopy -i efiboot.img /usr/share/refind/refind/refind_x64.efi ::/EFI/BOOT/BOOTX64.EFI mcopy -i efiboot.img $SYS_ROOT/bzImage ::/ mcopy -i efiboot.img $SYS_ROOT/ramfs.gz ::/ cp efiboot.img $SYS_ROOT/ LEAVE touch build/efiboot/installed fi cp $MUSL_GCC_ROOT/$ARCH-linux-musl/lib/libgcc_s.so.1 $SYS_ROOT/usr/lib/ cp $MUSL_GCC_ROOT/$ARCH-linux-musl/lib/libstdc++.so.6 $SYS_ROOT/usr/lib/ mkdir -p $SYS_ROOT/isolinux cp /usr/lib/ISOLINUX/isolinux.bin $SYS_ROOT/isolinux/ cp /usr/lib/syslinux/modules/bios/ldlinux.c32 $SYS_ROOT/isolinux/ cp /usr/lib/syslinux/modules/bios/libutil.c32 $SYS_ROOT/isolinux/ cp /usr/lib/syslinux/modules/bios/menu.c32 $SYS_ROOT/isolinux/ cat > $SYS_ROOT/isolinux/isolinux.cfg << EOF default menu.c32 timeout 50 menu title Boot Menu menu rows 3 label linux kernel /bzImage initrd /ramfs.gz append root=LABEL=SVOWINST rootfstype=iso9660 loglevel=4 installer label linux-sda kernel /bzImage append root=/dev/sda loglevel=4 installer label linux-sdb kernel /bzImage append root=/dev/sdb loglevel=4 installer EOF xorriso -as mkisofs -V "SVOWINST" -o openware.iso -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -eltorito-platform efi -eltorito-boot efiboot.img -no-emul-boot sys-root END="`date`" echo "--- Summary" echo "Construct started at: $START" echo "Construct finished at: $END"