detect-virt: detect User-Mode Linux

In a User-Mode Linux session:

  $ systemd-detect-virt
  none

Although it is possible to reliably detect virtualization:

  $ cat /proc/cpuinfo
  processor       : 0
  vendor_id       : User Mode Linux
  model name      : UML
  mode            : skas
  host            : Linux kytes 3.11.0-rc1-00009-ge5fd680 (...)
  bogomips        : 7007.43

So, grep for the string "\nvendor_id\t: User Mode Linux\n" in
/proc/cpuinfo, and say "uml" when asked.
This commit is contained in:
Ramkumar Ramachandra
2013-07-16 14:27:53 +02:00
committed by Lennart Poettering
parent 36c0868b67
commit 7080ea16b5
3 changed files with 13 additions and 0 deletions
+1
View File
@@ -969,6 +969,7 @@
<varname>xen</varname>,
<varname>bochs</varname>,
<varname>chroot</varname>,
<varname>uml</varname>,
<varname>openvz</varname>,
<varname>lxc</varname>,
<varname>lxc-libvirt</varname>,