aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rwxr-xr-xcore/baselayout/build2
-rw-r--r--core/baselayout/checksums1
-rwxr-xr-xcore/baselayout/files/install-sv34
-rw-r--r--core/baselayout/sources1
-rw-r--r--core/baselayout/version2
5 files changed, 39 insertions, 1 deletions
diff --git a/core/baselayout/build b/core/baselayout/build
index b94b05be..d55a8d0f 100755
--- a/core/baselayout/build
+++ b/core/baselayout/build
@@ -70,4 +70,6 @@ kinstall_t 644 "$1/etc" fstab group host.conf hosts issue keymap os-release \
passwd profile securetty shells mime.types
kinstall_t 600 "$1/etc" crypttab shadow
+kinstall_t 755 "$1/usr/bin" install-sv
+
ln -s /proc/self/mounts "$1/etc/mtab"
diff --git a/core/baselayout/checksums b/core/baselayout/checksums
index 9a7938d6..b4b4e3d2 100644
--- a/core/baselayout/checksums
+++ b/core/baselayout/checksums
@@ -1,4 +1,5 @@
3698c87cc3af757f0302f6d7f034350b1b22a7f25b2f71944292d0fb3de67cd7 crypttab
+898834c6adcadd039e56b7c362ae357a54166a7c01348c6413a4117e662e4605 install-sv
f85cb0b07f49ff20c4838c267ffb093a136fb5bfdf01badcb03eced852ffea89 fstab
38c9f4047ba597248ef199a77afbd36f873cfa4aeb70de90bac7f237faf2ecba group
a0fa9cd303cf7f1718f51e5624a671a418946718b790508b8988bccd542c6451 host.conf
diff --git a/core/baselayout/files/install-sv b/core/baselayout/files/install-sv
new file mode 100755
index 00000000..509b2516
--- /dev/null
+++ b/core/baselayout/files/install-sv
@@ -0,0 +1,34 @@
+#!/bin/sh -e
+# Carbs Linux service installer
+
+usage() {
+ printf '%s\n' \
+ "usage: ${0##*/} [FILE...]" \
+ "or: ${0##*/} [-a NAME FILE]" "" \
+ "You can set the DESTDIR environment variable to set a different root."
+ exit 1
+}
+
+svname=''
+case "$1" in
+ --help|-h|'') usage ;;
+ -a) [ "$#" -eq 3 ] || usage
+ svname=$2; shift 2
+esac
+
+for service; do
+ # Remove .run suffix and the directory name for service files.
+ sv=${svname:-${service%.run}} sv=${sv##*/}
+
+ # Create the service directories and copy the service file to them.
+ mkdir -p "$DESTDIR/etc/sysmgr" "$DESTDIR/etc/sv/$sv"
+ cp "$service" "$DESTDIR/etc/sysmgr/$sv"
+ cp "$service" "$DESTDIR/etc/sv/$sv/run"
+
+ # Set permissions for the services.
+ chmod 0755 "$DESTDIR/etc/sysmgr/$sv" "$DESTDIR/etc/sv/$sv/run"
+
+ # Create supervise directories for runit.
+ ln -s "/run/runit/supervise.$sv" "$DESTDIR/etc/sv/$sv/supervise"
+
+done
diff --git a/core/baselayout/sources b/core/baselayout/sources
index a663d479..44f9434f 100644
--- a/core/baselayout/sources
+++ b/core/baselayout/sources
@@ -1,4 +1,5 @@
files/crypttab
+files/install-sv
files/fstab
files/group
files/host.conf
diff --git a/core/baselayout/version b/core/baselayout/version
index 0d6a524b..cba3471e 100644
--- a/core/baselayout/version
+++ b/core/baselayout/version
@@ -1 +1 @@
-1 5
+2 1