From patchwork Mon Jan 25 20:49:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander 'lynxis' Couzens X-Patchwork-Id: 572902 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id BA11414016A for ; Tue, 26 Jan 2016 07:53:00 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 7407828C6C2; Mon, 25 Jan 2016 21:49:59 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 81A7228C0EC for ; Mon, 25 Jan 2016 21:49:19 +0100 (CET) X-policyd-weight: using cached result; rate: -7.6 Received: from mail.base45.de (mail.base45.de [80.241.61.77]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Mon, 25 Jan 2016 21:49:17 +0100 (CET) Received: from [2001:1a80:2259:d21a:9432:feb0:15e7:1734] (helo=lazus.yip) by mail.base45.de with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA256:128) (Exim 4.82) (envelope-from ) id 1aNo5F-00074z-5q; Mon, 25 Jan 2016 21:49:57 +0100 From: Alexander Couzens To: openwrt-devel@lists.openwrt.org Date: Mon, 25 Jan 2016 21:49:26 +0100 Message-Id: <1453754975-18721-5-git-send-email-lynxis@fe80.eu> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1453754975-18721-1-git-send-email-lynxis@fe80.eu> References: <1453754975-18721-1-git-send-email-lynxis@fe80.eu> Cc: bnewbold@robocracy.org Subject: [OpenWrt-Devel] [PATCH 04/13] include/kernel: add custom USER/DOMAIN config options X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" From: bryan newbold These allow the generated kernel's build metadata to be defined explicitly. This metadata is reported, eg, at boot time and in `uname -a` on running systems. If the variables aren't configured, the current build system username and hostname are used as normal. The motivation for this option is to achive reproducible (bit-for-bit identical) kernel builds of official openwrt releases. Signed-off-by: bryan newbold --- config/Config-kernel.in | 16 ++++++++++++++++ include/kernel-defaults.mk | 2 ++ 2 files changed, 18 insertions(+) diff --git a/config/Config-kernel.in b/config/Config-kernel.in index 6e79bae..c93bbde 100644 --- a/config/Config-kernel.in +++ b/config/Config-kernel.in @@ -4,6 +4,22 @@ # See /LICENSE for more information. # +config KERNEL_BUILD_USER + string "Custom Kernel Build User Name" + default "" + help + Sets the Kernel build user string, which for example will be returned + by 'uname -a' on running systems. + If not set, uses system user at build time. + +config KERNEL_BUILD_DOMAIN + string "Custom Kernel Build Domain Name" + default "" + help + Sets the Kernel build domain string, which for example will be + returned by 'uname -a' on running systems. + If not set, uses system hostname at build time. + config KERNEL_PRINTK bool "Enable support for printk" default y diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk index 052b2b3..63f996a 100644 --- a/include/kernel-defaults.mk +++ b/include/kernel-defaults.mk @@ -10,6 +10,8 @@ KERNEL_MAKEOPTS := -C $(LINUX_DIR) \ CROSS_COMPILE="$(KERNEL_CROSS)" \ ARCH="$(LINUX_KARCH)" \ KBUILD_HAVE_NLS=no \ + KBUILD_BUILD_USER="$(CONFIG_KERNEL_BUILD_USER)" \ + KBUILD_BUILD_HOST="$(CONFIG_KERNEL_BUILD_DOMAIN)" \ CONFIG_SHELL="$(BASH)" \ $(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') \ $(if $(PKG_BUILD_ID),LDFLAGS_MODULE=--build-id=0x$(PKG_BUILD_ID))