Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 262861

Summary: sys-apps/baselyout-1: /etc/init.d/functions.sh:is_xenU_sys() fails to detect paravirt_ops domU
Product: Gentoo Linux Reporter: Luca Lesinigo <luckyluke>
Component: [OLD] baselayoutAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED NEEDINFO    
Severity: normal CC: xen
Priority: High    
Version: 2008.0   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: proposed fix

Description Luca Lesinigo 2009-03-18 00:42:15 UTC
The is_xenU_sys() function in /etc/init.d/functions.sh will fail to detect that it's running in a domU when using a recent kernel with paravirt_ops support, since the entire /proc/xen directory doesn't exist.

AFAIK the only 'xen things' around are /sys/bus/xen, also present on a dom0 (don't know details about the contents) and the more specific line "Booting paravirtualized kernel on Xen" in dmesg. I'd look for that line, if grep or something similar is ok in functions.sh.
Comment 1 Luca Lesinigo 2009-03-18 00:51:47 UTC
Created attachment 185365 [details, diff]
proposed fix

seems like many other functions do the same kind of grepping so I assume it's ok to call grep :)
here is a working fix.
Comment 2 Jan Oravec 2009-04-10 22:20:30 UTC
Calling dmesg is not OK. You could have used dmesg -c or dmesg buffer may have been filled with something other since machine booted.
Comment 3 Luca Lesinigo 2009-04-14 15:51:22 UTC
what about grepping /var/log/dmesg?