configurable busybox

allows modules to add to the busybox applets and change config
This commit is contained in:
Daniel Barlow
2023-03-10 18:40:45 +00:00
parent 8b2fcb5336
commit 225fc6fe51
10 changed files with 101 additions and 20 deletions

View File

@@ -1,7 +1,6 @@
{
liminix
, lib
, busybox
, ppp
, pppoe
, writeAshScript

View File

@@ -1,6 +1,5 @@
{
liminix
, busybox
, writeAshScript
, serviceFns
} :
@@ -43,7 +42,7 @@ let
'';
in longrun {
inherit name;
run = "${busybox}/bin/udhcpc -f -i ${interface.device} -x hostname:$(cat /proc/sys/kernel/hostname) -s ${script}";
run = "/bin/udhcpc -f -i ${interface.device} -x hostname:$(cat /proc/sys/kernel/hostname) -s ${script}";
notification-fd = 10;
dependencies = [ interface ] ++ dependencies;
}

View File

@@ -3,7 +3,6 @@
, s6-rc
, s6
, lib
, busybox
, callPackage
, writeScript
, serviceFns
@@ -12,7 +11,7 @@ let
inherit (builtins) concatStringsSep;
output = service: name: "/run/service-state/${service.name}/${name}";
serviceScript = commands : ''
#!${busybox}/bin/sh
#!/bin/sh
exec 2>&1
. ${serviceFns}
${commands}

View File

@@ -4,7 +4,6 @@
, writeScript
, stdenvNoCC
, lib
, busybox
, s6-rc
}:
let
@@ -14,7 +13,7 @@ let
'';
init = writeScript "init" ''
#!${execline}/bin/execlineb -S0
${s6-linux-init}/bin/s6-linux-init -c /etc/s6-linux-init/current -m 0022 -p ${lib.makeBinPath [busybox execline s6-linux-init s6-rc]}:/usr/bin:/bin -d /dev -- "\$@"
${s6-linux-init}/bin/s6-linux-init -c /etc/s6-linux-init/current -m 0022 -p ${lib.makeBinPath [execline s6-linux-init s6-rc]}:/usr/bin:/bin -d /dev -- "\$@"
'';
in stdenvNoCC.mkDerivation {
name = "s6-init-bin";

View File

@@ -1,14 +1,13 @@
{
busybox
, writeScript
writeScript
, lib
}
: name : { runtimeInputs ? [] } : text : writeScript name ''
#!${busybox}/bin/sh
#!/bin/sh
set -o errexit
set -o nounset
set -o pipefail
export PATH="${lib.makeBinPath ([ busybox ] ++ runtimeInputs)}:$PATH"
export PATH="${lib.makeBinPath runtimeInputs}:$PATH"
${text}
''