1
0
mirror of https://github.com/kepler155c/opus synced 2024-11-15 21:24:49 +00:00
opus/sys/boot/multishell.boot

35 lines
809 B
Plaintext
Raw Normal View History

2016-12-11 19:24:52 +00:00
print('\nStarting multishell..')
LUA_PATH = '/sys/apis'
math.randomseed(os.clock())
_G.Util = dofile('/sys/apis/util.lua')
2016-12-27 03:26:43 +00:00
_G.debug = function(...) Util.print(...) end
2016-12-11 19:24:52 +00:00
_G.requireInjector = dofile('/sys/apis/injector.lua')
os.run(Util.shallowCopy(getfenv(1)), '/sys/extensions/device.lua')
-- vfs
local s, m = os.run(Util.shallowCopy(getfenv(1)), '/sys/extensions/vfs.lua')
if not s then
error(m)
end
-- process fstab
local mounts = Util.readFile('config/fstab')
if mounts then
for _,l in ipairs(Util.split(mounts)) do
if l:sub(1, 1) ~= '#' then
2016-12-27 03:26:43 +00:00
print('mounting ' .. l)
2016-12-11 19:24:52 +00:00
fs.mount(unpack(Util.matches(l)))
end
end
end
local env = Util.shallowCopy(getfenv(1))
env.multishell = { }
local _, m = os.run(env, '/apps/shell', '/apps/multishell')
printError(m or 'Multishell aborted')