Skip to content

Issue to personalize cloud-init sequence for LiveCD iso boot #3483

@j-landru

Description

@j-landru

Kairos version:

/etc/os-release

NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.22.0
PRETTY_NAME="Alpine Linux v3.22"
HOME_URL="https://alpinelinux.org/"

/etc/kairos-release

KAIROS_ARCH="amd64"
KAIROS_BUG_REPORT_URL="https://github.com/kairos-io/kairos/issues"
KAIROS_FAMILY="alpine"
KAIROS_FIPS="false"
KAIROS_FLAVOR="alpine"
KAIROS_FLAVOR_RELEASE="3.22"
KAIROS_FRAMEWORK_VERSION="v2.18.3"
KAIROS_HOME_URL="https://github.com/kairos-io/kairos"
KAIROS_ID="kairos"
KAIROS_ID_LIKE="kairos-core-alpine-3.22"
KAIROS_IMAGE_LABEL="3.22-core-amd64-generic-v1.0.0"
KAIROS_MODEL="generic"
KAIROS_NAME="kairos-core-alpine-3.22"
KAIROS_REGISTRY_AND_ORG="quay.io/kairos"
KAIROS_RELEASE="v1.0.0"
KAIROS_TARGETARCH="amd64"
KAIROS_VARIANT="core"
KAIROS_VERSION="v1.0.0"

CPU architecture, OS, and Version:

x86_64

LiveCD generation
AuroraBoot version : v0.8.6
LiveCD generated with kairos.docker.scarf.sh/kairos/auroraboot latest a077e1e4c8bd 7 days ago 1.36GB

Describe the bug

Building wayland only desktop LiveCD image as described in #3195, I have some trouble to personalize cloud-init stage at liveCD bootup.

Additional context
abcd4desktop is an Alpine kairos derivative with sddm/plasma (6.x) desktop which needs some adjustments for wayland :

Nota : abcd lineage is Alpine derivative so init is openrc - tty are governed by /etc/inittab. So needs some adjustments if you're using a systemd like distro

  • 1st - abcd4desktop lineage are installess immutable lab systems run once on demand, always in the same initial state (baremal lab workstation must remain in the same state after lab session, installing any other system is not allowed). So no need of kairos-agent and kairos webui (which may confilct with guacamole web resmote desktop server), nor all kairos cos-* init services.
  • 2nd - autlogin root session (to install from liveCD) at tty1 confilcts with sddm login manager which starts exclusively on tty1 ( see https://gitlab.alpinelinux.org/alpine/aports/-/issues/16802)
  • 2nd bis - for lab session it's not a good idea to let user/student having full root rights session on baremetal lab worskation ! So rewrite ^/etc/inittabby commenting ```#tty1::respawn:/sbin/agetty --autologin root -i --noclear tty1``` tty1entry as wellttyS0` entry.
  • 3rd - Xwayland (used by some kde/plasma app) hangs (black screen) due to lack of /tmp/.X11-unix dir so create that dir and set it full authz at startup !!

As far as I understand kairos default cloud-init sequence at bootup

  • /etc/inittab root login adjustment for install is done by native kairos cloud-init : /system/oem/25_autologin.yaml
  • cos-* and kairos-agent openrc services are set by native kairos cloud-init : /system/oem/09_openrc_services.yaml

howto to personalize LiveCD boot to adjust default kairos cloud-init sequence : Following kairos cloud init based instructions, but no success. What did I miss ?

Don't find a way to workaround part of the default kairos cloud-init sequence adding my own in /oem so "quick an dirty" remove 25_autologin.yaml and 09_openrc_services.yaml files at very early stage aka rootfs but with no success (nor at initramfs stage).

Here is my cloud-init config.yaml file passed to aurora at liveCD generation :

#cloud-config

# This is the config.yaml for abcd4desktop livecd bootup
#    abcd4desktop is an Alpine kairos derviate with sddm/plasma (6.x) desktop
#
#    which needs some adjustmeent for wayland (see comments below)
#
#  ***Nota :*** *abcd lineage is Alpine derivative so init is openrc - tty are governed by /etc/inittab*
#              *so needs some adjustments if you're using a systemd like distro*
#
#  1st - abcd4desktop lineage are installess immutable lab systems run once on demand, alaways the same initial state
#        so no need of kairos-agent webui (which may confilct with guacamole web resmote desktop server), nor all kairos cos-* init services
#  2nd - autlogin root session (to install from liveCD) at tty1 confilcts with sddm login manager which start exclusevily on tty1
#                          see https://gitlab.alpinelinux.org/alpine/aports/-/issues/16802
#  2nd bis - for lab session it's not a good idea to let user/student having full root rights session on baremetal lab worskation !
#        so rewrite inittab by commenting ```#tty1::respawn:/sbin/agetty --autologin root -i --noclear tty1``` tty1 entry
#  3rd - Xwayland (used by some kde/plasma app) hangs (black screen) due to lack of /tmp/.X11-unix dir
#        so create that dir and set it full authz at startup !!
#
# howto :
#      - /etc/inittab root login adjustment for install is done by native kairos cloud-init : /system/oem/25_autologin.yaml
#      - cos-* and kairos-agent openrc services are set by native kairos cloud-init         : /system/oem/09_openrc_services.yaml
#   Don't find a way to workaround those cloud-init files adding my own in /oem so "quick an dirty" remove those files at very early stage aka fs
#
#      - /tmp/.X11-unix stuff needed in all execution environments (liveCD as well as in abcdic4desktop container)
#                       so report in a new openrc services inside the docker image)
#
#
stages:
   # at rootfs stage
   rootfs:
     - name: "Adjust config for wayland desktop (inittab, /tmp/.X11-unix, ...) and installess liveCD
       files:
       commands:
         # reload  new modified inittab so HUP signal to openrc
         #- kill -HUP 1       #not needed in theory at that stage ??
         # xwayland hangs if no /tmp/.X11-unix dir !
         - mkdir -p /tmp/.X11-unix && chmod 1777 /tmp/.X11-unix
         # installess distro so remove kairos-agent and cos- services
         #        and install root session on tty1              
         #- rm /etc/runlevels/defautlt/kairos-agent
         #- rm /etc/runlevels/default/cos-*
         - rm /system/oem/25_autologin.yaml
         - rm /system/oem/09_openrc_services.yaml

When LiveCD is boot up, that file is well placed at /run/initramfsi/live/config.yaml but doesn't seem to be run : no /tmp/.X11-unix dir and system/oem/25_autologin.yaml, /system/oem/09_openrc_services.yaml still present.

Your guidelines are welcome.
Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageAdd this label to issues that should be triaged and prioretized in the next planning callunconfirmed

    Type

    No type

    Projects

    Status

    Todo 🖊

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions