made newer installer that does not require tar stuff
This commit is contained in:
1 parent
df62414229
commit
7deefc83ca
107 files changed
+648
-353
No files matched your search
@@ -0,0 +1,4 @@
|
||||
U $;/
|
||||
U devfs0000;/dev/
|
||||
U tmpfs0000;/tmp/
|
||||
U procfs0000;/proc/
|
||||
@@ -0,0 +1,84 @@
|
||||
-- :Minify:--
|
||||
local fs = {}
|
||||
local disks = {}
|
||||
local mounts = {}
|
||||
|
||||
local function resolve(path)
|
||||
local mountPoint = "/"
|
||||
for mount, disk in pairs(mounts) do
|
||||
if path:sub(1, #mount) == mount then
|
||||
if not mountPoint or #mount > #mountPoint then
|
||||
mountPoint = mount
|
||||
end
|
||||
end
|
||||
end
|
||||
local newPath = path:sub(#mountPoint + 1)
|
||||
return disks[mounts[mountPoint]], newPath
|
||||
end
|
||||
|
||||
function fs.update(initdisks)
|
||||
disks = {}
|
||||
for k, v in initdisks.list() do disks[k] = v end
|
||||
end
|
||||
|
||||
function fs.exists(path)
|
||||
local disk, newPath = resolve(path)
|
||||
return disk:directoryExists(newPath) or disk:fileExists(newPath)
|
||||
end
|
||||
|
||||
function fs.isFile(path)
|
||||
local disk, newPath = resolve(path)
|
||||
return disk:fileExists(newPath)
|
||||
end
|
||||
|
||||
function fs.isDir(path)
|
||||
local disk, newPath = resolve(path)
|
||||
return disk:directoryExists(newPath)
|
||||
end
|
||||
|
||||
function fs.list(path)
|
||||
local disk, newPath = resolve(path)
|
||||
return disk:list(newPath)
|
||||
end
|
||||
|
||||
function fs.makeDir(path)
|
||||
local disk, newPath = resolve(path)
|
||||
return disk:makeDirectory(newPath)
|
||||
end
|
||||
|
||||
function fs.remove(path)
|
||||
local disk, newPath = resolve(path)
|
||||
return disk:remove(newPath)
|
||||
end
|
||||
|
||||
function fs.readAllText(path)
|
||||
local disk, newPath = resolve(path)
|
||||
local handle = disk:open(newPath, "r")
|
||||
if not handle then return nil end
|
||||
local content = handle.readAll()
|
||||
handle.close()
|
||||
return content
|
||||
end
|
||||
|
||||
function fs.writeAllText(path, text)
|
||||
local disk, newPath = resolve(path)
|
||||
local handle = disk:open(newPath, "w")
|
||||
handle.write(text)
|
||||
handle.close()
|
||||
end
|
||||
|
||||
function fs.appendAllText(path, text)
|
||||
local disk, newPath = resolve(path)
|
||||
local handle = disk:open(newPath, "a")
|
||||
handle.write(text)
|
||||
handle.close()
|
||||
end
|
||||
|
||||
function fs.load(path) return load(fs.readAllText(path), path) end
|
||||
|
||||
function fs.mount(disk, mountPoint)
|
||||
if not disks[disk] then return end
|
||||
mounts[mountPoint] = disk
|
||||
end
|
||||
|
||||
return fs
|
||||
@@ -0,0 +1 @@
|
||||
local a=...a.beep(440,500)local b=a.screenCtl;local c=a.initfs;local d=a.disks;local e=a.architecture;local f={}f.LOG_Text=""f.version="HyperionOS V1.2.4"f.process="Kernel"f.users={[0]="root",[1]="User"}f.hostname="hyperion"f.groups={}f.uid=0;f.gid=0;f.status="start"f.key={}f.cache={}f.cache.preload={}f._G=_G;f.sleep=sleep;_G.sleep=nil;local g=false;function f.log(h,i,j)j=j or 0x6D6D6D;f.LOG_Text=f.LOG_Text..tostring(a:date()).." "..f.users[f.uid].." "..f.process.."["..tostring(i or"INFO").."]: "..h.."\n"if f.status=="start"then b:setTextColor(j)b:print(tostring(a:date()).." "..f.users[f.uid].." "..f.process.."["..tostring(i or"INFO").."]: "..h)elseif f.status=="term"then f.standbyTask=f.currentTask;f.currentTask=f.kernelTask;local k=f.vfs.open("/dev/console","w")f.vfs.devctl(k,"sfgc",j)f.vfs.write(k,tostring(a:date()).." "..f.users[f.uid].." "..f.process.."["..tostring(i or"INFO").."]: "..h.."\n")f.vfs.close(k)f.currentTask=f.standbyTask end end;function f.PANIC(h)if f.status~="Panic"then f.log("PANIC: "..h,"PANIC",0xFF0000)pcall(f["saveLog"])f.status="Panic"f.reason=h;b:enable()b:setTextColor(0xFF0000)b:setBackgroundColor(0x000000)b:clear()b:setCursorPos(1,1)b:print(f.LOG_Text)b:print("KERNEL PANIC!\n"..h.."\nSystem halted.")b:print("Press any key to continue...")f.exitMain=true end;while true do local l={a:getMachineEvent()}if l[1]=="keyPressed"then break end end;a.reboot=true;error("KERNEL PANIC")end;f.panic=f.PANIC;if g then b:setTextColor(0xFFFFFF)b:setBackgroundColor(0x0000FF)b:clear()local m,n=b:getSize()b:setCursorPos(3,5)b:print(":(")b:setCursorPos(3,7)b:print("Your PC ran into a problem and needs to restart. We're just collecting some error")b:setCursorPos(3,8)b:print("info, and then we'll restart for you.\n")b:setCursorPos(3,n-5)b:print("Stop code: average windows experience")b:setCursorPos(1,n)b:print("Press any key to continue... jk reboot it yourself lazy")while true do end end;f.log("Kernel loaded.")f.log("Mounting init disks...")d.refresh()c.update(d)f.disks={}for o,p in d.list()do f.disks[p.address]=p end;c.mount("$","/")local q=c.readAllText("/boot/fstab")local r=function(s,t,u)assert(#t==1,"only delim len 1 supported for now")u=(u or 0)-1;local v={}local w=""for x=1,#s do local j=string.sub(s,x,x)if#v~=u and j==t then table.insert(v,w)w=""else w=w..j end end;table.insert(v,w)return v end;if not c.isFile("/boot/boot.cfg")then f.log("First boot detected writing boot.cfg","INFO",0x00FF00)c.writeAllText("/boot/boot.cfg",c.readAllText("/boot/safeboot.cfg"))f.firstBoot=true end;local y,z=load(c.readAllText("/boot/boot.cfg"),"@boot.cfg")if not y then f.PANIC("Failed to load /boot/boot.cfg: "..tostring(z))end;local A,B=pcall(y)if not A then f.PANIC("Error in /boot/boot.cfg: "..tostring(B))end;f.config=B;local C=false;for x,p in ipairs(r(q,"\n"))do if p:sub(1,1)=="U"then local D=""for x=3,#p do if p:sub(x,x)==";"then if x==3 then f.log("Invalid fstab line... Skipping.","WARN",0xFF8800)C=true;break end;D=p:sub(3,x-1)end end;if not C then local E=p:sub(#D+4)c.mount(D,E)else C=false end end end;f.log("Disks initialized")function f.saveLog()if f.status=="running"then local k=f.vfs.open("/var/log/syslog.log","w")f.vfs.write(k,f.LOG_Text)f.vfs.close(k)else c.writeAllText("/var/log/syslog.log",f.LOG_Text)end end;function f.newFifo()local F={}F.push=function(G)table.insert(F,G)end;F.pop=function()return table.remove(F,1)end;return F end;function f.newUUID()local H="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"local I=""for x=1,#H do local j=H:sub(x,x)if j=="x"then I=I..string.format("%x",math.random(0,15))elseif j=="y"then I=I..string.format("%x",math.random(8,11))else I=I..j end end;return I end;f.syscalls={}local J={[0]={}}for x=0,100 do J[x]={}end;f.log("Gathering modules")for o,x in ipairs(c.list("/lib/modules"))do local K=c.list("/lib/modules/"..x)if not K then f.log("WARNING: could not list /lib/modules/"..x.." (skipping)","WARN",0xFF8800)else for o,p in ipairs(K)do local L=tonumber(p:sub(1,2))if L then J[L+1][#J[L+1]+1]="/lib/modules/"..x.."/"..p end end end end;f.ifs=c;f.apis=a.firmware;f.EFI=a;f.arch=e;f.initdisks=d;f.screen=b;f.processes={}f.fstab=q;f.kernelTask={name="kernel",status="R",pid=0,tgid=0,uid=0,fd={},exit="",sleep=0,ivs=0,vs=0,children={},syscallReturn={},cwd="/",timeSlice=0,lastTime=0,totalTime=0,numRuns=0}f.currentTask=f.kernelTask;function f.shutdown()f.exitMain=true;f.status="shutdown"end;function f.reboot()f.exitMain=true;f.status="reboot"end;f.syscalls["time"]=function()return f.EFI:getEpochMs()end;f.syscalls["date"]=function()return f.EFI:date()end;f.syscalls["log"]=f.log;f.syscalls["getUptime"]=function()return f.EFI:getUptime()end;f.syscalls["getUsername"]=function(M)return f.users[M or f.uid]end;f.syscalls["getHostname"]=function()return f.hostname end;f.syscalls["getHost"]=function()return f.apis._HOST end;f.syscalls["version"]=function()return f.version end;f.syscalls["setHostname"]=function(N)if f.uid~=0 then error("Permission denied")end;f.hostname=N end;f.syscalls["arch"]=fuLine truncated
|
||||
@@ -0,0 +1,12 @@
|
||||
-- DO NOT EDIT THIS FILE IF YOU DO NOT KNOW WHAT YOU ARE DOING!
|
||||
-- DOING SO MAY RENDER YOUR SYSTEM UNBOOTABLE!
|
||||
|
||||
-- This file is auto-generated during the build process.
|
||||
-- DEFAULT BOOT CONFIGURATION FILE
|
||||
return {
|
||||
initPath = "/sbin/init",
|
||||
maxOpenFiles = 128,
|
||||
maxFilesPerTask = 16,
|
||||
preempt=true,
|
||||
logTaskExit=true
|
||||
}
|
||||
Reference in new issue
Block a user