added #!/bin/bash instead #!/bin/sh

This commit is contained in:
wt committed 2025-03-01 22:07:33 +07:00
1 parent 91b7d9341d
commit dd41d6fe02
21 files changed
+91 -76

No files matched your search

+9 -6
View File
@@ -1,16 +1,19 @@
#!/bin/sh #!/bin/bash
. ./scripts/colors.sh . ./scripts/colors.sh
. ./scripts/funcs.sh . ./scripts/funcs.sh
. ./scripts/config.sh . ./scripts/config.sh
pkgname=bash
pkgver=5.2.32
bash() { bash() {
printf "$GREEN** Building and installing bash\n$RESET" printf "$GREEN** Building and installing bash\n$RESET"
mkdir $build/bash mkdir $build/${pkgname}
cd $build/bash cd $build/${pkgname}
tar -xvf $root/downloads/bash-5.2.32.tar.gz tar -xvf $root/downloads/${pkgname}-${pkgver}.tar.gz
check $? "Extract bash" check $? "Extract ${pkgname}"
cd bash-5.2.32 cd ${pkgname}-${pkgver}
./configure \ ./configure \
--prefix=/usr \ --prefix=/usr \
--disable-readline \ --disable-readline \
+1 -1
View File
@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
. ./scripts/colors.sh . ./scripts/colors.sh
. ./scripts/config.sh . ./scripts/config.sh
+1 -1
View File
@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
#--- import rolors --- #--- import rolors ---
. ./scripts/colors.sh . ./scripts/colors.sh
+2 -2
View File
@@ -1,6 +1,6 @@
#!/bin/sh #!/bin/bash
if [ -d out ]; then if [ -d out ]; then
rm -rv out; rm -rv out;
fi fi
if [ -d build ]; then if [ -d build ]; then
+1 -1
View File
@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
#--- reset colors --- #--- reset colors ---
RESET="\033[0m" RESET="\033[0m"
+1 -1
View File
@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
#------------ config ------------------ #------------ config ------------------
export PATH=$PATH:/opt/toolchains/arm-buildroot-linux-uclibcgnueabihf/bin export PATH=$PATH:/opt/toolchains/arm-buildroot-linux-uclibcgnueabihf/bin
+12 -9
View File
@@ -1,20 +1,23 @@
#!/bin/sh #!/bin/bash
. ./scripts/colors.sh . ./scripts/colors.sh
. ./scripts/funcs.sh . ./scripts/funcs.sh
. ./scripts/config.sh . ./scripts/config.sh
. ./scripts/zlib.sh . ./scripts/zlib.sh
pkgname=curl
pkgver=8.9.1
curl() { curl() {
if [ ! -d $build/zlib ]; then if [ ! -d $build/zlib ]; then
zlib zlib
fi fi
printf "$GREEN** Building and installing curl\n$RESET" printf "$GREEN** Building and installing curl\n$RESET"
mkdir $build/curl mkdir $build/${pkgname}
cd $build/curl cd $build/${pkgname}
tar -xvf $root/downloads/curl-8.9.1.tar.xz tar -xvf $root/downloads/${pkgname}-${pkgver}.tar.xz
check $? "Extract curl" check $? "Extract ${pkgname}"
cd curl-8.9.1 cd ${pkgname}-${pkgver}
./configure \ ./configure \
--prefix=/usr \ --prefix=/usr \
--host=$CROSS_COMPILE \ --host=$CROSS_COMPILE \
@@ -22,9 +25,9 @@ curl() {
--disable-static \ --disable-static \
--enable-shared \ --enable-shared \
--with-zlib=$rootfspath --with-zlib=$rootfspath
check $? "Configure curl" check $? "Configure ${pkgname}"
make $makeflags make $makeflags
check $? "Build curl" check $? "Build ${pkgname}"
make DESTDIR=$rootfspath install make DESTDIR=$rootfspath install
rm \ rm \
-rv \ -rv \
@@ -35,5 +38,5 @@ curl() {
$rootfspath/usr/lib/*.la \ $rootfspath/usr/lib/*.la \
$rootfspath/usr/lib/pkgconfig $rootfspath/usr/lib/pkgconfig
$CROSS_COMPILE-strip --strip-unneeded $rootfspath/usr/bin/curl $rootfspath/usr/lib/libcurl.so.4.8.0 $CROSS_COMPILE-strip --strip-unneeded $rootfspath/usr/bin/curl $rootfspath/usr/lib/libcurl.so.4.8.0
check $? "Installing to rootfs curl" check $? "Installing to rootfs ${pkgname}"
} }
+1 -1
View File
@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
. ./scripts/funcs.sh . ./scripts/funcs.sh
. ./scripts/config.sh . ./scripts/config.sh
+1 -1
View File
@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
. ./scripts/colors.sh . ./scripts/colors.sh
. ./scripts/funcs.sh . ./scripts/funcs.sh
+2 -2
View File
@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
#--- Import colors --- #--- Import colors ---
. ./scripts/colors.sh . ./scripts/colors.sh
@@ -10,7 +10,7 @@ check() {
printf "$URED** ERROR: $2\n$RESET" printf "$URED** ERROR: $2\n$RESET"
exit 1 exit 1
fi fi
printf "$UGREEN** SUCCESS: $2\n$RESET" printf "$UGREEN** SUCCESS: $2\n$RESET"
} }
#------------------------------------------- #-------------------------------------------
+11 -8
View File
@@ -1,30 +1,33 @@
#!/bin/sh #!/bin/bash
. ./scripts/colors.sh . ./scripts/colors.sh
. ./scripts/funcs.sh . ./scripts/funcs.sh
. ./scripts/config.sh . ./scripts/config.sh
. ./scripts/curl.sh . ./scripts/curl.sh
pkgname=git
pkgver=2.46.0
git() { git() {
if [ ! -d $build/curl ]; then if [ ! -d $build/curl ]; then
curl curl
fi fi
printf "$GREEN** Building and installing git\n$RESET" printf "$GREEN** Building and installing ${pkgname}\n$RESET"
mkdir $build/git mkdir $build/git
cd $build/git cd $build/git
tar -xvf $root/downloads/git-2.46.0.tar.xz tar -xvf $root/downloads/${pkgname}-${pkgver}.tar.xz
check $? "Extract git" check $? "Extract ${pkgname}"
cd git-2.46.0 cd ${pkgname}-${pkgver}
./configure \ ./configure \
--prefix=/usr \ --prefix=/usr \
--host=$CROSS_COMPILE \ --host=$CROSS_COMPILE \
NO_ICONV=true \ NO_ICONV=true \
ac_cv_fread_reads_directories=true \ ac_cv_fread_reads_directories=true \
ac_cv_snprintf_returns_bogus=false ac_cv_snprintf_returns_bogus=false
check $? "Configure git" check $? "Configure ${pkgname}"
make $makeflags make $makeflags
check $? "Build git" check $? "Build ${pkgname}"
make DESTDIR=$rootfspath install make DESTDIR=$rootfspath install
$CROSS_COMPILE-strip --strip-unneeded $rootfspath/usr/bin/* $rootfspath/libexec/git-core/* $CROSS_COMPILE-strip --strip-unneeded $rootfspath/usr/bin/* $rootfspath/libexec/git-core/*
printf "$GREEN** SUCCESS: Building and installing git\n$RESET" printf "$GREEN** SUCCESS: Building and installing ${pkgname}\n$RESET"
} }
+1 -1
View File
@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
. ./scripts/colors.sh . ./scripts/colors.sh
. ./scripts/funcs.sh . ./scripts/funcs.sh
+2 -2
View File
@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
. ./scripts/colors.sh . ./scripts/colors.sh
. ./scripts/funcs.sh . ./scripts/funcs.sh
@@ -33,4 +33,4 @@ initramfs() {
#--------------------------------------------------------------- #---------------------------------------------------------------
} # initramfs } # initramfs
#------------------------------------------------------------------ #------------------------------------------------------------------
+1 -1
View File
@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
. ./scripts/colors.sh . ./scripts/colors.sh
. ./scripts/funcs.sh . ./scripts/funcs.sh
+9 -9
View File
@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
. ./scripts/colors.sh . ./scripts/colors.sh
. ./scripts/funcs.sh . ./scripts/funcs.sh
@@ -8,11 +8,11 @@ pkgname=libnl
pkgver=3.10.0 pkgver=3.10.0
libnl() { libnl() {
printf "$GREEN** Building and installing libnl\n$RESET" printf "$GREEN** Building and installing ${pkgname}\n$RESET"
[ ! -d $build/libnl ] && mkdir $build/libnl [ ! -d $build/${pkgname} ] && mkdir $build/${pkgname}
cd $build/libnl cd $build/${pkgname}
tar -xvf $root/downloads/${pkgname}-${pkgver}.tar.gz tar -xvf $root/downloads/${pkgname}-${pkgver}.tar.gz
check $? "Extract $pkgname" check $? "Extract ${pkgname}"
cd ${pkgname}-${pkgver} cd ${pkgname}-${pkgver}
./configure \ ./configure \
--host=${CROSS_COMPILE} \ --host=${CROSS_COMPILE} \
@@ -21,18 +21,18 @@ libnl() {
--disable-cli \ --disable-cli \
--build=x86_64-pc-linux-gnu \ --build=x86_64-pc-linux-gnu \
--prefix=/opt/toolchains/arm-buildroot-linux-uclibcgnueabihf/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr --prefix=/opt/toolchains/arm-buildroot-linux-uclibcgnueabihf/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr
check $? "Configure $pkgname" check $? "Configure ${pkgname}"
make $makeflags make $makeflags
check $? "Build $pkgname" check $? "Build ${pkgname}"
make DESTDIR=$(pwd)/bin install make DESTDIR=$(pwd)/bin install
rm -rv $(pwd)/bin/opt/toolchains/arm-buildroot-linux-uclibcgnueabihf/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/lib/{pkgconfig,*.la} rm -rv $(pwd)/bin/opt/toolchains/arm-buildroot-linux-uclibcgnueabihf/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/lib/{pkgconfig,*.la}
${CROSS_COMPILE}-strip $(pwd)/bin/opt/toolchains/arm-buildroot-linux-uclibcgnueabihf/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/lib/* ${CROSS_COMPILE}-strip $(pwd)/bin/opt/toolchains/arm-buildroot-linux-uclibcgnueabihf/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/lib/*
cd $(pwd)/bin/opt/toolchains/arm-buildroot-linux-uclibcgnueabihf/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/lib cd $(pwd)/bin/opt/toolchains/arm-buildroot-linux-uclibcgnueabihf/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/lib
tar -czvf /tmp/libnl.tar.gz . tar -czvf /tmp/${pkgname}.tar.gz .
check $? "Archived libs" check $? "Archived libs"
cd - cd -
cd $rootfspath/usr/lib cd $rootfspath/usr/lib
tar -xvf /tmp/libnl.tar.gz tar -xvf /tmp/${pkgname}.tar.gz
check $? "Unrchived libs" check $? "Unrchived libs"
cd - cd -
} }
+1 -1
View File
@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
. ./scripts/colors.sh . ./scripts/colors.sh
. ./scripts/funcs.sh . ./scripts/funcs.sh
+2 -2
View File
@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
. ./scripts/colors.sh . ./scripts/colors.sh
. ./scripts/funcs.sh . ./scripts/funcs.sh
@@ -71,7 +71,7 @@ sdroot_usable() {
tar -czvf /tmp/rootfs.tar.gz.tmp . tar -czvf /tmp/rootfs.tar.gz.tmp .
cd $sdroot cd $sdroot
tar -xvf /tmp/rootfs.tar.gz.tmp tar -xvf /tmp/rootfs.tar.gz.tmp
initramfs initramfs
cp -v $build/initramfs.img $sdroot/boot cp -v $build/initramfs.img $sdroot/boot
cp -v $build/kernel/linux-6.13.3/arch/$ARCH/boot/zImage $sdroot/boot cp -v $build/kernel/linux-6.13.3/arch/$ARCH/boot/zImage $sdroot/boot
+1 -1
View File
@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
. ./scripts/colors.sh . ./scripts/colors.sh
. ./scripts/funcs.sh . ./scripts/funcs.sh
+2 -2
View File
@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
. ./scripts/colors.sh . ./scripts/colors.sh
. ./scripts/funcs.sh . ./scripts/funcs.sh
@@ -25,4 +25,4 @@ uboot() {
check $? "Install uboot to out directory" check $? "Install uboot to out directory"
check $? "Build and install uboot to out directory" check $? "Build and install uboot to out directory"
} }
#------------- #-------------
+16 -13
View File
@@ -1,24 +1,27 @@
#!/bin/sh #!/bin/bash
. ./scripts/colors.sh . ./scripts/colors.sh
. ./scripts/funcs.sh . ./scripts/funcs.sh
. ./scripts/config.sh . ./scripts/config.sh
pkgname=uClibc-ng
pkgver=1.0.50
#------------ glibc ---------------------------------------- #------------ glibc ----------------------------------------
uclibc() { uclibc() {
printf "$UGREEN** Building uclibc\n$RESET" printf "$UGREEN** Building ${pkgname}\n$RESET"
mkdir -p $build/uclibc # &>> $fulllogfile mkdir -p $build/${pkgname} # &>> $fulllogfile
cd $build/uclibc cd $build/${pkgname}
tar -xvf $root/downloads/uClibc-ng-1.0.50.tar.xz # &>> $fulllogfile tar -xvf $root/downloads/${pkgname}-${pkgver}.tar.xz # &>> $fulllogfile
check $? "Extract uclibc" check $? "Extract ${pkgname}"
cd uClibc-ng-1.0.50 cd ${pkgname}-${pkgver}
cp -rv $root/uclibc/config-1.0.50 .config cp -rv $root/uclibc/config-${pkgver} .config
make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- oldconfig make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- oldconfig
check $? "Configure uclibc" check $? "Configure ${pkgname}"
make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- $makeflags # &>> $fulllogfile make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- $makeflags # &>> $fulllogfile
check $? "Build uclibc" check $? "Build ${pkgname}"
make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- DESTDIR=$rootfspath install # &>> $fulllogfile make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- DESTDIR=$rootfspath install # &>> $fulllogfile
check $? "Install uclibc to rootfs" check $? "Install ${pkgname} to rootfs"
cd $rootfspath cd $rootfspath
find -name \*.a -delete # &>> $fulllogfile find -name \*.a -delete # &>> $fulllogfile
find -name \*.o -delete find -name \*.o -delete
@@ -26,6 +29,6 @@ uclibc() {
${CROSS_COMPILE}-strip --strip-unneeded $rootfspath/usr/lib/* $rootfspath/usr/bin/* # &>> $fulllogfile $rootfspath/usr/lib/* ${CROSS_COMPILE}-strip --strip-unneeded $rootfspath/usr/lib/* $rootfspath/usr/bin/* # &>> $fulllogfile $rootfspath/usr/lib/*
rm -rv $rootfspath/usr/include rm -rv $rootfspath/usr/include
cd $root cd $root
check $? "Build and install uclibc" check $? "Build and install ${pkgname}"
} }
#----------------------------------------------------------- #-----------------------------------------------------------
+14 -11
View File
@@ -1,22 +1,25 @@
#!/bin/sh #!/bin/bash
. ./scripts/colors.sh . ./scripts/colors.sh
. ./scripts/funcs.sh . ./scripts/funcs.sh
. ./scripts/config.sh . ./scripts/config.sh
pkgname=zlib
pkgver=1.3.1
zlib() { zlib() {
printf "$GREEN** Building and installing zlib\n$RESET" printf "$GREEN** Building and installing ${pkgname}\n$RESET"
mkdir $build/zlib mkdir $build/${pkgname}
cd $build/zlib cd $build/${pkgname}
tar -xvf $root/downloads/zlib-1.3.1.tar.gz tar -xvf $root/downloads/${pkgname}-${pkgver}.tar.gz
check $? "Extract zlib" check $? "Extract ${pkgname}"
cd zlib-1.3.1 cd ${pkgname}-${pkgver}
CC=${CROSS_COMPILE}-gcc ./configure --prefix=/usr --shared CC=${CROSS_COMPILE}-gcc ./configure --prefix=/usr --shared
check $? "Configure zlib" check $? "Configure ${pkgname}"
make $makeflags make $makeflags
check $? "Build zlib" check $? "Build ${pkgname}"
make DESTDIR=$rootfspath install make DESTDIR=$rootfspath install
rm -rv $rootfspath/usr/include $rootfspath/usr/share/man $rootfspath/usr/lib/{pkgconfig,libz.a} rm -rv $rootfspath/usr/include $rootfspath/usr/share/man $rootfspath/usr/lib/{pkgconfig,libz.a}
${CROSS_COMPILE}-strip --strip-unneeded $rootfspath/usr/lib/libz.so.1.3.1 ${CROSS_COMPILE}-strip --strip-unneeded $rootfspath/usr/lib/libz.so.${pkgver}
check $? "Installing to rootfs zlib" check $? "Installing to rootfs ${pkgname}"
} }