除了重新编译 proc.c 文件外,有其他简单方法修改吗
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 40
On-line CPU(s) list: 0-39
Thread(s) per core: 2
Core(s) per socket: 10
Socket(s): 2
NUMA node(s): 2
Vendor ID: GenuineIntel
CPU family: 6
Model: 85
Model name: Intel(R) Xeon(R) Silver 4114 CPU @ 2.20GHz
Stepping: 4
CPU MHz: 949.877
CPU max MHz: 3000.0000
CPU min MHz: 800.0000
BogoMIPS: 4400.00
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 1024K
L3 cache: 14080K
NUMA node0 CPU(s): 0-9,20-29
NUMA node1 CPU(s): 10-19,30-39
1
codehz 2022-04-27 13:49:20 +08:00 via Android 1
防止其他程序检测的话,用 mount --bind“覆盖”掉文件内容就好
|
2
codefever 2022-04-27 13:49:55 +08:00 1
[root@master ~]# cat /proc/cpuinfo |grep "physical id"|sort |uniq|wc -l1[root@master ~]# cat /proc/cpuinfo |grep "processor"|wc -l
4[root@master ~]# cat /proc/cpuinfo |grep "cores"|uniqcpu cores: 4[root@master ~]# cat /proc/cpuinfo |grep MHz|uniqcpu MHz: 2494.222[root@master ~]# cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c4 Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz[root@master ~]# getconf LONG_BIT64[root@master ~]# cat /proc/cpuinfo | grep physical | uniq -c1 physical id: 01 address sizes: 46 bits physical, 4 8 bits virtual1 physical id: 0 address sizes: 4 6 bits physical, 48 bits virtual 1 physical id: 01 address sizes: 46 bits physical, 48 bits virtual1 physical id: 01 address sizes: 46 bits physical, 48 bits virtual[root@master ~]# cat /proc/cpuinfo |
3
chongqing OP @codehz 按照您的思路可以实现。
咨询一个内存修改问题: 目前有内存条 2 根每一个是 32 G ,想改为 2 * 128G ,通过 mount 形式修改了 meminfo ,通过 free 查看也确实是 256G ,但通过 dmidecode -t memory 查看仍显示的是每条内存条为 32G 。 请问一下有好的思路解决吗 |
4
codehz 2022-12-28 12:36:29 +08:00 1
用类似方法把 /sys/firmware/dmi/tables/DMI 给“覆盖”了呗,不过具体内容就是二进制格式了,得研究下改哪个字段
|
5
chongqing OP @codehz 找了 dmidecode 源码 https://github.com/mirror/dmidecode/blob/master/dmidecode.c#L4690 ,很久没有搞过 C ,一时半会不知道怎么去修改 dmi ,能否付费帮忙弄一下呢。vx ( base64 ):SmljLWJsdWU=
|
6
codehz 2022-12-28 15:57:45 +08:00
自己编译一个,在附近用 hexdump 的方法打印出特征数据,不就知道数据来自哪里了吗
|