diff --git a/imgen.py b/imgen.py index 31a61e0..a854b1f 100644 --- a/imgen.py +++ b/imgen.py @@ -60,7 +60,7 @@ def make_manifest(size): }, "files" : { # common files - "system" : [ "initenv.lua", "startup.lua", "configure.lua" ], + "system" : [ "initenv.lua", "startup.lua", "configure.lua", "LICENSE" ], "common" : list_files("./scada-common"), "graphics" : list_files("./graphics"), "lockbox" : list_files("./lockbox"), diff --git a/startup.lua b/startup.lua index d330066..3b2eef1 100644 --- a/startup.lua +++ b/startup.lua @@ -1,30 +1,28 @@ local util = require("scada-common.util") -local BOOTLOADER_VERSION = "0.3" - local println = util.println -local println_ts = util.println_ts + +local BOOTLOADER_VERSION = "0.4" println("SCADA BOOTLOADER V" .. BOOTLOADER_VERSION) +println("BOOT> SCANNING FOR APPLICATIONS...") -local exit_code ---@type boolean - -println_ts("BOOT> SCANNING FOR APPLICATIONS...") +local exit_code if fs.exists("reactor-plc/startup.lua") then - println("BOOT> FOUND REACTOR PLC CODE: EXEC STARTUP") + println("BOOT> EXEC REACTOR PLC STARTUP") exit_code = shell.execute("reactor-plc/startup") elseif fs.exists("rtu/startup.lua") then - println("BOOT> FOUND RTU CODE: EXEC STARTUP") + println("BOOT> EXEC RTU STARTUP") exit_code = shell.execute("rtu/startup") elseif fs.exists("supervisor/startup.lua") then - println("BOOT> FOUND SUPERVISOR CODE: EXEC STARTUP") + println("BOOT> EXEC SUPERVISOR STARTUP") exit_code = shell.execute("supervisor/startup") elseif fs.exists("coordinator/startup.lua") then - println("BOOT> FOUND COORDINATOR CODE: EXEC STARTUP") + println("BOOT> EXEC COORDINATOR STARTUP") exit_code = shell.execute("coordinator/startup") elseif fs.exists("pocket/startup.lua") then - println("BOOT> FOUND POCKET CODE: EXEC STARTUP") + println("BOOT> EXEC POCKET STARTUP") exit_code = shell.execute("pocket/startup") else println("BOOT> NO SCADA STARTUP FOUND") @@ -32,6 +30,6 @@ else return false end -if not exit_code then println_ts("BOOT> APPLICATION CRASHED") end +if not exit_code then println("BOOT> APPLICATION CRASHED") end return exit_code