software = { version = "1.0.0"; embedded-script = " function set_active_system(bootenv) os.execute(\"fw_printenv -n active_system > /tmp/active_system\") fh = io.open(\"/tmp/active_system\") active_system = fh:read() print(\"active_system:\" .. tostring(active_system)) if active_system == \"A\" then bootenv.value= \"B\" else bootenv.value= \"A\" end fh.close() swupdate.trace(\"bootenv.value: \" .. bootenv.value) return true, bootenv end " images: ( { name = "rootfs"; version = "v0.1_20200429"; filename = "ozyx-image-qt5demo-qemux86.ext4.gz"; device = "/dev/null"; compressed=true; type = "raw"; } ); bootenv: ( { name = "active_system"; value = "X"; //dummy; hook = "set_active_system"; }, { name = "upgrade_available"; value = "1"; } ); }