From: Alessandro Astone Date: Sat, 27 Jul 2024 21:41:03 +0000 (+0200) Subject: Bail out if system_channel or vendor_channel are empty X-Git-Tag: 1.4.3~3 X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/waydroid.git/commitdiff_plain/c312b3fc94fb158df9c74fc20ea81c194b525caa?ds=sidebyside Bail out if system_channel or vendor_channel are empty Closes: #1033 --- diff --git a/tools/actions/initializer.py b/tools/actions/initializer.py index fee1280..8f6c2c3 100644 --- a/tools/actions/initializer.py +++ b/tools/actions/initializer.py @@ -59,6 +59,10 @@ def setup_config(args): if not args.system_type: args.system_type = channels_cfg["channels"]["system_type"] + if not args.system_channel or not args.vendor_channel: + logging.error("ERROR: You must provide 'System OTA' and 'Vendor OTA' URLs.") + return False + args.system_ota = args.system_channel + "/" + args.rom_type + \ "/waydroid_" + args.arch + "/" + args.system_type + ".json" system_request = helpers.http.retrieve(args.system_ota) @@ -101,6 +105,7 @@ def setup_config(args): cfg["waydroid"]["vndbinder"] = args.VNDBINDER_DRIVER cfg["waydroid"]["hwbinder"] = args.HWBINDER_DRIVER tools.config.save(args, cfg) + return True def init(args): if not is_initialized(args) or args.force: @@ -109,7 +114,8 @@ def init(args): initializer_service = tools.helpers.ipc.DBusContainerService("/Initializer", "id.waydro.Initializer") except dbus.DBusException: pass - setup_config(args) + if not setup_config(args): + return status = "STOPPED" if os.path.exists(tools.config.defaults["lxc"] + "/waydroid"): status = helpers.lxc.status(args)