* [PATCH v2 1/4] workflows: bootlinux: add reproducible builds support
2025-09-19 12:25 [PATCH v2 0/4] workflows: bootlinux: enhance kernel configuration fragment support Daniel Gomez
@ 2025-09-19 12:25 ` Daniel Gomez
2025-09-19 12:25 ` [PATCH v2 2/4] workflows: bootlinux: add comprehensive ccache support Daniel Gomez
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Daniel Gomez @ 2025-09-19 12:25 UTC (permalink / raw)
To: Luis Chamberlain, Chuck Lever; +Cc: kdevops, Daniel Gomez
From: Daniel Gomez <da.gomez@samsung.com>
Restructure bootlinux build parameters to use modular dictionary
approach for make module parameters and environment variables. This
prepares the codebase for extensible build features like ccache and
reproducible builds.
Add CONFIG_BOOTLINUX_REPRODUCIBLE_BUILDS option to enable deterministic
kernel builds by setting hardcoded environment variables. When enabled,
injects KBUILD_BUILD_TIMESTAMP='', KBUILD_BUILD_USER=kdevops, and
KBUILD_BUILD_HOST=kdevops during compilation.
Uses empty timestamp as recommended by LLVM documentation for optimal
compatibility with ccache and build reproducibility across different
development environments.
Features:
- Configurable via Kconfig with clear documentation
- Integrates with modular environment/params infrastructure
- Applied to both make module parameters and shell task environments
- Compatible with both GCC and Clang toolchains
Generated-by: Claude AI
Signed-off-by: Daniel Gomez <da.gomez@samsung.com>
---
playbooks/roles/bootlinux/defaults/main.yml | 26 ++++++++++++++
playbooks/roles/bootlinux/tasks/build/9p.yml | 44 +++++++++++++++++++++--
playbooks/roles/bootlinux/tasks/build/targets.yml | 6 ++--
playbooks/roles/bootlinux/tasks/main.yml | 22 ++++++++++--
workflows/linux/Kconfig | 17 +++++++++
5 files changed, 108 insertions(+), 7 deletions(-)
diff --git a/playbooks/roles/bootlinux/defaults/main.yml b/playbooks/roles/bootlinux/defaults/main.yml
index 84b61b8e..2d2eb798 100644
--- a/playbooks/roles/bootlinux/defaults/main.yml
+++ b/playbooks/roles/bootlinux/defaults/main.yml
@@ -30,7 +30,32 @@ make: "make"
# The commit is 34db57a47f875d11c4068567b9ec7ace174ec4cf
# introduce fact "ansible_processor_nproc": number of usable vcpus #66569
# https://github.com/ansible/ansible/pull/66569
+# Build command without environment variables (added via environment dict)
target_linux_make_cmd: "{{ make }} -j{{ ansible_processor_vcpus }}"
+
+# Make parameters dictionary for community.general.make module
+bootlinux_make_params: >-
+ {{
+ ({} | combine(
+ {
+ 'KBUILD_BUILD_TIMESTAMP': '',
+ 'KBUILD_BUILD_USER': 'kdevops',
+ 'KBUILD_BUILD_HOST': 'kdevops'
+ } if bootlinux_reproducible_builds|default(false)|bool else {}
+ ))
+ }}
+
+# Environment variables for remaining shell tasks (non-make)
+bootlinux_build_environment: >-
+ {{
+ ({} | combine(
+ {
+ 'KBUILD_BUILD_TIMESTAMP': '',
+ 'KBUILD_BUILD_USER': 'kdevops',
+ 'KBUILD_BUILD_HOST': 'kdevops'
+ } if bootlinux_reproducible_builds|default(false)|bool else {}
+ ))
+ }}
target_linux_make_install_cmd: "{{ target_linux_make_cmd }} modules_install install"
uninstall_kernel_enable: false
@@ -66,3 +91,4 @@ bootlinux_tree_custom_kernelrelease: false
bootlinux_tree_custom_localversion: false
bootlinux_is_dev_node: false
bootlinux_debug_ref: "{{ lookup('env', 'DEBUG_REF') | default(false, true) | bool }}"
+
diff --git a/playbooks/roles/bootlinux/tasks/build/9p.yml b/playbooks/roles/bootlinux/tasks/build/9p.yml
index acd69dc2..17b19cb3 100644
--- a/playbooks/roles/bootlinux/tasks/build/9p.yml
+++ b/playbooks/roles/bootlinux/tasks/build/9p.yml
@@ -135,6 +135,7 @@
register: configure_done
changed_when: configure_done.rc == 0 or configure_done.rc == 141
failed_when: configure_done.rc != 0 and configure_done.rc != 141
+ environment: "{{ bootlinux_build_environment }}"
args:
chdir: "{{ bootlinux_9p_host_path }}"
executable: /bin/bash
@@ -156,10 +157,44 @@
$ {{ ansible_callback_diy.result.output.cmd | join(' ') }}
{{ ansible_callback_diy.result.output.stdout | default('') }}
+- name: Debug kernel build command configuration for 9P build
+ ansible.builtin.debug:
+ msg: |
+ === KERNEL BUILD COMMAND DEBUG (9P BUILD) ===
+ build_jobs: {{ nproc_9p.stdout }}
+ bootlinux_make_params: {{ bootlinux_make_params }}
+ bootlinux_build_environment: {{ bootlinux_build_environment }}
+ bootlinux_compiler_clang: {{ bootlinux_compiler_clang|default(false) }}
+ bootlinux_reproducible_builds: {{ bootlinux_reproducible_builds|default(false) }}
+ run_once: true
+ delegate_to: localhost
+ vars:
+ ansible_callback_diy_runner_on_ok_msg: "{{ ansible_callback_diy.result.output.msg }}"
+ tags: ["build-linux"]
+
+- name: Test CC environment variable is working before build
+ ansible.builtin.shell: |
+ echo "CC environment test:"
+ echo "CC=${CC:-'not set'}"
+ echo "PATH=${PATH}"
+ which gcc || echo "gcc not found"
+ env | grep -E '^(CC|PATH)' | sort
+ environment: "{{ bootlinux_build_environment }}"
+ register: cc_test_result
+ run_once: true
+ delegate_to: localhost
+ vars:
+ ansible_callback_diy_runner_on_ok_msg: |
+ CC Environment Test Results:
+ {{ ansible_callback_diy.result.output.stdout | default('') }}
+ tags: ["build-linux"]
+
- name: Get kernelversion
community.general.make:
chdir: "{{ bootlinux_9p_host_path }}"
target: kernelversion
+ params: "{{ bootlinux_make_params }}"
+ environment: "{{ bootlinux_build_environment }}"
register: target_linux_kernelversion
tags: ["build-linux"]
when:
@@ -180,7 +215,8 @@
community.general.make:
jobs: "{{ nproc_9p.stdout }}"
chdir: "{{ bootlinux_9p_host_path }}"
- params: KERNELRELEASE={{ target_user_kernelrelease }}
+ params: "{{ bootlinux_make_params | combine({'KERNELRELEASE': target_user_kernelrelease}) }}"
+ environment: "{{ bootlinux_build_environment }}"
tags: ["build-linux"]
when:
- (active_linux_kernelrelease | default(target_linux_kernelrelease)) | length > 0
@@ -191,6 +227,8 @@
community.general.make:
jobs: "{{ nproc_9p.stdout }}"
chdir: "{{ bootlinux_9p_host_path }}"
+ params: "{{ bootlinux_make_params }}"
+ environment: "{{ bootlinux_build_environment }}"
tags: ["build-linux"]
when:
- (active_linux_kernelrelease | default(target_linux_kernelrelease)) | length == 0
@@ -201,8 +239,8 @@
community.general.make:
jobs: "{{ nproc_9p.stdout }}"
chdir: "{{ bootlinux_9p_host_path }}"
- params:
- M: "tools/testing/cxl"
+ params: "{{ bootlinux_make_params | combine({'M': 'tools/testing/cxl'}) }}"
+ environment: "{{ bootlinux_build_environment }}"
tags: ["build-linux", "cxl-build"]
when:
- bootlinux_cxl_test|bool
diff --git a/playbooks/roles/bootlinux/tasks/build/targets.yml b/playbooks/roles/bootlinux/tasks/build/targets.yml
index 6bd861cb..5deb330b 100644
--- a/playbooks/roles/bootlinux/tasks/build/targets.yml
+++ b/playbooks/roles/bootlinux/tasks/build/targets.yml
@@ -93,19 +93,21 @@
executable: /bin/bash
- name: Build {{ target_linux_tree }} on the target nodes
- ansible.builtin.command: "{{ target_linux_make_cmd }}"
+ ansible.builtin.shell: "{{ target_linux_make_cmd }}"
register: build
changed_when: "build.rc == 0"
args:
chdir: "{{ target_linux_dir_path }}"
+ environment: "{{ bootlinux_build_environment }}"
tags: ["build-linux"]
- name: Build {{ target_linux_tree }} cxl_test on the target nodes
- ansible.builtin.command: "{{ target_linux_make_cmd }} M=tools/testing/cxl"
+ ansible.builtin.shell: "{{ target_linux_make_cmd }} M=tools/testing/cxl"
register: build_cxl_test
changed_when: "build_cxl_test.rc == 0"
args:
chdir: "{{ target_linux_dir_path }}"
+ environment: "{{ bootlinux_build_environment }}"
tags: ["build-linux", "cxl-build"]
when:
- bootlinux_cxl_test|bool
diff --git a/playbooks/roles/bootlinux/tasks/main.yml b/playbooks/roles/bootlinux/tasks/main.yml
index e0eb2234..4110d596 100644
--- a/playbooks/roles/bootlinux/tasks/main.yml
+++ b/playbooks/roles/bootlinux/tasks/main.yml
@@ -193,6 +193,22 @@
when:
- bootlinux_9p|bool
+- name: Debug kernel build command configuration
+ ansible.builtin.debug:
+ msg: |
+ === KERNEL BUILD COMMAND DEBUG ===
+ build_jobs: {{ ansible_processor_vcpus }}
+ bootlinux_make_params: {{ bootlinux_make_params }}
+ bootlinux_build_environment: {{ bootlinux_build_environment }}
+ bootlinux_compiler_clang: {{ bootlinux_compiler_clang|default(false) }}
+ bootlinux_reproducible_builds: {{ bootlinux_reproducible_builds|default(false) }}
+ when:
+ - not workflow_linux_packaged|bool
+ - not bootlinux_9p|bool
+ vars:
+ ansible_callback_diy_runner_on_ok_msg: "{{ ansible_callback_diy.result.output.msg }}"
+ tags: ["install-linux", "debug"]
+
- name: Build the Linux kernel on the controller host
ansible.builtin.include_tasks:
file: "{{ role_path }}/tasks/build/9p.yml"
@@ -318,11 +334,12 @@
become: true
become_flags: "su - -c"
become_method: sudo
- ansible.builtin.command: "{{ target_linux_make_install_cmd }}"
+ ansible.builtin.shell: "{{ target_linux_make_install_cmd }}"
register: install_done
changed_when: "install_done.rc == 0"
args:
chdir: "{{ target_linux_dir_path }}"
+ environment: "{{ bootlinux_build_environment }}"
tags: ["install-linux"]
when:
- not workflow_linux_packaged|bool
@@ -335,11 +352,12 @@
become: true
become_flags: "su - -c"
become_method: sudo
- ansible.builtin.command: "{{ target_linux_make_install_cmd }} M=tools/testing/cxl INSTALL_MOD_DIR=updates"
+ ansible.builtin.shell: "{{ target_linux_make_install_cmd }} M=tools/testing/cxl INSTALL_MOD_DIR=updates"
register: install_done
changed_when: "install_done.rc == 0"
args:
chdir: "{{ target_linux_dir_path }}"
+ environment: "{{ bootlinux_build_environment }}"
tags: ["install-linux", "cxl-install"]
when:
- kdevops_workflow_enable_cxl|bool
diff --git a/workflows/linux/Kconfig b/workflows/linux/Kconfig
index 1b057042..897cb00f 100644
--- a/workflows/linux/Kconfig
+++ b/workflows/linux/Kconfig
@@ -171,6 +171,23 @@ config BOOTLINUX_COMPILER_CLANG
endchoice
+config BOOTLINUX_REPRODUCIBLE_BUILDS
+ bool "Enable reproducible builds"
+ output yaml
+ default n
+ help
+ Enable reproducible builds by setting deterministic environment
+ variables during kernel compilation. This ensures identical
+ binaries are produced from the same source code.
+
+ When enabled, sets:
+ - KBUILD_BUILD_TIMESTAMP='' (empty for deterministic timestamps)
+ - KBUILD_BUILD_USER='kdevops'
+ - KBUILD_BUILD_HOST='kdevops'
+
+ Recommended for CI/CD environments and when build reproducibility
+ is required. Compatible with both GCC and Clang toolchains.
+
choice
prompt "Type of development version of Linux to use"
default BOOTLINUX_LINUS if !BOOTLINUX_TREE_SET_BY_CLI && !BOOTLINUX_TREE_REF_SET_BY_CLI
--
2.50.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH v2 2/4] workflows: bootlinux: add comprehensive ccache support
2025-09-19 12:25 [PATCH v2 0/4] workflows: bootlinux: enhance kernel configuration fragment support Daniel Gomez
2025-09-19 12:25 ` [PATCH v2 1/4] workflows: bootlinux: add reproducible builds support Daniel Gomez
@ 2025-09-19 12:25 ` Daniel Gomez
2025-09-19 12:25 ` [PATCH v2 3/4] workflows: bootlinux: add kernel configuration fragments support Daniel Gomez
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Daniel Gomez @ 2025-09-19 12:25 UTC (permalink / raw)
To: Luis Chamberlain, Chuck Lever; +Cc: kdevops, Daniel Gomez
From: Daniel Gomez <da.gomez@samsung.com>
Add ccache (compiler cache) support to accelerate kernel builds with
both GCC and Clang toolchains. Implementation provides flexible
configuration options while maintaining simplicity for common use cases.
Key features:
- System-wide ccache configuration (default) for immediate use
- kdevops-managed configuration for project isolation
- Automatic package installation across all supported distros
- Modular environment variable composition for clean integration
- LLVM documentation compliance (CC="ccache clang")
- Seamless integration with reproducible builds and existing features
Configuration:
- Cache size specified in GiB (digits only, e.g., 10 = 10 GiB)
- Uses automatic Kconfig→Ansible integration via .extra_vars_auto.yaml
- Template-based configuration management with TOPDIR_PATH isolation
- Organized in dedicated ccache submenu for clean UI
Technical implementation:
- Uses modular bootlinux_make_params for community.general.make module
- Uses modular bootlinux_build_environment for shell tasks
- Automatic compiler detection (ccache gcc vs ccache clang)
- Enhanced debug output for build command validation
Generated-by: Claude AI
Signed-off-by: Daniel Gomez <da.gomez@samsung.com>
---
playbooks/roles/bootlinux/defaults/main.yml | 6 ++
playbooks/roles/bootlinux/tasks/build/9p.yml | 5 +-
playbooks/roles/bootlinux/tasks/ccache.yml | 37 ++++++++++
.../bootlinux/tasks/install-deps/debian/main.yml | 1 +
.../bootlinux/tasks/install-deps/redhat/main.yml | 1 +
.../bootlinux/tasks/install-deps/suse/main.yml | 1 +
.../tasks/install-minimal-deps/debian/main.yml | 1 +
.../tasks/install-minimal-deps/redhat/main.yml | 2 +
.../tasks/install-minimal-deps/suse/main.yml | 1 +
playbooks/roles/bootlinux/tasks/main.yml | 9 +++
playbooks/roles/bootlinux/templates/ccache.conf.j2 | 27 ++++++++
workflows/linux/Kconfig | 78 ++++++++++++++++++++++
12 files changed, 168 insertions(+), 1 deletion(-)
diff --git a/playbooks/roles/bootlinux/defaults/main.yml b/playbooks/roles/bootlinux/defaults/main.yml
index 2d2eb798..97adec30 100644
--- a/playbooks/roles/bootlinux/defaults/main.yml
+++ b/playbooks/roles/bootlinux/defaults/main.yml
@@ -37,6 +37,8 @@ target_linux_make_cmd: "{{ make }} -j{{ ansible_processor_vcpus }}"
bootlinux_make_params: >-
{{
({} | combine(
+ {'CC': 'ccache clang' if bootlinux_compiler_clang|default(false)|bool else 'ccache gcc'} if bootlinux_ccache|default(false)|bool else {}
+ ) | combine(
{
'KBUILD_BUILD_TIMESTAMP': '',
'KBUILD_BUILD_USER': 'kdevops',
@@ -49,6 +51,10 @@ bootlinux_make_params: >-
bootlinux_build_environment: >-
{{
({} | combine(
+ {'CCACHE_CONFIGPATH': topdir_path + '/.ccache/ccache.conf'} if (bootlinux_ccache|default(false)|bool and bootlinux_ccache_kdevops_managed|default(false)|bool) else {}
+ ) | combine(
+ {'CC': 'ccache clang' if bootlinux_compiler_clang|default(false)|bool else 'ccache gcc'} if bootlinux_ccache|default(false)|bool else {}
+ ) | combine(
{
'KBUILD_BUILD_TIMESTAMP': '',
'KBUILD_BUILD_USER': 'kdevops',
diff --git a/playbooks/roles/bootlinux/tasks/build/9p.yml b/playbooks/roles/bootlinux/tasks/build/9p.yml
index 17b19cb3..6f03ed9a 100644
--- a/playbooks/roles/bootlinux/tasks/build/9p.yml
+++ b/playbooks/roles/bootlinux/tasks/build/9p.yml
@@ -164,8 +164,10 @@
build_jobs: {{ nproc_9p.stdout }}
bootlinux_make_params: {{ bootlinux_make_params }}
bootlinux_build_environment: {{ bootlinux_build_environment }}
+ bootlinux_ccache: {{ bootlinux_ccache|default(false) }}
bootlinux_compiler_clang: {{ bootlinux_compiler_clang|default(false) }}
bootlinux_reproducible_builds: {{ bootlinux_reproducible_builds|default(false) }}
+ bootlinux_ccache_kdevops_managed: {{ bootlinux_ccache_kdevops_managed|default(false) }}
run_once: true
delegate_to: localhost
vars:
@@ -178,7 +180,8 @@
echo "CC=${CC:-'not set'}"
echo "PATH=${PATH}"
which gcc || echo "gcc not found"
- env | grep -E '^(CC|PATH)' | sort
+ which ccache || echo "ccache not found"
+ env | grep -E '^(CC|CCACHE|PATH)' | sort
environment: "{{ bootlinux_build_environment }}"
register: cc_test_result
run_once: true
diff --git a/playbooks/roles/bootlinux/tasks/ccache.yml b/playbooks/roles/bootlinux/tasks/ccache.yml
new file mode 100644
index 00000000..38b2c034
--- /dev/null
+++ b/playbooks/roles/bootlinux/tasks/ccache.yml
@@ -0,0 +1,37 @@
+---
+# ccache configuration and setup
+
+- name: Create kdevops ccache directory structure
+ ansible.builtin.file:
+ path: "{{ item }}"
+ state: directory
+ mode: '0755'
+ loop:
+ - "{{ topdir_path }}/.ccache"
+ - "{{ bootlinux_ccache_dir }}"
+ when:
+ - bootlinux_ccache|default(false)|bool
+ - bootlinux_ccache_kdevops_managed|default(false)|bool
+
+- name: Generate kdevops-managed ccache configuration
+ ansible.builtin.template:
+ src: ccache.conf.j2
+ dest: "{{ topdir_path }}/.ccache/ccache.conf"
+ mode: '0644'
+ when:
+ - bootlinux_ccache|default(false)|bool
+ - bootlinux_ccache_kdevops_managed|default(false)|bool
+
+- name: Display ccache configuration info
+ ansible.builtin.debug:
+ msg: |
+ ccache enabled: {{ bootlinux_ccache|default(false)|bool }}
+ ccache mode: {{ 'kdevops-managed' if bootlinux_ccache_kdevops_managed|default(false)|bool else 'system-wide' }}
+ {% if bootlinux_ccache_kdevops_managed|default(false)|bool %}
+ Config file: {{ topdir_path }}/.ccache/ccache.conf
+ Cache directory: {{ bootlinux_ccache_dir }}
+ Max size: {{ bootlinux_ccache_max_size }} GiB
+ {% endif %}
+ when: bootlinux_ccache|default(false)|bool
+ vars:
+ ansible_callback_diy_runner_on_ok_msg: "{{ ansible_callback_diy.result.output.msg }}"
diff --git a/playbooks/roles/bootlinux/tasks/install-deps/debian/main.yml b/playbooks/roles/bootlinux/tasks/install-deps/debian/main.yml
index 4edf8e1d..e5911029 100644
--- a/playbooks/roles/bootlinux/tasks/install-deps/debian/main.yml
+++ b/playbooks/roles/bootlinux/tasks/install-deps/debian/main.yml
@@ -39,4 +39,5 @@
- zstd
- libncurses-dev
- b4
+ - ccache
state: present
diff --git a/playbooks/roles/bootlinux/tasks/install-deps/redhat/main.yml b/playbooks/roles/bootlinux/tasks/install-deps/redhat/main.yml
index c7b18cd5..7f1955bf 100644
--- a/playbooks/roles/bootlinux/tasks/install-deps/redhat/main.yml
+++ b/playbooks/roles/bootlinux/tasks/install-deps/redhat/main.yml
@@ -52,6 +52,7 @@
- dwarves
- userspace-rcu
- zstd
+ - ccache
- name: Install btrfs-progs
become: true
diff --git a/playbooks/roles/bootlinux/tasks/install-deps/suse/main.yml b/playbooks/roles/bootlinux/tasks/install-deps/suse/main.yml
index 7f0cf249..5c9f0e3b 100644
--- a/playbooks/roles/bootlinux/tasks/install-deps/suse/main.yml
+++ b/playbooks/roles/bootlinux/tasks/install-deps/suse/main.yml
@@ -28,4 +28,5 @@
- portmap
- hwinfo
- open-iscsi
+ - ccache
disable_recommends: false
diff --git a/playbooks/roles/bootlinux/tasks/install-minimal-deps/debian/main.yml b/playbooks/roles/bootlinux/tasks/install-minimal-deps/debian/main.yml
index fab4998a..cc05a44a 100644
--- a/playbooks/roles/bootlinux/tasks/install-minimal-deps/debian/main.yml
+++ b/playbooks/roles/bootlinux/tasks/install-minimal-deps/debian/main.yml
@@ -24,4 +24,5 @@
- make
- gcc
- kmod
+ - ccache
state: present
diff --git a/playbooks/roles/bootlinux/tasks/install-minimal-deps/redhat/main.yml b/playbooks/roles/bootlinux/tasks/install-minimal-deps/redhat/main.yml
index 50651ab1..950dbfe1 100644
--- a/playbooks/roles/bootlinux/tasks/install-minimal-deps/redhat/main.yml
+++ b/playbooks/roles/bootlinux/tasks/install-minimal-deps/redhat/main.yml
@@ -10,6 +10,7 @@
- make
- gcc
- kmod
+ - ccache
state: present
when:
- ansible_facts['distribution_major_version']|int < 8
@@ -22,6 +23,7 @@
- make
- gcc
- kmod
+ - ccache
state: present
when:
- ansible_facts['distribution_major_version']|int >= 8
diff --git a/playbooks/roles/bootlinux/tasks/install-minimal-deps/suse/main.yml b/playbooks/roles/bootlinux/tasks/install-minimal-deps/suse/main.yml
index a4cc27bb..d8f75240 100644
--- a/playbooks/roles/bootlinux/tasks/install-minimal-deps/suse/main.yml
+++ b/playbooks/roles/bootlinux/tasks/install-minimal-deps/suse/main.yml
@@ -10,4 +10,5 @@
- make
- gcc
- kmod-compat
+ - ccache
state: present
diff --git a/playbooks/roles/bootlinux/tasks/main.yml b/playbooks/roles/bootlinux/tasks/main.yml
index 4110d596..eff6fb6b 100644
--- a/playbooks/roles/bootlinux/tasks/main.yml
+++ b/playbooks/roles/bootlinux/tasks/main.yml
@@ -32,6 +32,15 @@
- bootlinux_9p|bool
- not workflow_linux_packaged|bool
+# Setup ccache configuration
+- name: Setup ccache configuration
+ ansible.builtin.import_tasks:
+ file: ccache.yml
+ when:
+ - bootlinux_ccache|default(false)|bool
+ - not workflow_linux_packaged|bool
+ tags: ['ccache']
+
# We do this regardless of what distro you use
- name: Install b4
become: true
diff --git a/playbooks/roles/bootlinux/templates/ccache.conf.j2 b/playbooks/roles/bootlinux/templates/ccache.conf.j2
new file mode 100644
index 00000000..8c0a7bf9
--- /dev/null
+++ b/playbooks/roles/bootlinux/templates/ccache.conf.j2
@@ -0,0 +1,27 @@
+# kdevops-managed ccache configuration
+# Generated automatically - do not edit manually
+
+# Cache settings
+cache_dir = {{ bootlinux_ccache_dir }}
+max_size = {{ bootlinux_ccache_max_size }}.0 GiB
+
+# Performance settings
+compression = {{ bootlinux_ccache_compression | lower }}
+stats = true
+
+# Build reproducibility - ensure deterministic compilation
+compiler_check = mtime
+direct_mode = true
+hash_dir = true
+
+# Debugging (disabled by default for performance)
+debug = false
+
+# File handling
+file_clone = false
+hard_link = false
+inode_cache = true
+
+# Security
+umask =
+read_only = false
diff --git a/workflows/linux/Kconfig b/workflows/linux/Kconfig
index 897cb00f..cbfa8a3c 100644
--- a/workflows/linux/Kconfig
+++ b/workflows/linux/Kconfig
@@ -188,6 +188,84 @@ config BOOTLINUX_REPRODUCIBLE_BUILDS
Recommended for CI/CD environments and when build reproducibility
is required. Compatible with both GCC and Clang toolchains.
+menu "ccache configuration"
+
+config BOOTLINUX_CCACHE
+ bool "Enable ccache for faster kernel builds"
+ output yaml
+ default n
+ help
+ Enable ccache (compiler cache) to accelerate repeated kernel
+ builds by caching compilation results. Particularly effective
+ for incremental builds and CI/CD environments.
+
+ When enabled with Clang (LLVM=1), uses CC="ccache clang".
+ When enabled with GCC, uses CC="ccache gcc".
+
+ Requires ccache package to be installed on build nodes.
+
+choice
+ prompt "ccache configuration mode"
+ depends on BOOTLINUX_CCACHE
+ default BOOTLINUX_CCACHE_SYSTEM_WIDE
+ help
+ Choose how ccache configuration is managed.
+
+config BOOTLINUX_CCACHE_SYSTEM_WIDE
+ bool "Use system-wide ccache configuration"
+ output yaml
+ help
+ Use the system's existing ccache configuration
+ (~/.cache/ccache or system defaults). Allows manual
+ tuning via "ccache --set-config" commands.
+
+config BOOTLINUX_CCACHE_KDEVOPS_MANAGED
+ bool "kdevops-managed ccache configuration"
+ output yaml
+ help
+ kdevops generates and manages a project-specific ccache
+ configuration file using TOPDIR_PATH. This ensures
+ isolation from system-wide ccache settings and allows
+ project-specific tuning.
+
+ Configuration location: $(TOPDIR_PATH)/.ccache/ccache.conf
+
+endchoice
+
+if BOOTLINUX_CCACHE_KDEVOPS_MANAGED
+
+config BOOTLINUX_CCACHE_MAX_SIZE
+ int "Maximum cache size (GiB)"
+ output yaml
+ default 10
+ help
+ Maximum size for the ccache in GiB. Common values:
+ - 5 (default ccache setting)
+ - 10 (recommended for kernel development)
+ - 20 (large projects/multiple kernels)
+ - 50 (high-performance development environments)
+
+config BOOTLINUX_CCACHE_DIR
+ string "Cache directory"
+ output yaml
+ default "$(TOPDIR_PATH)/.ccache/cache"
+ help
+ Directory where ccache stores cached compilation results.
+ Using TOPDIR_PATH ensures project isolation.
+
+config BOOTLINUX_CCACHE_COMPRESSION
+ bool "Enable compression"
+ output yaml
+ default y
+ help
+ Enable compression of cached files to save disk space.
+ Slightly increases CPU usage but significantly reduces
+ storage requirements.
+
+endif # BOOTLINUX_CCACHE_KDEVOPS_MANAGED
+
+endmenu
+
choice
prompt "Type of development version of Linux to use"
default BOOTLINUX_LINUS if !BOOTLINUX_TREE_SET_BY_CLI && !BOOTLINUX_TREE_REF_SET_BY_CLI
--
2.50.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH v2 3/4] workflows: bootlinux: add kernel configuration fragments support
2025-09-19 12:25 [PATCH v2 0/4] workflows: bootlinux: enhance kernel configuration fragment support Daniel Gomez
2025-09-19 12:25 ` [PATCH v2 1/4] workflows: bootlinux: add reproducible builds support Daniel Gomez
2025-09-19 12:25 ` [PATCH v2 2/4] workflows: bootlinux: add comprehensive ccache support Daniel Gomez
@ 2025-09-19 12:25 ` Daniel Gomez
2025-09-19 12:25 ` [PATCH v2 4/4] workflows: bootlinux: add clean builds configuration option Daniel Gomez
2025-09-19 18:10 ` [PATCH v2 0/4] workflows: bootlinux: enhance kernel configuration fragment support Luis Chamberlain
4 siblings, 0 replies; 6+ messages in thread
From: Daniel Gomez @ 2025-09-19 12:25 UTC (permalink / raw)
To: Luis Chamberlain, Chuck Lever; +Cc: kdevops, Daniel Gomez
From: Daniel Gomez <da.gomez@samsung.com>
Add comprehensive kernel configuration fragment system that enables
building kernels using merge_config.sh with focused configuration
fragments instead of monolithic config files.
Key features:
- Modular Kconfig organization split into logical categories
- Support for both x86_64 and ARM64 architectures
- Architecture-specific fragment visibility (ARM64 page sizes)
- Module dependency management for advanced features
- New fragments for extended modversions, kmemleak, and module testing
Fragment categories:
- Essential: Core system requirements (64bit, systemd, distro, storage)
- Security: Hardening and security features
- Architecture: Platform-specific optimizations
- Development: Debugging and diagnostic tools
- Memory: NUMA and memory management features
- Modules: Kernel module system configuration
- Advanced: eBPF, XArray, and specialized features
- Container: Virtualization and container support
- Specialized: Minimal kernels, power management, Rust support
- Legacy: Compatibility and legacy feature support
Technical implementation:
- Uses merge_config.sh for robust fragment composition
- Complete integration with kdevops build workflow
- Supports both 9P and target build modes
- Pre-built configurations for common setups
- Template-based fragment management
Configuration fragments origin:
https://github.com/dkruces/linux-config-fragments
Generated-by: Claude AI
Signed-off-by: Daniel Gomez <da.gomez@samsung.com>
Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
---
defconfigs/configs/linux_kdevops.config | 11 +++
defconfigs/configs/linux_minimal.config | 9 +++
playbooks/roles/bootlinux/defaults/main.yml | 43 +++++++++++
playbooks/roles/bootlinux/tasks/build/9p.yml | 13 +++-
playbooks/roles/bootlinux/tasks/build/builder.yml | 2 +
playbooks/roles/bootlinux/tasks/build/targets.yml | 8 +++
.../roles/bootlinux/tasks/config-fragments.yml | 80 +++++++++++++++++++++
.../bootlinux/templates/fragments/64bit.config | 1 +
.../templates/fragments/arm64_16k_pages.config | 1 +
.../templates/fragments/arm64_4k_pages.config | 1 +
.../templates/fragments/arm64_64k_pages.config | 1 +
.../bootlinux/templates/fragments/blktrace.config | 2 +
.../templates/fragments/buffer_head.config | 7 ++
.../bootlinux/templates/fragments/distro.config | 84 ++++++++++++++++++++++
.../templates/fragments/ebpf-errorinj.config | 2 +
.../bootlinux/templates/fragments/ebpf.config | 61 ++++++++++++++++
.../roles/bootlinux/templates/fragments/gdb.config | 6 ++
.../bootlinux/templates/fragments/initramfs.config | 22 ++++++
.../bootlinux/templates/fragments/kmemleak.config | 3 +
.../roles/bootlinux/templates/fragments/ksm.config | 1 +
.../bootlinux/templates/fragments/localauto.config | 2 +
.../bootlinux/templates/fragments/moby.config | 9 +++
.../templates/fragments/modules-blk.config | 2 +
.../fragments/modules-extended-modversions.config | 2 +
.../templates/fragments/modules-modversions.config | 1 +
.../templates/fragments/modules-testing.config | 3 +
.../bootlinux/templates/fragments/modules.config | 15 ++++
.../bootlinux/templates/fragments/numa.config | 2 +
.../bootlinux/templates/fragments/storage.config | 11 +++
.../bootlinux/templates/fragments/systemd.config | 78 ++++++++++++++++++++
.../bootlinux/templates/fragments/virtio-fs.config | 15 ++++
.../bootlinux/templates/fragments/vm_debug.config | 1 +
.../bootlinux/templates/fragments/xarray.config | 6 ++
.../templates/fragments/xarray_no_multi.config | 9 +++
workflows/linux/Kconfig | 2 +
workflows/linux/Kconfig.fragments | 26 +++++++
workflows/linux/fragments/Kconfig.advanced | 27 +++++++
workflows/linux/fragments/Kconfig.arch | 30 ++++++++
workflows/linux/fragments/Kconfig.container | 15 ++++
workflows/linux/fragments/Kconfig.development | 28 ++++++++
workflows/linux/fragments/Kconfig.essential | 63 ++++++++++++++++
workflows/linux/fragments/Kconfig.legacy | 9 +++
workflows/linux/fragments/Kconfig.memory | 15 ++++
workflows/linux/fragments/Kconfig.modules | 46 ++++++++++++
workflows/linux/fragments/Kconfig.security | 10 +++
workflows/linux/fragments/Kconfig.specialized | 23 ++++++
46 files changed, 807 insertions(+), 1 deletion(-)
diff --git a/defconfigs/configs/linux_kdevops.config b/defconfigs/configs/linux_kdevops.config
new file mode 100644
index 00000000..948935e6
--- /dev/null
+++ b/defconfigs/configs/linux_kdevops.config
@@ -0,0 +1,11 @@
+CONFIG_BOOTLINUX_USE_CONFIG_FRAGMENTS=y
+CONFIG_BOOTLINUX_FRAGMENT_64BIT=y
+CONFIG_BOOTLINUX_FRAGMENT_KVM_GUEST=y
+CONFIG_BOOTLINUX_FRAGMENT_VIRTIO_FS=y
+CONFIG_BOOTLINUX_FRAGMENT_SYSTEMD=y
+CONFIG_BOOTLINUX_FRAGMENT_DISTRO=y
+CONFIG_BOOTLINUX_FRAGMENT_STORAGE=y
+CONFIG_BOOTLINUX_FRAGMENT_INITRAMFS=y
+CONFIG_BOOTLINUX_FRAGMENT_LOCALAUTO=y
+CONFIG_BOOTLINUX_FRAGMENT_MODULES=y
+CONFIG_BOOTLINUX_FRAGMENT_MODULES_BLK=y
diff --git a/defconfigs/configs/linux_minimal.config b/defconfigs/configs/linux_minimal.config
new file mode 100644
index 00000000..4624f6e7
--- /dev/null
+++ b/defconfigs/configs/linux_minimal.config
@@ -0,0 +1,9 @@
+CONFIG_BOOTLINUX_USE_CONFIG_FRAGMENTS=y
+CONFIG_BOOTLINUX_FRAGMENT_64BIT=y
+CONFIG_BOOTLINUX_FRAGMENT_KVM_GUEST=y
+CONFIG_BOOTLINUX_FRAGMENT_VIRTIO_FS=y
+CONFIG_BOOTLINUX_FRAGMENT_SYSTEMD=y
+CONFIG_BOOTLINUX_FRAGMENT_DISTRO=y
+CONFIG_BOOTLINUX_FRAGMENT_STORAGE=y
+CONFIG_BOOTLINUX_FRAGMENT_INITRAMFS=y
+CONFIG_BOOTLINUX_FRAGMENT_LOCALAUTO=y
diff --git a/playbooks/roles/bootlinux/defaults/main.yml b/playbooks/roles/bootlinux/defaults/main.yml
index 97adec30..1ae70b2c 100644
--- a/playbooks/roles/bootlinux/defaults/main.yml
+++ b/playbooks/roles/bootlinux/defaults/main.yml
@@ -98,3 +98,46 @@ bootlinux_tree_custom_localversion: false
bootlinux_is_dev_node: false
bootlinux_debug_ref: "{{ lookup('env', 'DEBUG_REF') | default(false, true) | bool }}"
+# Kernel configuration fragments support
+bootlinux_use_config_fragments: false
+
+# Upstream kernel fragments
+bootlinux_fragment_tiny: false
+bootlinux_fragment_nopm: false
+bootlinux_fragment_debug: false
+bootlinux_fragment_hardening: false
+bootlinux_fragment_kvm_guest: true
+bootlinux_fragment_xen: false
+bootlinux_fragment_rust: false
+
+# kdevops fragments
+bootlinux_fragment_64bit: true
+bootlinux_fragment_systemd: true
+bootlinux_fragment_distro: true
+bootlinux_fragment_storage: true
+bootlinux_fragment_virtio_fs: true
+bootlinux_fragment_numa: false
+bootlinux_fragment_modules: false
+bootlinux_fragment_initramfs: true
+bootlinux_fragment_ebpf: false
+bootlinux_fragment_gdb: false
+bootlinux_fragment_vm_debug: false
+bootlinux_fragment_localversion: false
+bootlinux_fragment_blktrace: false
+bootlinux_fragment_ksm: false
+
+# ARM64 page size (mutually exclusive choice)
+bootlinux_fragment_arm64_4k_pages: false
+bootlinux_fragment_arm64_16k_pages: false
+bootlinux_fragment_arm64_64k_pages: false
+
+# Additional kdevops fragments
+bootlinux_fragment_buffer_head: false
+bootlinux_fragment_ebpf_errorinj: false
+bootlinux_fragment_localauto: true
+bootlinux_fragment_moby: false
+bootlinux_fragment_modules_blk: false
+bootlinux_fragment_x86: false
+bootlinux_fragment_xarray: false
+bootlinux_fragment_xarray_no_multi: false
+
diff --git a/playbooks/roles/bootlinux/tasks/build/9p.yml b/playbooks/roles/bootlinux/tasks/build/9p.yml
index 6f03ed9a..08512c90 100644
--- a/playbooks/roles/bootlinux/tasks/build/9p.yml
+++ b/playbooks/roles/bootlinux/tasks/build/9p.yml
@@ -116,6 +116,16 @@
mode: "0644"
run_once: true
delegate_to: localhost
+ when: not bootlinux_use_config_fragments|default(false)|bool
+
+- name: Use configuration fragments for Linux {{ target_linux_tree }} on the control node
+ ansible.builtin.import_tasks: ../config-fragments.yml
+ run_once: true
+ delegate_to: localhost
+ vars:
+ target_linux_dir_path: "{{ bootlinux_9p_host_path }}"
+ when:
+ - bootlinux_use_config_fragments|default(false)|bool
- name: Set kernel localversion if requested on the control node
ansible.builtin.shell: "echo {{ active_linux_localversion | default(target_linux_localversion) }} > {{ bootlinux_9p_host_path }}/localversion"
@@ -128,7 +138,7 @@
$ {{ ansible_callback_diy.result.output.cmd | join(' ') }}
{{ ansible_callback_diy.result.output.stdout | default('') }}
-- name: Configure Linux {{ target_linux_tree }} on the control node
+- name: Configure kernel with oldconfig (9P build - monolithic config only)
ansible.builtin.shell: |
set -o pipefail
yes "" | make oldconfig
@@ -141,6 +151,7 @@
executable: /bin/bash
run_once: true
delegate_to: localhost
+ when: not bootlinux_use_config_fragments|default(false)|bool
vars:
ansible_callback_diy_runner_on_ok_msg: |
$ {{ ansible_callback_diy.result.output.cmd | join(' ') }}
diff --git a/playbooks/roles/bootlinux/tasks/build/builder.yml b/playbooks/roles/bootlinux/tasks/build/builder.yml
index 9ab73bf7..f981ad97 100644
--- a/playbooks/roles/bootlinux/tasks/build/builder.yml
+++ b/playbooks/roles/bootlinux/tasks/build/builder.yml
@@ -112,6 +112,7 @@
target: "olddefconfig"
when:
- bootlinux_compiler_gcc|bool
+ - not bootlinux_use_config_fragments|default(false)|bool
- name: Build {{ target_linux_tree }}
community.general.make:
@@ -129,6 +130,7 @@
target: "olddefconfig"
when:
- bootlinux_compiler_clang|bool
+ - not bootlinux_use_config_fragments|default(false)|bool
- name: Build {{ target_linux_tree }}
community.general.make:
diff --git a/playbooks/roles/bootlinux/tasks/build/targets.yml b/playbooks/roles/bootlinux/tasks/build/targets.yml
index 5deb330b..d77c8634 100644
--- a/playbooks/roles/bootlinux/tasks/build/targets.yml
+++ b/playbooks/roles/bootlinux/tasks/build/targets.yml
@@ -75,6 +75,13 @@
owner: "{{ data_user }}"
group: "{{ data_group }}"
mode: "0644"
+ when: not bootlinux_use_config_fragments|default(false)|bool
+
+- name: Use configuration fragments for Linux {{ target_linux_tree }} on target nodes
+ ansible.builtin.import_tasks: ../config-fragments.yml
+ when:
+ - bootlinux_use_config_fragments|default(false)|bool
+ - target_arch_arm64|default(false)|bool
- name: Set kernel localversion if requested on the target nodes
ansible.builtin.shell: "echo {{ target_linux_localversion }} > {{ target_linux_dir_path }}/localversion"
@@ -91,6 +98,7 @@
args:
chdir: "{{ target_linux_dir_path }}"
executable: /bin/bash
+ when: not bootlinux_use_config_fragments|default(false)|bool
- name: Build {{ target_linux_tree }} on the target nodes
ansible.builtin.shell: "{{ target_linux_make_cmd }}"
diff --git a/playbooks/roles/bootlinux/tasks/config-fragments.yml b/playbooks/roles/bootlinux/tasks/config-fragments.yml
new file mode 100644
index 00000000..855022b6
--- /dev/null
+++ b/playbooks/roles/bootlinux/tasks/config-fragments.yml
@@ -0,0 +1,80 @@
+---
+# Kernel configuration using fragments with merge_config.sh
+
+- name: Initialize fragment list
+ ansible.builtin.set_fact:
+ fragment_list: []
+
+# Build fragment list for upstream kernel fragments
+- name: Add upstream fragments to list
+ ansible.builtin.set_fact:
+ fragment_list: "{{ fragment_list + [item.path] }}"
+ loop:
+ - { condition: "{{ bootlinux_fragment_tiny|default(false)|bool }}", path: "kernel/configs/tiny.config" }
+ - { condition: "{{ bootlinux_fragment_nopm|default(false)|bool }}", path: "kernel/configs/nopm.config" }
+ - { condition: "{{ bootlinux_fragment_debug|default(false)|bool }}", path: "kernel/configs/debug.config" }
+ - { condition: "{{ bootlinux_fragment_hardening|default(false)|bool }}", path: "kernel/configs/hardening.config" }
+ - { condition: "{{ bootlinux_fragment_kvm_guest|default(false)|bool }}", path: "kernel/configs/kvm_guest.config" }
+ - { condition: "{{ bootlinux_fragment_xen|default(false)|bool }}", path: "kernel/configs/xen.config" }
+ - { condition: "{{ bootlinux_fragment_rust|default(false)|bool }}", path: "kernel/configs/rust.config" }
+ when: item.condition
+
+# Build fragment list for kdevops template fragments
+- name: Add kdevops template fragments to list
+ ansible.builtin.set_fact:
+ fragment_list: "{{ fragment_list + [role_path + '/templates/fragments/' + item.file] }}"
+ loop:
+ - { condition: "{{ bootlinux_fragment_64bit|default(false)|bool }}", file: "64bit.config" }
+ - { condition: "{{ bootlinux_fragment_systemd|default(false)|bool }}", file: "systemd.config" }
+ - { condition: "{{ bootlinux_fragment_distro|default(false)|bool }}", file: "distro.config" }
+ - { condition: "{{ bootlinux_fragment_storage|default(false)|bool }}", file: "storage.config" }
+ - { condition: "{{ bootlinux_fragment_virtio_fs|default(false)|bool }}", file: "virtio-fs.config" }
+ - { condition: "{{ bootlinux_fragment_numa|default(false)|bool }}", file: "numa.config" }
+ - { condition: "{{ bootlinux_fragment_modules|default(false)|bool }}", file: "modules.config" }
+ - { condition: "{{ bootlinux_fragment_initramfs|default(false)|bool }}", file: "initramfs.config" }
+ - { condition: "{{ bootlinux_fragment_ebpf|default(false)|bool }}", file: "ebpf.config" }
+ - { condition: "{{ bootlinux_fragment_gdb|default(false)|bool }}", file: "gdb.config" }
+ - { condition: "{{ bootlinux_fragment_vm_debug|default(false)|bool }}", file: "vm_debug.config" }
+ - { condition: "{{ bootlinux_fragment_localversion|default(false)|bool }}", file: "localversion.config" }
+ - { condition: "{{ bootlinux_fragment_blktrace|default(false)|bool }}", file: "blktrace.config" }
+ - { condition: "{{ bootlinux_fragment_ksm|default(false)|bool }}", file: "ksm.config" }
+ - { condition: "{{ bootlinux_fragment_arm64_4k_pages|default(false)|bool }}", file: "arm64_4k_pages.config" }
+ - { condition: "{{ bootlinux_fragment_arm64_16k_pages|default(false)|bool }}", file: "arm64_16k_pages.config" }
+ - { condition: "{{ bootlinux_fragment_arm64_64k_pages|default(false)|bool }}", file: "arm64_64k_pages.config" }
+ - { condition: "{{ bootlinux_fragment_buffer_head|default(false)|bool }}", file: "buffer_head.config" }
+ - { condition: "{{ bootlinux_fragment_ebpf_errorinj|default(false)|bool }}", file: "ebpf-errorinj.config" }
+ - { condition: "{{ bootlinux_fragment_localauto|default(false)|bool }}", file: "localauto.config" }
+ - { condition: "{{ bootlinux_fragment_moby|default(false)|bool }}", file: "moby.config" }
+ - { condition: "{{ bootlinux_fragment_modules_blk|default(false)|bool }}", file: "modules-blk.config" }
+ - { condition: "{{ bootlinux_fragment_x86|default(false)|bool }}", file: "x86.config" }
+ - { condition: "{{ bootlinux_fragment_xarray|default(false)|bool }}", file: "xarray.config" }
+ - { condition: "{{ bootlinux_fragment_xarray_no_multi|default(false)|bool }}", file: "xarray_no_multi.config" }
+ when: item.condition
+
+- name: Display selected configuration fragments
+ ansible.builtin.debug:
+ msg: |
+ Selected kernel configuration fragments ({{ fragment_list | length }} total):
+ {{ fragment_list | join(' ') }}
+ when: fragment_list | length > 0
+
+- name: Display warning if no fragments selected
+ ansible.builtin.debug:
+ msg: "WARNING: No configuration fragments were selected!"
+ when: fragment_list | length == 0
+ vars:
+ ansible_callback_diy_runner_on_ok_msg: "{{ ansible_callback_diy.result.output.msg }}"
+
+# Apply fragments using merge_config.sh
+- name: Apply configuration fragments using merge_config.sh
+ ansible.builtin.shell: >-
+ {{ 'LLVM=1 ' if bootlinux_compiler_clang|default(false)|bool else '' }}./scripts/kconfig/merge_config.sh
+ -n .config
+ {{ fragment_list | join(' ') }}
+ args:
+ chdir: "{{ target_linux_dir_path }}"
+ when: fragment_list | length > 0
+ vars:
+ ansible_callback_diy_runner_on_ok_msg: |
+ $ {{ ansible_callback_diy.result.output.cmd }}
+ {{ ansible_callback_diy.result.output.stdout | default('') }}
diff --git a/playbooks/roles/bootlinux/templates/fragments/64bit.config b/playbooks/roles/bootlinux/templates/fragments/64bit.config
new file mode 100644
index 00000000..06a94e48
--- /dev/null
+++ b/playbooks/roles/bootlinux/templates/fragments/64bit.config
@@ -0,0 +1 @@
+CONFIG_64BIT=y
diff --git a/playbooks/roles/bootlinux/templates/fragments/arm64_16k_pages.config b/playbooks/roles/bootlinux/templates/fragments/arm64_16k_pages.config
new file mode 100644
index 00000000..a83e1a50
--- /dev/null
+++ b/playbooks/roles/bootlinux/templates/fragments/arm64_16k_pages.config
@@ -0,0 +1 @@
+CONFIG_ARM64_16K_PAGES=y
diff --git a/playbooks/roles/bootlinux/templates/fragments/arm64_4k_pages.config b/playbooks/roles/bootlinux/templates/fragments/arm64_4k_pages.config
new file mode 100644
index 00000000..5df91df1
--- /dev/null
+++ b/playbooks/roles/bootlinux/templates/fragments/arm64_4k_pages.config
@@ -0,0 +1 @@
+CONFIG_ARM64_4K_PAGES=y
diff --git a/playbooks/roles/bootlinux/templates/fragments/arm64_64k_pages.config b/playbooks/roles/bootlinux/templates/fragments/arm64_64k_pages.config
new file mode 100644
index 00000000..bda5426d
--- /dev/null
+++ b/playbooks/roles/bootlinux/templates/fragments/arm64_64k_pages.config
@@ -0,0 +1 @@
+CONFIG_ARM64_64K_PAGES=y
diff --git a/playbooks/roles/bootlinux/templates/fragments/blktrace.config b/playbooks/roles/bootlinux/templates/fragments/blktrace.config
new file mode 100644
index 00000000..1d95879a
--- /dev/null
+++ b/playbooks/roles/bootlinux/templates/fragments/blktrace.config
@@ -0,0 +1,2 @@
+CONFIG_FTRACE=y
+CONFIG_BLK_DEV_IO_TRACE=y
diff --git a/playbooks/roles/bootlinux/templates/fragments/buffer_head.config b/playbooks/roles/bootlinux/templates/fragments/buffer_head.config
new file mode 100644
index 00000000..a091f1ee
--- /dev/null
+++ b/playbooks/roles/bootlinux/templates/fragments/buffer_head.config
@@ -0,0 +1,7 @@
+# Disable buffer head support
+CONFIG_EXFAT_FS=n
+CONFIG_EXT4_FS=n
+CONFIG_FAT_FS=n
+CONFIG_NTFS_FS=n
+CONFIG_MSDOS_FS=n
+CONFIG_VFAT_FS=n
diff --git a/playbooks/roles/bootlinux/templates/fragments/distro.config b/playbooks/roles/bootlinux/templates/fragments/distro.config
new file mode 100644
index 00000000..4a0d3cf0
--- /dev/null
+++ b/playbooks/roles/bootlinux/templates/fragments/distro.config
@@ -0,0 +1,84 @@
+CONFIG_ACPI=y
+CONFIG_ADVISE_SYSCALLS=y
+CONFIG_AIO=y
+CONFIG_ALLOW_DEV_COREDUMP=y
+CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_MISC=y
+CONFIG_BINFMT_SCRIPT=y
+CONFIG_BUG=y
+CONFIG_CHECKPOINT_RESTORE=y
+CONFIG_CMA_SYSFS=y
+CONFIG_CMA=y
+CONFIG_CONSOLE_TRANSLATIONS=y
+CONFIG_COREDUMP=y # Required by CONFIG_ELF_CORE
+CONFIG_CPU_ISOLATION=y
+CONFIG_CROSS_MEMORY_ATTACH=y
+CONFIG_DEBUG_MISC=y
+CONFIG_DEVMEM=y
+CONFIG_DEVTMPFS=y
+CONFIG_E1000E=y
+CONFIG_E1000=y
+CONFIG_ELF_CORE=y
+CONFIG_ETHERNET=y
+CONFIG_EXPERT=y
+CONFIG_EXT4_USE_FOR_EXT2=y
+CONFIG_FAT_DEFAULT_UTF8=y
+CONFIG_FAT_FS=y
+CONFIG_FILE_LOCKING=y # Required for CONFIG_NFSD
+CONFIG_FS_STACK=y
+CONFIG_FUSE_DAX=y
+CONFIG_FUSE_IO_URING=y
+CONFIG_FUSE_PASSTHROUGH=y
+CONFIG_FUTEX=y
+CONFIG_FW_LOADER=y
+CONFIG_GUP_TEST=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_HOTPLUG_CPU=y
+CONFIG_HWMON=y
+CONFIG_HW_RANDOM=y
+CONFIG_INPUT=y
+CONFIG_IOMMU_SUPPORT=y
+CONFIG_KALLSYMS=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_MEMBARRIER=y
+CONFIG_MEMCG=y
+CONFIG_MIGRATION=y
+CONFIG_MSDOS_FS=y
+CONFIG_NET_9P_FD=y
+CONFIG_NETFILTER=y
+CONFIG_NET_VENDOR_INTEL=y
+CONFIG_NFSD=y
+CONFIG_NLS_CODEPAGE_437=y
+CONFIG_NLS_ISO8859_1=y
+CONFIG_NLS=y
+CONFIG_NTFS_FS=y
+CONFIG_PACKET=y
+CONFIG_POSIX_TIMERS=y
+CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK=y
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_QUOTA=y
+CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
+CONFIG_SERIAL_AMBA_PL011=y
+CONFIG_SHMEM=y
+CONFIG_SIGNALFD=y
+CONFIG_SMP=y
+CONFIG_SYN_COOKIES=y
+CONFIG_SYSFS_DEPRECATED=n
+CONFIG_SYSFS_SYSCALL=y
+CONFIG_SYSFS=y
+CONFIG_SYSVIPC=y
+CONFIG_TIMERFD=y
+CONFIG_TMPFS_POSIX_ACL=y
+CONFIG_TRANSPARENT_HUGEPAGE=y
+CONFIG_TTY=y
+CONFIG_UNIX98_PTYS=y
+CONFIG_UNIX_DIAG=y
+CONFIG_USB_SUPPORT=y
+CONFIG_VFAT_FS=y
+CONFIG_VIRTIO_INPUT=y
+CONFIG_VT=y
+CONFIG_XFS_SUPPORT_ASCII_CI=y
+CONFIG_ZONE_DMA=y
diff --git a/playbooks/roles/bootlinux/templates/fragments/ebpf-errorinj.config b/playbooks/roles/bootlinux/templates/fragments/ebpf-errorinj.config
new file mode 100644
index 00000000..5e132d93
--- /dev/null
+++ b/playbooks/roles/bootlinux/templates/fragments/ebpf-errorinj.config
@@ -0,0 +1,2 @@
+CONFIG_BPF_KPROBE_OVERRIDE=y
+CONFIG_FUNCTION_ERROR_INJECTION=y
diff --git a/playbooks/roles/bootlinux/templates/fragments/ebpf.config b/playbooks/roles/bootlinux/templates/fragments/ebpf.config
new file mode 100644
index 00000000..2d393735
--- /dev/null
+++ b/playbooks/roles/bootlinux/templates/fragments/ebpf.config
@@ -0,0 +1,61 @@
+# eBPF
+# DOCS:
+# https://github.com/iovisor/bcc/blob/master/docs/kernel_config.md
+# https://github.com/iovisor/bcc/blob/master/INSTALL.md#kernel-configuration
+CONFIG_BPF=y
+CONFIG_BPFILTER=y
+CONFIG_BPFILTER_UMH=y
+CONFIG_BPF_EVENTS=y
+CONFIG_BPF_JIT=y
+CONFIG_BPF_JIT_ALWAYS_ON=y
+CONFIG_BPF_LIRC_MODE2=y
+CONFIG_BPF_LSM=y
+CONFIG_BPF_STREAM_PARSER=y
+CONFIG_BPF_SYSCALL=y
+CONFIG_CGROUP_BPF=y
+CONFIG_DEBUG_INFO_BTF=y # macos sdk error
+CONFIG_DEBUG_INFO_REDUCED=n
+CONFIG_DUMMY=y
+CONFIG_DYNAMIC_FTRACE=y
+CONFIG_FTRACE=y # Required by CONFIG_BPF_EVENTS
+CONFIG_FTRACE_SYSCALLS=y
+CONFIG_FUNCTION_GRAPH_TRACER=y
+CONFIG_FUNCTION_TRACER=y
+CONFIG_IKHEADERS=y
+CONFIG_IPV6_SEG6_LWTUNNEL=y
+CONFIG_KPROBES=y
+CONFIG_KPROBE_EVENTS=y # Required by CONFIG_BPF_EVENTS
+CONFIG_LIRC=y
+CONFIG_LWTUNNEL_BPF=y
+CONFIG_MODULES=y # Required by CONFIG_BPF_JIT
+CONFIG_NETFILTER_XTABLES=y
+CONFIG_NETFILTER_XT_MATCH_BPF=y
+CONFIG_NET_ACT_BPF=y
+CONFIG_NET_ACT_GACT=y
+CONFIG_NET_ACT_POLICE=y
+CONFIG_NET_CLS_ACT=y
+CONFIG_NET_CLS_BPF=y
+CONFIG_NET_SCHED=y
+CONFIG_NET_SCH_SFQ=y
+CONFIG_PERF_EVENTS=y # Required by CONFIG_BPF_EVENTS
+CONFIG_PROFILING=y
+CONFIG_RC_CORE=y
+CONFIG_SECURITY=y
+CONFIG_STACK_TRACER=y
+CONFIG_UPROBE_EVENTS=y # Required by CONFIG_BPF_EVENTS
+CONFIG_VXLAN=y
+CONFIG_NET=y # Required by CONFIG_BPFILTER and CONFIG_IPV6_SEG6_LWTUNNEL
+CONFIG_INET=y # Required by CONFIG_BPFILTER and CONFIG_IPV6_SEG6_LWTUNNEL
+CONFIG_RC_CORE=y # Required by CONFIG_BPF_LIRC_MODE2
+CONFIG_LIRC=y # Required by CONFIG_BPF_LIRC_MODE2
+CONFIG_INPUT=y # Required by CONFIG_BPF_LIRC_MODE2
+CONFIG_SECURITY=y # Required by BPF_LSM
+CONFIG_SYSFS=y # Required by CONFIG_SECURITY and CONFIG_IKHEADERS
+CONFIG_MULTIUSER=y # Required by CONFIG_SECURITY
+CONFIG_CGROUPS=y # Required by CONFIG_CGROUP_BPF
+CONFIG_DEBUG_INFO=y # Required by CONFIG_DEBUG_INFO_BTF
+CONFIG_DEBUG_INFO_SPLIT=n # Required by CONFIG_DEBUG_INFO_BTF
+CONFIG_DEBUG_INFO_REDUCED=n # Required by CONFIG_DEBUG_INFO_BTF
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y # Required by CONFIG_DEBUG_INFO_BTF (CONFIG_DEBUG_INFO_DWARF5)
+CONFIG_NETDEVICES=y # Required by CONFIG_DUMMY
+CONFIG_NET_CORE=y # Required by CONFIG_DUMMY
diff --git a/playbooks/roles/bootlinux/templates/fragments/gdb.config b/playbooks/roles/bootlinux/templates/fragments/gdb.config
new file mode 100644
index 00000000..e95cf9ce
--- /dev/null
+++ b/playbooks/roles/bootlinux/templates/fragments/gdb.config
@@ -0,0 +1,6 @@
+# Debugging kernel and modules via gdb
+# DOCS: https://docs.kernel.org/process/debugging/gdb-kernel-debugging.html
+CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
+CONFIG_DEBUG_INFO_REDUCED=n
+CONFIG_GDB_SCRIPTS=y
diff --git a/playbooks/roles/bootlinux/templates/fragments/initramfs.config b/playbooks/roles/bootlinux/templates/fragments/initramfs.config
new file mode 100644
index 00000000..f80daba7
--- /dev/null
+++ b/playbooks/roles/bootlinux/templates/fragments/initramfs.config
@@ -0,0 +1,22 @@
+# Initial RAM disk support
+CONFIG_BLK_DEV_INITRD=y
+
+# Compression support for initramfs
+CONFIG_RD_GZIP=y
+CONFIG_RD_BZIP2=y
+CONFIG_RD_LZMA=y
+CONFIG_RD_XZ=y
+CONFIG_RD_LZO=y
+CONFIG_RD_LZ4=y
+CONFIG_RD_ZSTD=y
+
+# Kernel compression algorithms needed for initramfs
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_ZSTD_DECOMPRESS=y
+CONFIG_ZSTD_COMPRESS=y
+CONFIG_XZ_DEC=y
+CONFIG_LZO_COMPRESS=y
+CONFIG_LZO_DECOMPRESS=y
+CONFIG_LZ4_COMPRESS=y
+CONFIG_LZ4_DECOMPRESS=y
diff --git a/playbooks/roles/bootlinux/templates/fragments/kmemleak.config b/playbooks/roles/bootlinux/templates/fragments/kmemleak.config
new file mode 100644
index 00000000..9e07bad2
--- /dev/null
+++ b/playbooks/roles/bootlinux/templates/fragments/kmemleak.config
@@ -0,0 +1,3 @@
+CONFIG_DEBUG_KMEMLEAK=y
+CONFIG_SAMPLES=y
+CONFIG_SAMPLE_KMEMLEAK=m
diff --git a/playbooks/roles/bootlinux/templates/fragments/ksm.config b/playbooks/roles/bootlinux/templates/fragments/ksm.config
new file mode 100644
index 00000000..757efcb9
--- /dev/null
+++ b/playbooks/roles/bootlinux/templates/fragments/ksm.config
@@ -0,0 +1 @@
+CONFIG_KSM=y
diff --git a/playbooks/roles/bootlinux/templates/fragments/localauto.config b/playbooks/roles/bootlinux/templates/fragments/localauto.config
new file mode 100644
index 00000000..6276cf0a
--- /dev/null
+++ b/playbooks/roles/bootlinux/templates/fragments/localauto.config
@@ -0,0 +1,2 @@
+CONFIG_COMPILE_TEST=n
+CONFIG_LOCALVERSION_AUTO=y
diff --git a/playbooks/roles/bootlinux/templates/fragments/moby.config b/playbooks/roles/bootlinux/templates/fragments/moby.config
new file mode 100644
index 00000000..38d45d4a
--- /dev/null
+++ b/playbooks/roles/bootlinux/templates/fragments/moby.config
@@ -0,0 +1,9 @@
+# Moby (docker open source)
+# https://github.com/moby/moby/blob/master/contrib/check-config.sh
+CONFIG_BRIDGE_NETFILTER=y
+CONFIG_BRIDGE=y
+CONFIG_CGROUP_CPUACCT=y
+CONFIG_IP_VS=y
+CONFIG_NF_CONNTRACK=y
+CONFIG_OVERLAY_FS=y
+CONFIG_NF_TABLES=y
diff --git a/playbooks/roles/bootlinux/templates/fragments/modules-blk.config b/playbooks/roles/bootlinux/templates/fragments/modules-blk.config
new file mode 100644
index 00000000..3cb3e5c8
--- /dev/null
+++ b/playbooks/roles/bootlinux/templates/fragments/modules-blk.config
@@ -0,0 +1,2 @@
+CONFIG_BLK_DEV_RAM=m
+CONFIG_BLK_DEV_LOOP=m
diff --git a/playbooks/roles/bootlinux/templates/fragments/modules-extended-modversions.config b/playbooks/roles/bootlinux/templates/fragments/modules-extended-modversions.config
new file mode 100644
index 00000000..8e57d490
--- /dev/null
+++ b/playbooks/roles/bootlinux/templates/fragments/modules-extended-modversions.config
@@ -0,0 +1,2 @@
+CONFIG_MODVERSIONS=y
+CONFIG_EXTENDED_MODVERSIONS=y
diff --git a/playbooks/roles/bootlinux/templates/fragments/modules-modversions.config b/playbooks/roles/bootlinux/templates/fragments/modules-modversions.config
new file mode 100644
index 00000000..6119c683
--- /dev/null
+++ b/playbooks/roles/bootlinux/templates/fragments/modules-modversions.config
@@ -0,0 +1 @@
+CONFIG_MODVERSIONS=y
diff --git a/playbooks/roles/bootlinux/templates/fragments/modules-testing.config b/playbooks/roles/bootlinux/templates/fragments/modules-testing.config
new file mode 100644
index 00000000..59a229dd
--- /dev/null
+++ b/playbooks/roles/bootlinux/templates/fragments/modules-testing.config
@@ -0,0 +1,3 @@
+CONFIG_TEST_KALLSYMS=m
+CONFIG_TEST_KMOD=m
+CONFIG_XFS_FS=m
diff --git a/playbooks/roles/bootlinux/templates/fragments/modules.config b/playbooks/roles/bootlinux/templates/fragments/modules.config
new file mode 100644
index 00000000..42abd686
--- /dev/null
+++ b/playbooks/roles/bootlinux/templates/fragments/modules.config
@@ -0,0 +1,15 @@
+CONFIG_MODULES=y
+CONFIG_MODULE_DEBUG=y
+CONFIG_MODULE_STATS=y
+CONFIG_MODULE_DEBUG_AUTOLOAD_DUPS=n
+CONFIG_MODULE_FORCE_LOAD=n
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=n
+CONFIG_MODULE_UNLOAD_TAINT_TRACKING=y
+CONFIG_MODVERSIONS=n
+CONFIG_MODULE_SRCVERSION_ALL=n
+CONFIG_MODULE_SIG=n
+CONFIG_MODULE_COMPRESS=n
+CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS=n
+CONFIG_MODPROBE_PATH=/sbin/modprobe
+CONFIG_TRIM_UNUSED_KSYMS=n
diff --git a/playbooks/roles/bootlinux/templates/fragments/numa.config b/playbooks/roles/bootlinux/templates/fragments/numa.config
new file mode 100644
index 00000000..a7a4edf5
--- /dev/null
+++ b/playbooks/roles/bootlinux/templates/fragments/numa.config
@@ -0,0 +1,2 @@
+CONFIG_SMP=y
+CONFIG_NUMA=y
diff --git a/playbooks/roles/bootlinux/templates/fragments/storage.config b/playbooks/roles/bootlinux/templates/fragments/storage.config
new file mode 100644
index 00000000..da2b46aa
--- /dev/null
+++ b/playbooks/roles/bootlinux/templates/fragments/storage.config
@@ -0,0 +1,11 @@
+CONFIG_BLK_DEV_NULL_BLK=y
+CONFIG_BLK_DEV_NVME=y
+CONFIG_COMPILE_TEST=y
+CONFIG_CONFIGFS_FS=y
+CONFIG_DEBUG_FS=y
+CONFIG_DNOTIFY=y
+CONFIG_EXFAT_FS=y
+CONFIG_FUSE_FS=y
+CONFIG_HUGETLBFS=y
+CONFIG_IO_URING=y
+CONFIG_NVME_VERBOSE_ERRORS=y
diff --git a/playbooks/roles/bootlinux/templates/fragments/systemd.config b/playbooks/roles/bootlinux/templates/fragments/systemd.config
new file mode 100644
index 00000000..be009461
--- /dev/null
+++ b/playbooks/roles/bootlinux/templates/fragments/systemd.config
@@ -0,0 +1,78 @@
+# systemd
+# DOCS: https://github.com/systemd/systemd/blob/main/README
+CONFIG_AUDIT=n
+CONFIG_AUTOFS_FS=y
+CONFIG_SCSI=y # Required by CONFIG_BLK_DEV_BSG
+CONFIG_BLK_DEV_BSG=y
+#CONFIG_BPF=y
+#CONFIG_MODULES=y # Required by CONFIG_BPF_JIT
+#CONFIG_BPF_JIT=y
+#CONFIG_PERF_EVENTS=y # Required by CONFIG_BPF_EVENTS
+#CONFIG_UPROBE_EVENTS=y # Required by CONFIG_BPF_EVENTS
+#CONFIG_KPROBE_EVENTS=y # Required by CONFIG_BPF_EVENTS
+#CONFIG_FTRACE=y # Required by CONFIG_BPF_EVENTS
+#CONFIG_BPF_EVENTS=y
+#CONFIG_BPF_LSM=y
+#CONFIG_BPF_SYSCALL=y
+CONFIG_BTRFS_FS=y
+CONFIG_CFS_BANDWIDTH=y
+CONFIG_CGROUPS=y
+#CONFIG_CGROUP_BPF=y
+CONFIG_CGROUP_SCHED=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y # Required by CONFIG_DEBUG_INFO
+CONFIG_DEBUG_INFO=y # Required for CONFIG_DEBUG_INFO_BTF
+#CONFIG_DEBUG_INFO_BTF=y
+CONFIG_DEVTMPFS=y
+CONFIG_DMI=y # Required by CONFIG_DMIID
+CONFIG_DMIID=y
+CONFIG_SECONDARY_TRUSTED_KEYRING=y # Required by CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG_SECONDARY_KEYRING
+CONFIG_BLK_DEV_DM=y # Required by CONFIG_DM_VERITY
+CONFIG_MD=y # Required by CONFIG_DM_VERITY
+CONFIG_DM_VERITY=y # Required by CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG
+CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG=y
+CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG_SECONDARY_KEYRING=y
+CONFIG_EFI=y # Required for CONFIG_EFIVAR_FS
+CONFIG_EFIVAR_FS=y
+CONFIG_EFI_PARTITION=y
+CONFIG_EPOLL=y
+CONFIG_EXT4_FS=y
+CONFIG_FAIR_GROUP_SCHED=y
+CONFIG_FHANDLE=y
+CONFIG_9P_FS_POSIX_ACL=y
+CONFIG_FS_POSIX_ACL=y
+CONFIG_EXT4_FS_POSIX_ACL=y # Selects FS_POSIX_ACL
+CONFIG_XFS_POSIX_ACL=y # Selects FS_POSIX_ACL
+CONFIG_BTRFS_FS_POSIX_ACL=y # Selects FS_POSIX_ACL
+CONFIG_FW_LOADER_USER_HELPER=n
+CONFIG_HAVE_EBPF_JIT=y
+CONFIG_INTEGRITY_SIGNATURE=y # Required for CONFIG_INTEGRITY_ASYMMETRIC_KEYS
+CONFIG_INTEGRITY_ASYMMETRIC_KEYS=y # Required for CONFIG_IMA_ARCH_POLICY
+CONFIG_SECURITY=y # Required for CONFIG_INTEGRITY
+CONFIG_INTEGRITY=y
+CONFIG_IMA=y # Required by CONFIG_IMA_ARCH_POLICY
+CONFIG_IMA_APPRAISE=y # Required by CONFIG_IMA_ARCH_POLICY
+CONFIG_IMA_ARCH_POLICY=y
+CONFIG_INOTIFY_USER=y
+#CONFIG_INTEGRITY_MACHINE_KEYRING=y
+CONFIG_IPV6=y
+CONFIG_KCMP=y
+CONFIG_NET=y
+CONFIG_NET_NS=y
+CONFIG_PROC_FS=y
+CONFIG_PSI=y
+CONFIG_RT_GROUP_SCHED=n
+CONFIG_SECCOMP=y
+CONFIG_SECCOMP_FILTER=y
+CONFIG_SIGNALFD=y
+CONFIG_SYSFS=y
+CONFIG_SYSFS_DEPRECATED=n
+CONFIG_TIMERFD=y
+CONFIG_SHMEM=y # Required for CONFIG_TMPFS
+CONFIG_TMPFS=y
+CONFIG_TMPFS_XATTR=y
+CONFIG_UEVENT_HELPER_PATH=""
+CONFIG_UNIX=y
+CONFIG_MULTIUSER=y # Required for CONFIG_NAMESPACES
+CONFIG_NAMESPACES=y # Required for CONFIG_USER_NS
+CONFIG_USER_NS=y
+CONFIG_XFS_FS=y
diff --git a/playbooks/roles/bootlinux/templates/fragments/virtio-fs.config b/playbooks/roles/bootlinux/templates/fragments/virtio-fs.config
new file mode 100644
index 00000000..df391082
--- /dev/null
+++ b/playbooks/roles/bootlinux/templates/fragments/virtio-fs.config
@@ -0,0 +1,15 @@
+#CONFIG_VIRTIO_MMIO=y
+# virtio-fs
+# DOCS: https://virtio-fs.gitlab.io/howto-qemu.html
+CONFIG_DAX=y
+#CONFIG_DAX_DRIVER=y # Deprecated by afd586f0d06c ("dax: remove CONFIG_DAX_DRIVER")
+CONFIG_FS_DAX=y
+CONFIG_FUSE_FS=y # Required for VIRTIO_FS
+CONFIG_MEMORY_HOTPLUG=y # Required by CONFIG_ZONE_DEVICE
+CONFIG_MEMORY_HOTREMOVE=y # Required by CONFIG_ZONE_DEVICE
+CONFIG_SPARSEMEM_VMEMMAP=y # Required by CONFIG_ZONE_DEVICE
+CONFIG_MIGRATION=y # Required for CONFIG_MEMORY_HOTREMOVE=y
+CONFIG_MMU=y # Required by CONFIG_FS_DAX
+CONFIG_VIRTIO=y
+CONFIG_VIRTIO_FS=y
+CONFIG_ZONE_DEVICE=y # Required by CONFIG_FS_DAX
diff --git a/playbooks/roles/bootlinux/templates/fragments/vm_debug.config b/playbooks/roles/bootlinux/templates/fragments/vm_debug.config
new file mode 100644
index 00000000..d19bdfdd
--- /dev/null
+++ b/playbooks/roles/bootlinux/templates/fragments/vm_debug.config
@@ -0,0 +1 @@
+CONFIG_DEBUG_VM=y
diff --git a/playbooks/roles/bootlinux/templates/fragments/xarray.config b/playbooks/roles/bootlinux/templates/fragments/xarray.config
new file mode 100644
index 00000000..5474e5f9
--- /dev/null
+++ b/playbooks/roles/bootlinux/templates/fragments/xarray.config
@@ -0,0 +1,6 @@
+CONFIG_TEST_XARRAY=m
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_DEBUG_VM_PGFLAGS=y
+CONFIG_DEBUG_VM=y
+CONFIG_RUNTIME_TESTING_MENU=y # Required for CONFIG_TEST_XARRAY
diff --git a/playbooks/roles/bootlinux/templates/fragments/xarray_no_multi.config b/playbooks/roles/bootlinux/templates/fragments/xarray_no_multi.config
new file mode 100644
index 00000000..456dc608
--- /dev/null
+++ b/playbooks/roles/bootlinux/templates/fragments/xarray_no_multi.config
@@ -0,0 +1,9 @@
+CONFIG_TEST_XARRAY=m
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_DEBUG_VM_PGFLAGS=y
+CONFIG_DEBUG_VM=y
+CONFIG_RUNTIME_TESTING_MENU=y # Required for CONFIG_TEST_XARRAY
+CONFIG_XARRAY_MULTI=n
+CONFIG_TRANSPARENT_HUGEPAGE=n
+CONFIG_PREEMPT_RT=n
diff --git a/workflows/linux/Kconfig b/workflows/linux/Kconfig
index cbfa8a3c..cae82382 100644
--- a/workflows/linux/Kconfig
+++ b/workflows/linux/Kconfig
@@ -561,4 +561,6 @@ endif # BOOTLINUX_AB_DIFFERENT_REF
endif # KDEVOPS_BASELINE_AND_DEV
+source "workflows/linux/Kconfig.fragments"
+
endif # BOOTLINUX
diff --git a/workflows/linux/Kconfig.fragments b/workflows/linux/Kconfig.fragments
new file mode 100644
index 00000000..6d99885a
--- /dev/null
+++ b/workflows/linux/Kconfig.fragments
@@ -0,0 +1,26 @@
+config BOOTLINUX_USE_CONFIG_FRAGMENTS
+ bool "Use kernel configuration fragments"
+ output yaml
+ help
+ Enable this to build the kernel using configuration fragments
+ instead of a monolithic configuration file. This allows you to
+ compose kernel configurations from smaller, focused fragments.
+
+ When enabled, the kernel configuration will be built using
+ merge_config.sh with selected fragments from both upstream
+ kernel sources and kdevops templates.
+
+if BOOTLINUX_USE_CONFIG_FRAGMENTS
+
+source "workflows/linux/fragments/Kconfig.essential"
+source "workflows/linux/fragments/Kconfig.security"
+source "workflows/linux/fragments/Kconfig.arch"
+source "workflows/linux/fragments/Kconfig.development"
+source "workflows/linux/fragments/Kconfig.memory"
+source "workflows/linux/fragments/Kconfig.modules"
+source "workflows/linux/fragments/Kconfig.advanced"
+source "workflows/linux/fragments/Kconfig.container"
+source "workflows/linux/fragments/Kconfig.specialized"
+source "workflows/linux/fragments/Kconfig.legacy"
+
+endif # BOOTLINUX_USE_CONFIG_FRAGMENTS
diff --git a/workflows/linux/fragments/Kconfig.advanced b/workflows/linux/fragments/Kconfig.advanced
new file mode 100644
index 00000000..05d5bc66
--- /dev/null
+++ b/workflows/linux/fragments/Kconfig.advanced
@@ -0,0 +1,27 @@
+menu "Advanced features"
+
+config BOOTLINUX_FRAGMENT_EBPF
+ bool "eBPF support (kdevops: ebpf.config)"
+ output yaml
+ help
+ Enable extended Berkeley Packet Filter support.
+
+config BOOTLINUX_FRAGMENT_EBPF_ERRORINJ
+ bool "eBPF error injection (kdevops: ebpf-errorinj.config)"
+ output yaml
+ help
+ Enable eBPF-based error injection capabilities for testing.
+
+config BOOTLINUX_FRAGMENT_XARRAY
+ bool "XArray data structure support (kdevops: xarray.config)"
+ output yaml
+ help
+ Enable XArray data structure support in the kernel.
+
+config BOOTLINUX_FRAGMENT_XARRAY_NO_MULTI
+ bool "XArray without multi-index (kdevops: xarray_no_multi.config)"
+ output yaml
+ help
+ Enable XArray support but disable multi-index functionality.
+
+endmenu
diff --git a/workflows/linux/fragments/Kconfig.arch b/workflows/linux/fragments/Kconfig.arch
new file mode 100644
index 00000000..1a383666
--- /dev/null
+++ b/workflows/linux/fragments/Kconfig.arch
@@ -0,0 +1,30 @@
+menu "Architecture-specific configuration"
+
+choice
+ prompt "ARM64 page size configuration"
+ depends on TARGET_ARCH_ARM64
+ default BOOTLINUX_FRAGMENT_ARM64_4K_PAGES
+ help
+ Choose the page size configuration for ARM64.
+
+config BOOTLINUX_FRAGMENT_ARM64_4K_PAGES
+ bool "4KB pages (kdevops: arm64_4k_pages.config)"
+ output yaml
+ help
+ Use 4KB page size (default for most systems).
+
+config BOOTLINUX_FRAGMENT_ARM64_16K_PAGES
+ bool "16KB pages (kdevops: arm64_16k_pages.config)"
+ output yaml
+ help
+ Use 16KB page size for better performance in some workloads.
+
+config BOOTLINUX_FRAGMENT_ARM64_64K_PAGES
+ bool "64KB pages (kdevops: arm64_64k_pages.config)"
+ output yaml
+ help
+ Use 64KB page size for high-performance computing workloads.
+
+endchoice
+
+endmenu
diff --git a/workflows/linux/fragments/Kconfig.container b/workflows/linux/fragments/Kconfig.container
new file mode 100644
index 00000000..c3f0460e
--- /dev/null
+++ b/workflows/linux/fragments/Kconfig.container
@@ -0,0 +1,15 @@
+menu "Container and virtualization"
+
+config BOOTLINUX_FRAGMENT_XEN
+ bool "Xen guest support (upstream: xen.config)"
+ output yaml
+ help
+ Use the upstream xen.config fragment to enable Xen hypervisor support.
+
+config BOOTLINUX_FRAGMENT_MOBY
+ bool "Container/Moby support (kdevops: moby.config)"
+ output yaml
+ help
+ Enable kernel features required for container runtimes like Moby/Docker.
+
+endmenu
diff --git a/workflows/linux/fragments/Kconfig.development b/workflows/linux/fragments/Kconfig.development
new file mode 100644
index 00000000..9f9968b8
--- /dev/null
+++ b/workflows/linux/fragments/Kconfig.development
@@ -0,0 +1,28 @@
+menu "Development and debugging"
+
+config BOOTLINUX_FRAGMENT_DEBUG
+ bool "Kernel debugging features (upstream: debug.config)"
+ output yaml
+ help
+ Use the upstream debug.config fragment to enable various kernel debugging
+ and diagnostic features.
+
+config BOOTLINUX_FRAGMENT_GDB
+ bool "Kernel GDB support (kdevops: gdb.config)"
+ output yaml
+ help
+ Enable kernel debugging via GDB.
+
+config BOOTLINUX_FRAGMENT_VM_DEBUG
+ bool "Virtual memory debugging (kdevops: vm_debug.config)"
+ output yaml
+ help
+ Enable virtual memory debugging features.
+
+config BOOTLINUX_FRAGMENT_BLKTRACE
+ bool "Block I/O tracing support (kdevops: blktrace.config)"
+ output yaml
+ help
+ Enable block layer tracing and debugging capabilities.
+
+endmenu
diff --git a/workflows/linux/fragments/Kconfig.essential b/workflows/linux/fragments/Kconfig.essential
new file mode 100644
index 00000000..78d08073
--- /dev/null
+++ b/workflows/linux/fragments/Kconfig.essential
@@ -0,0 +1,63 @@
+menu "Essential kernel configuration"
+
+config BOOTLINUX_FRAGMENT_64BIT
+ bool "64-bit architecture optimizations (kdevops: 64bit.config)"
+ default y
+ output yaml
+ help
+ Enable 64-bit specific optimizations and features.
+
+config BOOTLINUX_FRAGMENT_KVM_GUEST
+ bool "KVM guest optimizations (upstream: kvm_guest.config)"
+ default y
+ output yaml
+ help
+ Use the upstream kvm_guest.config fragment to enable optimizations for
+ running the kernel as a KVM guest.
+
+config BOOTLINUX_FRAGMENT_VIRTIO_FS
+ bool "VirtIO filesystem support (kdevops: virtio-fs.config)"
+ default y
+ output yaml
+ help
+ Enable VirtIO filesystem support for virtualized environments.
+
+config BOOTLINUX_FRAGMENT_SYSTEMD
+ bool "systemd support (kdevops: systemd.config)"
+ default y
+ output yaml
+ help
+ Enable kernel features required by systemd init system.
+
+config BOOTLINUX_FRAGMENT_DISTRO
+ bool "Distribution kernel features (kdevops: distro.config)"
+ default y
+ output yaml
+ help
+ Enable features commonly needed by Linux distributions.
+
+config BOOTLINUX_FRAGMENT_STORAGE
+ bool "Storage and filesystem features (kdevops: storage.config)"
+ default y
+ output yaml
+ help
+ Enable advanced storage and filesystem features.
+
+config BOOTLINUX_FRAGMENT_INITRAMFS
+ bool "Initial RAM disk support (kdevops: initramfs.config)"
+ default y
+ output yaml
+ help
+ Enable initramfs (initial RAM disk) support with compression
+ algorithms. This is essential for most Linux distributions
+ and is needed for generating initrd images during kernel
+ installation.
+
+config BOOTLINUX_FRAGMENT_LOCALAUTO
+ bool "Local version auto generation (kdevops: localauto.config)"
+ default y
+ output yaml
+ help
+ Automatically generate local version strings with git information.
+
+endmenu
diff --git a/workflows/linux/fragments/Kconfig.legacy b/workflows/linux/fragments/Kconfig.legacy
new file mode 100644
index 00000000..87f0f754
--- /dev/null
+++ b/workflows/linux/fragments/Kconfig.legacy
@@ -0,0 +1,9 @@
+menu "Legacy and compatibility"
+
+config BOOTLINUX_FRAGMENT_BUFFER_HEAD
+ bool "Buffer head support (kdevops: buffer_head.config)"
+ output yaml
+ help
+ Enable buffer head infrastructure for filesystem operations.
+
+endmenu
diff --git a/workflows/linux/fragments/Kconfig.memory b/workflows/linux/fragments/Kconfig.memory
new file mode 100644
index 00000000..d6fbcb91
--- /dev/null
+++ b/workflows/linux/fragments/Kconfig.memory
@@ -0,0 +1,15 @@
+menu "Memory management"
+
+config BOOTLINUX_FRAGMENT_NUMA
+ bool "NUMA support (kdevops: numa.config)"
+ output yaml
+ help
+ Enable Non-Uniform Memory Access support.
+
+config BOOTLINUX_FRAGMENT_KSM
+ bool "Kernel Samepage Merging (kdevops: ksm.config)"
+ output yaml
+ help
+ Enable KSM for memory deduplication in virtualized environments.
+
+endmenu
diff --git a/workflows/linux/fragments/Kconfig.modules b/workflows/linux/fragments/Kconfig.modules
new file mode 100644
index 00000000..e64673b1
--- /dev/null
+++ b/workflows/linux/fragments/Kconfig.modules
@@ -0,0 +1,46 @@
+menu "Module and extensibility"
+
+config BOOTLINUX_FRAGMENT_MODULES
+ bool "Enhanced module support (kdevops: modules.config)"
+ output yaml
+ help
+ Enable advanced kernel module features.
+
+config BOOTLINUX_FRAGMENT_MODULES_BLK
+ bool "Block layer module support (kdevops: modules-blk.config)"
+ depends on BOOTLINUX_FRAGMENT_MODULES
+ output yaml
+ help
+ Enhanced block layer module support and debugging.
+
+config BOOTLINUX_FRAGMENT_MODULES_MODVERSIONS
+ bool "Standard module versioning (kdevops: modules-modversions.config)"
+ depends on BOOTLINUX_FRAGMENT_MODULES
+ output yaml
+ help
+ Enable standard module versioning support for module compatibility checking.
+
+config BOOTLINUX_FRAGMENT_MODULES_EXTENDED_MODVERSIONS
+ bool "Extended module versioning (kdevops: modules-extended-modversions.config)"
+ depends on BOOTLINUX_FRAGMENT_MODULES
+ output yaml
+ help
+ Enable extended module versioning support for long symbol names.
+ Required for Rust support and advanced module versioning.
+
+config BOOTLINUX_FRAGMENT_MODULES_TESTING
+ bool "Module testing support (kdevops: modules-testing.config)"
+ depends on BOOTLINUX_FRAGMENT_MODULES
+ output yaml
+ help
+ Enable kernel module testing features including kallsyms and kmod tests.
+
+config BOOTLINUX_FRAGMENT_KMEMLEAK
+ bool "Kernel memory leak detection (kdevops: kmemleak.config)"
+ depends on BOOTLINUX_FRAGMENT_MODULES
+ output yaml
+ help
+ Enable kernel memory leak detection and sample module for debugging
+ memory leaks in kernel code.
+
+endmenu
diff --git a/workflows/linux/fragments/Kconfig.security b/workflows/linux/fragments/Kconfig.security
new file mode 100644
index 00000000..e79f3584
--- /dev/null
+++ b/workflows/linux/fragments/Kconfig.security
@@ -0,0 +1,10 @@
+menu "Security and hardening"
+
+config BOOTLINUX_FRAGMENT_HARDENING
+ bool "Security hardening options (upstream: hardening.config)"
+ output yaml
+ help
+ Use the upstream hardening.config fragment to enable kernel security
+ hardening features.
+
+endmenu
diff --git a/workflows/linux/fragments/Kconfig.specialized b/workflows/linux/fragments/Kconfig.specialized
new file mode 100644
index 00000000..444c0599
--- /dev/null
+++ b/workflows/linux/fragments/Kconfig.specialized
@@ -0,0 +1,23 @@
+menu "Specialized kernel variants"
+
+config BOOTLINUX_FRAGMENT_TINY
+ bool "Tiny kernel configuration (upstream: tiny.config)"
+ output yaml
+ help
+ Use the upstream tiny.config fragment from the kernel sources.
+ This enables CONFIG_EMBEDDED and other options for minimal kernels.
+
+config BOOTLINUX_FRAGMENT_NOPM
+ bool "Disable power management (upstream: nopm.config)"
+ output yaml
+ help
+ Use the upstream nopm.config fragment to disable power management features.
+
+config BOOTLINUX_FRAGMENT_RUST
+ bool "Rust language support (upstream: rust.config)"
+ output yaml
+ help
+ Use the upstream rust.config fragment to enable Rust programming language
+ support in the kernel.
+
+endmenu
--
2.50.1
^ permalink raw reply related [flat|nested] 6+ messages in thread