aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2025-11-09 00:57:58 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2025-11-09 00:57:58 +0000
commitf994407328292d9e5788ab81a9fc6afe36091e46 (patch)
treef316ff6191f369e4839b4ccc9f7c8b213a2a3554
parent7f6bc9d2ba0e3397c6d23f58a0535f2937548067 (diff)
downloads6-rc-f994407328292d9e5788ab81a9fc6afe36091e46.tar.gz
Make default bundle name configurable
-rwxr-xr-xconfigure4
-rw-r--r--package/configure-snippets/configure_case_lines1
-rw-r--r--package/configure-snippets/configure_generate_configh1
-rw-r--r--package/configure-snippets/configure_help_options1
-rw-r--r--package/configure-snippets/configure_init_vars1
-rw-r--r--src/repo/s6-rc-set-commit.c2
6 files changed, 9 insertions, 1 deletions
diff --git a/configure b/configure
index c298570..87bb7dd 100755
--- a/configure
+++ b/configure
@@ -51,6 +51,7 @@ Optional features:
--enable-pkgconfig Build and install .pc files for pkg-config [disabled]
--enable-slashpackage[=ROOT] assume /package installation at ROOT [disabled]
--enable-absolute-paths hardcode absolute BINDIR/foobar paths in binaries [disabled]
+ --with-default-bundle=def name of the bundle started at boot [default]
EOF
exit 0
@@ -174,6 +175,7 @@ build=
bootdb=/etc/s6-rc/compiled/current
livedir=/run/s6-rc
repodir=/var/lib/s6-rc/repository
+defaultbundle=default
for arg ; do
case "$arg" in
@@ -214,6 +216,7 @@ for arg ; do
--bootdb=*) bootdb=${arg#*=} ;;
--livedir=*) livedir=${arg#*=} ;;
--repodir=*) repodir=${arg#*=} ;;
+ --with-default-bundle=*) defaultbundle=${arg#*=} ;;
--enable-*|--disable-*|--with-*|--without-*|--*dir=*) ;;
--enable-*|--disable-*|--with-*|--without-*|--*dir=*) ;;
@@ -555,6 +558,7 @@ echo "#define ${package_macro_name}_SYSCONFPREFIX \"$sysconfdir/\""
echo "#define ${package_macro_name}_BOOTDB \"$bootdb\""
echo "#define ${package_macro_name}_LIVEDIR \"$livedir\""
echo "#define ${package_macro_name}_REPODIR \"$repodir\""
+echo "#define ${package_macro_name}_DEFBUNDLE \"$defaultbundle\""
echo
echo "#endif"
diff --git a/package/configure-snippets/configure_case_lines b/package/configure-snippets/configure_case_lines
index 1dcbf11..87c8df8 100644
--- a/package/configure-snippets/configure_case_lines
+++ b/package/configure-snippets/configure_case_lines
@@ -1,4 +1,5 @@
--bootdb=*) bootdb=${arg#*=} ;;
--livedir=*) livedir=${arg#*=} ;;
--repodir=*) repodir=${arg#*=} ;;
+ --with-default-bundle=*) defaultbundle=${arg#*=} ;;
diff --git a/package/configure-snippets/configure_generate_configh b/package/configure-snippets/configure_generate_configh
index ba49153..3a43da6 100644
--- a/package/configure-snippets/configure_generate_configh
+++ b/package/configure-snippets/configure_generate_configh
@@ -1,4 +1,5 @@
echo "#define ${package_macro_name}_BOOTDB \"$bootdb\""
echo "#define ${package_macro_name}_LIVEDIR \"$livedir\""
echo "#define ${package_macro_name}_REPODIR \"$repodir\""
+echo "#define ${package_macro_name}_DEFBUNDLE \"$defaultbundle\""
diff --git a/package/configure-snippets/configure_help_options b/package/configure-snippets/configure_help_options
index 8b13789..e003d52 100644
--- a/package/configure-snippets/configure_help_options
+++ b/package/configure-snippets/configure_help_options
@@ -1 +1,2 @@
+ --with-default-bundle=def name of the bundle started at boot [default]
diff --git a/package/configure-snippets/configure_init_vars b/package/configure-snippets/configure_init_vars
index 04e5418..effff4f 100644
--- a/package/configure-snippets/configure_init_vars
+++ b/package/configure-snippets/configure_init_vars
@@ -1,3 +1,4 @@
bootdb=/etc/s6-rc/compiled/current
livedir=/run/s6-rc
repodir=/var/lib/s6-rc/repository
+defaultbundle=default
diff --git a/src/repo/s6-rc-set-commit.c b/src/repo/s6-rc-set-commit.c
index 45d5708..7612506 100644
--- a/src/repo/s6-rc-set-commit.c
+++ b/src/repo/s6-rc-set-commit.c
@@ -62,7 +62,7 @@ int main (int argc, char const *const *argv)
PROG = "s6-rc-set-commit" ;
wgola[GOLA_REPODIR] = S6RC_REPODIR ;
- wgola[GOLA_DEFBUNDLE] = "default" ;
+ wgola[GOLA_DEFBUNDLE] = S6RC_DEFBUNDLE ;
golc = GOL_main(argc, argv, rgolb, rgola, &wgolb, wgola) ;
argc -= golc ; argv += golc ;