added duf and nginx and some refactor
This commit is contained in:
@@ -65,4 +65,6 @@ export LIBSQLITE3_ENABLE=n
|
||||
export LM_SENSORS_ENABLE=n
|
||||
export LRZSZ_ENABLE=n
|
||||
export TCC_C_COMPILER_ENABLE=n
|
||||
export NGINX_ENABLE=n
|
||||
export DUF_BIN_ENABLE=n
|
||||
#--------------------------------------
|
||||
|
||||
@@ -65,4 +65,6 @@ export LIBSQLITE3_ENABLE=n
|
||||
export LM_SENSORS_ENABLE=y
|
||||
export LRZSZ_ENABLE=n
|
||||
export TCC_C_COMPILER_ENABLE=n
|
||||
export NGINX_ENABLE=n
|
||||
export DUF_BIN_ENABLE=n
|
||||
#--------------------------------------
|
||||
|
||||
@@ -53,4 +53,6 @@ export LIBSQLITE3_ENABLE=n
|
||||
export LM_SENSORS_ENABLE=n
|
||||
export LRZSZ_ENABLE=n
|
||||
export TCC_C_COMPILER_ENABLE=n
|
||||
export NGINX_ENABLE=n
|
||||
export DUF_BIN_ENABLE=n
|
||||
#--------------------------------------
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
. ./scripts/lrzsz.sh
|
||||
. ./scripts/tcc.sh
|
||||
. ./scripts/zlib.sh
|
||||
. ./scripts/nginx.sh
|
||||
. ./scripts/duf_bin.sh
|
||||
|
||||
case $1 in
|
||||
build)
|
||||
@@ -92,6 +94,12 @@ case $1 in
|
||||
zlib)
|
||||
zlib
|
||||
;;
|
||||
nginx)
|
||||
nginx_build
|
||||
;;
|
||||
duf_bin)
|
||||
duf_bin
|
||||
;;
|
||||
*)
|
||||
printf "$UYELLOW** $0 script using: $0 {clean|build|download|rootfs}\n$RESET"
|
||||
exit 1
|
||||
|
||||
+9
-10
@@ -12,19 +12,19 @@
|
||||
busybox_rootfs() {
|
||||
printf "$UGREEN** Building busybox for rootfs\n$RESET"
|
||||
[ -d $build/busybox ] && return 0
|
||||
mkdir -p $build/busybox # &>> $fulllogfile
|
||||
mkdir -p $build/busybox
|
||||
cd $build/busybox
|
||||
tar -xjf $root/downloads/busybox-${BUSYBOX_VERSION}.tar.bz2 # &>> $fulllogfile
|
||||
tar -xjf $root/downloads/busybox-${BUSYBOX_VERSION}.tar.bz2
|
||||
cd busybox-${BUSYBOX_VERSION}
|
||||
sed -i 's/|| ctx->process_block == sha1_process_block64_shaNI/|| ctx->process_block == sha1_process_block64/' libbb/hash_md5_sha.c
|
||||
cp $root/board/${BOARD_NAME}/busybox-${BUSYBOX_VERSION}.config .config # &>> $fulllogfile
|
||||
cp $root/board/${BOARD_NAME}/busybox-${BUSYBOX_VERSION}.config .config
|
||||
printf "$UGREEN** Configuring busybox\n$RESET"
|
||||
make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- oldconfig # &>> $fulllogfile
|
||||
make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- oldconfig
|
||||
check $? "Configure busybox all logs in .log"
|
||||
printf "$UGREEN** Building busybox\n$RESET"
|
||||
make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- $makeflags # &>> $fulllogfile
|
||||
make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- $makeflags
|
||||
check $? "Build busybox all logs in .log"
|
||||
cp -v busybox $rootfspath/usr/bin # &>> $fulllogfile
|
||||
cp -v busybox $rootfspath/usr/bin
|
||||
cd $rootfspath/usr/bin
|
||||
for i in $(cat $BUSYBOX_LIST_FILE); do ln -sv busybox $i; done
|
||||
}
|
||||
@@ -33,19 +33,18 @@ busybox_rootfs() {
|
||||
#------------------ Building busybox for initramfs ----------------
|
||||
busybox_initramfs() {
|
||||
printf "$UGREEN** Building busybox for initramfs\n$RESET"
|
||||
# [ -d $build/busybox ] && return 0
|
||||
[ -f $build/initramfs.img ] && return 0
|
||||
mkdir -p $build/busybox
|
||||
cd $build/busybox
|
||||
tar -xjf $root/downloads/busybox-${BUSYBOX_VERSION}.tar.bz2
|
||||
check $? "Extract busybox"
|
||||
cd busybox-${BUSYBOX_VERSION}
|
||||
cp -v $root/board/${BOARD_NAME}/busybox-initrd-${BUSYBOX_VERSION}.config .config
|
||||
# export PATH=$PATH:/opt/toolchains/x86_64-buildroot-linux-uclibc-gcc/bin
|
||||
printf "$UGREEN** Configuring busybox\n$RESET"
|
||||
make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- oldconfig # &>> $fulllogfile
|
||||
make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- oldconfig
|
||||
check $? "Configure busybox all logs in .log"
|
||||
printf "$UGREEN** Building busybox\n$RESET"
|
||||
make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- $makeflags # &>> $fulllogfile
|
||||
make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- $makeflags
|
||||
check $? "Build busybox all logs in .log"
|
||||
}
|
||||
#------------------------------------------------------------------
|
||||
|
||||
@@ -28,14 +28,5 @@ curl() {
|
||||
make $makeflags
|
||||
check $? "Build ${pkgname}"
|
||||
make DESTDIR=$rootfspath install
|
||||
# rm \
|
||||
# -rv \
|
||||
# $rootfspath/usr/include \
|
||||
# $rootfspath/usr/share/aclocal \
|
||||
# $rootfspath/usr/share/man \
|
||||
# $rootfspath/usr/lib/*.a \
|
||||
# $rootfspath/usr/lib/*.la \
|
||||
# $rootfspath/usr/lib/pkgconfig
|
||||
# $CROSS_COMPILE-strip --strip-unneeded $rootfspath/usr/bin/curl $rootfspath/usr/lib/libcurl.so.4.8.0
|
||||
check $? "Installing to rootfs ${pkgname}"
|
||||
}
|
||||
|
||||
@@ -14,8 +14,6 @@ dnsmasq() {
|
||||
cd ${pkgname}-${pkgver}
|
||||
make CC=${CROSS_COMPILE}-gcc ${makeflags}
|
||||
check $? "Build ${pkgname}"
|
||||
# ${CROSS_COMPILE}-strip src/$pkgname
|
||||
# check $? "Stripping ${pkgname} binary"
|
||||
cp -v src/$pkgname $rootfspath/usr/bin/$pkgname
|
||||
check $? "Install to rootfs ${pkgname}"
|
||||
}
|
||||
|
||||
+8
-9
@@ -6,29 +6,28 @@
|
||||
. ./scripts/zlib.sh
|
||||
|
||||
dropbear() {
|
||||
if [ ! -d $build/zlib ]; then
|
||||
zlib
|
||||
fi
|
||||
printf "$GREEN** Building and installing dropbear\n$RESET"
|
||||
# [ -d $build/dropbear ] && return 0
|
||||
[ -d $build/dropbear ] && return 0
|
||||
mkdir $build/dropbear
|
||||
cd $build/dropbear
|
||||
tar -xvf $root/downloads/DROPBEAR_2025.89.tar.gz
|
||||
check $? "Extract dropbear"
|
||||
cd dropbear-DROPBEAR_2025.89
|
||||
if [ "${ZLIB_ENABLE}" = "n" ]; then
|
||||
./configure \
|
||||
--prefix=/usr \
|
||||
--host=$CROSS_COMPILE \
|
||||
--disable-zlib
|
||||
else
|
||||
./configure \
|
||||
--prefix=/usr \
|
||||
--host=$CROSS_COMPILE \
|
||||
--with-zlib=$build/rootfs/usr/include
|
||||
# CC=${CROSS_COMPILE}gcc ./configure --prefix=/usr --shared
|
||||
fi
|
||||
check $? "Configure dropbear"
|
||||
make $makeflags
|
||||
check $? "Build dropbear"
|
||||
make DESTDIR=$rootfspath install
|
||||
check $? "Installing to rootfs dropbear"
|
||||
# [ "$SFTP_SERVER_ENABLE" = "n" ] && rm -rv $rootfspath/usr/include $rootfspath/usr/share/man $rootfspath/usr/lib/{pkgconfig,libz.a}
|
||||
# ${CROSS_COMPILE}-strip --strip-unneeded $rootfspath/usr/bin/*
|
||||
mkdir -pv $build/rootfs/etc/dropbear
|
||||
# check $? "Installing to rootfs zlib"
|
||||
# rm -rvf $rootfspath/usr/share/man
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ./scripts/colors.sh
|
||||
. ./scripts/funcs.sh
|
||||
. ./scripts/config.sh
|
||||
|
||||
duf_bin() {
|
||||
pkgname=duf
|
||||
pkgver=0.9.1
|
||||
printf "$GREEN** Building and installing ${pkgname}\n$RESET"
|
||||
[ -d $build/${pkgname} ] && return 0
|
||||
mkdir $build/${pkgname}
|
||||
cd $build/${pkgname}
|
||||
if [ "${ARCH}" = "arm64" ] || [ "${ARCH}" = "x86_64" ]; then
|
||||
wget https://github.com/muesli/duf/releases/download/v${pkgver}/${pkgname}_${pkgver}_linux_${ARCH}.tar.gz
|
||||
check $? "Download ${pkgname}"
|
||||
fi
|
||||
if [ "${ARCH}" = "arm" ]; then
|
||||
wget https://github.com/muesli/duf/releases/download/v${pkgver}/${pkgname}_${pkgver}_linux_${ARCH}v7.tar.gz
|
||||
check $? "Download ${pkgname}"
|
||||
fi
|
||||
tar -xvf ${pkgname}_${pkgver}_linux*.tar.gz
|
||||
check $? "Extract ${pkgname}"
|
||||
cp -v duf $rootfspath/usr/bin/
|
||||
check $? "Installing to rootfs ${pkgname}"
|
||||
}
|
||||
@@ -68,21 +68,4 @@ finit_init() {
|
||||
check $? "Build finit"
|
||||
make DESTDIR=$rootfspath install
|
||||
check $? "Installing to rootfs finit"
|
||||
|
||||
# find $rootfspath -name "*.la" -delete
|
||||
# find $rootfspath -name "*.a" -delete
|
||||
# rm -rv \
|
||||
# $rootfspath/usr/lib/pkgconfig \
|
||||
# $rootfspath/lib/pkgconfig \
|
||||
# $rootfspath/usr/include \
|
||||
# $rootfspath/usr/share/man \
|
||||
# $rootfspath/usr/share/doc
|
||||
# $CROSS_COMPILE-strip --strip-unneeded \
|
||||
# $rootfspath/usr/lib/libite.so.5.4.0 \
|
||||
# $rootfspath/usr/lib/libuev.so.3.0.0 \
|
||||
# $rootfspath/sbin/finit \
|
||||
# $rootfspath/sbin/initctl \
|
||||
# $rootfspath/libexec/finit/* \
|
||||
# $rootfspath/lib/libsystemd.so.0.0.0 \
|
||||
# $rootfspath/lib/finit/plugins/*
|
||||
}
|
||||
|
||||
@@ -27,6 +27,5 @@ git_build() {
|
||||
make $makeflags
|
||||
check $? "Build ${pkgname}"
|
||||
make DESTDIR=$rootfspath install
|
||||
# $CROSS_COMPILE-strip --strip-unneeded $rootfspath/usr/bin/* $rootfspath/libexec/git-core/*
|
||||
printf "$GREEN** SUCCESS: Building and installing ${pkgname}\n$RESET"
|
||||
}
|
||||
|
||||
@@ -24,11 +24,5 @@ iptables() {
|
||||
check $? "Build ${pkgname}"
|
||||
make install DESTDIR=$rootfspath
|
||||
check $? "Install to rootfs ${pkgname}"
|
||||
# ${CROSS_COMPILE}-strip \
|
||||
# $rootfspath/usr/bin/* \
|
||||
# $rootfspath/usr/sbin/* \
|
||||
# $rootfspath/usr/lib/* \
|
||||
# $rootfspath/usr/lib/xtables/*
|
||||
# rm -rv $rootfspath/usr/share/man
|
||||
printf "$GREEN** SUCCESS: Building and installing ${pkgname}\n$RESET"
|
||||
}
|
||||
|
||||
@@ -18,8 +18,6 @@ iw() {
|
||||
PKG_CONFIG_PATH=/opt/toolchains/$CROSS_COMPILE/$CROSS_COMPILE/sysroot/usr/lib/pkgconfig \
|
||||
make ${makeflags}
|
||||
check $? "Build ${pkgname}"
|
||||
# ${CROSS_COMPILE}-strip iw
|
||||
# check $? "Stripping ${pkgname} binary"
|
||||
cp -v iw $rootfspath/usr/bin/iw
|
||||
check $? "Install to rootfs ${pkgname}"
|
||||
}
|
||||
|
||||
+9
-10
@@ -8,19 +8,19 @@
|
||||
kernel() {
|
||||
printf "$UGREEN** Building Linux Kernel\n$RESET"
|
||||
[ -d $build/kernel ] && return 0
|
||||
mkdir -p $build/kernel # &>> $fulllogfile
|
||||
mkdir -p $build/kernel
|
||||
cd $build/kernel
|
||||
printf "$UGREEN** Extracting Linux Kernel\n$RESET"
|
||||
tar -xf $root/downloads/linux-$KERNEL_VERSION.tar.xz # &>> $fulllogfile
|
||||
tar -xf $root/downloads/linux-$KERNEL_VERSION.tar.xz
|
||||
check $? "Extract Linux Kernel"
|
||||
cd linux-$KERNEL_VERSION
|
||||
printf "$UGREEN** Configuring Linux Kernel\n$RESET"
|
||||
make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- mrproper # &>> $fulllogfile
|
||||
cp $root/board/${BOARD_NAME}/linux-$KERNEL_VERSION.config .config # &>> $fulllogfile
|
||||
make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- oldconfig # &>> $fulllogfile
|
||||
make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- mrproper
|
||||
cp $root/board/${BOARD_NAME}/linux-$KERNEL_VERSION.config .config
|
||||
make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- oldconfig
|
||||
check $? "Configure Linux Kernel"
|
||||
printf "$UGREEN** Building Linux Kernel\n$RESET"
|
||||
make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- $makeflags # &>> $fulllogfile
|
||||
make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- $makeflags
|
||||
check $? "Build Linux Kernel"
|
||||
KIMAGE=zImage
|
||||
[ "$ARCH" = "arm64" ] && KIMAGE=Image
|
||||
@@ -31,17 +31,16 @@ kernel() {
|
||||
#----------- Build and Install kernel modules --------------
|
||||
kernel_modules() {
|
||||
printf "$UGREEN** Building Linux Kernel modules\n$RESET"
|
||||
# [ -d $build/kernel/linux-$KERNEL_VERSION ] && return 0
|
||||
[ -d $rootfspath/usr/lib/modules ] && return 0
|
||||
cd $build/kernel/linux-$KERNEL_VERSION
|
||||
make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- modules # &>> fulllogfile
|
||||
make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- modules
|
||||
check $? "Build Linux Kernel modules"
|
||||
printf "$UGREEN** Installing Linux Kernel modules into rootfs path\n$RESET"
|
||||
make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- INSTALL_MOD_PATH=$rootfspath modules_install # &>> $fulllogfile
|
||||
make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- INSTALL_MOD_PATH=$rootfspath modules_install
|
||||
for i in $(find $rootfspath | grep .ko); do
|
||||
gzip -9 $i;
|
||||
done
|
||||
check $? "Install Linux Kernel modules"
|
||||
# rm -v $rootfspath/usr/lib/modules/$KERNEL_VERSION/{source,build}
|
||||
} # kernel_modules
|
||||
#-----------------------------------------------------------
|
||||
|
||||
|
||||
@@ -24,8 +24,6 @@ libnl() {
|
||||
make $makeflags
|
||||
check $? "Build ${pkgname}"
|
||||
make DESTDIR=$(pwd)/bin install
|
||||
# rm -rv $(pwd)/bin/opt/toolchains/$CROSS_COMPILE/$CROSS_COMPILE/sysroot/usr/lib/{pkgconfig,*.la}
|
||||
# ${CROSS_COMPILE}-strip $(pwd)/bin/opt/toolchains/$CROSS_COMPILE/$CROSS_COMPILE/sysroot/usr/lib/*
|
||||
cd $(pwd)/bin/opt/toolchains/$CROSS_COMPILE/$CROSS_COMPILE/sysroot/usr/lib
|
||||
tar -czvf /tmp/${pkgname}.tar.gz .
|
||||
check $? "Archived libs"
|
||||
|
||||
@@ -21,9 +21,4 @@ libsqlite3() {
|
||||
check $? "Build ${pkgname}"
|
||||
make DESTDIR=$rootfspath install
|
||||
check $? "Installing to rootfs ${pkgname}"
|
||||
# ${CROSS_COMPILE}-strip --strip-unneeded $rootfspath/usr/lib/*
|
||||
# rm -rvf $rootfspath/usr/lib/pkgconfig
|
||||
# find $rootfspath -type f -name "*.a" -delete
|
||||
# find $rootfspath -type f -name "*.la" -delete
|
||||
# rm -rvf $rootfspath/usr/include $rootfspath/usr/share/man $rootfspath/usr/share/doc
|
||||
}
|
||||
|
||||
@@ -12,7 +12,4 @@ lm_sensors() {
|
||||
git clone https://github.com/lm-sensors/lm-sensors.git
|
||||
cd lm-sensors
|
||||
make CC=$CROSS_COMPILE-gcc PREFIX=/usr DESTDIR=$rootfspath install -j$(nproc)
|
||||
# rm -rf $rootfspath/usr/man $rootfspath/usr/include
|
||||
# find $rootfspath -type f -name "*.a" -delete
|
||||
# ${CROSS_COMPILE}-strip $rootfspath/usr/bin/* $rootfspath/usr/lib/* $rootfspath/usr/sbin/*
|
||||
}
|
||||
|
||||
@@ -19,7 +19,5 @@ lrzsz-build() {
|
||||
make $makeflags
|
||||
check $? "Build ${pkgname}"
|
||||
make DESTDIR=$rootfspath install
|
||||
# rm -rv $rootfspath/usr/include $rootfspath/usr/share/man $rootfspath/usr/lib/{pkgconfig,libz.a}
|
||||
# ${CROSS_COMPILE}-strip --strip-unneeded $rootfspath/usr/bin/{lsx,lrb,lrx,lrz,lsz,lsb}
|
||||
check $? "Installing to rootfs ${pkgname}"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ./scripts/colors.sh
|
||||
. ./scripts/funcs.sh
|
||||
. ./scripts/config.sh
|
||||
|
||||
nginx_build() {
|
||||
pkgname=nginx
|
||||
pkgver=1.29.5
|
||||
printf "$GREEN** Building and installing ${pkgname}\n$RESET"
|
||||
[ -d $build/${pkgname} ] && return 0
|
||||
mkdir $build/${pkgname}
|
||||
cd $build/${pkgname}
|
||||
tar -xvf $root/downloads/${pkgname}-${pkgver}.tar.gz
|
||||
check $? "Extract ${pkgname}"
|
||||
cd ${pkgname}-${pkgver}
|
||||
./configure \
|
||||
--prefix=/opt/nginx \
|
||||
--without-pcre \
|
||||
--without-http_rewrite_module \
|
||||
--with-cc-opt="-DNGX_HAVE_EPOLLEXCLUSIVE=0 -DNGX_HAVE_STRERRORDESC_NP=0 -DNGX_HAVE_IP_BIND_ADDRESS_NO_PORT=0 -DNGX_HAVE_GNU_CRYPT_R=0"
|
||||
check $? "Configure ${pkgname}"
|
||||
sed -i "/CC =/s/.*/CC=$CROSS_COMPILE-gcc/" objs/Makefile
|
||||
sed -i "/CPP =/s/.*/CPP=$CROSS_COMPILE-gcc -E/" objs/Makefile
|
||||
make $makeflags
|
||||
check $? "Build ${pkgname}"
|
||||
make DESTDIR=$rootfspath install
|
||||
check $? "Installing to rootfs ${pkgname}"
|
||||
cat << EOF > $rootfspath/etc/finit.d/available/nginx.conf
|
||||
run [S] mkdir -p /run/nginx /var/log/nginx /var/cache/nginx
|
||||
run [S] chown -R nginx:nginx /run/nginx 2>/dev/null || chown -R nobody:nobody /run/nginx 2>/dev/null || true
|
||||
|
||||
service [2345] \\
|
||||
pid:/run/nginx/nginx.pid \\
|
||||
log:/opt/nginx/logs/error.log \\
|
||||
/opt/nginx/sbin/nginx -g "daemon off; pid /run/nginx/nginx.pid;" -c /opt/nginx/conf/nginx.conf \\
|
||||
-- Nginx Web Server
|
||||
EOF
|
||||
[ -f $rootfspath/opt/nginx/sbin/nginx.old ] && rm -v $rootfspath/opt/nginx/sbin/nginx.old
|
||||
}
|
||||
@@ -25,8 +25,6 @@ openssl() {
|
||||
check $? "Configure ${pkgname}"
|
||||
make ${makeflags}
|
||||
check $? "Build ${pkgname}"
|
||||
# ${CROSS_COMPILE}-strip libcrypto.so.3 libssl.so.3
|
||||
# check $? "Stripping ${pkgname} binary"
|
||||
cp -v libcrypto.so.3 libssl.so.3 $rootfspath/usr/lib/
|
||||
ln -sv libcrypto.so.3 $rootfspath/usr/lib/libcrypto.so
|
||||
ln -sv libssl.so.3 $rootfspath/usr/lib/libssl.so
|
||||
|
||||
+16
-23
@@ -27,51 +27,42 @@
|
||||
. ./scripts/lrzsz.sh
|
||||
. ./scripts/tcc.sh
|
||||
. ./scripts/cleanup_rootfs.sh
|
||||
. ./scripts/nginx.sh
|
||||
. ./scripts/duf_bin.sh
|
||||
|
||||
#----------- Building rootfs ----------------------
|
||||
rootfs() {
|
||||
printf "$UGREEN** Building rootfs\n$RESET"
|
||||
# rm -rv $rootfspath # &>> $fulllogfile
|
||||
mkdir -pv $rootfspath # &>> $fulllogfile
|
||||
if [ ! -d $rootfspath ]; then
|
||||
mkdir -pv $rootfspath
|
||||
cd $rootfspath
|
||||
mkdir -pv $(cat $rootfsfile) # &>> $fulllogfile
|
||||
ln -sv usr/lib lib # &>> $fulllogfile
|
||||
[ "$ARCH" = "arm" ] && ln -sv usr/lib lib32 # &>> $fulllogfile
|
||||
mkdir -pv $(cat $rootfsfile)
|
||||
ln -sv usr/lib lib
|
||||
[ "$ARCH" = "arm" ] && ln -sv usr/lib lib32
|
||||
[ "$ARCH" = "arm64" ] && ln -sv usr/lib lib64
|
||||
ln -sv usr/bin bin # &>> $fulllogfile
|
||||
ln -sv usr/bin sbin # &>> $fulllogfile
|
||||
ln -sv usr/bin bin
|
||||
ln -sv usr/bin sbin
|
||||
ln -sv var/run run
|
||||
cd usr
|
||||
ln -sv bin sbin # &>> $fulllogfile
|
||||
[ "$ARCH" = "arm" ] && ln -sv lib lib32 # &>> $fulllogfile
|
||||
ln -sv bin sbin
|
||||
[ "$ARCH" = "arm" ] && ln -sv lib lib32
|
||||
[ "$ARCH" = "arm64" ] && ln -sv lib lib64
|
||||
ln -sv bin libexec
|
||||
cd ..
|
||||
# tar -xvf $root/downloads/20250110-1.tar.gz
|
||||
# cp -rv initscripts/* .
|
||||
# rm -rv initscripts
|
||||
ln -sv /proc/mounts etc/mtab # &>> $fulllogfile
|
||||
|
||||
ln -sv /proc/mounts etc/mtab
|
||||
cat << EOF > $rootfspath/etc/os-release
|
||||
NAME="$distro_name"
|
||||
PRETTY_NAME="$distro_pretty_name"
|
||||
ID="$distro_id"
|
||||
BUILD_ID="$distro_build_id"
|
||||
EOF
|
||||
fi
|
||||
|
||||
busybox_rootfs
|
||||
# cp -v $build/busybox/busybox-${BUSYBOX_VERSION}/busybox $rootfspath/usr/bin # &>> $fulllogfile
|
||||
# cd $rootfspath/usr/bin
|
||||
# for i in $(cat $BUSYBOX_LIST_FILE); do ln -sv busybox $i; done
|
||||
# cp -v $root/rootfs/init.in $rootfspath/init
|
||||
kernel_headers
|
||||
uclibc
|
||||
# kernel
|
||||
# kernel_modules
|
||||
if [ "$FINIT_INIT_ENABLE" = "y" ]; then
|
||||
finit_init
|
||||
# cp -rv $root/rootfs/overlay/* $rootfspath
|
||||
# rm $rootfspath/init
|
||||
ln -sv usr/bin/finit $rootfspath/init
|
||||
fi
|
||||
[ "$ZLIB_ENABLE" = "y" ] && zlib
|
||||
@@ -93,6 +84,8 @@ EOF
|
||||
[ "$LM_SENSORS_ENABLE" = "y" ] && lm_sensors
|
||||
[ "$LRZSZ_ENABLE" = "y" ] && lrzsz-build
|
||||
[ "$TCC_C_COMPILER_ENABLE" = "y" ] && tcc_build
|
||||
[ "$NGINX_ENABLE" = "y" ] && nginx_build
|
||||
[ "$DUF_BIN_ENABLE" = "y" ] && duf_bin
|
||||
|
||||
if [ ! -z "$DEFAULT_HOSTNAME" ]; then
|
||||
echo "$DEFAULT_HOSTNAME" > $rootfspath/etc/hostname
|
||||
@@ -108,7 +101,7 @@ EOF
|
||||
|
||||
[ ! -z "$ROOTFS_OVERLAY" ] && cp -rv $ROOTFS_OVERLAY/* $rootfspath
|
||||
|
||||
chmod 640 $rootfspath/etc/shadow #$rootfspath/etc/inittab
|
||||
chmod 640 $rootfspath/etc/shadow
|
||||
chmod 755 $rootfspath/usr/share/udhcpc/default.script
|
||||
chmod 644 $rootfspath/etc/{passwd,group,hostname,hosts,fstab,shells,issue} $rootfspath/etc/network/interfaces
|
||||
|
||||
|
||||
@@ -14,9 +14,9 @@ sftp_server() {
|
||||
fi
|
||||
printf "$UGREEN** Building sftp-server\n$RESET"
|
||||
[ -d $build/sftp_server ] && return 0
|
||||
mkdir -p $build/sftp_server # &>> $fulllogfile
|
||||
mkdir -p $build/sftp_server
|
||||
cd $build/sftp_server
|
||||
tar -xvf $root/downloads/openssh-9.9p1.tar.gz # &>> $fulllogfile
|
||||
tar -xvf $root/downloads/openssh-9.9p1.tar.gz
|
||||
check $? "Extract openssh"
|
||||
cd openssh-9.9p1
|
||||
./configure \
|
||||
@@ -25,10 +25,9 @@ sftp_server() {
|
||||
--without-openssl \
|
||||
--with-zlib=$rootfspath/usr/include
|
||||
check $? "Configure openssh"
|
||||
make sftp-server $makeflags # &>> $fulllogfile
|
||||
make sftp-server $makeflags
|
||||
check $? "Build sftp-server"
|
||||
cp -v sftp-server $rootfspath/usr/bin/
|
||||
# $CROSS_COMPILE-strip $rootfspath/usr/bin/sftp-server
|
||||
check $? "Install sftp-server to rootfs directory"
|
||||
check $? "Build and install sftp-server to rootfs directory"
|
||||
}
|
||||
|
||||
@@ -25,9 +25,5 @@ tcc_build() {
|
||||
make $makeflags
|
||||
check $? "Build ${pkgname}"
|
||||
make DESTDIR=$rootfspath install
|
||||
# ${CROSS_COMPILE}-strip --strip-unneeded $rootfspath/usr/bin/tcc $rootfspath/usr/lib/libtcc.so
|
||||
check $? "Installing to rootfs ${pkgname}"
|
||||
# find $rootfspath -type f -name "*.a" -delete
|
||||
# find $rootfspath -type f -name "*.la" -delete
|
||||
# rm -rvf $rootfspath/usr/share/{info,man,doc}
|
||||
}
|
||||
|
||||
+3
-5
@@ -9,16 +9,15 @@ uboot_version=2025.07
|
||||
#--- uboot ---
|
||||
uboot() {
|
||||
printf "$UGREEN** Building uboot\n$RESET"
|
||||
mkdir -p $build/uboot # &>> $fulllogfile
|
||||
mkdir -p $build/uboot
|
||||
cd $build/uboot
|
||||
tar -xvf $root/downloads/v$uboot_version.tar.gz # &>> $fulllogfile
|
||||
tar -xvf $root/downloads/v$uboot_version.tar.gz
|
||||
check $? "Extract uboot"
|
||||
cd u-boot-$uboot_version
|
||||
# cp -rv $root/uclibc/config-1.0.50 .config
|
||||
make ARCH=arm CROSS_COMPILE=$CROSS_COMPILE- $UBOOT_DEFCONFIG
|
||||
check $? "Configure uboot"
|
||||
if [ "$BOARD_NAME" = "orangepi_pc" ]; then
|
||||
make ARCH=arm CROSS_COMPILE=$CROSS_COMPILE- $makeflags # &>> $fulllogfile
|
||||
make ARCH=arm CROSS_COMPILE=$CROSS_COMPILE- $makeflags
|
||||
elif [ "$BOARD_NAME" = "orangepi_zero_2w" ]; then
|
||||
make ARCH=arm CROSS_COMPILE=$CROSS_COMPILE- BL31=$root/board/$BOARD_NAME/bl31.bin $makeflags
|
||||
fi
|
||||
@@ -29,7 +28,6 @@ uboot() {
|
||||
elif [ "$ARCH" = "arm64" ]; then
|
||||
cp -v dts/upstream/src/arm64/allwinner/sun50i-h618-orangepi-zero2w.dtb $sdroot/boot/dtbs
|
||||
fi
|
||||
# make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE DESTDIR=$rootfspath install # &>> $fulllogfile
|
||||
check $? "Install uboot to out directory"
|
||||
check $? "Build and install uboot to out directory"
|
||||
}
|
||||
|
||||
+4
-11
@@ -10,27 +10,20 @@ uclibc() {
|
||||
pkgver=${UCLIBC_VERSION}
|
||||
printf "$UGREEN** Building ${pkgname}\n$RESET"
|
||||
[ -d $build/${pkgname} ] && return 0
|
||||
mkdir -p $build/${pkgname} # &>> $fulllogfile
|
||||
mkdir -p $build/${pkgname}
|
||||
cd $build/${pkgname}
|
||||
tar -xvf $root/downloads/${pkgname}-${pkgver}.tar.xz # &>> $fulllogfile
|
||||
tar -xvf $root/downloads/${pkgname}-${pkgver}.tar.xz
|
||||
check $? "Extract ${pkgname}"
|
||||
cd ${pkgname}-${pkgver}
|
||||
cp -rv $UCLIBC_CONFIG_FILE .config
|
||||
sed -i -e "s/KERNEL_HEADERS=/KERNEL_HEADERS=\"..\/..\/kernel-headers\/linux-$KERNEL_VERSION\/usr\/include\"/g" .config
|
||||
make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- oldconfig
|
||||
check $? "Configure ${pkgname}"
|
||||
make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- $makeflags # &>> $fulllogfile
|
||||
make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- $makeflags
|
||||
check $? "Build ${pkgname}"
|
||||
sed -i 's/constexpr/is_constant/g' extra/scripts/unifdef.c
|
||||
make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- DESTDIR=$rootfspath install # &>> $fulllogfile
|
||||
make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- DESTDIR=$rootfspath install
|
||||
check $? "Install ${pkgname} to rootfs"
|
||||
# cd $rootfspath
|
||||
# find -name \*.a -delete # &>> $fulllogfile
|
||||
# find -name \*.o -delete
|
||||
# rm -v $rootfspath/usr/lib/libc.so
|
||||
# ${CROSS_COMPILE}-strip --strip-unneeded $rootfspath/usr/lib/* $rootfspath/usr/bin/* # &>> $fulllogfile $rootfspath/usr/lib/*
|
||||
# rm -rv $rootfspath/usr/include
|
||||
# cd $root
|
||||
check $? "Build and install ${pkgname}"
|
||||
}
|
||||
#-----------------------------------------------------------
|
||||
|
||||
@@ -22,8 +22,6 @@ build_wpa_supplicant() {
|
||||
PKG_CONFIG_PATH=/opt/toolchains/$CROSS_COMPILE/$CROSS_COMPILE/sysroot/usr/lib/pkgconfig \
|
||||
make ${makeflags} BINDIR=/usr/bin LIBDIR=/usr/lib
|
||||
check $? "Build ${pkgname}"
|
||||
# ${CROSS_COMPILE}-strip wpa_cli wpa_passphrase wpa_supplicant
|
||||
# check $? "Stripping ${pkgname} binary"
|
||||
cp -v wpa_cli wpa_passphrase wpa_supplicant $rootfspath/usr/bin/
|
||||
check $? "Install to rootfs ${pkgname}"
|
||||
}
|
||||
|
||||
+1
-5
@@ -8,6 +8,7 @@ zlib() {
|
||||
pkgname=zlib
|
||||
pkgver=1.3.1
|
||||
printf "$GREEN** Building and installing ${pkgname}\n$RESET"
|
||||
[ -d $build/${pkgname} ] && return 0
|
||||
mkdir $build/${pkgname}
|
||||
cd $build/${pkgname}
|
||||
tar -xvf $root/downloads/${pkgname}-${pkgver}.tar.gz
|
||||
@@ -18,10 +19,5 @@ zlib() {
|
||||
make $makeflags
|
||||
check $? "Build ${pkgname}"
|
||||
make DESTDIR=$rootfspath install
|
||||
# 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.${pkgver}
|
||||
check $? "Installing to rootfs ${pkgname}"
|
||||
# rm -rvf $rootfspath/usr/lib/pkgconfig
|
||||
# find $rootfspath -type f -name "*.a" -delete
|
||||
# find $rootfspath -type f -name "*.la" -delete
|
||||
}
|
||||
|
||||
@@ -28,3 +28,4 @@ https://dl.gitea.com/gitea/1.22.4/gitea-1.22.4-linux-arm-5
|
||||
# https://github.com/LuaDist/libsqlite3.git
|
||||
# https://w1.fi/releases/wpa_supplicant-2.11.tar.gz
|
||||
# https://download.savannah.gnu.org/releases/tinycc/tcc-0.9.27.tar.bz2
|
||||
https://github.com/nginx/nginx/releases/download/release-1.29.5/nginx-1.29.5.tar.gz
|
||||
|
||||
Reference in New Issue
Block a user