diff --git a/service/fsmanager.lua b/service/fsmanager.lua index b5385bb..6b623f5 100644 --- a/service/fsmanager.lua +++ b/service/fsmanager.lua @@ -1,7 +1,8 @@ local fsmanager = {} fsmanager.filesystems = {} local run = true -local function mount(addr) + +local function fsmanager.mount(addr) dest = "/" .. (component.invoke(addr,"getLabel") or "mnt/"..addr:sub(1,3)) syslog("Mounting "..addr.." to "..dest) fs.makeDirectory(dest) @@ -22,7 +23,7 @@ function fsmanager.start() while run do local tE = {coroutine.yield()} if tE[1] == "component_added" and tE[3] == "filesystem" then - mount(tE[2]) + fsmanager.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]])