Make kernel build deterministic

https://lwn.net/Articles/437864/

LWN ContentEdition
Subscribe / Log in / New accountMake kernel build deterministicFrom: Michal Marek mmarek@suse.czTo: linux-kbuild@vger.kernel.orgSubject: [PATCH 00/34] Make kernel build deterministicDate: Tue, 5 Apr 2011 16:58:47 +0200Message-ID: 1302015561-21047-1-git-send-email-mmarek@suse.czCc: anil_ravindranath@pmc-sierra.com, mchehab@redhat.com, benh@kernel.crashing.org, x86@kernel.org, mac@melware.de, aacraid@adaptec.com, linux-mtd@lists.infradead.org, allan.stephens@windriver.com, hpa@zytor.com, netdev@vger.kernel.org, t.sailer@alumni.ethz.ch, gwingerde@gmail.com, IvDoorn@gmail.com, elf@buici.com, cluster-devel@redhat.com, ccaulfie@redhat.com, mingo@redhat.com, dougthompson@xmission.com, linux-usb@vger.kernel.org, linux-media@vger.kernel.org, arnaud.giersch@free.fr, teigland@redhat.com, tony.olech@elandigitalsystems.com, apw@canonical.com, linux-hams@vger.kernel.org, tglx@linutronix.de, swhiteho@redhat.com, linux-arm-kernel@lists.infradead.org, linux-edac@vger.kernel.org, jon.maloy@ericsson.com, linux-scsi@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, gregkh@suse.de, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, bluesmoke-devel@lists.soArchive-link: ArticleHi,this series makes it possible to build bit-identical kernel image andmodules from identical sources. Of course the build is alreadydeterministic in terms of behavior of the code, but the varioustimestamps embedded in the object files make it hard to compare twobuilds, for instance to verify that a makefile cleanup didn’taccidentally change something. A prime example is /proc/config.gz, whichhas both a timestamp in the gzip header and a timestamp in the payloaddata. With this series applied, a script like this will produceidentical kernels each time:#!/bin/bashrm -rf /dev/shm/{source,build}{,1,2}export KCONFIG_NOTIMESTAMP=1export KBUILD_BUILD_TIMESTAMP='Sun May 1 12:00:00 CEST 2011’export KBUILD_BUILD_USER=userexport KBUILD_BUILD_HOST=hostexport ROOT_DEV=FLOPPYfor i in 1 2; do mkdir /dev/shm/source # randomize the inode order just for fun git ls-tree -r -z --name-only HEAD | sort -R -z | xargs -0 \ cp --parents --target=/dev/shm/source pushd /dev/shm/source mkdir /dev/shm/build >/dev/shm/build/all.config for opt in GCOV_KERNEL UBIFS_FS_DEBUG; do echo "# CONFIG_ o p t i s n o t s e t " > > " / d e v / s h m / b u i l d " / a l l . c o n f i g d o n e m a k

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值