lua-platform-info: x86-generic: add image type detection
This commit is contained in:
parent
f221d17e1c
commit
d9b982d5df
|
@ -8,6 +8,23 @@ for line in io.lines('/proc/cpuinfo') do
|
|||
end
|
||||
|
||||
|
||||
local image_name = 'x86-generic'
|
||||
|
||||
local f = io.open('/sys/class/dmi/id/sys_vendor')
|
||||
if f then
|
||||
local vendor = f:read('*line')
|
||||
f:close()
|
||||
|
||||
if vendor then
|
||||
if vendor:match('^VMware') or vendor:match('^VMW') then
|
||||
image_name = 'x86-vmware'
|
||||
elseif vendor:match('^innotek GmbH') then
|
||||
image_name = 'x86-virtualbox'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
module 'platform_info'
|
||||
|
||||
|
||||
|
@ -33,5 +50,5 @@ end
|
|||
|
||||
-- The image name for sysupgrades
|
||||
function get_image_name()
|
||||
return nil
|
||||
return image_name
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue