mirror of
https://git.shadowkat.net/izaya/OC-PsychOS2.git
synced 2024-11-22 03:54:20 -05:00
Compare commits
No commits in common. "026f2524e681fb5035467846ef4c493f95c1f35f" and "82decfabf964c1e9637290995cd023a0f8def025" have entirely different histories.
026f2524e6
...
82decfabf9
@ -24,7 +24,7 @@ local function saveConfig()
|
||||
end
|
||||
|
||||
function rc.load(name,force) -- string boolean -- table -- Attempts to load service *name*, and if *force* is true, replaces the current instance.
|
||||
if not service[name] or force then
|
||||
if not package.loaded[name] or force then
|
||||
for d in rc.paths:gmatch("[^\n]+") do
|
||||
if fs.exists(d.."/"..name..".lua") then
|
||||
service[name] = runfile(d.."/"..name..".lua")
|
||||
|
@ -34,7 +34,7 @@ end
|
||||
|
||||
function print(...) -- Writes each argument to the default output stream, separated by space.
|
||||
for k,v in ipairs({...}) do
|
||||
io.write((k>1 and "\t" or "")..tostring(v))
|
||||
io.write(tostring(v).."\t")
|
||||
end
|
||||
io.write("\n")
|
||||
end
|
||||
|
@ -1,8 +1,7 @@
|
||||
local fsmanager = {}
|
||||
fsmanager.filesystems = {}
|
||||
local run = true
|
||||
|
||||
function fsmanager.mount(addr)
|
||||
local function mount(addr)
|
||||
dest = "/" .. (component.invoke(addr,"getLabel") or "mnt/"..addr:sub(1,3))
|
||||
syslog("Mounting "..addr.." to "..dest)
|
||||
fs.makeDirectory(dest)
|
||||
@ -18,12 +17,12 @@ function fsmanager.start()
|
||||
run = true
|
||||
return os.spawn(function()
|
||||
for addr, _ in component.list("filesystem") do
|
||||
fsmanager.mount(addr)
|
||||
mount(addr)
|
||||
end
|
||||
while run do
|
||||
local tE = {coroutine.yield()}
|
||||
if tE[1] == "component_added" and tE[3] == "filesystem" then
|
||||
fsmanager.mount(tE[2])
|
||||
mount(tE[2])
|
||||
elseif tE[1] == "component_removed" and fsmanager.filesystems[tE[2]] and tE[3] == "filesystem" then
|
||||
syslog("Unmounting "..tE[2].." from "..fsmanager.filesystems[tE[2]])
|
||||
fs.umount(fsmanager.filesystems[tE[2]])
|
||||
|
Loading…
Reference in New Issue
Block a user