From 9c7c27af89d709a32b18db9a86b88b5165dfedbf Mon Sep 17 00:00:00 2001 From: Itxaka Date: Wed, 1 Mar 2023 12:42:35 +0100 Subject: [PATCH 1/3] Skip kcrypt on non-immmutable systems Disable the module creating any services if the inmutability layer is not gonna run as it makes no sense to load kcrypt if we are not mounting our stuff. Fixes https://github.com/kairos-io/kairos/issues/642 Signed-off-by: Itxaka --- dracut/29kcrypt/generator.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dracut/29kcrypt/generator.sh b/dracut/29kcrypt/generator.sh index a449e82..96d6c2b 100755 --- a/dracut/29kcrypt/generator.sh +++ b/dracut/29kcrypt/generator.sh @@ -9,6 +9,17 @@ GENERATOR_DIR="$2" oem_label=$(getarg rd.cos.oemlabel=) +// Several things indicate booting from a different media so we should not do anything +// rd.cos.disable is set on LIVECD and disables mounting of any type +if getargbool 0 rd.cos.disable; then + exit 0 +fi +// Netboot is set on...well, netboot obiously +if getargbool 0 netboot; then + exit 0 +fi + + # See https://github.com/kairos-io/packages/blob/d12b12b043a71d8471454f7b4fc84c3181d2bf60/packages/system/dracut/immutable-rootfs/30cos-immutable-rootfs/cos-generator.sh#L29 { echo "[Unit]" From 1296f284cbef55214aa800c2e6b2940d79502b2d Mon Sep 17 00:00:00 2001 From: Itxaka Date: Wed, 1 Mar 2023 16:58:01 +0100 Subject: [PATCH 2/3] Update dracut/29kcrypt/generator.sh Co-authored-by: Mauro Morales --- dracut/29kcrypt/generator.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dracut/29kcrypt/generator.sh b/dracut/29kcrypt/generator.sh index 96d6c2b..eacba5a 100755 --- a/dracut/29kcrypt/generator.sh +++ b/dracut/29kcrypt/generator.sh @@ -9,8 +9,8 @@ GENERATOR_DIR="$2" oem_label=$(getarg rd.cos.oemlabel=) -// Several things indicate booting from a different media so we should not do anything -// rd.cos.disable is set on LIVECD and disables mounting of any type +## Several things indicate booting from a different media so we should not do anything +## rd.cos.disable is set on LIVECD and disables mounting of any type if getargbool 0 rd.cos.disable; then exit 0 fi From 94cfbcfe883e0f648d829da266b3a12729a14b98 Mon Sep 17 00:00:00 2001 From: Itxaka Date: Wed, 1 Mar 2023 16:58:08 +0100 Subject: [PATCH 3/3] Update dracut/29kcrypt/generator.sh Co-authored-by: Mauro Morales --- dracut/29kcrypt/generator.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dracut/29kcrypt/generator.sh b/dracut/29kcrypt/generator.sh index eacba5a..9f5c26a 100755 --- a/dracut/29kcrypt/generator.sh +++ b/dracut/29kcrypt/generator.sh @@ -14,7 +14,7 @@ oem_label=$(getarg rd.cos.oemlabel=) if getargbool 0 rd.cos.disable; then exit 0 fi -// Netboot is set on...well, netboot obiously +## Netboot is set on...well, netboot obiously if getargbool 0 netboot; then exit 0 fi