From patchwork Fri Jun 10 11:02:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Lagerwall X-Patchwork-Id: 9169481 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CC24660573 for ; Fri, 10 Jun 2016 11:05:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BDA561FF45 for ; Fri, 10 Jun 2016 11:05:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B298C2835A; Fri, 10 Jun 2016 11:05:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4D0A91FF45 for ; Fri, 10 Jun 2016 11:05:05 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bBKDP-0003NM-Dj; Fri, 10 Jun 2016 11:03:03 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bBKDO-0003Mv-8L for xen-devel@lists.xen.org; Fri, 10 Jun 2016 11:03:02 +0000 Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id B9/7F-17282-56E9A575; Fri, 10 Jun 2016 11:03:01 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprFIsWRWlGSWpSXmKPExsXitHSDvW7qvKh wg7eP2S2WfFzM4sDocXT3b6YAxijWzLyk/IoE1ozLkzazFLQqVUxfvZCtgXGGZBcjJ4eEgL/E 2mNrGEFsNgEDiVuXvjOD2CICshKru+awg9jMAvES6+dMZAWxhQUMJXZfP8AGYrMIqEq8XLUEr J5XwFPi+aODQDUcQDPlJZ7drgcJcwp4STz+dwysRAiopP/tTXYIW03i7fIzLBCtghInZz5hgV glIXHwxQtmiDHcEn+77Scw8s1CUjULSdUCRqZVjOrFqUVlqUW6ZnpJRZnpGSW5iZk5uoYGpnq 5qcXFiempOYlJxXrJ+bmbGIHhxAAEOxinNjgfYpTkYFIS5Z08OSpciC8pP6UyI7E4I76oNCe1 +BCjDAeHkgSv9VygnGBRanpqRVpmDjCwYdISHDxKIrwMIGne4oLE3OLMdIjUKUZdjnmTdh1jE mLJy89LlRLnVQUpEgApyijNgxsBi7JLjLJSwryMQEcJ8RSkFuVmlqDKv2IU52BUEuY9OgdoCk 9mXgncpldARzABHbH8SDjIESWJCCmpBsaFv49cXxpmxzErO2XhoWuVDCqKD6YK/mKrWBzR3qM of3wJw75e2w/L5L1KrJfUXT1zZ5NgusgiqRLHJdNFuOIXLvVT3Fi8NSLLnTGo3f/210DemqRX KZsPz174wvuum3z85cIfngahk/7o221L4ptivPjb7U+u3Z61vSUTsjd/DHqzm13RcpESS3FGo qEWc1FxIgDCLVJzrQIAAA== X-Env-Sender: prvs=9624cb854=ross.lagerwall@citrix.com X-Msg-Ref: server-10.tower-206.messagelabs.com!1465556578!26996526!2 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 27299 invoked from network); 10 Jun 2016 11:03:00 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-10.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 10 Jun 2016 11:03:00 -0000 X-IronPort-AV: E=Sophos;i="5.26,449,1459814400"; d="scan'208";a="366463641" From: Ross Lagerwall To: Date: Fri, 10 Jun 2016 12:02:44 +0100 Message-ID: <1465556565-26403-2-git-send-email-ross.lagerwall@citrix.com> X-Mailer: git-send-email 2.4.11 In-Reply-To: <1465556565-26403-1-git-send-email-ross.lagerwall@citrix.com> References: <1465556565-26403-1-git-send-email-ross.lagerwall@citrix.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: Ross Lagerwall Subject: [Xen-devel] [PATCH 2/3] Update to use a .config file X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Remove the old --xen-debug option, and instead, require the user to pass a .config file matching the original build's .config. Signed-off-by: Ross Lagerwall --- livepatch-build | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/livepatch-build b/livepatch-build index 8dc8889..e9d1e8d 100755 --- a/livepatch-build +++ b/livepatch-build @@ -66,7 +66,7 @@ function build_full() { cd "${SRCDIR}/xen" || die make "-j$CPUS" clean &> "${OUTPUT}/build_full_clean.log" || die - make "-j$CPUS" debug="$XEN_DEBUG" &> "${OUTPUT}/build_full_compile.log" || die + make "-j$CPUS" &> "${OUTPUT}/build_full_compile.log" || die cp xen-syms "$OUTPUT" } @@ -86,7 +86,7 @@ function build_special() # Build with special GCC flags cd "${SRCDIR}/xen" || die sed -i 's/CFLAGS += -nostdinc/CFLAGS += -nostdinc -ffunction-sections -fdata-sections/' Rules.mk - make "-j$CPUS" debug="$XEN_DEBUG" &> "${OUTPUT}/build_${name}_compile.log" || die + make "-j$CPUS" &> "${OUTPUT}/build_${name}_compile.log" || die sed -i 's/CFLAGS += -nostdinc -ffunction-sections -fdata-sections/CFLAGS += -nostdinc/' Rules.mk unset LIVEPATCH_BUILD_DIR @@ -158,17 +158,17 @@ usage() { echo " -h, --help Show this help message" >&2 echo " -s, --srcdir Xen source directory" >&2 echo " -p, --patch Patch file" >&2 + echo " -c, --config .config file" >&2 echo " -o, --output Output directory" >&2 echo " -j, --cpus Number of CPUs to use" >&2 echo " -k, --skip Skip build or diff phase" >&2 echo " -d, --debug Enable debug logging" >&2 - echo " --xen-debug Build debug Xen" >&2 echo " --xen-syms Build against a xen-syms" >&2 echo " --depends Required build-id" >&2 echo " --prelink Prelink" >&2 } -options=$(getopt -o hs:p:o:j:k:d -l "help,srcdir:patch:output:cpus:,skip:,debug,xen-debug,xen-syms:,depends:,prelink" -- "$@") || die "getopt failed" +options=$(getopt -o hs:p:c:o:j:k:d -l "help,srcdir:patch:config:output:cpus:,skip:,debug,xen-syms:,depends:,prelink" -- "$@") || die "getopt failed" eval set -- "$options" @@ -192,10 +192,6 @@ while [[ $# -gt 0 ]]; do DEBUG=1 shift ;; - --xen-debug) - XEN_DEBUG=y - shift - ;; -s|--srcdir) shift srcarg="$1" @@ -206,6 +202,11 @@ while [[ $# -gt 0 ]]; do patcharg="$1" shift ;; + -c|--config) + shift + configarg="$1" + shift + ;; -o|--output) shift outputarg="$1" @@ -235,15 +236,18 @@ done [ -z "$srcarg" ] && die "Xen directory not given" [ -z "$patcharg" ] && die "Patchfile not given" +[ -z "$configarg" ] && die ".config not given" [ -z "$outputarg" ] && die "Output directory not given" [ -z "$DEPENDS" ] && die "Build-id dependency not given" SRCDIR="$(readlink -m -- "$srcarg")" PATCHFILE="$(readlink -m -- "$patcharg")" +CONFIGFILE="$(readlink -m -- "$configarg")" OUTPUT="$(readlink -m -- "$outputarg")" [ -d "${SRCDIR}" ] || die "Xen directory does not exist" [ -f "${PATCHFILE}" ] || die "Patchfile does not exist" +[ -f "${CONFIGFILE}" ] || die ".config does not exist" PATCHNAME=$(make_patch_name "${PATCHFILE}") @@ -251,16 +255,20 @@ echo "Building LivePatch patch: ${PATCHNAME}" echo echo "Xen directory: ${SRCDIR}" echo "Patch file: ${PATCHFILE}" +echo ".config file: ${CONFIGFILE}" echo "Output directory: ${OUTPUT}" echo "================================================" echo if [ "${SKIP}" != "build" ]; then [ -e "${OUTPUT}" ] && die "Output directory exists" + grep -q 'CONFIG_LIVEPATCH=y' "${CONFIGFILE}" || die "CONFIG_LIVEPATCH must be enabled" cd "$SRCDIR" || die patch -s -N -p1 -f --fuzz=0 --dry-run < "$PATCHFILE" || die "Source patch file failed to apply" mkdir -p "${OUTPUT}" || die + cp -f "${CONFIGFILE}" "${OUTPUT}/.config" + cp -f "${OUTPUT}/.config" "xen/.config" echo "Perform full initial build with ${CPUS} CPU(s)..." build_full