Skip to content

Comments

Flatcar: add target for Flatcar-compatible systemd sysext images#973

Open
kartikjoshi21 wants to merge 5 commits intoproject-dalec:mainfrom
kartikjoshi21:kartikjoshi21/flatcar-suport
Open

Flatcar: add target for Flatcar-compatible systemd sysext images#973
kartikjoshi21 wants to merge 5 commits intoproject-dalec:mainfrom
kartikjoshi21:kartikjoshi21/flatcar-suport

Conversation

@kartikjoshi21
Copy link
Member

@kartikjoshi21 kartikjoshi21 commented Feb 20, 2026

This PR adds an initial Flatcar build target to Dalec focused on producing Flatcar-compatible systemd system extension images (.raw).

  • Adds flatcar/testing/sysext which builds a .raw sysext using the Flatcar SDK image as the sysext worker.
  • Introduces an optional SysextEnv(...) hook so a target can supply default DALEC_SYSEXT_* values for build_sysext.sh.DALEC_SYSEXT_* build args always override defaults.
  • If DALEC_SYSEXT_OS_VERSION_ID is set and DALEC_SYSEXT_SYSEXT_LEVEL is not explicitly set, the default SYSEXT_LEVEL is dropped to avoid over-constraining extension matching.

Default behavior for Flatcar sysext
The Flatcar target provides defaults aligned with Flatcar expectations:

  • DALEC_SYSEXT_OS_ID=flatcar
  • default output image name is the spec name (produces .raw)
  • default DALEC_SYSEXT_SYSEXT_LEVEL=1.0 (unless OS_VERSION_ID is pinned without an explicit level)

Tests
Adds unit coverage for:

  • filtering of DALEC_SYSEXT_* build args
  • merging target defaults with build-arg overrides
  • the OS_VERSION_ID vs SYSEXT_LEVEL precedence rule

Fixes: #969

Signed-off-by: Kartik Joshi <karikjoshi21@gmail.com>
Signed-off-by: Kartik Joshi <karikjoshi21@gmail.com>
Signed-off-by: Kartik Joshi <karikjoshi21@gmail.com>
@kartikjoshi21 kartikjoshi21 changed the title Kartikjoshi21/flatcar suport flatcar distro support(Draft) Feb 20, 2026
…ages

This PR introduces initial Flatcar support by adding a new flatcar
build target that produces Flatcar-compatible systemd system extension
images (.raw).

Signed-off-by: Kartik Joshi <karikjoshi21@gmail.com>
@kartikjoshi21 kartikjoshi21 changed the title flatcar distro support(Draft) Flatcar: add target for Flatcar-compatible systemd sysext images Feb 23, 2026
Signed-off-by: Kartik Joshi <karikjoshi21@gmail.com>
@kartikjoshi21 kartikjoshi21 force-pushed the kartikjoshi21/flatcar-suport branch from 81fcf97 to fc4ff38 Compare February 23, 2026 18:42
@kartikjoshi21 kartikjoshi21 marked this pull request as ready for review February 23, 2026 18:42
Copilot AI review requested due to automatic review settings February 23, 2026 18:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new Flatcar build target to Dalec, enabling production of Flatcar-compatible systemd system extension (.raw) images. The implementation follows established patterns in the codebase while introducing an optional interface for distro-specific sysext configuration.

Changes:

  • Adds new Flatcar target with sysext support using the Flatcar SDK for building
  • Introduces optional sysextEnvProvider interface allowing targets to supply default DALEC_SYSEXT_* environment variables
  • Implements smart merging logic that drops default SYSEXT_LEVEL when OS_VERSION_ID is pinned to avoid over-constraining extension matching

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
targets/linux/flatcar/flatcar.go New Flatcar target implementation using composition pattern, delegating to Ubuntu Noble for base functionality while providing Flatcar-specific SDK worker and sysext defaults
targets/linux/distro_handler.go Adds optional sysextEnvProvider interface and environment merging logic to pass DALEC_SYSEXT_* build args to build_sysext.sh with proper default handling
targets/linux/build_sysext.sh Enhances script to support configurable output naming, OS ID matching, VERSION_ID/SYSEXT_LEVEL parameters, and creates proper symlinks for Flatcar naming conventions
targets/linux/sysext_env_test.go Unit tests for DALEC_SYSEXT_* environment filtering and merging logic including the OS_VERSION_ID/SYSEXT_LEVEL precedence rule
targets/plugin/init.go Registers new Flatcar target in plugin initialization
load.go Allows DALEC_SYSEXT_* build args without requiring spec declaration

# systemd-sysext expects extension-release.<IMAGE> where <IMAGE> matches the image basename.
# Provide a matching entry for the produced image name.
if [ "${IMAGE_NAME}" != "${NAME}" ]; then
ln -sf "${BASE_REL}" "${REL_DIR}/extension-release.${IMAGE_NAME}"
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation here uses spaces instead of tabs, which is inconsistent with the rest of the file that uses tabs for indentation. Please change the leading spaces to a tab to maintain consistency.

Suggested change
ln -sf "${BASE_REL}" "${REL_DIR}/extension-release.${IMAGE_NAME}"
ln -sf "${BASE_REL}" "${REL_DIR}/extension-release.${IMAGE_NAME}"

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flatcar distro support

1 participant