forked from Hyperion/HyperionOS
update to start working on SysInit
This commit is contained in:
26
Test/Hyperion-kernel-v0.1.0/lib/modules/Hyperion/15_fstabInit.kmod
Executable file
26
Test/Hyperion-kernel-v0.1.0/lib/modules/Hyperion/15_fstabInit.kmod
Executable file
@@ -0,0 +1,26 @@
|
||||
local args = {...}
|
||||
local kernel = args[1]
|
||||
local ifs=kernel.ifs
|
||||
|
||||
kernel.log("Mounting fstab")
|
||||
local fstab=ifs.readAllText("/etc/fstab")
|
||||
local entrys = string.split(fstab,"\n")
|
||||
for i,v in ipairs(entrys) 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
|
||||
id=v:sub(3,i-1)
|
||||
end
|
||||
end
|
||||
local path=v:sub(#id+4,#v)
|
||||
if i~=#entrys then
|
||||
path=path:sub(1,#path-1)
|
||||
end
|
||||
kernel.log("Mounted "..id.." to "..path)
|
||||
kernel.fs.mount(id,path)
|
||||
::endline::
|
||||
end
|
||||
end
|
||||
kernel.log("Mounted all disks")
|
||||
Reference in New Issue
Block a user