From 05afc39b817385fbad2688ffef07323ae892e983 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Thu, 18 Sep 2025 20:12:00 +0200 Subject: [PATCH] Add std-stream oneshot service --- README.md | 5 +++++ busybox/std-stream/dependencies | 1 + busybox/std-stream/type | 1 + busybox/std-stream/up | 12 ++++++++++++ 4 files changed, 19 insertions(+) create mode 100644 busybox/std-stream/dependencies create mode 100644 busybox/std-stream/type create mode 100644 busybox/std-stream/up diff --git a/README.md b/README.md index 7d3dc3d..839ddbc 100644 --- a/README.md +++ b/README.md @@ -1 +1,6 @@ Some s6 service definitions for third-party software on Slackware Linux. + +## busybox + +This directory contains scripts that can be used on embedded Linux systems +(riscv32). diff --git a/busybox/std-stream/dependencies b/busybox/std-stream/dependencies new file mode 100644 index 0000000..8b71071 --- /dev/null +++ b/busybox/std-stream/dependencies @@ -0,0 +1 @@ +procfs diff --git a/busybox/std-stream/type b/busybox/std-stream/type new file mode 100644 index 0000000..bdd22a1 --- /dev/null +++ b/busybox/std-stream/type @@ -0,0 +1 @@ +oneshot diff --git a/busybox/std-stream/up b/busybox/std-stream/up new file mode 100644 index 0000000..4bf594a --- /dev/null +++ b/busybox/std-stream/up @@ -0,0 +1,12 @@ +################################################ +# Create symlinks for standard streams in /dev # +################################################ + +if { ln -sf /proc/self/fd /dev/fd } +forx STREAM { "0 stdin" "1 stdout" "2 stderr" } +importas -Sus STREAM +backtick ARGUMENTS { + printf "/proc/self/fd/%i /dev/%s" $STREAM +} +importas -Ssu ARGUMENTS +ln -sf $ARGUMENTS