diff --git a/partman/service/partman.lua b/partman/service/partman.lua index caab4fc..39cd72e 100644 --- a/partman/service/partman.lua +++ b/partman/service/partman.lua @@ -1,11 +1,16 @@ local diskpart = require "diskpart" local vcomponent = require "vcomponent" -local partman = {} +local partman = { + dtypes={ + drive=true, + ["tape_drive"]=true + } +} local hooks = {} function hooks.component_added(_,a,t) - if t ~= "drive" then return end + if not partman.dtypes[t] then return end for k,v in ipairs(diskpart.getPartitions(a)) do if v[4] > 0 then syslog(string.format("Registering vcomponent for partition %s/%i",a,k)) @@ -23,7 +28,7 @@ function hooks.component_added(_,a,t) end function hooks.component_removed(_,a,t) - if t ~= "drive" then return end + if not partman.dtypes[t] then return end for ca,t in component.list() do if (t == "partition" or t == "filesystem") and ca:sub(1,a:len()) == a then vcomponent.unregister(ca)