mirror of
https://github.com/kepler155c/opus
synced 2025-10-24 12:17:40 +00:00
network group wip + virtual dirs + better trust
This commit is contained in:
@@ -5,6 +5,8 @@ end
|
||||
_G.requireInjector(_ENV)
|
||||
local Util = require('util')
|
||||
|
||||
-- TODO: support getDrive for virtual nodes
|
||||
|
||||
local fs = _G.fs
|
||||
|
||||
fs.native = Util.shallowCopy(fs)
|
||||
@@ -88,6 +90,13 @@ function nativefs.exists(node, dir)
|
||||
return fs.native.exists(dir)
|
||||
end
|
||||
|
||||
function nativefs.getDrive(node, dir)
|
||||
if node.mountPoint == dir then
|
||||
return fs.native.getDrive(dir) or 'virt'
|
||||
end
|
||||
return fs.native.getDrive(dir)
|
||||
end
|
||||
|
||||
function nativefs.delete(node, dir)
|
||||
if node.mountPoint == dir then
|
||||
fs.unmount(dir)
|
||||
|
||||
@@ -6,7 +6,15 @@ local device = _G.device
|
||||
local kernel = _G.kernel
|
||||
local os = _G.os
|
||||
|
||||
_G.network = { }
|
||||
do
|
||||
local config = Config.load('os')
|
||||
_G.network = setmetatable({ }, { __index = {
|
||||
getGroup = function() return config.group end,
|
||||
setGroup = function(name)
|
||||
config.group = name
|
||||
end
|
||||
}})
|
||||
end
|
||||
|
||||
local function startNetwork()
|
||||
kernel.run({
|
||||
|
||||
Reference in New Issue
Block a user