diff options
| author | emmett1 <emmett1.2miligrams@protonmail.com> | 2025-09-07 13:07:35 +0800 |
|---|---|---|
| committer | emmett1 <emmett1.2miligrams@protonmail.com> | 2025-09-07 13:07:35 +0800 |
| commit | c09688749462898ade41f76ed66fe67983a70c4a (patch) | |
| tree | f8522d163311b06b975f7ce5d1954b389a3835d2 /repos/core | |
| parent | 7a568c4325b338179429d6b8c5deafbf43bd5c64 (diff) | |
| download | alicelinux-c09688749462898ade41f76ed66fe67983a70c4a.tar.gz alicelinux-c09688749462898ade41f76ed66fe67983a70c4a.zip | |
busybox: added udhcpc and net-static service
Diffstat (limited to 'repos/core')
| -rw-r--r-- | repos/core/busybox/.checksum | 7 | ||||
| -rw-r--r-- | repos/core/busybox/.files | 14 | ||||
| -rw-r--r-- | repos/core/busybox/abuild | 34 | ||||
| -rwxr-xr-x | repos/core/busybox/crond.run | 1 | ||||
| -rwxr-xr-x | repos/core/busybox/default.script | 13 | ||||
| -rw-r--r-- | repos/core/busybox/net-static.conf | 7 | ||||
| -rwxr-xr-x | repos/core/busybox/net-static.run | 23 | ||||
| -rw-r--r-- | repos/core/busybox/udhcpc.conf | 3 | ||||
| -rwxr-xr-x | repos/core/busybox/udhcpc.run | 13 |
9 files changed, 104 insertions, 11 deletions
diff --git a/repos/core/busybox/.checksum b/repos/core/busybox/.checksum index d6ab8c69..d44fed96 100644 --- a/repos/core/busybox/.checksum +++ b/repos/core/busybox/.checksum @@ -7,7 +7,8 @@ d7fef12ae5c778a12294be5da8ff8ffcc4a3ff3e0a5dca5885964626a47c2a0f acpid.run f62969ee1426bea40ffd603cb01aa4f6e264930ce29a0266b776f5d08253772a adduser-no-setgid.patch 179c4567a112635be6cb442fd8e3ff95dd0e718facd0666f2426d94322110a8f busybox-1.37.0.tar.bz2 c8e25401863bfdecb4f3a5d4b68ef0507bac74dd69782ce3abdd7e49fecc4a80 busybox-suidwrapper.c -239685f1d7b222d8cb4c73db36dfe76b2127c2baeff5eb4198dd32420d9a5c2d crond.run +48b8a6cc6f4aa539de48f5c4d405a4400239215fe3dc7f30df370951e51743ca crond.run +f24b5c4bbd14270de74ff44595a98c750b249c3e956fa363cad6b6a59a1f3a7f default.script 2fc84cd00bba1a27bb692fb61f7b06307bd2a618161c1f019efd5a8432b0f3c5 fsck-resolve-uuid.patch 91df6065aec94c67f59f0d10e7beb1cd05286d8739bf57f478382a98d2ef90a5 httpd.run 1e7ca4ffd2de2182a591c0c9eb8f1f2d792342db96a44762a4ef022253aaaa5c inetd.run @@ -16,6 +17,8 @@ e8fa37d2abb51c4d75d473b0b495b245afee37e48e80b8a4fd5b3539bc06ad68 klogd.run a8be467d592f549df6405baa7e6228fd4363c759200161222a4b23e72ebd65f2 mdev.conf 12e52732c806aaebd01f6ca9a88594d3be568eb157e44208dde64237b5cfd8af mdev.run 0e7127f64ee6760d433ceff02e3c6300c5cbf35ac0172037c68725538babd32c modprobe-kernel-version.patch +2855fddb9955070b89ae1d873e63024f3831b2b7e1db0d9ad45fd401a51af0f3 net-static.conf +7a856c0c7a8faf52fa48b25023c8cc3c1f7f54f11b70af06f35feac57d1e9a3d net-static.run e6c26ac11e580f48a8578d6e116d0d7c293a2939e5c4d85d0a094094886850c9 ntpd.run 71446b4690cd21f8e5fddd85f6fbf70c4bfbe1998988764e572021ee674d6790 pause.1 8a3b2dc28757685ce69dd472483127d47703f4f7995395f1980745f3b1bf88b0 pause.c @@ -27,3 +30,5 @@ f220e64f2c99e5fae0bf764a750dcab6b91568f8afbee791949b43bc189cc8c0 tty1.run 308c64afb0fac11a04ca7acdbd03d376ef3fc034ce60e0aff5cf639cd0a2844a tty4.run 7c60f858969c374e06d03c1d649696d4242f43676ef8e7dd6cdf606a4e583592 tty5.run e1fb7d9b56a24067762dd7a931e95a2c6b271134d90b9dc10a57502e2b05dae2 ttyS0.run +9515af6267864a2233389892714eec863ddf50eeb5f738f5be05ff69c89ac4b9 udhcpc.conf +9264db7730978f6f5a0fbe82bbfcc5bbe10991483a9dc31ab4b26c3374020658 udhcpc.run diff --git a/repos/core/busybox/.files b/repos/core/busybox/.files index e8ef6101..8cd93cfc 100644 --- a/repos/core/busybox/.files +++ b/repos/core/busybox/.files @@ -110,6 +110,8 @@ lrwxrwxrwx root/root etc/sv/klogd/supervise -> ../../../run/runit/supervise.k drwxr-xr-x root/root etc/sv/mdev/ -rwxr-xr-x root/root etc/sv/mdev/run.new lrwxrwxrwx root/root etc/sv/mdev/supervise -> ../../../run/runit/supervise.mdev +drwxr-xr-x root/root etc/sv/net-static/ +-rw-r--r-- root/root etc/sv/net-static/conf.new drwxr-xr-x root/root etc/sv/ntpd/ -rwxr-xr-x root/root etc/sv/ntpd/run.new lrwxrwxrwx root/root etc/sv/ntpd/supervise -> ../../../run/runit/supervise.ntpd @@ -134,6 +136,10 @@ lrwxrwxrwx root/root etc/sv/tty5/supervise -> ../../../run/runit/supervise.tt drwxr-xr-x root/root etc/sv/ttyS0/ -rwxr-xr-x root/root etc/sv/ttyS0/run.new lrwxrwxrwx root/root etc/sv/ttyS0/supervise -> ../../../run/runit/supervise.ttyS0 +drwxr-xr-x root/root etc/sv/udhcpc/ +-rw-r--r-- root/root etc/sv/udhcpc/conf.new +-rwxr-xr-x root/root etc/sv/udhcpc/run.new +lrwxrwxrwx root/root etc/sv/udhcpc/supervise -> ../../../run/runit/supervise.udhcpc drwxr-xr-x root/root sbin/ lrwxrwxrwx root/root sbin/acpid -> ../bin/busybox lrwxrwxrwx root/root sbin/adjtimex -> ../bin/busybox @@ -215,6 +221,7 @@ lrwxrwxrwx root/root usr/bin/chpst -> ../../bin/busybox lrwxrwxrwx root/root usr/bin/chrt -> ../../bin/busybox lrwxrwxrwx root/root usr/bin/chvt -> ../../bin/busybox lrwxrwxrwx root/root usr/bin/cksum -> ../../bin/busybox +lrwxrwxrwx root/root usr/bin/clear -> ../../bin/busybox lrwxrwxrwx root/root usr/bin/cmp -> ../../bin/busybox lrwxrwxrwx root/root usr/bin/comm -> ../../bin/busybox lrwxrwxrwx root/root usr/bin/crc32 -> ../../bin/busybox @@ -292,6 +299,7 @@ lrwxrwxrwx root/root usr/bin/pwdx -> ../../bin/busybox lrwxrwxrwx root/root usr/bin/readlink -> ../../bin/busybox lrwxrwxrwx root/root usr/bin/realpath -> ../../bin/busybox lrwxrwxrwx root/root usr/bin/renice -> ../../bin/busybox +lrwxrwxrwx root/root usr/bin/reset -> ../../bin/busybox lrwxrwxrwx root/root usr/bin/resize -> ../../bin/busybox lrwxrwxrwx root/root usr/bin/runsv -> ../../bin/busybox lrwxrwxrwx root/root usr/bin/runsvdir -> ../../bin/busybox @@ -427,3 +435,9 @@ drwxr-xr-x root/root usr/share/busybox/ drwxr-xr-x root/root usr/share/man/ drwxr-xr-x root/root usr/share/man/man1/ -rw-r--r-- root/root usr/share/man/man1/pause.1.gz +drwxr-xr-x root/root usr/share/udhcpc/ +-rwxr-xr-x root/root usr/share/udhcpc/default.script +drwxr-xr-x root/root var/ +drwxr-xr-x root/root var/spool/ +drwxr-xr-x root/root var/spool/cron/ +drwxr-xr-x root/root var/spool/cron/crontabs/ diff --git a/repos/core/busybox/abuild b/repos/core/busybox/abuild index 2b177b61..ba544675 100644 --- a/repos/core/busybox/abuild +++ b/repos/core/busybox/abuild @@ -1,6 +1,6 @@ name=busybox version=1.37.0 -release=3 +release=4 source="https://${name}.net/downloads/${name}-${version}.tar.bz2 0001-awk-fix-handling-of-literal-backslashes-in-replaceme.patch 0016-ping-make-ping-work-without-root-privileges.patch @@ -14,14 +14,18 @@ source="https://${name}.net/downloads/${name}-${version}.tar.bz2 modprobe-kernel-version.patch busybox-suidwrapper.c mdev.conf + udhcpc.conf + net-static.conf acpid.run crond.run ntpd.run syslogd.run - klogd.run - inetd.run - httpd.run - mdev.run + udhcpc.run + klogd.run + inetd.run + httpd.run + mdev.run + net-static.run tty1.run tty2.run tty3.run @@ -29,7 +33,8 @@ source="https://${name}.net/downloads/${name}-${version}.tar.bz2 tty5.run ttyS0.run pause.c - pause.1" + pause.1 + default.script" sv="acpid.run crond.run ntpd.run @@ -38,12 +43,15 @@ sv="acpid.run inetd.run httpd.run mdev.run + udhcpc.run tty1.run tty2.run tty3.run tty4.run tty5.run - ttyS0.run" + ttyS0.run + net-static.conf + udhcpc.conf" _disable() { while [ "$1" ]; do @@ -64,7 +72,7 @@ build() { _disable XZCAT XZ UNXZ UNLZMA LZCAT LZMA # provided by xz _disable STRINGS # provided by llvm - _disable CLEAR RESET # provided by ncurses + #_disable CLEAR RESET # provided by ncurses _disable PATCH # provided by patch (GNU patch works better) _disable BZCAT BUNZIP2 BZIP2 # provided by bzip2 _disable CHATTR LSATTR MKE2FS FINDFS MKFS_EXT2 BLKID # provided by e2fsprogs @@ -95,10 +103,18 @@ build() { [ -e /bin/$i ] && ln -svf busybox-suidwrapper $PKG/bin/$i [ -e /usr/bin/$i ] && ln -svf ../../bin/busybox-suidwrapper $PKG/usr/bin/$i done - + + # mdev mkdir -p $PKG/etc install -m644 $SRC/mdev.conf $PKG/etc/mdev.conf + + # udhcpc script + mkdir -p $PKG/usr/share/udhcpc + install -m755 $SRC/default.script $PKG/usr/share/udhcpc/default.script + # crond + mkdir -p $PKG/var/spool/cron/crontabs + ${CC:-gcc} ${CFLAGS} $SRC/pause.c -o $PKG/usr/bin/pause install -d $PKG/usr/share/man/man1 install -m644 $SRC/pause.1 $PKG/usr/share/man/man1/pause.1 diff --git a/repos/core/busybox/crond.run b/repos/core/busybox/crond.run index dda94538..aac79c16 100755 --- a/repos/core/busybox/crond.run +++ b/repos/core/busybox/crond.run @@ -1,3 +1,2 @@ #!/bin/sh -mkdir -p /var/spool/cron/crontabs/ exec crond -f -d8 2>&1 diff --git a/repos/core/busybox/default.script b/repos/core/busybox/default.script new file mode 100755 index 00000000..e6e51f68 --- /dev/null +++ b/repos/core/busybox/default.script @@ -0,0 +1,13 @@ +#!/bin/sh + +case "$1" in + deconfig) + ip addr flush dev "$interface" + ;; + bound|renew|leasefail) + ip addr flush dev "$interface" + ip addr add "$ip/$subnet" dev "$interface" + ip route add default via "$router" + echo "nameserver $dns" > /etc/resolv.conf + ;; +esac diff --git a/repos/core/busybox/net-static.conf b/repos/core/busybox/net-static.conf new file mode 100644 index 00000000..83f7b1b3 --- /dev/null +++ b/repos/core/busybox/net-static.conf @@ -0,0 +1,7 @@ +# config for net-static service + +#IFACE="wlan0" +#IP="192.168.1.2" +#NETMASK="24" +#GATEWAY="192.168.1.1" + diff --git a/repos/core/busybox/net-static.run b/repos/core/busybox/net-static.run new file mode 100755 index 00000000..0a43abee --- /dev/null +++ b/repos/core/busybox/net-static.run @@ -0,0 +1,23 @@ +#!/bin/sh +exec 2>&1 + +[ -f ./conf ] && . ./conf + +# bring interface up +ip link set "${IFACE:-wlan0}" up + +# flush old IPs +ip addr flush dev "${IFACE:-wlan0}" + +# assign static IP +ip addr add "${IP:-192.168.1.22}/${NETMASK:-24}" dev "${IFACE:-wlan0}" + +# set default route +ip route add default via "${GATEWAY:-192.168.1.1}" + +# configure DNS +echo "nameserver ${GATEWAY:-192.168.1.1}" > /etc/resolv.conf +echo "nameserver 8.8.8.8" >> /etc/resolv.conf + +# block forever so runit keeps it "up" +exec sleep infinity diff --git a/repos/core/busybox/udhcpc.conf b/repos/core/busybox/udhcpc.conf new file mode 100644 index 00000000..e1625f02 --- /dev/null +++ b/repos/core/busybox/udhcpc.conf @@ -0,0 +1,3 @@ +# config file for udhcpc service + +#IFACE=wlan0 diff --git a/repos/core/busybox/udhcpc.run b/repos/core/busybox/udhcpc.run new file mode 100755 index 00000000..2336c915 --- /dev/null +++ b/repos/core/busybox/udhcpc.run @@ -0,0 +1,13 @@ +#!/bin/sh +exec 2>&1 +[ -f ./conf ] && . ./conf +if [ ! "$IFACE" ]; then + for i in /sys/class/net/*; do + [ -e $i/phy80211 ] && { + IFACE=${i##*/} + break + } + done +fi +[ "$IFACE" ] || exit 1 +exec udhcpc -f -i $IFACE |