# SPDX-License-Identifier: LGPL-2.1-or-later

[Config]
@Images=system
MinimumVersion=23~devel

[Output]
@OutputDirectory=build/mkosi.output
@BuildDirectory=build/mkosi.builddir
@CacheDirectory=build/mkosi.cache

[Content]
# Prevent ASAN warnings when building the image and ship the real ASAN options prefixed with MKOSI_.
Environment=ASAN_OPTIONS=verify_asan_link_order=false
            MKOSI_ASAN_OPTIONS=strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1:disable_coredump=0:use_madv_dontdump=1
            MKOSI_UBSAN_OPTIONS=print_stacktrace=1:print_summary=1:halt_on_error=1
@SELinuxRelabel=no
BuildSourcesEphemeral=yes

KernelCommandLine=systemd.crash_shell
                  systemd.log_level=debug,console:info
                  systemd.log_ratelimit_kmsg=0
                  # Disable the kernel's ratelimiting on userspace logging to kmsg.
                  printk.devkmsg=on
                  # Make sure /sysroot is mounted rw in the initrd.
                  rw
                  # Lower the default device timeout so we get a shell earlier if the root device does
                  # not appear for some reason.
                  systemd.default_device_timeout_sec=20
                  # Make sure no LSMs are enabled by default.
                  apparmor=0
                  selinux=0
                  enforcing=0
                  systemd.early_core_pattern=/core
                  systemd.firstboot=no
                  systemd.setenv=SYSTEMD_ENABLE_LOG_CONTEXT=yes
                  SYSTEMD_ENABLE_LOG_CONTEXT=yes
                  raid=noautodetect
                  oops=panic
                  panic=-1
                  softlockup_panic=1
                  panic_on_warn=1
                  # These don't ship proper units with [Install] directives so we have to mask them instead.
                  systemd.mask=isc-dhcp-server.service
                  systemd.mask=mdmonitor.service

[Host]
Credentials=journal.storage=persistent
@Incremental=yes
@RuntimeBuildSources=yes
@QemuSmp=2
@QemuSwtpm=yes
@QemuVsock=yes
@QemuKvm=yes
ToolsTreePackages=virtiofsd
