diff --git a/Src/Hyperion-kernel/boot/kernel.lua b/Src/Hyperion-kernel/boot/kernel.lua index 518b2e4..72b8084 100644 --- a/Src/Hyperion-kernel/boot/kernel.lua +++ b/Src/Hyperion-kernel/boot/kernel.lua @@ -130,18 +130,22 @@ if not initCfgStatus then end kernel.config = config +local skip=false for i,v in ipairs(split(fstab,"\n")) do if v:sub(1,1)=="U" then local id="" for i=3,#v do if v:sub(i,i)==";" then - if i==3 then kernel.log("Invalid fstab line... Skipping.","WARN") goto endline end + if i==3 then kernel.log("Invalid fstab line... Skipping.","WARN") skip == true; break end id=v:sub(3,i-1) end end - local path=v:sub(#id+4) - ifs.mount(id,path) - ::endline:: + if not skip then + local path=v:sub(#id+4) + ifs.mount(id,path) + else + skip=false + end end end kernel.log("Disks initialized") @@ -265,15 +269,13 @@ for _,p in ipairs(modules) do if kernel.config.showModLoad then kernel.log("Loading module "..v, "DBUG", 5) end local code=ifs.readAllText(v) if not code then - kernel.log("ModuReadErr: "..v, "WARN", 8) - goto skip + kernel.panic("Failed to read module "..v) end local func,err=load(code,"@"..v) - if not func then kernel.panic("ModuLoadErr: "..tostring(err)) goto skip end + if not func then kernel.panic("ModuLoadErr: "..tostring(err)) end local status, err = xpcall(func,debug.traceback, kernel) if not status then kernel.panic("ModuRunErr: "..tostring(err)) end if kernel.config.showModLoad then kernel.log("Loaded module "..v, "DBUG", 5) end - ::skip:: end end diff --git a/install/data/tarbad b/install/data/tarbad index caa6983..d4cc91b 100644 --- a/install/data/tarbad +++ b/install/data/tarbad @@ -1,4 +1,3 @@ - local function octal_to_number(str) str = str:gsub("%z", ""):match("^%s*(.-)%s*$") return tonumber(str, 8) or 0 @@ -98,29 +97,30 @@ local function unpack_tar(tarstr) local pad = (512 - (size % 512)) % 512 i = i + size + pad - if name == "" then goto continue end + if name ~= "" then - local is_dir = typeflag == "5" or name:sub(-1) == "/" + local is_dir = typeflag == "5" or name:sub(-1) == "/" + local clean_name = name:gsub("/$", "") + + if clean_name ~= "" then - local clean_name = name:gsub("/$", "") - if clean_name == "" then goto continue end + local parent_path = clean_name:match("(.+)/") + local fname = clean_name:match("([^/]+)$") + if not fname then - local parent_path = clean_name:match("(.+)/") - local fname = clean_name:match("([^/]+)$") - if not fname then goto continue end - - local parent = root - if parent_path then - parent = make_dirs(root, parent_path .. "/") + local parent = root + if parent_path then + parent = make_dirs(root, parent_path .. "/") + end + + if is_dir then + parent[fname] = parent[fname] or { __type = "dir", __entries = {} } + else + parent[fname] = { __type = "file", __contents = contents } + end + end + end end - - if is_dir then - parent[fname] = parent[fname] or { __type = "dir", __entries = {} } - else - parent[fname] = { __type = "file", __contents = contents } - end - - ::continue:: end return flatten(root) diff --git a/install/installcc.lua b/install/installcc.lua index fe683ca..88e6c81 100644 --- a/install/installcc.lua +++ b/install/installcc.lua @@ -4,24 +4,18 @@ term.clear() print("Do you want to install HyperionOS? [Y/n]") local input=read() if input=="y" or input=="Y" or input=="" then - goto install -else - goto exit -end - -::install:: -print("Installing tar but bad...") -shell.run("wget https://git.astronand.dev/Hyperion/HyperionOS/raw/branch/1.2-dev/install/data/tarbad /tar.lua") -print("Installing HyperionOS...") -print("Installing precompiled tar") -shell.run("wget https://git.astronand.dev/Hyperion/HyperionOS/raw/branch/1.2-dev/install/data/Build.tar /Build.tar") -shell.run("tar Build.tar /") -print("Removing tar but bad...") -shell.run("rm /tar.lua") -shell.run("rm $") -shell.run("cp Build $") -shell.run("rm Build") -shell.run("rm Build.tar") -fs.copy("/$/boot/cct/eeprom","/startup.lua") -dofile("startup.lua") -::exit:: \ No newline at end of file + print("Installing tar but bad...") + shell.run("wget https://git.astronand.dev/Hyperion/HyperionOS/raw/branch/main/install/data/tarbad /tar.lua") + print("Installing HyperionOS...") + print("Installing precompiled tar") + shell.run("wget https://git.astronand.dev/Hyperion/HyperionOS/raw/branch/main/install/data/Build.tar /Build.tar") + shell.run("tar Build.tar /") + print("Removing tar but bad...") + shell.run("rm /tar.lua") + shell.run("rm $") + shell.run("cp Build $") + shell.run("rm Build") + shell.run("rm Build.tar") + fs.copy("/$/boot/cct/eeprom","/startup.lua") + dofile("startup.lua") +end \ No newline at end of file