forked from Hyperion/HyperionOS
rewrite
This commit is contained in:
22
Test/Hyperion-kernel-v0.1.0/lib/modules/Hyperion/11_fstabInit.kmod
Executable file
22
Test/Hyperion-kernel-v0.1.0/lib/modules/Hyperion/11_fstabInit.kmod
Executable file
@@ -0,0 +1,22 @@
|
||||
local args={...}
|
||||
local kernel=args[1]
|
||||
local ifs=kernel.ifs
|
||||
local initdisks=kernel.initdisks
|
||||
|
||||
local fstab=ifs.readAllText("/etc/fstab")
|
||||
kernel.fs.update(initdisks)
|
||||
for i,v in ipairs(string.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
|
||||
id=v:sub(3,i-1)
|
||||
end
|
||||
end
|
||||
local path=v:sub(#id+4)
|
||||
kernel.log("Mounted "..id.." to "..path)
|
||||
kernel.fs.mount(id,path)
|
||||
::endline::
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user