From e468fc518ee0b3aade66b01e7b05471fc546bc25 Mon Sep 17 00:00:00 2001 From: Luca Weiss Date: Wed, 7 Sep 2022 22:49:23 +0200 Subject: [PATCH] pmb.parse.kconfig: add 'community' option (MR 2204) Add the new option that will be mandatory for all devices in community/main category. This is just a combination of anbox + iwd + nftables + containers + zram + netboot. While the existing options could be removed we're keeping it for now given that also some devices with downstream kernel might find some options useful. --- pmb/build/menuconfig.py | 1 + pmb/helpers/frontend.py | 2 ++ pmb/parse/arguments.py | 3 +++ pmb/parse/kconfig.py | 18 ++++++++++++++++-- 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/pmb/build/menuconfig.py b/pmb/build/menuconfig.py index da9e4c24..032ff062 100644 --- a/pmb/build/menuconfig.py +++ b/pmb/build/menuconfig.py @@ -158,5 +158,6 @@ def menuconfig(args, pkgname, use_oldconfig): force_containers_check=False, force_zram_check=False, force_netboot_check=False, + force_community_check=False, force_uefi_check=False, details=True) diff --git a/pmb/helpers/frontend.py b/pmb/helpers/frontend.py index f4bbf961..50c7fb44 100644 --- a/pmb/helpers/frontend.py +++ b/pmb/helpers/frontend.py @@ -384,6 +384,7 @@ def kconfig(args): containers=args.containers, zram=args.zram, netboot=args.netboot, + community=args.community, uefi=args.uefi, details=True): logging.info("kconfig check succeeded!") @@ -420,6 +421,7 @@ def kconfig(args): force_containers_check=args.containers, force_zram_check=args.zram, force_netboot_check=args.netboot, + force_community_check=args.community, force_uefi_check=args.uefi, details=True): error = True diff --git a/pmb/parse/arguments.py b/pmb/parse/arguments.py index aad5b45d..ab9b54fa 100644 --- a/pmb/parse/arguments.py +++ b/pmb/parse/arguments.py @@ -476,6 +476,9 @@ def arguments_kconfig(subparser): " options needed for zram support too") check.add_argument("--netboot", action="store_true", help="check" " options needed for netbooting too") + check.add_argument("--community", action="store_true", help="check" + " options needed for various features, required for" + " community/main devices") check.add_argument("--uefi", action="store_true", help="check" " options needed for uefi too") add_kernel_arg(check) diff --git a/pmb/parse/kconfig.py b/pmb/parse/kconfig.py index 41661abd..d1f5b169 100644 --- a/pmb/parse/kconfig.py +++ b/pmb/parse/kconfig.py @@ -91,6 +91,7 @@ def check_config(config_path, config_path_pretty, config_arch, pkgver, containers=False, zram=False, netboot=False, + community=False, uefi=False, details=False): logging.debug(f"Check kconfig: {config_path}") @@ -111,6 +112,14 @@ def check_config(config_path, config_path_pretty, config_arch, pkgver, components["zram"] = pmb.config.necessary_kconfig_options_zram if netboot: components["netboot"] = pmb.config.necessary_kconfig_options_netboot + if community: + components["anbox"] = pmb.config.necessary_kconfig_options_anbox + components["iwd"] = pmb.config.necessary_kconfig_options_iwd + components["nftables"] = pmb.config.necessary_kconfig_options_nftables + components["containers"] = \ + pmb.config.necessary_kconfig_options_containers + components["zram"] = pmb.config.necessary_kconfig_options_zram + components["netboot"] = pmb.config.necessary_kconfig_options_netboot if uefi: components["uefi"] = pmb.config.necessary_kconfig_options_uefi @@ -162,6 +171,7 @@ def check(args, pkgname, force_containers_check=False, force_zram_check=False, force_netboot_check=False, + force_community_check=False, force_uefi_check=False, details=False, must_exist=True): @@ -196,6 +206,8 @@ def check(args, pkgname, "pmb:kconfigcheck-zram" in apkbuild["options"]) check_netboot = force_netboot_check or ( "pmb:kconfigcheck-netboot" in apkbuild["options"]) + check_community = force_community_check or ( + "pmb:kconfigcheck-community" in apkbuild["options"]) check_uefi = force_uefi_check or ( "pmb:kconfigcheck-uefi" in apkbuild["options"]) for config_path in glob.glob(aport + "/config-*"): @@ -222,6 +234,7 @@ def check(args, pkgname, containers=check_containers, zram=check_zram, netboot=check_netboot, + community=check_community, uefi=check_uefi, details=details) return ret @@ -260,8 +273,8 @@ def extract_version(config_file): def check_file(config_file, anbox=False, nftables=False, - containers=False, zram=False, netboot=False, uefi=False, - details=False): + containers=False, zram=False, netboot=False, + community=False, uefi=False, details=False): """ Check for necessary kernel config options in a kconfig file. @@ -277,5 +290,6 @@ def check_file(config_file, anbox=False, nftables=False, containers=containers, zram=zram, netboot=netboot, + community=community, uefi=uefi, details=details)