1
0
mirror of https://github.com/kepler155c/opus synced 2025-10-10 21:37:43 +00:00

major directory reorganize

This commit is contained in:
kepler155c@gmail.com
2017-05-20 18:27:26 -04:00
parent 7954c79d66
commit c8147ef9e8
85 changed files with 67 additions and 59 deletions

View File

@@ -2,22 +2,20 @@ print('\nStarting multishell..')
LUA_PATH = '/sys/apis'
-- math.randomseed(os.clock()) -- totally broken
_G.Util = dofile('/sys/apis/util.lua')
_G.Util = dofile('sys/apis/util.lua')
_G.debug = function(...) Util.print(...) end
_G.requireInjector = dofile('/sys/apis/injector.lua')
_G.requireInjector = dofile('sys/apis/injector.lua')
os.run(Util.shallowCopy(getfenv(1)), '/sys/extensions/device.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')
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')
local mounts = Util.readFile('usr/config/fstab')
if mounts then
for _,l in ipairs(Util.split(mounts)) do
if l:sub(1, 1) ~= '#' then
@@ -27,8 +25,16 @@ if mounts then
end
end
-- 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
local env = Util.shallowCopy(getfenv(1))
env.multishell = { }
local _, m = os.run(env, '/apps/shell', '/apps/multishell')
local _, m = os.run(env, 'sys/apps/shell', 'sys/apps/multishell')
printError(m or 'Multishell aborted')