Compare commits
8 Commits
1.2.4-dev
...
5172da1b5b
| Author | SHA1 | Date | |
|---|---|---|---|
| 5172da1b5b | |||
| d08935b68a | |||
| 45b46cf3c4 | |||
| aeea68bc9b | |||
| f983b13d56 | |||
| 03c5b106c4 | |||
| 08323e00ff | |||
| 5e3cdbe40c |
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ local function doLogin()
|
|||||||
syscall.write(1, "Username: ")
|
syscall.write(1, "Username: ")
|
||||||
local username = readLine(nil)
|
local username = readLine(nil)
|
||||||
|
|
||||||
if username == "" then goto continue end
|
if username ~= "" then
|
||||||
|
|
||||||
syscall.write(1, "Password: ")
|
syscall.write(1, "Password: ")
|
||||||
local password = readLine("*")
|
local password = readLine("*")
|
||||||
@@ -154,8 +154,7 @@ local function doLogin()
|
|||||||
syscall.write(1, "Login incorrect.\n\n")
|
syscall.write(1, "Login incorrect.\n\n")
|
||||||
syscall.devctl(1, "sfgc", 1)
|
syscall.devctl(1, "sfgc", 1)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
::continue::
|
|
||||||
end
|
end
|
||||||
|
|
||||||
syscall.devctl(1, "sfgc", 2)
|
syscall.devctl(1, "sfgc", 2)
|
||||||
|
|||||||
@@ -308,7 +308,7 @@ local history = {}
|
|||||||
|
|
||||||
while true do
|
while true do
|
||||||
local code = getUserInput("lua> ", history)
|
local code = getUserInput("lua> ", history)
|
||||||
if code == "" then goto continue end
|
if code ~= "" then
|
||||||
|
|
||||||
while isIncomplete(code) do
|
while isIncomplete(code) do
|
||||||
code = code .. "\n" .. getUserInput("... ", nil)
|
code = code .. "\n" .. getUserInput("... ", nil)
|
||||||
@@ -319,5 +319,5 @@ while true do
|
|||||||
end
|
end
|
||||||
|
|
||||||
runCode(code)
|
runCode(code)
|
||||||
::continue::
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -139,12 +139,9 @@ local function parseCommands(src)
|
|||||||
local c = src:sub(pos, pos)
|
local c = src:sub(pos, pos)
|
||||||
if c == "\n" or c == ";" then
|
if c == "\n" or c == ";" then
|
||||||
pos = pos + 1
|
pos = pos + 1
|
||||||
goto continue
|
elseif c == "#" then
|
||||||
end
|
|
||||||
if c == "#" then
|
|
||||||
while pos <= len and src:sub(pos,pos) ~= "\n" do pos = pos + 1 end
|
while pos <= len and src:sub(pos,pos) ~= "\n" do pos = pos + 1 end
|
||||||
goto continue
|
else
|
||||||
end
|
|
||||||
|
|
||||||
local addr1, addr2
|
local addr1, addr2
|
||||||
addr1, pos = parseAddr(src, pos)
|
addr1, pos = parseAddr(src, pos)
|
||||||
@@ -203,8 +200,7 @@ local function parseCommands(src)
|
|||||||
elseif cmd == "\n" or cmd == ";" then
|
elseif cmd == "\n" or cmd == ";" then
|
||||||
else
|
else
|
||||||
end
|
end
|
||||||
|
end
|
||||||
::continue::
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return cmds
|
return cmds
|
||||||
|
|||||||
@@ -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