diff --git a/pmb/build/menuconfig.py b/pmb/build/menuconfig.py index 2b2e8121..1caca557 100644 --- a/pmb/build/menuconfig.py +++ b/pmb/build/menuconfig.py @@ -157,4 +157,5 @@ def menuconfig(args, pkgname, use_oldconfig): force_nftables_check=False, force_containers_check=False, force_zram_check=False, + force_netboot_check=False, details=True) diff --git a/pmb/config/__init__.py b/pmb/config/__init__.py index 2e70c18d..4f583ea7 100644 --- a/pmb/config/__init__.py +++ b/pmb/config/__init__.py @@ -563,6 +563,15 @@ necessary_kconfig_options_zram = { }, } +# Necessary netboot kernel config options +necessary_kconfig_options_netboot = { + ">=0.0.0": { # all versions + "all": { # all arches + "BLK_DEV_NBD": True, + } + }, +} + # # PARSE # diff --git a/pmb/helpers/frontend.py b/pmb/helpers/frontend.py index 45cb9086..a533fda2 100644 --- a/pmb/helpers/frontend.py +++ b/pmb/helpers/frontend.py @@ -379,6 +379,7 @@ def kconfig(args): nftables=args.nftables, containers=args.containers, zram=args.zram, + netboot=args.netboot, details=True): logging.info("kconfig check succeeded!") return @@ -414,6 +415,7 @@ def kconfig(args): force_nftables_check=args.nftables, force_containers_check=args.containers, force_zram_check=args.zram, + force_netboot_check=args.netboot, details=True): error = True diff --git a/pmb/parse/arguments.py b/pmb/parse/arguments.py index 2fd50d78..6d07aa0d 100644 --- a/pmb/parse/arguments.py +++ b/pmb/parse/arguments.py @@ -456,6 +456,8 @@ def arguments_kconfig(subparser): help="check options needed for containers too") check.add_argument("--zram", action="store_true", help="check" " options needed for zram support too") + check.add_argument("--netboot", action="store_true", help="check" + " options needed for netboooting too") add_kernel_arg(check) # "pmbootstrap kconfig edit" diff --git a/pmb/parse/kconfig.py b/pmb/parse/kconfig.py index 3707f6e5..b1a03de8 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, nftables=False, containers=False, zram=False, + netboot=False, details=False): logging.debug(f"Check kconfig: {config_path}") with open(config_path) as handle: @@ -110,6 +111,8 @@ def check_config(config_path, config_path_pretty, config_arch, pkgver, pmb.config.necessary_kconfig_options_containers if zram: components["zram"] = pmb.config.necessary_kconfig_options_zram + if netboot: + components["netboot"] = pmb.config.necessary_kconfig_options_netboot results = [check_config_options_set(config, config_path_pretty, config_arch, options, component, @@ -159,6 +162,7 @@ def check(args, pkgname, force_nftables_check=False, force_containers_check=False, force_zram_check=False, + force_netboot_check=False, details=False): """ Check for necessary kernel config options in a package. @@ -188,6 +192,8 @@ def check(args, pkgname, "pmb:kconfigcheck-containers" in apkbuild["options"]) check_zram = force_zram_check or ( "pmb:kconfigcheck-zram" in apkbuild["options"]) + check_netboot = force_netboot_check or ( + "pmb:kconfigcheck-netboot" in apkbuild["options"]) for config_path in glob.glob(aport + "/config-*"): # The architecture of the config is in the name, so it just needs to be # extracted @@ -201,6 +207,7 @@ def check(args, pkgname, nftables=check_nftables, containers=check_containers, zram=check_zram, + netboot=check_netboot, details=details) return ret @@ -238,7 +245,7 @@ def extract_version(config_file): def check_file(config_file, anbox=False, nftables=False, - containers=False, zram=False, details=False): + containers=False, zram=False, netboot=False, details=False): """ Check for necessary kernel config options in a kconfig file. @@ -253,4 +260,5 @@ def check_file(config_file, anbox=False, nftables=False, nftables=nftables, containers=containers, zram=zram, + netboot=netboot, details=details)