[Bug 529008] Re: Should emulate /proc/cpuinfo

DaveHansen dave at sr71.net
Wed Jun 2 17:27:50 BST 2010


If you're chroot'ing anyway, then you should have privileged access.
You could probably do this entirely in userspace, without even specially
intercepting the syscalls.  When you set up the chroot, just get a copy
of how you want cpuinfo to look, and bind mount it on top of the
existing cpuinfo file:

root at nimitz:~# egrep cache.size\|^processor /proc/cpuinfo 
processor	: 0
cache size	: 4096 KB
processor	: 1
cache size	: 4096 KB
root at nimitz:~# cat /proc/cpuinfo | perl -pe 's/4096 KB/8192 KB/g' > cpuinfo.lie
root at nimitz:~# mount --bind cpuinfo.lie /proc/cpuinfo 
root at nimitz:~# egrep cache.size\|^processor /proc/cpuinfo 
processor	: 0
cache size	: 8192 KB
processor	: 1
cache size	: 8192 KB

Would that work?

-- 
Should emulate /proc/cpuinfo
https://bugs.launchpad.net/bugs/529008
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to qemu-kvm in ubuntu.



More information about the Ubuntu-server-bugs mailing list