main #10
@@ -130,18 +130,22 @@ if not initCfgStatus then
|
|||||||
end
|
end
|
||||||
kernel.config = config
|
kernel.config = config
|
||||||
|
|
||||||
|
local skip=false
|
||||||
for i,v in ipairs(split(fstab,"\n")) do
|
for i,v in ipairs(split(fstab,"\n")) do
|
||||||
if v:sub(1,1)=="U" then
|
if v:sub(1,1)=="U" then
|
||||||
local id=""
|
local id=""
|
||||||
for i=3,#v do
|
for i=3,#v do
|
||||||
if v:sub(i,i)==";" then
|
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)
|
id=v:sub(3,i-1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if not skip then
|
||||||
local path=v:sub(#id+4)
|
local path=v:sub(#id+4)
|
||||||
ifs.mount(id,path)
|
ifs.mount(id,path)
|
||||||
::endline::
|
else
|
||||||
|
skip=false
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
kernel.log("Disks initialized")
|
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
|
if kernel.config.showModLoad then kernel.log("Loading module "..v, "DBUG", 5) end
|
||||||
local code=ifs.readAllText(v)
|
local code=ifs.readAllText(v)
|
||||||
if not code then
|
if not code then
|
||||||
kernel.log("ModuReadErr: "..v, "WARN", 8)
|
kernel.panic("Failed to read module "..v)
|
||||||
goto skip
|
|
||||||
end
|
end
|
||||||
local func,err=load(code,"@"..v)
|
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)
|
local status, err = xpcall(func,debug.traceback, kernel)
|
||||||
if not status then kernel.panic("ModuRunErr: "..tostring(err)) end
|
if not status then kernel.panic("ModuRunErr: "..tostring(err)) end
|
||||||
if kernel.config.showModLoad then kernel.log("Loaded module "..v, "DBUG", 5) end
|
if kernel.config.showModLoad then kernel.log("Loaded module "..v, "DBUG", 5) end
|
||||||
::skip::
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
local function octal_to_number(str)
|
local function octal_to_number(str)
|
||||||
str = str:gsub("%z", ""):match("^%s*(.-)%s*$")
|
str = str:gsub("%z", ""):match("^%s*(.-)%s*$")
|
||||||
return tonumber(str, 8) or 0
|
return tonumber(str, 8) or 0
|
||||||
@@ -98,16 +97,16 @@ local function unpack_tar(tarstr)
|
|||||||
local pad = (512 - (size % 512)) % 512
|
local pad = (512 - (size % 512)) % 512
|
||||||
i = i + size + pad
|
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("/$", "")
|
local clean_name = name:gsub("/$", "")
|
||||||
if clean_name == "" then goto continue end
|
|
||||||
|
if clean_name ~= "" then
|
||||||
|
|
||||||
local parent_path = clean_name:match("(.+)/")
|
local parent_path = clean_name:match("(.+)/")
|
||||||
local fname = clean_name:match("([^/]+)$")
|
local fname = clean_name:match("([^/]+)$")
|
||||||
if not fname then goto continue end
|
if not fname then
|
||||||
|
|
||||||
local parent = root
|
local parent = root
|
||||||
if parent_path then
|
if parent_path then
|
||||||
@@ -119,8 +118,9 @@ local function unpack_tar(tarstr)
|
|||||||
else
|
else
|
||||||
parent[fname] = { __type = "file", __contents = contents }
|
parent[fname] = { __type = "file", __contents = contents }
|
||||||
end
|
end
|
||||||
|
end
|
||||||
::continue::
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return flatten(root)
|
return flatten(root)
|
||||||
|
|||||||
@@ -4,17 +4,11 @@ term.clear()
|
|||||||
print("Do you want to install HyperionOS? [Y/n]")
|
print("Do you want to install HyperionOS? [Y/n]")
|
||||||
local input=read()
|
local input=read()
|
||||||
if input=="y" or input=="Y" or input=="" then
|
if input=="y" or input=="Y" or input=="" then
|
||||||
goto install
|
|
||||||
else
|
|
||||||
goto exit
|
|
||||||
end
|
|
||||||
|
|
||||||
::install::
|
|
||||||
print("Installing tar but bad...")
|
print("Installing tar but bad...")
|
||||||
shell.run("wget https://git.astronand.dev/Hyperion/HyperionOS/raw/branch/1.2-dev/install/data/tarbad /tar.lua")
|
shell.run("wget https://git.astronand.dev/Hyperion/HyperionOS/raw/branch/main/install/data/tarbad /tar.lua")
|
||||||
print("Installing HyperionOS...")
|
print("Installing HyperionOS...")
|
||||||
print("Installing precompiled tar")
|
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("wget https://git.astronand.dev/Hyperion/HyperionOS/raw/branch/main/install/data/Build.tar /Build.tar")
|
||||||
shell.run("tar Build.tar /")
|
shell.run("tar Build.tar /")
|
||||||
print("Removing tar but bad...")
|
print("Removing tar but bad...")
|
||||||
shell.run("rm /tar.lua")
|
shell.run("rm /tar.lua")
|
||||||
@@ -24,4 +18,4 @@ shell.run("rm Build")
|
|||||||
shell.run("rm Build.tar")
|
shell.run("rm Build.tar")
|
||||||
fs.copy("/$/boot/cct/eeprom","/startup.lua")
|
fs.copy("/$/boot/cct/eeprom","/startup.lua")
|
||||||
dofile("startup.lua")
|
dofile("startup.lua")
|
||||||
::exit::
|
end
|
||||||
Reference in New Issue
Block a user