From nobody Sat Nov 23 18:56:02 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=1701163370; cv=none; d=zohomail.com; s=zohoarc; b=HwD//qVprZSBS6nDyxm9yjqawtrzlXffAaEjXrrZ+RI1AHKX9hnFoBUKWMc2lGwth4s4IfYWsDYOTrc5FskuSS9CIGfb3f2MwlbjdcqpKC7KIbyNE4FNGe7dNKkzeSrFn7lXY/wVq0aGDQw2hlAWDcPS+VK7hZwew/SbBXsmkcA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1701163370; 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=h5HPry0cHVXYa7E65UlZUEhBkm420RlLl9/gqlG+ArQ=; b=BEf/Mmkc/EIcs62gJN/ECG019X07Rxdf+zUJ7mGNc7+5uqw8jhAtABLrLztnmLiwtZIOLgEIGYPsT7Qn3lnRGvJqHEci1uJI/MnoT7X5BJFDVP8ANJk1rz31j65dcQcidIwrSHsNxuFRS8B1cXsbwYr+MRZ9T5iyicjAG310fIE= 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 1701163370777515.2913431708956; Tue, 28 Nov 2023 01:22:50 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.642825.1002578 (Exim 4.92) (envelope-from ) id 1r7uIW-0005cP-Kd; Tue, 28 Nov 2023 09:22:28 +0000 Received: by outflank-mailman (output) from mailman id 642825.1002578; Tue, 28 Nov 2023 09:22:28 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r7uIW-0005cI-HU; Tue, 28 Nov 2023 09:22:28 +0000 Received: by outflank-mailman (input) for mailman id 642825; Tue, 28 Nov 2023 09:22:26 +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 1r7uIU-0004tr-Kw for xen-devel@lists.xenproject.org; Tue, 28 Nov 2023 09:22:26 +0000 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [2a00:1450:4864:20::42a]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id a3ccb24d-8dcf-11ee-9b0e-b553b5be7939; Tue, 28 Nov 2023 10:22:24 +0100 (CET) Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-3316bb1303bso3233170f8f.0 for ; Tue, 28 Nov 2023 01:22:25 -0800 (PST) Received: from localhost ([213.195.113.99]) by smtp.gmail.com with ESMTPSA id b7-20020adfe307000000b00332fbf7ab21sm6834899wrj.60.2023.11.28.01.22.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 01:22:23 -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: a3ccb24d-8dcf-11ee-9b0e-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1701163344; x=1701768144; 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=h5HPry0cHVXYa7E65UlZUEhBkm420RlLl9/gqlG+ArQ=; b=BKFwDsMvtefl2dhVlXZFUuughPuwhabDvJjl8vY5hQCWU3R+dHFu/GgCQ3iqn20iHz xHYT9WQ617iOMTkRXDZp6cTauItHg7A33DRHiTnwAlF51qh+XKDYyH/4MrsK1j5pw07n u2ikulgVxRh4P0D1IpNHlq0kG35r8Ht5H/dK0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701163344; x=1701768144; 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=h5HPry0cHVXYa7E65UlZUEhBkm420RlLl9/gqlG+ArQ=; b=gdIE698slba8G89/W7bDN1d2ykemlqLjeKlPLoz4d2NDWKpE7L8c9mGJCrohxbB6jD sSvNv4qeYm4M/2RKR9DB2Hw4eZ7nc8GxlIckWeJFdLusgmJbbvNvcM+FU7oh3TYUC0XL rLqc7tTqYxOEXKmEK5GAj9ImzXLIZxWSqAIq3lPtYXv4MN3Yts02FVKdwMBfiN7Pv8+H UbYTDXNpUUeBVwgcX8vxKwpKyH1M0cZZnH6yl+2PYDqzrXDXzPim6J+asZMQsM8DIbJT 6L0PXO5xPEM5iKkZ11boC3mYqSgv8r7UlmJEbC3E5MMhrp4CWJwXzEi/WSPaKhY20ONm dtiQ== X-Gm-Message-State: AOJu0YwEcNK+ChUOrn9wNc/40pwSTWDgZ1BUxw0HmVC9JOLc+42U7McD 9eFGn8DWTgtOktf+KHUJR5wIxmRzZ395XiUQXUk= X-Google-Smtp-Source: AGHT+IEQiMZYddsFFj7Vr/s1dpjiADp3UuvyPpdn8nKI0utkQ7+Yp9K9ye8K+CxyXt8skoTiuCjdFg== X-Received: by 2002:adf:f349:0:b0:333:ed:82ed with SMTP id e9-20020adff349000000b0033300ed82edmr4459304wrp.66.1701163343894; Tue, 28 Nov 2023 01:22:23 -0800 (PST) From: Roger Pau Monne To: xen-devel@lists.xenproject.org Cc: Konrad Rzeszutek Wilk , Ross Lagerwall , Roger Pau Monne Subject: [PATCH v2 2/3] livepatch-build-tools: remove usage of gawk Date: Tue, 28 Nov 2023 10:21:51 +0100 Message-ID: <20231128092152.35039-3-roger.pau@citrix.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231128092152.35039-1-roger.pau@citrix.com> References: <20231128092152.35039-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: 1701163372323000002 And instead use plain awk. Since plain awk cannot do the conversion from hex to decimal, use the shell (bash) printf to convert the (maybe) hexadecimal output of readelf. Signed-off-by: Roger Pau Monn=C3=A9 --- Changes since v1: - Use shell printf to convert. --- livepatch-build | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/livepatch-build b/livepatch-build index 305644037ee7..e2ccce4f7fd7 100755 --- a/livepatch-build +++ b/livepatch-build @@ -423,14 +423,15 @@ 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} e =3D=3D 0 && /DW_AT_name.* exception_table_entry/ {e =3D 1= ; next} - a =3D=3D 1 {printf("export ALT_STRUCT_SIZE=3D%d\n", $4); a = =3D 2} - b =3D=3D 1 {printf("export BUG_STRUCT_SIZE=3D%d\n", $4); b = =3D 2} - e =3D=3D 1 {printf("export EX_STRUCT_SIZE=3D%d\n", $4); e = =3D 2} + # Use shell printf to (possibly) convert from hex to decimal + a =3D=3D 1 {printf("export ALT_STRUCT_SIZE=3D`printf \"%%d\= " \"%s\"`\n", $4); a =3D 2} + b =3D=3D 1 {printf("export BUG_STRUCT_SIZE=3D`printf \"%%d\= " \"%s\"`\n", $4); b =3D 2} + e =3D=3D 1 {printf("export EX_STRUCT_SIZE=3D`printf \"%%d\"= \"%s\"`\n", $4); e =3D 2} a =3D=3D 2 && b =3D=3D 2 && e =3D=3D 2 {exit}') [[ -n $SPECIAL_VARS ]] && eval "$SPECIAL_VARS" if [[ -z $ALT_STRUCT_SIZE ]] || [[ -z $BUG_STRUCT_SIZE ]] || [[ -z $EX= _STRUCT_SIZE ]]; then --=20 2.43.0