2016-12-11 19:24:52 +00:00
|
|
|
print('\nStarting multishell..')
|
|
|
|
|
|
|
|
LUA_PATH = '/sys/apis'
|
|
|
|
|
2017-05-20 22:27:26 +00:00
|
|
|
_G.Util = dofile('sys/apis/util.lua')
|
2016-12-27 03:26:43 +00:00
|
|
|
_G.debug = function(...) Util.print(...) end
|
2017-05-20 22:27:26 +00:00
|
|
|
_G.requireInjector = dofile('sys/apis/injector.lua')
|
2016-12-11 19:24:52 +00:00
|
|
|
|
2017-05-20 22:27:26 +00:00
|
|
|
os.run(Util.shallowCopy(getfenv(1)), 'sys/extensions/device.lua')
|
2016-12-11 19:24:52 +00:00
|
|
|
|
|
|
|
-- vfs
|
2017-05-20 22:27:26 +00:00
|
|
|
local s, m = os.run(Util.shallowCopy(getfenv(1)), 'sys/extensions/vfs.lua')
|
2016-12-11 19:24:52 +00:00
|
|
|
if not s then
|
|
|
|
error(m)
|
|
|
|
end
|
|
|
|
|
|
|
|
-- process fstab
|
2017-05-20 22:27:26 +00:00
|
|
|
local mounts = Util.readFile('usr/config/fstab')
|
2016-12-11 19:24:52 +00:00
|
|
|
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
|
|
|
|
|
2017-05-20 22:27:26 +00:00
|
|
|
-- user environment
|
|
|
|
if not fs.exists('usr/apps') then
|
|
|
|
fs.makeDir('usr/apps')
|
|
|
|
end
|
|
|
|
if not fs.exists('usr/autorun') then
|
|
|
|
fs.makeDir('usr/autorun')
|
|
|
|
end
|
|
|
|
|
2016-12-11 19:24:52 +00:00
|
|
|
local env = Util.shallowCopy(getfenv(1))
|
|
|
|
env.multishell = { }
|
|
|
|
|
2017-05-20 22:27:26 +00:00
|
|
|
local _, m = os.run(env, 'sys/apps/shell', 'sys/apps/multishell')
|
2016-12-11 19:24:52 +00:00
|
|
|
printError(m or 'Multishell aborted')
|