From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id E90FF139086 for ; Mon, 2 Jan 2017 20:40:08 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2F359E0D79; Mon, 2 Jan 2017 20:40:07 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E5CADE0D79 for ; Mon, 2 Jan 2017 20:40:06 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2C0BF340EDA for ; Mon, 2 Jan 2017 20:40:01 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 7BFFB261D for ; Mon, 2 Jan 2017 20:39:59 +0000 (UTC) From: "Robin H. Johnson" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Robin H. Johnson" Message-ID: <1483389551.98c7a1c54c78785862d645df178afdcb8a7722f3.robbat2@gentoo> Subject: [gentoo-commits] proj/genkernel:master commit in: / X-VCS-Repository: proj/genkernel X-VCS-Files: gen_compile.sh X-VCS-Directories: / X-VCS-Committer: robbat2 X-VCS-Committer-Name: Robin H. Johnson X-VCS-Revision: 98c7a1c54c78785862d645df178afdcb8a7722f3 X-VCS-Branch: master Date: Mon, 2 Jan 2017 20:39:59 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 055d878b-1718-4b6e-85d7-ea3c8e6a65a2 X-Archives-Hash: 030a763f982cbeafd734ca44ea3f545c commit: 98c7a1c54c78785862d645df178afdcb8a7722f3 Author: Robin H. Johnson gentoo org> AuthorDate: Mon Jan 2 20:39:11 2017 +0000 Commit: Robin H. Johnson gentoo org> CommitDate: Mon Jan 2 20:39:11 2017 +0000 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=98c7a1c5 gen_compile: ensure toggling NFS options invalidates the bincache of busybox. Signed-off-by: Robin H. Johnson gentoo.org> gen_compile.sh | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/gen_compile.sh b/gen_compile.sh index a730d77..04a7bd4 100755 --- a/gen_compile.sh +++ b/gen_compile.sh @@ -412,11 +412,23 @@ compile_busybox() { gen_die "Could not find a busybox config file" fi + # Apply config-based tweaks to the busybox config. + # This needs to be done before cache validation. + cp "${BUSYBOX_CONFIG}" "${TEMP}/busybox-config" + if isTrue "${NFS}" + then + sed -i \ + -e 's/.*CONFIG_FEATURE_MOUNT_NFS.*/CONFIG_FEATURE_MOUNT_NFS=y/' \ + "${TEMP}/busybox-config" + fi + # Delete cache if stored config's MD5 does not match one to be used + # This exactly just the .config.gk_orig file, and compares it again the + # current .config. if [ -f "${BUSYBOX_BINCACHE}" ] then - oldconfig_md5=$(tar -xjf "${BUSYBOX_BINCACHE}" -O .config.gk_orig 2>/dev/null | md5sum) - newconfig_md5=$(md5sum < "${BUSYBOX_CONFIG}") + oldconfig_md5="$(tar -xjf "${BUSYBOX_BINCACHE}" -O .config.gk_orig 2>/dev/null | md5sum)" + newconfig_md5="$(md5sum < "${TEMP}/busybox-config")" if [ "${oldconfig_md5}" != "${newconfig_md5}" ] then print_info 1 "busybox: >> Removing stale cache..." @@ -426,6 +438,9 @@ compile_busybox() { fi fi + # If the busybox bincache does NOT exist, create it; this cannot be merged + # with the above statement, because that statement might remove the + # bincache. if [ ! -f "${BUSYBOX_BINCACHE}" ] then cd "${TEMP}" @@ -434,19 +449,20 @@ compile_busybox() { gen_die 'Could not extract busybox source tarball!' [ -d "${BUSYBOX_DIR}" ] || gen_die "Busybox directory ${BUSYBOX_DIR} is invalid!" - cp "${BUSYBOX_CONFIG}" "${BUSYBOX_DIR}/.config" - cp "${BUSYBOX_CONFIG}" "${BUSYBOX_DIR}/.config.gk_orig" - if isTrue "${NFS}" - then - sed -i 's/.*CONFIG_FEATURE_MOUNT_NFS.*/CONFIG_FEATURE_MOUNT_NFS=y/' "${BUSYBOX_DIR}/.config" - fi + + cp "${TEMP}/busybox-config" "${BUSYBOX_DIR}/.config" + cp "${BUSYBOX_DIR}/.config" "${BUSYBOX_DIR}/.config.gk_orig" # used for the bincache compare + cd "${BUSYBOX_DIR}" apply_patches busybox ${BUSYBOX_VER} + + # This has the side-effect of changing the .config print_info 1 'busybox: >> Configuring...' yes '' 2>/dev/null | compile_generic oldconfig utils print_info 1 'busybox: >> Compiling...' compile_generic all utils V=1 + print_info 1 'busybox: >> Copying to cache...' [ -f "${TEMP}/${BUSYBOX_DIR}/busybox" ] || gen_die 'Busybox executable does not exist!'