mirror of
https://github.com/kairos-io/kcrypt.git
synced 2025-08-16 06:33:00 +00:00
Try to wait for oem mount instead
This commit is contained in:
parent
b3d7b86591
commit
7f397a3459
@ -7,31 +7,29 @@ GENERATOR_DIR="$2"
|
|||||||
[ -z "$GENERATOR_DIR" ] && exit 1
|
[ -z "$GENERATOR_DIR" ] && exit 1
|
||||||
[ -d "$GENERATOR_DIR" ] || mkdir "$GENERATOR_DIR"
|
[ -d "$GENERATOR_DIR" ] || mkdir "$GENERATOR_DIR"
|
||||||
|
|
||||||
if getargbool 0 rd.neednet; then
|
oem_label=$(getarg rd.cos.oemlabel=)
|
||||||
{
|
neednet="rd.neednet"
|
||||||
|
|
||||||
|
# See https://github.com/kairos-io/packages/blob/d12b12b043a71d8471454f7b4fc84c3181d2bf60/packages/system/dracut/immutable-rootfs/30cos-immutable-rootfs/cos-generator.sh#L29
|
||||||
|
{
|
||||||
echo "[Unit]"
|
echo "[Unit]"
|
||||||
echo "DefaultDependencies=no"
|
echo "DefaultDependencies=no"
|
||||||
echo "Description=kcrypt online mount"
|
echo "Description=kcrypt online mount"
|
||||||
echo "Before=cos-immutable-rootfs.service"
|
echo "Before=cos-immutable-rootfs.service"
|
||||||
echo "After=network-online.target"
|
if getargbool 0 $neednet; then
|
||||||
echo "Wants=network-online.target"
|
echo "Wants=network-online.target"
|
||||||
|
echo "After=network-online.target"
|
||||||
|
fi
|
||||||
|
# OEM is special as kcrypt plugins might need that in order to unlock other partitions and plugins can reside in /oem as well and kcrypt needs to find them
|
||||||
|
if [ -n "${oem_label}" ]; then
|
||||||
|
echo "After=oem.mount"
|
||||||
|
fi
|
||||||
echo "[Service]"
|
echo "[Service]"
|
||||||
echo "Type=oneshot"
|
echo "Type=oneshot"
|
||||||
echo "RemainAfterExit=no"
|
echo "RemainAfterExit=no"
|
||||||
echo "ExecStart=/sbin/kcrypt-mount-local"
|
echo "ExecStart=/sbin/kcrypt-mount-local"
|
||||||
} > "$GENERATOR_DIR"/kcrypt.service
|
} > "$GENERATOR_DIR"/kcrypt.service
|
||||||
else
|
|
||||||
{
|
|
||||||
echo "[Unit]"
|
|
||||||
echo "DefaultDependencies=no"
|
|
||||||
echo "Description=kcrypt mount"
|
|
||||||
echo "Before=cos-immutable-rootfs.service"
|
|
||||||
echo "[Service]"
|
|
||||||
echo "Type=oneshot"
|
|
||||||
echo "RemainAfterExit=no"
|
|
||||||
echo "ExecStart=/sbin/kcrypt-mount-local"
|
|
||||||
} > "$GENERATOR_DIR"/kcrypt.service
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -e "$GENERATOR_DIR/initrd-fs.target.requires/kcrypt.service" ]; then
|
if [ ! -e "$GENERATOR_DIR/initrd-fs.target.requires/kcrypt.service" ]; then
|
||||||
mkdir -p "$GENERATOR_DIR"/initrd-fs.target.requires
|
mkdir -p "$GENERATOR_DIR"/initrd-fs.target.requires
|
||||||
|
Loading…
Reference in New Issue
Block a user