build: fix symlinks

This commit is contained in:
William Hubbs 2021-09-08 11:59:25 -05:00
parent 803aa1c637
commit 46a0bfedd1
3 changed files with 14 additions and 1 deletions

View File

@ -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)

View File

@ -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

View File

@ -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}"