aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--meson.build3
-rwxr-xr-xscripts/meson_script_links.sh5
-rwxr-xr-xtools/meson_runlevels.sh7
3 files changed, 14 insertions, 1 deletions
diff --git a/meson.build b/meson.build
index d13b5027..51adee4a 100644
--- a/meson.build
+++ b/meson.build
@@ -180,7 +180,8 @@ meson.add_install_script('tools/meson_runlevels.sh',
os,
get_option('newnet') ? 'yes' : 'no',
rc_libexecdir,
- get_option('sysconfdir'))
+ get_option('sysconfdir'),
+ get_option('sysvinit') ? 'yes' : 'no')
meson.add_install_script('tools/meson_final.sh',
rc_libexecdir,
os)
diff --git a/scripts/meson_script_links.sh b/scripts/meson_script_links.sh
index dcb8f1d5..d49a433d 100755
--- a/scripts/meson_script_links.sh
+++ b/scripts/meson_script_links.sh
@@ -12,3 +12,8 @@ for f in $binaries; do
"${DESTDIR}${sbindir}/${f}"
fi
done
+# sysvinit is active when halt exits
+if [ -x "${DESTDIR}${rc_libexecdir}/bin/halt" ]; then
+ ln -snf "${DESTDIR}${sbindir}/openrc-init" \
+ "${DESTDIR}${sbindir}/init"
+fi
diff --git a/tools/meson_runlevels.sh b/tools/meson_runlevels.sh
index 7cf068a9..e5f5aeaa 100755
--- a/tools/meson_runlevels.sh
+++ b/tools/meson_runlevels.sh
@@ -7,6 +7,7 @@ os="$1"
net="$2"
rc_libexecdir="$3"
sysconfdir="$4"
+sysvinit="$5"
init_d_dir="${sysconfdir}/init.d"
leveldir="${sysconfdir}/runlevels"
@@ -90,5 +91,11 @@ if ! test -d "${DESTDIR}${shutdowndir}"; then
ln -snf "${init_d_dir}/$x" "${DESTDIR}${shutdowndir}/$x"
done
fi
+if test "${sysvinit}" = yes && test "${os}" = Linux; then \
+ for x in tty1 tty2 tty3 tty4 tty5 tty6; do
+ ln -snf "${init_d_dir}/agetty" "${DESTDIR}/${init_d_dir}/agetty.$x"
+ ln -snf "${init_d_dir}/agetty.$x" "${DESTDIR}/${defaultdir}/agetty.$x"
+ done;
+fi
ln -snf "${rc_libexecdir}"/sh/functions.sh "${DESTDIR}/${init_d_dir}"