Add online service

This commit is contained in:
Ettore Di Giacinto 2022-10-15 17:17:10 +00:00
parent 4c073ca50c
commit d496900927
4 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,12 @@
[Unit]
Description=kcrypt online mount
DefaultDependencies=no
Before=cos-immutable-rootfs.service
After=network-online.target
Wants=network-online.target
ConditionKernelCommandLine=rd.neednet=1
[Service]
Type=oneshot
RemainAfterExit=no
ExecStart=/sbin/kcrypt-mount-local

View File

@ -2,6 +2,7 @@
Description=kcrypt mount
DefaultDependencies=no
Before=cos-immutable-rootfs.service
ConditionKernelCommandLine=!rd.neednet=1
[Service]
Type=oneshot

View File

@ -31,8 +31,14 @@ install() {
#inst_hook pre-trigger 10 "$moddir/mount-local.sh"
inst_simple "${moddir}/kcrypt.service" \
"${systemdsystemunitdir}/kcrypt.service"
inst_simple "${moddir}/kcrypt-online.service" \
"${systemdsystemunitdir}/kcrypt-online.service"
mkdir -p "${initdir}/${systemdsystemunitdir}/initrd-fs.target.requires"
ln_r "../kcrypt.service" \
"${systemdsystemunitdir}/initrd-fs.target.requires/kcrypt.service"
ln_r "../kcrypt-online.service" \
"${systemdsystemunitdir}/initrd-fs.target.requires/kcrypt-online.service"
dracut_need_initqueue
}

View File

@ -2,6 +2,10 @@
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
PATH=/usr/sbin:/usr/bin:/sbin:/bin
OEM=$(blkid -L COS_OEM)
if [ "$OEM" != "" ]; then
mkdir /oem