0
点赞
收藏
分享

微信扫一扫

使得两次编译linux内核产生一样的结果

洲行 2022-10-14 阅读 67


export INSTALL_MOD_STRIP=-s
export KBUILD_BUILD_TIMESTAMP=0
export KBUILD_BUILD_USER=root
export KBUILD_BUILD_HOST=localhost
make mrproper
make allnoconfig
make

其中​​make allnoconfig​​表示除必须的选项外, 其它选项一律不选。

然后就可以发现​​vmlinux​​​和​​arch/x86/boot/bzImage​​​都是确定性的。需要注意的是其他文件可能仍然是不确定的。关于这两个文件的描述可以看这里:​​https://en.wikipedia.org/wiki/Vmlinux​​

参考文献
​​​https://blog.abraithwaite.net/2014/08/12/deterministic-kernel-builds/​​​​Make kernel build deterministic​​​​Linux​​

​​Kernel内核配置方式详解​​


举报

相关推荐

0 条评论