pmb.parse.kconfig: rename anbox check to waydroid (MR 2204)

Change the naming to fit what software is actually used in postmarketOS.
This commit is contained in:
Luca Weiss 2022-09-04 22:45:22 +02:00 committed by Oliver Smith
parent e468fc518e
commit f7fb1fe078
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
7 changed files with 29 additions and 28 deletions

View File

@ -153,7 +153,8 @@ def menuconfig(args, pkgname, use_oldconfig):
pmb.build.checksum.update(args, pkgname)
# Check config
pmb.parse.kconfig.check(args, apkbuild["_flavor"], force_anbox_check=False,
pmb.parse.kconfig.check(args, apkbuild["_flavor"],
force_waydroid_check=False,
force_nftables_check=False,
force_containers_check=False,
force_zram_check=False,

View File

@ -329,8 +329,8 @@ necessary_kconfig_options = {
}
}
# Necessary anbox/waydroid kernel config options (android app support)
necessary_kconfig_options_anbox = {
# Necessary waydroid kernel config options (android app support)
necessary_kconfig_options_waydroid = {
">=0.0.0": { # all versions
"all": { # all arches
"SQUASHFS": True,
@ -354,12 +354,12 @@ necessary_kconfig_options_anbox = {
},
">=3.5": {
"all": {
"CROSS_MEMORY_ATTACH": True, # required by Waydroid
"CROSS_MEMORY_ATTACH": True,
}
},
">=4.20.0": {
"all": {
"PSI": True, # required by userspace OOM killer in Waydroid
"PSI": True, # required by userspace OOM killer
"PSI_DEFAULT_DISABLED": False,
}
},
@ -450,7 +450,7 @@ necessary_kconfig_options_containers = {
"CPUSETS": True,
"KEYS": True,
"VETH": True,
"BRIDGE": True, # (also needed for anbox)
"BRIDGE": True, # (also needed for waydroid)
"BRIDGE_NETFILTER": True,
"IP_NF_FILTER": True,
"IP_NF_TARGET_MASQUERADE": True,
@ -517,7 +517,7 @@ necessary_kconfig_options_containers = {
},
">=3.9": {
"all": { # all arches
"BRIDGE_VLAN_FILTERING": True, # Network Drivers (also for anbox)
"BRIDGE_VLAN_FILTERING": True, # Network Drivers (also for waydroid)
"MACVLAN": True, # Network Drivers
}
},
@ -655,7 +655,7 @@ apkbuild_attributes = {
apkbuild_custom_valid_options = [
"!pmb:crossdirect",
"!pmb:kconfig-check",
"pmb:kconfigcheck-anbox",
"pmb:kconfigcheck-waydroid",
"pmb:kconfigcheck-containers",
"pmb:kconfigcheck-nftables",
"pmb:cross-native",

View File

@ -379,7 +379,7 @@ def kconfig(args):
# Handle passing a file directly
if args.file:
if pmb.parse.kconfig.check_file(args.package,
anbox=args.anbox,
waydroid=args.waydroid,
nftables=args.nftables,
containers=args.containers,
zram=args.zram,
@ -415,7 +415,7 @@ def kconfig(args):
continue
if not pmb.parse.kconfig.check(
args, package,
force_anbox_check=args.anbox,
force_waydroid_check=args.waydroid,
force_iwd_check=args.iwd,
force_nftables_check=args.nftables,
force_containers_check=args.containers,

View File

@ -464,8 +464,8 @@ def arguments_kconfig(subparser):
check.add_argument("--arch", choices=arch_choices, dest="arch")
check.add_argument("--file", action="store_true", help="check a file"
" directly instead of a config in a package")
check.add_argument("--anbox", action="store_true", help="check"
" options needed for anbox too")
check.add_argument("--waydroid", action="store_true", help="check"
" options needed for waydroid too")
check.add_argument("--iwd", action="store_true", help="check"
" options needed for iwd too")
check.add_argument("--nftables", action="store_true", help="check"

View File

@ -85,7 +85,7 @@ def check_option(component, details, config, config_path_pretty, option,
def check_config(config_path, config_path_pretty, config_arch, pkgver,
anbox=False,
waydroid=False,
iwd=False,
nftables=False,
containers=False,
@ -99,8 +99,8 @@ def check_config(config_path, config_path_pretty, config_arch, pkgver,
config = handle.read()
components = {"postmarketOS": pmb.config.necessary_kconfig_options}
if anbox:
components["anbox"] = pmb.config.necessary_kconfig_options_anbox
if waydroid:
components["waydroid"] = pmb.config.necessary_kconfig_options_waydroid
if iwd:
components["iwd"] = pmb.config.necessary_kconfig_options_iwd
if nftables:
@ -113,7 +113,7 @@ def check_config(config_path, config_path_pretty, config_arch, pkgver,
if netboot:
components["netboot"] = pmb.config.necessary_kconfig_options_netboot
if community:
components["anbox"] = pmb.config.necessary_kconfig_options_anbox
components["waydroid"] = pmb.config.necessary_kconfig_options_waydroid
components["iwd"] = pmb.config.necessary_kconfig_options_iwd
components["nftables"] = pmb.config.necessary_kconfig_options_nftables
components["containers"] = \
@ -165,7 +165,7 @@ def check_config_options_set(config, config_path_pretty, config_arch, options,
def check(args, pkgname,
force_anbox_check=False,
force_waydroid_check=False,
force_iwd_check=False,
force_nftables_check=False,
force_containers_check=False,
@ -194,8 +194,8 @@ def check(args, pkgname,
return None
apkbuild = pmb.parse.apkbuild(f"{aport}/APKBUILD")
pkgver = apkbuild["pkgver"]
check_anbox = force_anbox_check or (
"pmb:kconfigcheck-anbox" in apkbuild["options"])
check_waydroid = force_waydroid_check or (
"pmb:kconfigcheck-waydroid" in apkbuild["options"])
check_iwd = force_iwd_check or (
"pmb:kconfigcheck-iwd" in apkbuild["options"])
check_nftables = force_nftables_check or (
@ -228,7 +228,7 @@ def check(args, pkgname,
config_path_pretty = f"linux-{flavor}/{os.path.basename(config_path)}"
ret &= check_config(config_path, config_path_pretty, config_arch,
pkgver,
anbox=check_anbox,
waydroid=check_waydroid,
iwd=check_iwd,
nftables=check_nftables,
containers=check_containers,
@ -272,7 +272,7 @@ def extract_version(config_file):
return "unknown"
def check_file(config_file, anbox=False, nftables=False,
def check_file(config_file, waydroid=False, nftables=False,
containers=False, zram=False, netboot=False,
community=False, uefi=False, details=False):
"""
@ -285,7 +285,7 @@ def check_file(config_file, anbox=False, nftables=False,
logging.debug(f"Check kconfig: parsed arch={arch}, version={version} from "
f"file: {config_file}")
return check_config(config_file, config_file, arch, version,
anbox=anbox,
waydroid=waydroid,
nftables=nftables,
containers=containers,
zram=zram,

View File

@ -31,11 +31,11 @@ def test_kconfig_check(args):
"bad-missing-required-option")
assert pmb.parse.kconfig.check_file(dir + "good")
assert not pmb.parse.kconfig.check_file(dir + "bad-wrong-option-set")
assert pmb.parse.kconfig.check_file(dir + "good-anbox",
anbox=True)
assert pmb.parse.kconfig.check_file(dir + "good-waydroid",
waydroid=True)
assert not pmb.parse.kconfig.check_file(dir +
"bad-array-missing-some-options",
anbox=True)
waydroid=True)
assert pmb.parse.kconfig.check_file(dir + "good-nftables",
nftables=True)
assert not pmb.parse.kconfig.check_file(dir + "bad-nftables",
@ -56,12 +56,12 @@ def test_kconfig_check(args):
# supports nftables (with pmb:kconfigcheck-nftables)
assert pmb.parse.kconfig.check(args, "nokia-n900")
# supports Anbox (with pmb:kconfigcheck-anbox)
# supports Waydroid (with pmb:kconfigcheck-waydroid)
assert pmb.parse.kconfig.check(args, "postmarketos-allwinner")
# testing the force param: nokia-n900 will never have anbox support
# testing the force param: nokia-n900 will never have waydroid support
assert not pmb.parse.kconfig.check(args, "nokia-n900",
force_anbox_check=True)
force_waydroid_check=True)
# supports zram (with pmb:kconfigcheck-zram), nftables
assert pmb.parse.kconfig.check(args, "linux-purism-librem5")