diff --git a/util/OpenOS/config.d/02_plan9k.lua b/util/OpenOS/config.d/02_plan9k.lua new file mode 100644 index 0000000..190da4c --- /dev/null +++ b/util/OpenOS/config.d/02_plan9k.lua @@ -0,0 +1,12 @@ +local cfgadd = ... +local comp = require("component") +for fs in comp.list("filesystem") do + if comp.invoke(fs, "getLabel") == "Plan9k" and comp.invoke(fs, "exists", "init.lua") then + print("Plan9k discovered on "..fs) + cfgadd(string.format([[ +menu.add("Plan9k on %s", function() + return loadmod("loader_openos")("%s") +end) +]], fs:sub(1, 3), fs)) + end +end \ No newline at end of file diff --git a/utils/selfextract.lua b/utils/selfextract.lua index 29d76e8..0a60787 100644 --- a/utils/selfextract.lua +++ b/utils/selfextract.lua @@ -124,7 +124,7 @@ end local lname = "" while lname ~= "TRAILER!!!" do local dat = read(22) - local e = read_header(dat) + local e = assert(read_header(dat)) e.name = read(e.namesize) e.pos = seek(e.namesize & 1) seek(e.filesize + (e.filesize & 1)) @@ -143,4 +143,4 @@ for i=1, #tbl do end end -error("Init not found.") \ No newline at end of file +error("Init not found.")