added duf and nginx and some refactor

This commit is contained in:
wt
2026-02-28 00:55:00 +07:00
parent 5da3185a36
commit 6a0c6c50f3
28 changed files with 146 additions and 146 deletions
+24 -31
View File
@@ -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
cd $rootfspath
mkdir -pv $(cat $rootfsfile) # &>> $fulllogfile
ln -sv usr/lib lib # &>> $fulllogfile
[ "$ARCH" = "arm" ] && ln -sv usr/lib lib32 # &>> $fulllogfile
[ "$ARCH" = "arm64" ] && ln -sv usr/lib lib64
ln -sv usr/bin bin # &>> $fulllogfile
ln -sv usr/bin sbin # &>> $fulllogfile
ln -sv var/run run
cd usr
ln -sv bin sbin # &>> $fulllogfile
[ "$ARCH" = "arm" ] && ln -sv lib lib32 # &>> $fulllogfile
[ "$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
cat <<EOF > $rootfspath/etc/os-release
if [ ! -d $rootfspath ]; then
mkdir -pv $rootfspath
cd $rootfspath
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
ln -sv usr/bin sbin
ln -sv var/run run
cd usr
ln -sv bin sbin
[ "$ARCH" = "arm" ] && ln -sv lib lib32
[ "$ARCH" = "arm64" ] && ln -sv lib lib64
ln -sv bin libexec
cd ..
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