On some platforms, like a VM, we don't have the "getprop" android
utility available. It could be, also, that the default values
for some properties don't match the target device.
With this PR, one can add a [properties] section in waydroid.cfg,
that will act as an override for the values that would have been
put otherwise.
Example, on our LuneOS x86 VM:
[properties]
ro.hardware.gralloc=default
ro.hardware.egl=mesa
A minimal waydroid.cfg could even be shipped with waydroid, and
the rest of the configuration will be filled with "waydroid init".
Signed-off-by: Christophe Chapuis <chris.chapuis@gmail.com>
" default value from config: {}".format(cfg['waydroid'][key]))
del cfg["waydroid"][key]
+ if "properties" not in cfg:
+ cfg["properties"] = {}
+ # no default values for property override
+
return cfg
def load_session():
if prop_fp != "":
props.append("ro.build.fingerprint=" + prop_fp)
+ # now append/override with values in [properties] section of waydroid.cfg
+ cfg = tools.config.load(args)
+ for k, v in cfg["properties"].items():
+ for idx, elem in enumerate(props):
+ if (k+"=") in elem:
+ props.pop(idx)
+ props.append(k+"="+v)
+
base_props = open(args.work + "/waydroid_base.prop", "w")
for prop in props:
base_props.write(prop + "\n")