aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremmett1 <emmett1.2miligrams@protonmail.com>2024-08-21 19:49:13 +0800
committeremmett1 <emmett1.2miligrams@protonmail.com>2024-08-21 19:49:13 +0800
commit13130691a57ede2e08626da0e3c136d6bc86ddf8 (patch)
tree1158b3c915155d17383c3eae1f782b80c8b90e87
parentd1ba430f85b2742cd7fe5f68cb5973264925f036 (diff)
downloadalicelinux-13130691a57ede2e08626da0e3c136d6bc86ddf8.tar.gz
alicelinux-13130691a57ede2e08626da0e3c136d6bc86ddf8.zip
added pause
-rw-r--r--repos/core/busybox/.files4
-rw-r--r--repos/core/busybox/abuild27
-rwxr-xr-xrepos/core/busybox/pause.139
-rwxr-xr-xrepos/core/busybox/pause.c20
4 files changed, 77 insertions, 13 deletions
diff --git a/repos/core/busybox/.files b/repos/core/busybox/.files
index a119564d..a855702c 100644
--- a/repos/core/busybox/.files
+++ b/repos/core/busybox/.files
@@ -261,6 +261,7 @@ lrwxrwxrwx root/root usr/bin/od -> ../../bin/busybox
lrwxrwxrwx root/root usr/bin/openvt -> ../../bin/busybox
lrwxrwxrwx root/root usr/bin/passwd -> ../../bin/busybox-suid
lrwxrwxrwx root/root usr/bin/paste -> ../../bin/busybox
+-rwxr-xr-x root/root usr/bin/pause
lrwxrwxrwx root/root usr/bin/pgrep -> ../../bin/busybox
lrwxrwxrwx root/root usr/bin/pkill -> ../../bin/busybox
lrwxrwxrwx root/root usr/bin/pmap -> ../../bin/busybox
@@ -402,3 +403,6 @@ lrwxrwxrwx root/root usr/sbin/udhcpd -> ../../bin/busybox
drwxr-xr-x root/root usr/share/
drwxr-xr-x root/root usr/share/busybox/
-rw-r--r-- root/root usr/share/busybox/config
+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
diff --git a/repos/core/busybox/abuild b/repos/core/busybox/abuild
index 3242e20e..b320b54d 100644
--- a/repos/core/busybox/abuild
+++ b/repos/core/busybox/abuild
@@ -1,6 +1,6 @@
name=busybox
version=1.36.1
-release=1
+release=2
source="https://${name}.net/downloads/${name}-${version}.tar.bz2
config
mdev.conf
@@ -22,7 +22,9 @@ source="https://${name}.net/downloads/${name}-${version}.tar.bz2
tty3.run
tty4.run
tty5.run
- ttyS0.run"
+ ttyS0.run
+ pause.c
+ pause.1"
sv="acpid.run
crond.run
ntpd.run
@@ -35,19 +37,14 @@ sv="acpid.run
ttyS0.run"
build() {
- #make defconfig
- #sed -i "s/# CONFIG_STATIC .*/CONFIG_STATIC=y/" .config
-
- #for o in LINUXRC STRINGS XZ UNXZ XZCAT LZCAT UNLZMA LZMA PATCH BZIP2 BZCAT BUNZIP2; do
- # sed -i "s/CONFIG_${o}=y/# CONFIG_${o} is not set/" .config
- #done
-
- #sed -i "s/^CONFIG_MODPROBE_SMALL*/# CONFIG_MODPROBE_SMALL is not set/" .config
-
+ if [ "$BOOTSTRAP" ]; then
+ _opt="ARCH=$CARCH CROSS_COMPILE=$CTARGET-"
+ fi
+
cp $SRC/config .config
#make menuconfig
- make
- make CONFIG_PREFIX=$PKG install
+ make $_opt
+ make $_opt CONFIG_PREFIX=$PKG install
mkdir -p $PKG/usr/share/busybox
cat .config > $PKG/usr/share/busybox/config
@@ -92,4 +89,8 @@ build() {
rm $PKG/usr/bin/diff
ln -s busybox $PKG/bin/diff
+
+ ${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/pause.1 b/repos/core/busybox/pause.1
new file mode 100755
index 00000000..1e56f20a
--- /dev/null
+++ b/repos/core/busybox/pause.1
@@ -0,0 +1,39 @@
+.Dd September 27, 2012
+.Dt PAUSE 1
+.Os Linux
+.Sh NAME
+.Nm pause
+.Nd don't exit, efficiently
+.Sh SYNOPSIS
+.Nm pause
+.Sh DESCRIPTION
+.Nm pause
+waits to be terminated by a signal.
+It can be used when service supervision is used but there is no
+long-running program to supervise.
+.Nm pause
+uses minimal system resources.
+.Sh EXAMPLES
+Setting up a static IP address with
+.Xr plugsv 8 .
+.Pp
+.Pa /etc/netsv/eth0/run :
+.Bd -literal -offset indent
+#!/bin/sh
+ip link set eth0 up
+ip addr add 192.0.2.1/24 dev eth0
+exec pause
+.Ed
+.Pp
+.Pa /etc/netsv/eth0/finish :
+.Bd -literal -offset indent
+#!/bin/sh
+ip addr del 192.0.2.1/24 dev eth0
+ip link set eth0 down
+.Ed
+.Sh SEE ALSO
+.Xr sleep 1 ,
+.Xr pause 2
+.Sh AUTHOR
+.An Leah Neukirchen ,
+.Mt leah@vuxu.org .
diff --git a/repos/core/busybox/pause.c b/repos/core/busybox/pause.c
new file mode 100755
index 00000000..4825df6b
--- /dev/null
+++ b/repos/core/busybox/pause.c
@@ -0,0 +1,20 @@
+#include <unistd.h>
+#include <signal.h>
+
+static void
+nop(int sig)
+{
+}
+
+int
+main()
+{
+ signal(SIGTERM, nop);
+ signal(SIGINT, nop);
+ signal(SIGHUP, SIG_IGN);
+
+ pause();
+
+ return 0;
+}
+