On Thursday 26 July 2012 16:32:26 Bruce Dubbs wrote: > I'm trying to write a script to be run in Section 7.2 to initialize > 70-persistent-net.rules. I'm using, as a base, the udev-182 rule > 75-persistent-net-generator.rules. > > I have a problem in that this rule uses a variable SUBSYSTEMS. It is > looking for xen, pci, usb, pcmcia, ieee1394, or ccwgroup (S/390). Most > of these are only used to set a comment in the net rule, but we need to > be able to skip setting the rules completely for xen. > > The SUBSYSTEM variable (without the trailing S) is different. I seem to > be able to get that with: > > $ basename `readlink -f /sys/class/net/eth0/device/subsystem` > pci > > So how can I detect xen? > > Any ideas? > > -- Bruce
is this useful? http://projects.puppetlabs.com/projects/1/wiki/Virtual_Machine_Patterns Supposedly, dmesg | grep Xen should report if you're running a xen-enabled kernel. Another google hit: http://stackoverflow.com/questions/4338768/how-do-i-detect-xen-in-a-python- script The interesting bit is the answer: The /proc/xen/capabilities file is what I'm looking for. If it's not there, it's not Xen. If it's there but empty, it's a domU. If it's there and contains 'control_d', then it's dom0. Thanks! – Martin Del Vecchio IvanK. -- http://linuxfromscratch.org/mailman/listinfo/lfs-dev FAQ: http://www.linuxfromscratch.org/faq/ Unsubscribe: See the above information page