I have a few questions about this file.
1. When does this file get generated?
2. Is this file accessible if I move the SD card from the RPI to another machine?


It's a virtual filesystem generated by the Linux kernel when it boots.valevalorin wrote:1. When does this file get generated?
Code: Select all
#!/bin/sh
cat /proc/cpuinfo | sed -e 's/Serial.*/Serial\t\t: 00000000deadbeef/g' > /tmp/cpuinfo_fake
mount -o bind /tmp/cpuinfo_fake /proc/cpuinfo
mount -o remount,ro,bind /proc/cpuinfo
Rewrite the kernel modules and build your own kernel. But, you WILL break lots of things that expect cpuinfo to be world readable.valevalorin wrote:Is there some other way I can make cpuinfo only accessible by root? Is it only accessible by root by default?
Yes, you can use chmod to restrict read access (but not to make the file meaningfully writeable). You will have to repeat it every boot, because the permissions are not stored on disk.valevalorin wrote:I actually have another question: can I use chmod on cpuinfo?