From 37b56a79dcc4fab8470134ea3cfa16c9366ba15e Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Fri, 2 Dec 2022 20:34:38 +0100 Subject: mkosi: Rework kconfig handling Instead of relying on the arch specific kconfigs that enable all kinds of options that are irrelevant for our use case, let's beef up our own config a little so that we don't need to rely on the arch specific configs anymore. Also, instead of using scripts/config to enable options in the mkosi build script, let's add a new kernel.config file that includes all the configs we want enabled/disabled. Finally, let's make sure we can properly run the bpf selftests by making sure we enable all the right configs required to run the bpf selftests successfully. We use the scripts/kconfig/merge_config.sh script to merge the three different config files together. --- mkosi.build | 36 ++++-------------------------------- 1 file changed, 4 insertions(+), 32 deletions(-) (limited to 'mkosi.build') diff --git a/mkosi.build b/mkosi.build index 5f6208dd88..cde688b9e6 100755 --- a/mkosi.build +++ b/mkosi.build @@ -284,38 +284,10 @@ if [ -d mkosi.kernel/ ]; then export KBUILD_BUILD_TIMESTAMP="Fri Jun 5 15:58:00 CEST 2015" export KBUILD_BUILD_HOST="mkosi" - make O="$BUILDDIR/mkosi.kernel" defconfig - - scripts/config \ - --file "$BUILDDIR/mkosi.kernel/.config" \ - --enable BPF_SYSCALL \ - --enable BPF_JIT \ - --enable BPF_JIT_ALWAYS_ON \ - --enable BPF_JIT_DEFAULT_ON \ - --enable BPF_UNPRIV_DEFAULT_OFF \ - --enable USERMODE_DRIVER \ - --enable BPF_PRELOAD \ - --enable BPF_PRELOAD_UMD \ - --enable BPF_LSM \ - --enable DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT \ - --enable DEBUG_INFO_BTF \ - --enable BTRFS_FS \ - --enable BTRFS_FS_POSIX_ACL \ - --enable PSI \ - --enable CGROUPS \ - --enable CGROUP_BPF \ - --enable MEMCG \ - --enable MEMCG_SWAP \ - --enable MEMCG_KMEM \ - --enable IMA_ARCH_POLICY \ - --enable DM_VERITY_VERIFY_ROOTHASH_SIG \ - --enable DM_VERITY_VERIFY_ROOTHASH_SIG_SECONDARY_KEYRING \ - --enable INTEGRITY_MACHINE_KEYRING \ - --enable NETFILTER_ADVANCED \ - --enable NF_CONNTRACK_MARK - - # Make sure all unset options are set to their default value. - make O="$BUILDDIR/mkosi.kernel" olddefconfig + scripts/kconfig/merge_config.sh -O "$BUILDDIR/mkosi.kernel" \ + ../mkosi.kernel.config \ + tools/testing/selftests/bpf/config.x86_64 \ + tools/testing/selftests/bpf/config make O="$BUILDDIR/mkosi.kernel" -j "$(nproc)" -- cgit v1.2.1