From afb263e88f85d1cdf7145c5afb972d7623dc4dfa Mon Sep 17 00:00:00 2001 From: Itxaka Date: Mon, 13 Mar 2023 21:59:27 +0100 Subject: [PATCH] Take into account uki mode for rootfs stuff Signed-off-by: Itxaka --- overlay/files/system/oem/00_rootfs.yaml | 2 +- overlay/files/system/oem/10_accounting.yaml | 4 +-- overlay/files/system/oem/11_persistency.yaml | 2 +- overlay/files/system/oem/32_uki.yaml | 38 -------------------- 4 files changed, 4 insertions(+), 42 deletions(-) delete mode 100644 overlay/files/system/oem/32_uki.yaml diff --git a/overlay/files/system/oem/00_rootfs.yaml b/overlay/files/system/oem/00_rootfs.yaml index 85e7b85648..650911a047 100644 --- a/overlay/files/system/oem/00_rootfs.yaml +++ b/overlay/files/system/oem/00_rootfs.yaml @@ -13,7 +13,7 @@ stages: providers: ["aws", "gcp", "openstack", "cdrom"] path: "/oem" rootfs: - - if: '[ ! -f "/run/cos/recovery_mode" ]' + - if: '[ ! -f "/run/cos/recovery_mode" ] && [ ! -e "/run/cos/uki_mode" ]' name: "Layout configuration" environment_file: /run/cos/cos-layout.env environment: diff --git a/overlay/files/system/oem/10_accounting.yaml b/overlay/files/system/oem/10_accounting.yaml index 3011015898..b0dcd93ba0 100644 --- a/overlay/files/system/oem/10_accounting.yaml +++ b/overlay/files/system/oem/10_accounting.yaml @@ -16,8 +16,8 @@ stages: homedir: "/home/kairos" groups: - "admin" - - name: "Set user password if running in live" - if: "[ -e /run/cos/live_mode ]" + - name: "Set user password if running in live or uki" + if: "[ -e /run/cos/live_mode ] || [ -e /run/cos/uki_mode ]" users: kairos: passwd: "kairos" diff --git a/overlay/files/system/oem/11_persistency.yaml b/overlay/files/system/oem/11_persistency.yaml index 7fa91798ae..a5b70ebfee 100644 --- a/overlay/files/system/oem/11_persistency.yaml +++ b/overlay/files/system/oem/11_persistency.yaml @@ -39,7 +39,7 @@ stages: /usr/share/pki/trust /usr/share/pki/trust/anchors /var/lib/ca-certificates - - if: '([ -e "/run/cos/active_mode" ] || [ -e "/run/cos/passive_mode" ]) && [ ! -e "/run/cos/uki_mode" ]' + - if: '[ ! -f "/run/cos/recovery_mode" ] && [ ! -e "/run/cos/uki_mode" ]' name: "Layout configuration for active/passive" environment_file: /run/cos/cos-layout.env environment: diff --git a/overlay/files/system/oem/32_uki.yaml b/overlay/files/system/oem/32_uki.yaml deleted file mode 100644 index bccf8f163d..0000000000 --- a/overlay/files/system/oem/32_uki.yaml +++ /dev/null @@ -1,38 +0,0 @@ -name: "Default user for UKI" -stages: - initramfs: - - name: "Setup groups" - if: "[ -e /run/cos/uki_mode ]" - ensure_entities: - - entity: | - kind: "group" - group_name: "admin" - password: "x" - gid: 900 - - name: "Setup users on UKI mode" - if: "[ -e /run/cos/uki_mode ]" - users: - kairos: - passwd: "kairos" - shell: /bin/bash - homedir: "/home/kairos" - groups: - - "admin" - - name: "Setup sudo" - if: "[ -e /run/cos/uki_mode ]" - files: - - path: "/etc/sudoers" - owner: 0 - group: 0 - permsisions: 0600 - content: | - Defaults always_set_home - Defaults secure_path="/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/bin:/usr/local/sbin" - Defaults env_reset - Defaults env_keep = "LANG LC_ADDRESS LC_CTYPE LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE LC_ATIME LC_ALL LANGUAGE LINGUAS XDG_SESSION_COOKIE" - Defaults !insults - root ALL=(ALL) ALL - %admin ALL=(ALL) NOPASSWD: ALL - #includedir /etc/sudoers.d - commands: - - passwd -l root