From 29247e48b628ef4e5792c261c6b8e1def5d3c012 Mon Sep 17 00:00:00 2001 From: TolaMironcenko Date: Fri, 6 Mar 2026 11:38:35 +0700 Subject: [PATCH] up --- Makefile | 30 ++++++++++++++++++++---------- scripts/bash.sh | 1 + scripts/clean.sh | 12 ++++++++++-- scripts/curl.sh | 1 + scripts/dnsmasq.sh | 1 + scripts/finit_init.sh | 2 +- scripts/funcs.sh | 10 +++++++--- scripts/git.sh | 1 + scripts/hostapd.sh | 1 + scripts/iptables.sh | 1 + scripts/iw.sh | 1 + scripts/libnl.sh | 2 ++ scripts/libsqlite3.sh | 3 ++- scripts/nginx.sh | 1 + scripts/openssl.sh | 1 + scripts/sftp_server.sh | 1 + scripts/tcc.sh | 1 + scripts/uclibc.sh | 1 + scripts/wpa_supplicant.sh | 1 + scripts/zlib.sh | 1 + 20 files changed, 56 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index 1ccb4b0..cbd087d 100644 --- a/Makefile +++ b/Makefile @@ -10,11 +10,11 @@ download: ./scripts/build_image.sh download clean: - ./scripts/clean.sh + @./scripts/clean.sh distclean: - ./scripts/clean.sh - if [ -d downloads ]; then \ + @./scripts/clean.sh + @if [ -d downloads ]; then \ rm -rv downloads; \ fi @@ -42,11 +42,21 @@ ko8821au: sdroot_usable: ./scripts/build_image.sh sdroot_usable -orangepi_pc_defconfig: - cp -v configs/orangepi_pc_defconfig scripts/config.sh +%_defconfig: + @cp -v configs/$@ scripts/config.sh -orangepi_zero_2w_defconfig: - cp -v configs/orangepi_zero_2w_defconfig scripts/config.sh - -x86_64_uclibc_defconfig: - cp -v configs/x86_64_uclibc_defconfig scripts/config.sh +list-defconfigs: + @first=true; \ + for defconfig in configs/*_defconfig; do \ + [ -f "$${defconfig}" ] || continue; \ + if $${first}; then \ + if [ "$(2)" ]; then \ + printf 'External configs in "$(call qstrip,$(2))":\n'; \ + else \ + printf "Built-in configs:\n"; \ + fi; \ + first=false; \ + fi; \ + defconfig="$${defconfig##*/}"; \ + printf " %-35s - Build for %s\n" "$${defconfig}" "$${defconfig%_defconfig}"; \ + done diff --git a/scripts/bash.sh b/scripts/bash.sh index 5e04807..341b047 100644 --- a/scripts/bash.sh +++ b/scripts/bash.sh @@ -7,6 +7,7 @@ bash() { pkgname=bash pkgver=5.2.32 + srcurl=https://ftp.gnu.org/gnu/${pkgname}/${pkgname}-${pkgver}.tar.gz print_info "** Building and installing bash" mkdir $build/${pkgname} cd $build/${pkgname} diff --git a/scripts/clean.sh b/scripts/clean.sh index a445302..d973140 100755 --- a/scripts/clean.sh +++ b/scripts/clean.sh @@ -1,8 +1,16 @@ #!/bin/bash +. ./scripts/funcs.sh + +print_info "** Clean all build and outputs (build and out directories)" + if [ -d out ]; then - rm -rvf out; + print_info "** Deleting out directory" + rm -rf out; + check $? "Delete out directory" fi if [ -d build ]; then - rm -rvf build + print_info "** Deleting build directory" + rm -rf build + check $? "Delete build directory" fi diff --git a/scripts/curl.sh b/scripts/curl.sh index d9609b1..b64f1a3 100644 --- a/scripts/curl.sh +++ b/scripts/curl.sh @@ -11,6 +11,7 @@ curl() { fi pkgname=curl pkgver=8.9.1 + srcurl=https://curl.se/download/${pkgname}-${pkgver}.tar.xz print_info "** Building and installing curl" mkdir $build/${pkgname} cd $build/${pkgname} diff --git a/scripts/dnsmasq.sh b/scripts/dnsmasq.sh index fc50346..ad0e93d 100644 --- a/scripts/dnsmasq.sh +++ b/scripts/dnsmasq.sh @@ -7,6 +7,7 @@ dnsmasq() { pkgname=dnsmasq pkgver=2.90 + srcurl=https://thekelleys.org.uk/${pkgname}/${pkgname}-${pkgver}.tar.xz print_info "** Building and installing $pkgname" [ ! -d $build/$pkgname ] && mkdir $build/$pkgname cd $build/$pkgname diff --git a/scripts/finit_init.sh b/scripts/finit_init.sh index 382df4c..bfe9337 100644 --- a/scripts/finit_init.sh +++ b/scripts/finit_init.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash . ./scripts/colors.sh . ./scripts/funcs.sh diff --git a/scripts/funcs.sh b/scripts/funcs.sh index e2f5c41..813c80d 100755 --- a/scripts/funcs.sh +++ b/scripts/funcs.sh @@ -7,10 +7,10 @@ #------- Check errors func ----------------- check() { if [ $1 -ne 0 ]; then - printf "$ON_RED** ERROR: $2\n$RESET" + print_err "** ERROR: $2" exit 1 fi - printf "$ON_GREEN** SUCCESS: $2\n$RESET" + print_info "** SUCCESS: $2" } #------------------------------------------- @@ -24,5 +24,9 @@ check_root() { #------------------------------------------- print_info() { - printf "$ON_GREEN$1$RESET\n" + printf "\033[30;42m$1$RESET\n" +} + +print_err() { + printf "$ON_RED$1$RESET\n" } diff --git a/scripts/git.sh b/scripts/git.sh index 6a3b05c..5e6c01f 100644 --- a/scripts/git.sh +++ b/scripts/git.sh @@ -11,6 +11,7 @@ git_build() { fi pkgname=git pkgver=2.46.0 + srcurl=https://www.kernel.org/pub/software/scm/git/${pkgname}-${pkgver}.tar.xz print_info "** Building and installing ${pkgname}" mkdir $build/git cd $build/git diff --git a/scripts/hostapd.sh b/scripts/hostapd.sh index afe9720..7f61af7 100644 --- a/scripts/hostapd.sh +++ b/scripts/hostapd.sh @@ -11,6 +11,7 @@ hostapd() { [ ! -d $build/openssl ] && openssl pkgname=hostapd pkgver=2.11 + srcurl=https://w1.fi/releases/${pkgname}-${pkgver}.tar.gz print_info "** Building and installing ${pkgname}" [ ! -d $build/${pkgname} ] && mkdir $build/${pkgname} cd $build/${pkgname} diff --git a/scripts/iptables.sh b/scripts/iptables.sh index 3e565eb..caf3d70 100644 --- a/scripts/iptables.sh +++ b/scripts/iptables.sh @@ -7,6 +7,7 @@ iptables() { pkgname=iptables pkgver=1.8.11 + srcurl=https://www.netfilter.org/projects/iptables/files/${pkgname}-${pkgver}.tar.xz print_info "** Building and installing $pkgname" [ ! -d $build/$pkgname ] && mkdir $build/$pkgname cd $build/$pkgname diff --git a/scripts/iw.sh b/scripts/iw.sh index 19852cf..c193d44 100644 --- a/scripts/iw.sh +++ b/scripts/iw.sh @@ -9,6 +9,7 @@ iw() { [ ! -d $build/libnl ] && libnl pkgname=iw pkgver=6.9 + srcurl=https://www.kernel.org/pub/software/network/${pkgname}/${pkgname}-${pkgver}.tar.xz print_info "** Building and installing ${pkgname}" [ ! -d $build/iw ] && mkdir $build/iw cd $build/iw diff --git a/scripts/libnl.sh b/scripts/libnl.sh index 35ba1f5..d1e83a2 100644 --- a/scripts/libnl.sh +++ b/scripts/libnl.sh @@ -7,6 +7,8 @@ libnl() { pkgname=libnl pkgver=3.10.0 + _upkgver=3_10_0 + srcurl=https://github.com/thom311/libnl/releases/download/${pkgname}${_upkgver}/${pkgname}-${pkgver}.tar.gz print_info "** Building and installing ${pkgname}" [ ! -d $build/${pkgname} ] && mkdir $build/${pkgname} cd $build/${pkgname} diff --git a/scripts/libsqlite3.sh b/scripts/libsqlite3.sh index 225ae48..d95383e 100644 --- a/scripts/libsqlite3.sh +++ b/scripts/libsqlite3.sh @@ -7,10 +7,11 @@ libsqlite3() { pkgname=libsqlite3 pkgver=3.10.0 + giturl=https://github.com/LuaDist/libsqlite3.git print_info "** Building and installing ${pkgname}" [ ! -d $build/${pkgname} ] && mkdir $build/${pkgname} cd $build/${pkgname} - git clone https://github.com/LuaDist/libsqlite3.git + git clone ${giturl} check $? "Download ${pkgname}" cd ${pkgname} ./configure \ diff --git a/scripts/nginx.sh b/scripts/nginx.sh index a76af13..e1b5282 100644 --- a/scripts/nginx.sh +++ b/scripts/nginx.sh @@ -7,6 +7,7 @@ nginx_build() { pkgname=nginx pkgver=1.29.5 + srcurl=https://github.com/nginx/nginx/releases/download/release-${pkgver}/${pkgname}-${pkgver}.tar.gz print_info "** Building and installing ${pkgname}" [ -d $build/${pkgname} ] && return 0 mkdir $build/${pkgname} diff --git a/scripts/openssl.sh b/scripts/openssl.sh index 03d851e..49a9cd4 100644 --- a/scripts/openssl.sh +++ b/scripts/openssl.sh @@ -9,6 +9,7 @@ set -x openssl() { pkgname=openssl pkgver=3.4.1 + srcurl=https://github.com/openssl/openssl/releases/download/${pkgname}-${pkgver}/${pkgname}-${pkgver}.tar.gz print_info "** Building and installing ${pkgname}" [ -d $build/${pkgname} ] && return 0 [ ! -d $build/${pkgname} ] && mkdir $build/${pkgname} diff --git a/scripts/sftp_server.sh b/scripts/sftp_server.sh index c49d684..684124f 100644 --- a/scripts/sftp_server.sh +++ b/scripts/sftp_server.sh @@ -13,6 +13,7 @@ sftp_server() { dropbear fi print_info "** Building sftp-server" + srcurl=https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.9p1.tar.gz [ -d $build/sftp_server ] && return 0 mkdir -p $build/sftp_server cd $build/sftp_server diff --git a/scripts/tcc.sh b/scripts/tcc.sh index e1b3fe5..60954ec 100644 --- a/scripts/tcc.sh +++ b/scripts/tcc.sh @@ -7,6 +7,7 @@ tcc_build() { pkgname=tcc pkgver=0.9.27 + srcurl=https://download.savannah.gnu.org/releases/tinycc/${pkgname}-${pkgver}.tar.bz2 print_info "** Building and installing ${pkgname}" mkdir $build/${pkgname} cd $build/${pkgname} diff --git a/scripts/uclibc.sh b/scripts/uclibc.sh index fc715f3..a8f75a1 100755 --- a/scripts/uclibc.sh +++ b/scripts/uclibc.sh @@ -8,6 +8,7 @@ uclibc() { pkgname=uClibc-ng pkgver=${UCLIBC_VERSION} + srcurl=https://downloads.uclibc-ng.org/releases/${pkgver}/${pkgname}-${pkgver}.tar.xz print_info "** Building ${pkgname}" [ -d $build/${pkgname} ] && return 0 mkdir -p $build/${pkgname} diff --git a/scripts/wpa_supplicant.sh b/scripts/wpa_supplicant.sh index 3d7184c..f24b324 100755 --- a/scripts/wpa_supplicant.sh +++ b/scripts/wpa_supplicant.sh @@ -11,6 +11,7 @@ build_wpa_supplicant() { [ ! -d $build/openssl ] && openssl pkgname=wpa_supplicant pkgver=2.11 + srcurl=https://w1.fi/releases/wpa_supplicant-2.11.tar.gz print_info "** Building and installing iw" [ -d $build/wpa_supplicant ] && return 0 [ ! -d $build/wpa_supplicant ] && mkdir $build/wpa_supplicant diff --git a/scripts/zlib.sh b/scripts/zlib.sh index 7b499ca..c62fd31 100644 --- a/scripts/zlib.sh +++ b/scripts/zlib.sh @@ -7,6 +7,7 @@ zlib() { pkgname=zlib pkgver=1.3.1 + srcurl=https://www.zlib.net/zlib-1.3.1.tar.gz print_info "** Building and installing ${pkgname}" [ -d $build/${pkgname} ] && return 0 mkdir $build/${pkgname}