summaryrefslogtreecommitdiff
path: root/bootstrap
diff options
context:
space:
mode:
authordavidovski <git@davidovski.xyz>2022-04-07 21:04:30 +0100
committerdavidovski <git@davidovski.xyz>2022-04-07 21:04:30 +0100
commit7865aeacb7cb02d82c1276f64f07bfb968838ca6 (patch)
treeb887f5584ebd2ffcf9d1eefe7b1dacfd3d8108ef /bootstrap
parent819fa943defac148c7970ef1ddf1ad4a6030396a (diff)
patched to work with sbase
Diffstat (limited to 'bootstrap')
-rwxr-xr-xbootstrap/bootstrap.sh6
-rw-r--r--bootstrap/stage1.sh36
-rw-r--r--bootstrap/stage2.sh74
3 files changed, 58 insertions, 58 deletions
diff --git a/bootstrap/bootstrap.sh b/bootstrap/bootstrap.sh
index 814f39a..71e2fab 100755
--- a/bootstrap/bootstrap.sh
+++ b/bootstrap/bootstrap.sh
@@ -4,7 +4,7 @@
## VERSIONS ##
# TODO move to a different package
-LINUX_VER=5.16.11
+LINUX_VER=5.17.1
BINUTILS_VER=2.38
MPFR_VER=4.1.0
MPC_VER=1.2.1
@@ -52,7 +52,7 @@ chroot=$(pwd)/chroot
PATH=${TOOLS}/bin:${CROSS_TOOLS}/bin:/usr/bin
-MAKEFLAGS="-j$(nproc)"
+MAKEFLAGS="-j$(grep "processor" /proc/cpuinfo | wc -l)"
export chroot TARGET PATH WD CURL_OPTS CROSS_TOOLS TOOLS MAKEFLAGS
@@ -108,7 +108,7 @@ ptch () {
clean () {
rm -rf $WD $CROSS_TOOLS $TOOLS
- mkdir -pv $WD $CROSS_TOOLS $TOOL
+ mkdir -p $WD $CROSS_TOOLS $TOOL
}
mount_chroot () {
diff --git a/bootstrap/stage1.sh b/bootstrap/stage1.sh
index 68fa048..0453973 100644
--- a/bootstrap/stage1.sh
+++ b/bootstrap/stage1.sh
@@ -6,17 +6,17 @@ cross_tools_kernel_headers () {
make mrproper
make ARCH=${ARCH} headers
- mkdir -pv $CROSS_TOOLS/$TARGET/include
+ mkdir -p $CROSS_TOOLS/$TARGET/include
- cp -rv usr/include/* $CROSS_TOOLS/$TARGET/include
- find $CROSS_TOOLS/$TARGET/include -name '.*.cmd' -exec rm -vf {} \;
- rm -v $CROSS_TOOLS/$TARGET/include/Makefile
+ cp -r usr/include/* $CROSS_TOOLS/$TARGET/include
+ find $CROSS_TOOLS/$TARGET/include -name '.*.cmd' -exec rm -f {} \;
+ rm $CROSS_TOOLS/$TARGET/include/Makefile
}
cross_tools_binutils () {
src "https://ftp.gnu.org/gnu/binutils/binutils-$BINUTILS_VER.tar.xz"
- mkdir -v build &&
+ mkdir build &&
cd build &&
../configure \
@@ -40,11 +40,11 @@ cross_tools_gcc_static () {
src "https://ftp.gnu.org/gnu/mpc/mpc-$MPC_VER.tar.gz"
src "https://ftp.gnu.org/gnu/gcc/gcc-$GCC_VER/gcc-$GCC_VER.tar.xz"
- mv -v ../mpfr-$MPFR_VER mpfr &&
- mv -v ../gmp-$GMP_VER gmp &&
- mv -v ../mpc-$MPC_VER mpc &&
+ mv ../mpfr-$MPFR_VER mpfr &&
+ mv ../gmp-$GMP_VER gmp &&
+ mv ../mpc-$MPC_VER mpc &&
- mkdir -v build && cd build &&
+ mkdir build && cd build &&
CFLAGS='-g0 -O0' \
CXXFLAGS=$CFLAGS \
@@ -77,8 +77,8 @@ cross_tools_musl () {
make && DESTDIR=${CROSS_TOOLS} make install &&
# Add missing directory and link
- mkdir -v ${CROSS_TOOLS}/usr &&
- ln -sv ../include ${CROSS_TOOLS}/usr/include &&
+ mkdir ${CROSS_TOOLS}/usr &&
+ ln -s ../include ${CROSS_TOOLS}/usr/include &&
case $(uname -m) in
x86_64) export ARCH="x86_64"
@@ -92,14 +92,14 @@ cross_tools_musl () {
esac
# Fix link
- rm -vf ${CROSS_TOOLS}/lib/ld-musl-${ARCH}.so.1 &&
- ln -sv libc.so ${CROSS_TOOLS}/lib/ld-musl-${ARCH}.so.1
+ rm -f ${CROSS_TOOLS}/lib/ld-musl-${ARCH}.so.1 &&
+ ln -s libc.so ${CROSS_TOOLS}/lib/ld-musl-${ARCH}.so.1
# Create link for ldd:
- ln -sv ../lib/ld-musl-$ARCH.so.1 ${CROSS_TOOLS}/bin/ldd
+ ln -s ../lib/ld-musl-$ARCH.so.1 ${CROSS_TOOLS}/bin/ldd
# Create config for dynamic library loading:
- mkdir -v ${CROSS_TOOLS}/etc
+ mkdir ${CROSS_TOOLS}/etc
echo $CROSS_TOOLS/lib >> ${CROSS_TOOLS}/etc/ld-musl-$ARCH.path
echo $TOOLS/lib >> ${CROSS_TOOLS}/etc/ld-musl-$ARCH.path
@@ -116,9 +116,9 @@ cross_tools_gcc_final () {
src "https://ftp.gnu.org/gnu/mpc/mpc-$MPC_VER.tar.gz"
src "https://ftp.gnu.org/gnu/gcc/gcc-$GCC_VER/gcc-$GCC_VER.tar.xz"
- mv -v ../mpfr-$MPFR_VER mpfr
- mv -v ../gmp-$GMP_VER gmp
- mv -v ../mpc-$MPC_VER mpc
+ mv ../mpfr-$MPFR_VER mpfr
+ mv ../gmp-$GMP_VER gmp
+ mv ../mpc-$MPC_VER mpc
patch_gcc
diff --git a/bootstrap/stage2.sh b/bootstrap/stage2.sh
index 161f799..c8409b2 100644
--- a/bootstrap/stage2.sh
+++ b/bootstrap/stage2.sh
@@ -21,26 +21,26 @@ toolchain_musl () {
make && make DESTDIR=$TOOLS install &&
case $(uname -m) in
- x86_64) rm -v $TOOLS/lib/ld-musl-x86_64.so.1
- ln -sv libc.so $TOOLS/lib/ld-musl-x86_64.so.1
+ x86_64) rm $TOOLS/lib/ld-musl-x86_64.so.1
+ ln -s libc.so $TOOLS/lib/ld-musl-x86_64.so.1
export barch=$(uname -m)
;;
- i686) rm -v $TOOLS/lib/ld-musl-i386.so.1
- ln -sv libc.so $TOOLS/lib/ld-musl-i386.so.1
+ i686) rm $TOOLS/lib/ld-musl-i386.so.1
+ ln -s libc.so $TOOLS/lib/ld-musl-i386.so.1
export barch=i386
;;
- arm*) rm -v $TOOLS/lib/ld-musl-arm.so.1
- ln -sv libc.so $TOOLS/lib/ld-musl-arm.so.1
+ arm*) rm $TOOLS/lib/ld-musl-arm.so.1
+ ln -s libc.so $TOOLS/lib/ld-musl-arm.so.1
export barch=arm
;;
- aarch64) rm -v $TOOLS/lib/ld-musl-aarch64.so.1
- ln -sv libc.so $TOOLS/lib/ld-musl-aarch64.so.1
+ aarch64) rm $TOOLS/lib/ld-musl-aarch64.so.1
+ ln -s libc.so $TOOLS/lib/ld-musl-aarch64.so.1
export barch=$(uname -m)
;;
esac &&
# Create dynamic linker config
- mkdir -pv $TOOLS/etc &&
+ mkdir -p $TOOLS/etc &&
echo "$TOOLS/lib" > $TOOLS/etc/ld-musl-${barch}.path
unset barch
}
@@ -123,8 +123,8 @@ toolchain_adjustments () {
unset SPECFILE
GCC_INCLUDEDIR=`dirname $(${TARGET}-gcc -print-libgcc-file-name)`/include &&
- find ${GCC_INCLUDEDIR}/* -maxdepth 0 -xtype d -exec rm -rvf '{}' \; &&
- rm -vf `grep -l "DO NOT EDIT THIS FILE" ${GCC_INCLUDEDIR}/*` &&
+ find ${GCC_INCLUDEDIR}/* -maxdepth 0 -xtype d -exec rm -rf '{}' \; &&
+ rm -f `grep -l "DO NOT EDIT THIS FILE" ${GCC_INCLUDEDIR}/*` &&
unset GCC_INCLUDEDIR
echo 'int main(){}' > dummy.c
@@ -132,7 +132,7 @@ toolchain_adjustments () {
readelf -l a.out | grep ': /tools'
read confirm
- rm -v dummy.c a.out
+ rm dummy.c a.out
}
@@ -141,11 +141,11 @@ toolchain_binutils () {
# Link directories so libraries can be found in both lib & lib64
case $(uname -m) in
- x86_64) ln -sv lib $TOOLS/lib64 ;;
+ x86_64) ln -s lib $TOOLS/lib64 ;;
esac &&
# Configure in dedicated build directory
- mkdir -v build && cd build &&
+ mkdir build && cd build &&
../configure --prefix=$TOOLS \
--with-lib-path=$TOOLS/lib \
--build=${HOST} \
@@ -160,7 +160,7 @@ toolchain_binutils () {
make -C ld clean &&
make -C ld LIB_PATH=/usr/lib:/lib &&
- cp -v ld/ld-new $TOOLS/bin
+ cp ld/ld-new $TOOLS/bin
}
toolchain_gcc () {
@@ -169,9 +169,9 @@ toolchain_gcc () {
src "https://ftp.gnu.org/gnu/mpc/mpc-$MPC_VER.tar.gz"
src "https://ftp.gnu.org/gnu/gcc/gcc-$GCC_VER/gcc-$GCC_VER.tar.xz"
- mv -v ../mpfr-$MPFR_VER mpfr &&
- mv -v ../gmp-$GMP_VER gmp &&
- mv -v ../mpc-$MPC_VER mpc &&
+ mv ../mpfr-$MPFR_VER mpfr &&
+ mv ../gmp-$GMP_VER gmp &&
+ mv ../mpc-$MPC_VER mpc &&
patch_gcc &&
@@ -184,7 +184,7 @@ toolchain_gcc () {
# For i686/x86_64:
for file in gcc/config/linux/linux.h gcc/config/linux/linux64.h gcc/config/i386/linux.h gcc/config/i386/linux64.h
do
- cp -uv $file $file.orig
+ cp $file $file.orig
sed -e "s,/lib\(64\)\?\(32\)\?/ld,$TOOLS&,g" \
-e "s,/usr,$TOOLS,g" ${file}.orig > ${file}
echo "
@@ -196,7 +196,7 @@ toolchain_gcc () {
done &&
# Configure in dedicated build directory
- mkdir -v build && cd build &&
+ mkdir build && cd build &&
CFLAGS='-g0 -O0' \
CXXFLAGS=$CFLAGS \
../configure \
@@ -221,7 +221,7 @@ toolchain_gcc () {
PATH=$CROSS_TOOLS/bin:/bin:/usr/bin:$TOOLS/bin make &&
make install &&
- ln -sv gcc $TOOLS/bin/cc
+ ln -s gcc $TOOLS/bin/cc
}
toolchain_kernel_headers () {
@@ -229,10 +229,10 @@ toolchain_kernel_headers () {
make mrproper &&
ARCH=${ARCH} make headers &&
- cp -rv usr/include/* $TOOLS/include
+ cp -r usr/include/* $TOOLS/include
- find $TOOLS/include -name '.*.cmd' -exec rm -vf {} \;
- rm -v $TOOLS/include/Makefile
+ find $TOOLS/include -name '.*.cmd' -exec rm -f {} \;
+ rm $TOOLS/include/Makefile
}
toolchain_libstdcxx () {
@@ -242,14 +242,14 @@ toolchain_libstdcxx () {
src "https://ftp.gnu.org/gnu/mpc/mpc-$MPC_VER.tar.gz"
src "https://ftp.gnu.org/gnu/gcc/gcc-$GCC_VER/gcc-$GCC_VER.tar.xz"
- mv -v ../mpfr-$MPFR_VER mpfr &&
- mv -v ../gmp-$GMP_VER gmp &&
- mv -v ../mpc-$MPC_VER mpc &&
+ mv ../mpfr-$MPFR_VER mpfr &&
+ mv ../gmp-$GMP_VER gmp &&
+ mv ../mpc-$MPC_VER mpc &&
ptch "https://raw.githubusercontent.com/dslm4515/Musl-LFS/master/patches/gcc-mlfs-$GCC_VER/fix_fenv_header.patch" &&
patch_gcc &&
- mkdir -v build && cd build &&
+ mkdir build && cd build &&
../libstdc++-v3/configure \
--target=${TARGET} \
--build=${HOST} \
@@ -283,9 +283,9 @@ toolchain_tcl () {
make && make install
- chmod -v u+w $TOOLS/lib/libtcl${TCL_VER%.*}.so
+ chmod u+w $TOOLS/lib/libtcl${TCL_VER%.*}.so
make install-private-headers
- ln -sv tclsh${TCL_VER%.*} $TOOLS/bin/tclsh
+ ln -s tclsh${TCL_VER%.*} $TOOLS/bin/tclsh
}
toolchain_expect () {
@@ -298,7 +298,7 @@ toolchain_expect () {
curl ${CURL_OPTS} "https://raw.githubusercontent.com/dslm4515/Musl-LFS/master/files/config.guess-musl" > tclconfig/config.guess
curl ${CURL_OPTS} "https://raw.githubusercontent.com/dslm4515/Musl-LFS/master/files/config.sub-musl" > tclconfig/config.sub
- cp -v configure configure.orig
+ cp configure configure.orig
sed 's:/usr/local/bin:/bin:' configure.orig > configure
./configure --build=${HOST} \
@@ -428,7 +428,7 @@ toolchain_gawk () {
toolchain_gettext () {
src "https://ftp.barfooze.de/pub/sabotage/tarballs/gettext-tiny-$GETTEXT_TINY_VER.tar.xz"
make ${MJ} LIBINTL=MUSL prefix=$TOOLS
- cp -v msgfmt msgmerge xgettext $TOOLS/bin
+ cp msgfmt msgmerge xgettext $TOOLS/bin
}
toolchain_grep () {
@@ -470,14 +470,14 @@ toolchain_perl () {
src "https://github.com/arsv/perl-cross/releases/download/$PERL_CROSS_VER/perl-cross-$PERL_CROSS_VER.tar.gz"
src "https://www.cpan.org/src/5.0/perl-$PERL_VER.tar.xz"
- cp -vrf ../perl-cross-$PERL_CROSS_VER/* ./
+ cp -rf ../perl-cross-$PERL_CROSS_VER/* ./
./configure --prefix=${TOOLS} \
--target=${TARGET} &&
make &&
- cp -v perl cpan/podlators/scripts/pod2man ${TOOLS}/bin &&
- mkdir -pv ${TOOLS}/lib/perl5/$PERL_VER &&
- cp -Rv lib/* ${TOOLS}/lib/perl5/$PERL_VER
+ cp perl cpan/podlators/scripts/pod2man ${TOOLS}/bin &&
+ mkdir -p ${TOOLS}/lib/perl5/$PERL_VER &&
+ cp -r lib/* ${TOOLS}/lib/perl5/$PERL_VER
}
toolchain_texinfo () {
@@ -512,7 +512,7 @@ toolchain_strip () {
${TOOLS}/man \
${TOOLS}/doc
- find ${TOOLS}/lib ${TOOLS}/libexec -name \*.la -exec rm -rvf {} \;
+ find ${TOOLS}/lib ${TOOLS}/libexec -name \*.la -exec rm -rf {} \;
}
printf "${BLUE}building musl...\n${RESET}"