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:
parent
e468fc518e
commit
f7fb1fe078
|
@ -153,7 +153,8 @@ def menuconfig(args, pkgname, use_oldconfig):
|
||||||
pmb.build.checksum.update(args, pkgname)
|
pmb.build.checksum.update(args, pkgname)
|
||||||
|
|
||||||
# Check config
|
# 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_nftables_check=False,
|
||||||
force_containers_check=False,
|
force_containers_check=False,
|
||||||
force_zram_check=False,
|
force_zram_check=False,
|
||||||
|
|
|
@ -329,8 +329,8 @@ necessary_kconfig_options = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Necessary anbox/waydroid kernel config options (android app support)
|
# Necessary waydroid kernel config options (android app support)
|
||||||
necessary_kconfig_options_anbox = {
|
necessary_kconfig_options_waydroid = {
|
||||||
">=0.0.0": { # all versions
|
">=0.0.0": { # all versions
|
||||||
"all": { # all arches
|
"all": { # all arches
|
||||||
"SQUASHFS": True,
|
"SQUASHFS": True,
|
||||||
|
@ -354,12 +354,12 @@ necessary_kconfig_options_anbox = {
|
||||||
},
|
},
|
||||||
">=3.5": {
|
">=3.5": {
|
||||||
"all": {
|
"all": {
|
||||||
"CROSS_MEMORY_ATTACH": True, # required by Waydroid
|
"CROSS_MEMORY_ATTACH": True,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
">=4.20.0": {
|
">=4.20.0": {
|
||||||
"all": {
|
"all": {
|
||||||
"PSI": True, # required by userspace OOM killer in Waydroid
|
"PSI": True, # required by userspace OOM killer
|
||||||
"PSI_DEFAULT_DISABLED": False,
|
"PSI_DEFAULT_DISABLED": False,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -450,7 +450,7 @@ necessary_kconfig_options_containers = {
|
||||||
"CPUSETS": True,
|
"CPUSETS": True,
|
||||||
"KEYS": True,
|
"KEYS": True,
|
||||||
"VETH": True,
|
"VETH": True,
|
||||||
"BRIDGE": True, # (also needed for anbox)
|
"BRIDGE": True, # (also needed for waydroid)
|
||||||
"BRIDGE_NETFILTER": True,
|
"BRIDGE_NETFILTER": True,
|
||||||
"IP_NF_FILTER": True,
|
"IP_NF_FILTER": True,
|
||||||
"IP_NF_TARGET_MASQUERADE": True,
|
"IP_NF_TARGET_MASQUERADE": True,
|
||||||
|
@ -517,7 +517,7 @@ necessary_kconfig_options_containers = {
|
||||||
},
|
},
|
||||||
">=3.9": {
|
">=3.9": {
|
||||||
"all": { # all arches
|
"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
|
"MACVLAN": True, # Network Drivers
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -655,7 +655,7 @@ apkbuild_attributes = {
|
||||||
apkbuild_custom_valid_options = [
|
apkbuild_custom_valid_options = [
|
||||||
"!pmb:crossdirect",
|
"!pmb:crossdirect",
|
||||||
"!pmb:kconfig-check",
|
"!pmb:kconfig-check",
|
||||||
"pmb:kconfigcheck-anbox",
|
"pmb:kconfigcheck-waydroid",
|
||||||
"pmb:kconfigcheck-containers",
|
"pmb:kconfigcheck-containers",
|
||||||
"pmb:kconfigcheck-nftables",
|
"pmb:kconfigcheck-nftables",
|
||||||
"pmb:cross-native",
|
"pmb:cross-native",
|
||||||
|
|
|
@ -379,7 +379,7 @@ def kconfig(args):
|
||||||
# Handle passing a file directly
|
# Handle passing a file directly
|
||||||
if args.file:
|
if args.file:
|
||||||
if pmb.parse.kconfig.check_file(args.package,
|
if pmb.parse.kconfig.check_file(args.package,
|
||||||
anbox=args.anbox,
|
waydroid=args.waydroid,
|
||||||
nftables=args.nftables,
|
nftables=args.nftables,
|
||||||
containers=args.containers,
|
containers=args.containers,
|
||||||
zram=args.zram,
|
zram=args.zram,
|
||||||
|
@ -415,7 +415,7 @@ def kconfig(args):
|
||||||
continue
|
continue
|
||||||
if not pmb.parse.kconfig.check(
|
if not pmb.parse.kconfig.check(
|
||||||
args, package,
|
args, package,
|
||||||
force_anbox_check=args.anbox,
|
force_waydroid_check=args.waydroid,
|
||||||
force_iwd_check=args.iwd,
|
force_iwd_check=args.iwd,
|
||||||
force_nftables_check=args.nftables,
|
force_nftables_check=args.nftables,
|
||||||
force_containers_check=args.containers,
|
force_containers_check=args.containers,
|
||||||
|
|
|
@ -464,8 +464,8 @@ def arguments_kconfig(subparser):
|
||||||
check.add_argument("--arch", choices=arch_choices, dest="arch")
|
check.add_argument("--arch", choices=arch_choices, dest="arch")
|
||||||
check.add_argument("--file", action="store_true", help="check a file"
|
check.add_argument("--file", action="store_true", help="check a file"
|
||||||
" directly instead of a config in a package")
|
" directly instead of a config in a package")
|
||||||
check.add_argument("--anbox", action="store_true", help="check"
|
check.add_argument("--waydroid", action="store_true", help="check"
|
||||||
" options needed for anbox too")
|
" options needed for waydroid too")
|
||||||
check.add_argument("--iwd", action="store_true", help="check"
|
check.add_argument("--iwd", action="store_true", help="check"
|
||||||
" options needed for iwd too")
|
" options needed for iwd too")
|
||||||
check.add_argument("--nftables", action="store_true", help="check"
|
check.add_argument("--nftables", action="store_true", help="check"
|
||||||
|
|
|
@ -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,
|
def check_config(config_path, config_path_pretty, config_arch, pkgver,
|
||||||
anbox=False,
|
waydroid=False,
|
||||||
iwd=False,
|
iwd=False,
|
||||||
nftables=False,
|
nftables=False,
|
||||||
containers=False,
|
containers=False,
|
||||||
|
@ -99,8 +99,8 @@ def check_config(config_path, config_path_pretty, config_arch, pkgver,
|
||||||
config = handle.read()
|
config = handle.read()
|
||||||
|
|
||||||
components = {"postmarketOS": pmb.config.necessary_kconfig_options}
|
components = {"postmarketOS": pmb.config.necessary_kconfig_options}
|
||||||
if anbox:
|
if waydroid:
|
||||||
components["anbox"] = pmb.config.necessary_kconfig_options_anbox
|
components["waydroid"] = pmb.config.necessary_kconfig_options_waydroid
|
||||||
if iwd:
|
if iwd:
|
||||||
components["iwd"] = pmb.config.necessary_kconfig_options_iwd
|
components["iwd"] = pmb.config.necessary_kconfig_options_iwd
|
||||||
if nftables:
|
if nftables:
|
||||||
|
@ -113,7 +113,7 @@ def check_config(config_path, config_path_pretty, config_arch, pkgver,
|
||||||
if netboot:
|
if netboot:
|
||||||
components["netboot"] = pmb.config.necessary_kconfig_options_netboot
|
components["netboot"] = pmb.config.necessary_kconfig_options_netboot
|
||||||
if community:
|
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["iwd"] = pmb.config.necessary_kconfig_options_iwd
|
||||||
components["nftables"] = pmb.config.necessary_kconfig_options_nftables
|
components["nftables"] = pmb.config.necessary_kconfig_options_nftables
|
||||||
components["containers"] = \
|
components["containers"] = \
|
||||||
|
@ -165,7 +165,7 @@ def check_config_options_set(config, config_path_pretty, config_arch, options,
|
||||||
|
|
||||||
|
|
||||||
def check(args, pkgname,
|
def check(args, pkgname,
|
||||||
force_anbox_check=False,
|
force_waydroid_check=False,
|
||||||
force_iwd_check=False,
|
force_iwd_check=False,
|
||||||
force_nftables_check=False,
|
force_nftables_check=False,
|
||||||
force_containers_check=False,
|
force_containers_check=False,
|
||||||
|
@ -194,8 +194,8 @@ def check(args, pkgname,
|
||||||
return None
|
return None
|
||||||
apkbuild = pmb.parse.apkbuild(f"{aport}/APKBUILD")
|
apkbuild = pmb.parse.apkbuild(f"{aport}/APKBUILD")
|
||||||
pkgver = apkbuild["pkgver"]
|
pkgver = apkbuild["pkgver"]
|
||||||
check_anbox = force_anbox_check or (
|
check_waydroid = force_waydroid_check or (
|
||||||
"pmb:kconfigcheck-anbox" in apkbuild["options"])
|
"pmb:kconfigcheck-waydroid" in apkbuild["options"])
|
||||||
check_iwd = force_iwd_check or (
|
check_iwd = force_iwd_check or (
|
||||||
"pmb:kconfigcheck-iwd" in apkbuild["options"])
|
"pmb:kconfigcheck-iwd" in apkbuild["options"])
|
||||||
check_nftables = force_nftables_check or (
|
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)}"
|
config_path_pretty = f"linux-{flavor}/{os.path.basename(config_path)}"
|
||||||
ret &= check_config(config_path, config_path_pretty, config_arch,
|
ret &= check_config(config_path, config_path_pretty, config_arch,
|
||||||
pkgver,
|
pkgver,
|
||||||
anbox=check_anbox,
|
waydroid=check_waydroid,
|
||||||
iwd=check_iwd,
|
iwd=check_iwd,
|
||||||
nftables=check_nftables,
|
nftables=check_nftables,
|
||||||
containers=check_containers,
|
containers=check_containers,
|
||||||
|
@ -272,7 +272,7 @@ def extract_version(config_file):
|
||||||
return "unknown"
|
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,
|
containers=False, zram=False, netboot=False,
|
||||||
community=False, uefi=False, details=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 "
|
logging.debug(f"Check kconfig: parsed arch={arch}, version={version} from "
|
||||||
f"file: {config_file}")
|
f"file: {config_file}")
|
||||||
return check_config(config_file, config_file, arch, version,
|
return check_config(config_file, config_file, arch, version,
|
||||||
anbox=anbox,
|
waydroid=waydroid,
|
||||||
nftables=nftables,
|
nftables=nftables,
|
||||||
containers=containers,
|
containers=containers,
|
||||||
zram=zram,
|
zram=zram,
|
||||||
|
|
|
@ -31,11 +31,11 @@ def test_kconfig_check(args):
|
||||||
"bad-missing-required-option")
|
"bad-missing-required-option")
|
||||||
assert pmb.parse.kconfig.check_file(dir + "good")
|
assert pmb.parse.kconfig.check_file(dir + "good")
|
||||||
assert not pmb.parse.kconfig.check_file(dir + "bad-wrong-option-set")
|
assert not pmb.parse.kconfig.check_file(dir + "bad-wrong-option-set")
|
||||||
assert pmb.parse.kconfig.check_file(dir + "good-anbox",
|
assert pmb.parse.kconfig.check_file(dir + "good-waydroid",
|
||||||
anbox=True)
|
waydroid=True)
|
||||||
assert not pmb.parse.kconfig.check_file(dir +
|
assert not pmb.parse.kconfig.check_file(dir +
|
||||||
"bad-array-missing-some-options",
|
"bad-array-missing-some-options",
|
||||||
anbox=True)
|
waydroid=True)
|
||||||
assert pmb.parse.kconfig.check_file(dir + "good-nftables",
|
assert pmb.parse.kconfig.check_file(dir + "good-nftables",
|
||||||
nftables=True)
|
nftables=True)
|
||||||
assert not pmb.parse.kconfig.check_file(dir + "bad-nftables",
|
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)
|
# supports nftables (with pmb:kconfigcheck-nftables)
|
||||||
assert pmb.parse.kconfig.check(args, "nokia-n900")
|
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")
|
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",
|
assert not pmb.parse.kconfig.check(args, "nokia-n900",
|
||||||
force_anbox_check=True)
|
force_waydroid_check=True)
|
||||||
|
|
||||||
# supports zram (with pmb:kconfigcheck-zram), nftables
|
# supports zram (with pmb:kconfigcheck-zram), nftables
|
||||||
assert pmb.parse.kconfig.check(args, "linux-purism-librem5")
|
assert pmb.parse.kconfig.check(args, "linux-purism-librem5")
|
||||||
|
|
Loading…
Reference in New Issue