2

I have a postinstall script that runs after my preseed install that checks /proc/cpuinfo for vmx or svm flags and if the server has them, it installs kvm packages. The only problem is due to the install running in a chroot /target directory, there is no /proc/cpuinfo to look at. The "lshw" command doesn't have the goods either. Any thoughts on how this can otherwise be accomplished?

2 Answers 2

3

The problem with not having access to /proc is that you don't have any script access to the sysfs calls required to do the check. What you need to do is to make sure your chroot has access to proc.

You can do this by mounting /proc before your chroot using the late pressed command like this:

d-i preseed/late_command string chroot /target; mount proc /proc -t proc;

And also a second option: remounting proc inside the chroot like this:

mount proc /proc -t proc

in fact if it's an installed system, mount /proc alone would work.

0
1

Another option would be to use the kvm-ok script (or parts of it), that comes in the cpu-checker package. This uses the msr-tools package to query the CPU's MSR registers directly via a /dev node. So that trades needing /proc for needed /dev. :)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .