From nobody Fri May 17 08:39:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1700755742; cv=none; d=zohomail.com; s=zohoarc; b=LUwjFf4beEwDtf8p3xFz7xAxcV73QD9pAJRkF+tYm+kmVIltKDQ1MIW+O9iMBi0NDpNqClgcgVcHv2GECO666DRHFYX7b2abIom4p+D8iK1cZLEgbdMFNDIkmCJTqqPDef8wG9sBzpzYmbyF3LMeEiVyt3pi+0piHcwc4vNhRKg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700755742; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=rMkauDFn+qAfuR/oZAOw0ra8gHEXx3ErgUZ/htH3VG0=; b=cAYSjNCzA7Hbq1V4HPvMWXXkvfvGKZ1xDtCtji0fEjud5pX/JOVjEgiqQa3f03W9InJss9e7MGLEFl+RdgAHQnOlCt8m5VWJlteupIReMXKFVxf980Tntk+fxjbdEwjbXd4xarOEu+iOwdpasvcOEcMcxjue8+eLX7sMYUVXLdM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1700755742307915.8859636152636; Thu, 23 Nov 2023 08:09:02 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.639825.997514 (Exim 4.92) (envelope-from ) id 1r6CFq-0002rE-OE; Thu, 23 Nov 2023 16:08:38 +0000 Received: by outflank-mailman (output) from mailman id 639825.997514; Thu, 23 Nov 2023 16:08:38 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r6CFq-0002qf-JW; Thu, 23 Nov 2023 16:08:38 +0000 Received: by outflank-mailman (input) for mailman id 639825; Thu, 23 Nov 2023 16:08:37 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r6CFp-0002oi-Ho for xen-devel@lists.xenproject.org; Thu, 23 Nov 2023 16:08:37 +0000 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [2a00:1450:4864:20::42e]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 8e75e311-8a1a-11ee-9b0e-b553b5be7939; Thu, 23 Nov 2023 17:08:36 +0100 (CET) Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-332e3ad436cso415973f8f.3 for ; Thu, 23 Nov 2023 08:08:36 -0800 (PST) Received: from localhost ([213.195.113.99]) by smtp.gmail.com with ESMTPSA id q14-20020adff78e000000b0031c52e81490sm1994948wrp.72.2023.11.23.08.08.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 08:08:34 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 8e75e311-8a1a-11ee-9b0e-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1700755715; x=1701360515; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rMkauDFn+qAfuR/oZAOw0ra8gHEXx3ErgUZ/htH3VG0=; b=dQ2EjVj0qsCz/FdrqNhZXb5Jw0inDEuecf5HiXvCT2iHClnBtVbFAlfa4v4pZ0sgLK 6PK62G8SollWfE5zIhs65JXi+FMT1LU5m6TkbidyQnomVo6qUNRzZ6/feeHhQlX6TdG8 0q4lzljSdH/67EVYK7ZrnsaFA9mczWSIXi9MM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700755715; x=1701360515; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rMkauDFn+qAfuR/oZAOw0ra8gHEXx3ErgUZ/htH3VG0=; b=jB7tWBnByb3/pIke4ds8rB5QA2BCMG87Fijbd4zKDJSqN4dGtsNVeKNgFWIf0Et1aP g2gALmcWduMv+VbmwKy1JdeH7cCAYQfIYBVbEDKE9xM/txpYsL3HivlSHEcl6/dZ9+2G +1i+ewGBPG66DfztcOl0z2z84ctC7sB6tYfebdtg+dtVFzXbopdhqsCtdP4JRDAIeNLL hMJ5kFEFGrhAO4FdDJbJQRtM4aoGMY//K3Ss9Y/gFfK40IB5N9G6MO9m+aIin4TpMQu4 uAN1SSi1GsaT28aSViFdf0SldaT7fNmqOf6Ige99lJcyTMVuW5HD0cr1nbXaAchrV8i+ ujrA== X-Gm-Message-State: AOJu0YwdfSGkMIitnZ5BB/pLSNdgLQ5OZHYB5WKxSkFmnX3M1FbA4gCR ba2a8XEKWG3S6dCBCmRsI0FdC7/WVicFuJT2NVI= X-Google-Smtp-Source: AGHT+IHJaU8zC+nXolQBUc96aBO3NKFRA31Z/rp8UDlbKGxszXv7kGob8xzwyqCzkQa/ZwAGJVQ8jg== X-Received: by 2002:adf:ec4e:0:b0:332:c5bd:1d9e with SMTP id w14-20020adfec4e000000b00332c5bd1d9emr3794889wrn.4.1700755714811; Thu, 23 Nov 2023 08:08:34 -0800 (PST) From: Roger Pau Monne To: xen-devel@lists.xenproject.org Cc: Konrad Rzeszutek Wilk , Ross Lagerwall , Roger Pau Monne Subject: [PATCH 1/2] livepatch-build-tools: remove usage of gawk Date: Thu, 23 Nov 2023 17:05:34 +0100 Message-ID: <20231123160535.18658-2-roger.pau@citrix.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231123160535.18658-1-roger.pau@citrix.com> References: <20231123160535.18658-1-roger.pau@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1700755742794100001 And instead use plain awk. There's no need to use the --non-decimal-data option for gawk, since the numbers that we want to print are already prefixed with '0x', and so plain = awk will do the conversion from hexadecimal to decimal just fine. Signed-off-by: Roger Pau Monn=C3=A9 --- livepatch-build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/livepatch-build b/livepatch-build index 91d203bda0eb..26c88a2ed2c3 100755 --- a/livepatch-build +++ b/livepatch-build @@ -422,7 +422,7 @@ if [ "${SKIP}" !=3D "build" ]; then echo "Reading special section data" # Using xen-syms built in the previous step by build_full(). SPECIAL_VARS=3D$(readelf -wi "$OUTPUT/xen-syms" | - gawk --non-decimal-data ' + awk ' BEGIN { a =3D b =3D e =3D 0 } a =3D=3D 0 && /DW_AT_name.* alt_instr/ {a =3D 1; next} b =3D=3D 0 && /DW_AT_name.* bug_frame/ {b =3D 1; next} base-commit: e588b7914e7afa3abb64b15a32fc2fdb57ded341 --=20 2.43.0 From nobody Fri May 17 08:39:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1700755746; cv=none; d=zohomail.com; s=zohoarc; b=MSgo7a5bKekHCP65adbM2/t9zda1ssFo+F7X4bFLjJiVSyBNiVN0QYDF0mAML0PegcS+ciBWfZUJUaO7aCPY1YbLRU1tlFMGT+QkMTkcH69B+FedLe5DodxC4ecixOqTGZEUEQFteUgREU+AK5KZU9AN+4nXLt+0mkqsnf0TnRI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700755746; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=nfobU6oQZA/gb41m+Lcagy1PuTHLFIO9Dot16l0EkH8=; b=IqXT0XOqasrS8bLi758IpytcW3cwq8mOqB9EWI0RL5t5vilpJ+oHzXf9S4/J2FsScobULOxyCMPBkbYW7S52OYsBYi7Mu5kF+Odn2U4Ow43OMObUDjIwkjm3K9sFmENYBmi5QTGamV2Ajoq8EOjbRQMm3XJgy5PZjbV6Qo1D0LE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1700755746585356.646778687257; Thu, 23 Nov 2023 08:09:06 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.639826.997529 (Exim 4.92) (envelope-from ) id 1r6CFs-0003IT-0W; Thu, 23 Nov 2023 16:08:40 +0000 Received: by outflank-mailman (output) from mailman id 639826.997529; Thu, 23 Nov 2023 16:08:39 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r6CFr-0003IM-T7; Thu, 23 Nov 2023 16:08:39 +0000 Received: by outflank-mailman (input) for mailman id 639826; Thu, 23 Nov 2023 16:08:38 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r6CFq-0002oi-DN for xen-devel@lists.xenproject.org; Thu, 23 Nov 2023 16:08:38 +0000 Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [2a00:1450:4864:20::230]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 8efde5f9-8a1a-11ee-9b0e-b553b5be7939; Thu, 23 Nov 2023 17:08:36 +0100 (CET) Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2c5b7764016so11767431fa.1 for ; Thu, 23 Nov 2023 08:08:36 -0800 (PST) Received: from localhost ([213.195.113.99]) by smtp.gmail.com with ESMTPSA id z4-20020a1c4c04000000b0040b32edf626sm2389446wmf.31.2023.11.23.08.08.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 08:08:35 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 8efde5f9-8a1a-11ee-9b0e-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1700755716; x=1701360516; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nfobU6oQZA/gb41m+Lcagy1PuTHLFIO9Dot16l0EkH8=; b=n3/NcrC++yMlQc7SToGcbcGxTQbrfQjd+Oj1O6IF9vwHzVGD2bpiEotcmLvPXVSIgV UgS0yq1fusDeYRSYfjVvaTIEEf0eizxBSRToesjCW4YIlbZ2v907U+9mWsyY0Ee2VZtX 9nAXkeUgRCCI+kFAdz+N742wh1DkkVxIUaGvw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700755716; x=1701360516; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nfobU6oQZA/gb41m+Lcagy1PuTHLFIO9Dot16l0EkH8=; b=Ov9b16DQcrk5M5UF/r5Bn477l7zjxmesJtREr4tdIV9adxuG+HNzg6ebQtERcBCG75 j0JQtppOToMT5A2Ou7smbiHLcZ25B5vot8UdIBskaP4Qv2aBOQJlahaZ5o8+FygsswUQ xTAUlPNOc37WeJ6DdnubyzDsz2DvZQNxg9aVu/zdOSN+L5fm4X4k5m9K4PZgZVICIdfR 7Dh+BovYt88NFkKQPmozLZvaglQte/+If0axk0IFEHtPur7bK78i0CUqsKFu+GL72hTR 0eNiaWopgnkA2VnSylCoJP54djA0VvFABIYqJDDHRaojUj41mffNSuxfZA4cqrlm7+rS A2hQ== X-Gm-Message-State: AOJu0Yz/+1IDQxV+U+1Uf6oXPBPLU6UvjZFKRFq93P6b89FmPKwqpDpN Y5jDKpP8djCh91LtuECKa2M66/z7ODz3BpyZrH8= X-Google-Smtp-Source: AGHT+IErJ5LvfgBLNdXMU2XeRi7CmqTTb4oF0dHB65UIsSG26Lhx5thivbpCT/4zNzHhguujexxr8A== X-Received: by 2002:a2e:9f4e:0:b0:2c5:f1a:1f31 with SMTP id v14-20020a2e9f4e000000b002c50f1a1f31mr3188351ljk.1.1700755716042; Thu, 23 Nov 2023 08:08:36 -0800 (PST) From: Roger Pau Monne To: xen-devel@lists.xenproject.org Cc: Konrad Rzeszutek Wilk , Ross Lagerwall , Roger Pau Monne Subject: [PATCH 2/2] livepatch-build-tools: do not use readlink -m option Date: Thu, 23 Nov 2023 17:05:35 +0100 Message-ID: <20231123160535.18658-3-roger.pau@citrix.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231123160535.18658-1-roger.pau@citrix.com> References: <20231123160535.18658-1-roger.pau@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1700755748821100003 Busybox readlink implementation only supports the -f option to follow symli= nks, so adjust the logic in order to keep the same behaviour without using the -m option. Singed-off-by: Roger Pau Monn=C3=A9 Reviewed-by: Ross Lagerwall --- livepatch-build | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/livepatch-build b/livepatch-build index 26c88a2ed2c3..2f35e98d30a3 100755 --- a/livepatch-build +++ b/livepatch-build @@ -336,8 +336,8 @@ while [[ $# -gt 0 ]]; do ;; --xen-syms) shift - XENSYMS=3D"$(readlink -m -- "$1")" - [ -f "$XENSYMS" ] || die "xen-syms file does not exist" + [ -f "$1" ] || die "xen-syms file does not exist" + XENSYMS=3D"$(readlink -f -- "$1")" shift ;; --depends) @@ -366,22 +366,20 @@ while [[ $# -gt 0 ]]; do done =20 [ -z "$srcarg" ] && die "Xen directory not given" +[ -d "$srcarg" ] || die "Xen directory does not exist" [ -z "$patcharg" ] && die "Patchfile not given" +[ -f "$patcharg" ] || die "Patchfile does not exist" [ -z "$configarg" ] && die ".config not given" +[ -f "$configarg" ] || die ".config does not exist" [ -z "$outputarg" ] && die "Output directory not given" [ -z "$DEPENDS" ] && die "Build-id dependency not given" [ -z "$XEN_DEPENDS" ] && die "Xen Build-id dependency not given" =20 -SRCDIR=3D"$(readlink -m -- "$srcarg")" +SRCDIR=3D"$(readlink -f -- "$srcarg")" # We need an absolute path because we move around, but we need to # retain the name of the symlink (=3D realpath -s) PATCHFILE=3D"$(readlink -f "$(dirname "$patcharg")")/$(basename "$patcharg= ")" -CONFIGFILE=3D"$(readlink -m -- "$configarg")" -OUTPUT=3D"$(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" +CONFIGFILE=3D"$(readlink -f -- "$configarg")" =20 PATCHNAME=3D$(make_patch_name "${PATCHFILE}") =20 @@ -390,17 +388,20 @@ echo echo "Xen directory: ${SRCDIR}" echo "Patch file: ${PATCHFILE}" echo ".config file: ${CONFIGFILE}" -echo "Output directory: ${OUTPUT}" +echo "Output directory: $outputarg" echo "=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D" echo =20 if [ "${SKIP}" !=3D "build" ]; then - [ -e "${OUTPUT}" ] && die "Output directory exists" + # Make sure output directory doesn't exist, and create it. + [ -e "$outputarg" ] && die "Output directory exists" + mkdir -p "$outputarg" || die + OUTPUT=3D"$(readlink -f -- "$outputarg")" + grep -q 'CONFIG_LIVEPATCH=3Dy' "${CONFIGFILE}" || die "CONFIG_LIVEPATC= H must be enabled" cd "$SRCDIR" || die patch -s -N -p1 -f --fuzz=3D0 --dry-run < "$PATCHFILE" || die "Source = patch file failed to apply" =20 - mkdir -p "${OUTPUT}" || die cp -f "${CONFIGFILE}" "${OUTPUT}/.config" cp -f "${OUTPUT}/.config" "xen/.config" =20 @@ -453,7 +454,9 @@ if [ "${SKIP}" !=3D "build" ]; then fi =20 if [ "${SKIP}" !=3D "diff" ]; then - [ -d "${OUTPUT}" ] || die "Output directory does not exist" + cd "${SCRIPTDIR}" || die + [ -d "$outputarg" ] || die "Output directory does not exist" + OUTPUT=3D"$(readlink -f -- "$outputarg")" =20 cd "${OUTPUT}" || die create_patch --=20 2.43.0