From patchwork Fri Oct 20 12:44:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niko Mauno X-Patchwork-Id: 32650 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5824AC0032E for ; Fri, 20 Oct 2023 12:45:58 +0000 (UTC) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (EUR04-VI1-obe.outbound.protection.outlook.com [40.107.8.40]) by mx.groups.io with SMTP id smtpd.web10.53239.1697805955384323293 for ; Fri, 20 Oct 2023 05:45:55 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@vaisala.com header.s=selector1 header.b=NHn1WSeW; spf=permerror, err=parse error for token &{10 18 spf.protection.outlook.com}: limit exceeded (domain: vaisala.com, ip: 40.107.8.40, mailfrom: niko.mauno@vaisala.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EIdWNSOKGxBFkLnvEc1UjAC4cgQg/EYz0MNPk3bVenDf6bXQ2NKkLRMTaekaMiEc/TvaBrRuipvMQfQ9sKxf1Yl15x+CUefhhwYaezvxeb06H0UACAxgtqai9QZAiCv6GX6hF3+NWR6AqtAJ0pn6V69g5TXTZdfUn6jOOzPs64ath/85hnWZsy6oPDmOIqR5TmCGGhtm0kjyPvLJp5bGJ+paCqQ3K78d0ZeGBkfxJS2fYV21oFOacQWSJU6WhdQIg3UFtRQBqScUKakNABCjiFd0F5rqJn4ZDSayFMWqEqLAjSE7hFG9XdOkRt2hqcqizfMs1bJ+QW8pp80Pk5LMgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8HfaFG1HZbfu/xXcgVfe+Lj2DrxJoDIOB+IIqgOK968=; b=UIvyO6PKjmE8vvziEyxbjtidwHWwwHIbbDYppvGs0bkHb5DUohigFUvdtdnx7ic0HdgLsdZpN0i0Q4tsjoq3/p6WpOHuPjNpiEmPQVDTGJAS9MEoWyt7Z22LmUkzeKIVH4JG/UpEehfNGUTvCQwa2JQAXFQrkor+K3/o3ByCVKoCJvDQJYxfAqc2FHlhoktb+RT1+hqGIE9PogXs6L2fwJ+zHAaR2mAk96MyCiZC6jDcPtVFRwPRxfl7uD5dLDPjfOxQad33rv0tlftzIhlmJYfoUk3iC/8nce2su2zB5vrsknevYOT/KGf9CBJ427pqqjAFUgJ2w6jJN/b+b1HVqQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vaisala.com; dmarc=pass action=none header.from=vaisala.com; dkim=pass header.d=vaisala.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vaisala.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8HfaFG1HZbfu/xXcgVfe+Lj2DrxJoDIOB+IIqgOK968=; b=NHn1WSeWTDq+ql8MogIJlQNgIi3kcvbxJChaE1/QVZcCPEzHo4qtfHzumsz1JMGf1N1YnDcso5qLNn2kCmx+MFw24uMYfjbnvMWuy/a+NWEnN1gI5wYZSAfqi1tocWYS4G7QjRlBbmRL1o0zT6l5725d9hQ1tDhsDAqkP6+aswjuU796kUVyOV78WTjPwh3d2CueKnVItoYJjqMhRRfQQGs0OtDg0Fq9TLHqsoEeMbGzNfr9dzJA6NOYQFL4rKeOid8JZpNQf5ZPPCBS1zTrsmfxClNR8e+lnlRFkwX22WjMy7mxqWda1d+/jUTDOP3ZOBewMGrw9vuKjTBGpTK4vQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vaisala.com; Received: from AS4PR06MB8447.eurprd06.prod.outlook.com (2603:10a6:20b:4e2::11) by DB9PR06MB7515.eurprd06.prod.outlook.com (2603:10a6:10:260::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.23; Fri, 20 Oct 2023 12:45:52 +0000 Received: from AS4PR06MB8447.eurprd06.prod.outlook.com ([fe80::cf3a:acd1:fc53:af3c]) by AS4PR06MB8447.eurprd06.prod.outlook.com ([fe80::cf3a:acd1:fc53:af3c%5]) with mapi id 15.20.6907.021; Fri, 20 Oct 2023 12:45:52 +0000 From: niko.mauno@vaisala.com To: openembedded-core@lists.openembedded.org CC: Niko Mauno Subject: [PATCH 4/4] package_rpm.bbclass: Support compression override Date: Fri, 20 Oct 2023 12:44:50 +0000 Message-ID: <20231020124450.9736-4-niko.mauno@vaisala.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231020124450.9736-1-niko.mauno@vaisala.com> References: <20231020124450.9736-1-niko.mauno@vaisala.com> X-ClientProxiedBy: AS4P192CA0033.EURP192.PROD.OUTLOOK.COM (2603:10a6:20b:658::27) To AS4PR06MB8447.eurprd06.prod.outlook.com (2603:10a6:20b:4e2::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS4PR06MB8447:EE_|DB9PR06MB7515:EE_ X-MS-Office365-Filtering-Correlation-Id: 779ea407-d61d-41ce-186e-08dbd16a7e73 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0SLAEA8Gnmq48H6T0Yn6ytU3asR3nFrE0tJBQFLqf81SJiSUvGtcQijHoe+HnWGNJpHRwsi69ECbC6a42lRFHe7zbqjcedKEmwkJbhCwyu/fj9u30OqDWASO7RlPu50oPj58NFE0kBayoqW+254nHYxrMomJtzH86wlypeIDgGfFpqD99G56T4Tym6Tlb88DaE5XzIMHNuW28UZ8WtfQcNBIc+lDTmAlhdFaAj1fkJq2jP1JRzIj51t1B/9oifjiEw6RkvdIiWnOocSqiVOXLcxT8EzpoXck5nH1I/ej6JaZZsCkXfdGJahWm8bdNYWv8qh2uRQOzhZZrbGg/Ubb0tPZl99O5/qxhZTxJGONNFd3Y0l+s0VcBq5z43tmgv6GJ36Av5j9rWF7/3c8F84h2znE8qQeY+frqy34DV7jT8Bz7meGZvHEpWQe9s2CFfTkgbIM4fJJ7bYTFb+cREQNlZaKa9SrKag5+UhNxxw4imya3KORbQMvQKeDTIc8ZJQ1XKIkd4LIzNdmChljCsY8nknyGmEN6MKK3XMtgnW4q/Bq2HQ5fwNhA9cnNUEGa79a3j647G6GVeiCrcXXV0ScskttP6lwD+xWwTouteQzKHSHa+PgkVdPdWJt75TwDtQm X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS4PR06MB8447.eurprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(39860400002)(376002)(396003)(346002)(136003)(366004)(230922051799003)(451199024)(1800799009)(64100799003)(186009)(41300700001)(83380400001)(38100700002)(107886003)(9686003)(6512007)(2616005)(36756003)(1076003)(2906002)(5660300002)(6916009)(66476007)(86362001)(8936002)(66946007)(8676002)(4326008)(66556008)(316002)(478600001)(52116002)(6506007)(6486002)(26005)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: MgO1ThRvEOE1jph8/YhOHPwY8PiFmyHCIdiAqkHLXYujClnP7sjNV/9+ZRR5NN9+bTwgzJP7I2m+N0C8r5jIoKo1Rv8xWScQQE+KrWNNqo4y0I++1gvP53eeeb5bIJwI/ok5piKTA7gnYwGgNqIyFjCvkyMVTwwbW5kgiBr3XPFgRAEYn/4aC6V5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tPj120VcG0eMEADVZfQjH1WlvRpuAOIDwi0tUDeJWbHjlNIFeCkaeymc+A+Ub4s7rA3G+jYhhZstRVlOJzQU355Z/e/9mPcO6UJLwvEtSoEEBWNeNrgAX2zxAevSdIViMK8L6O7chjQMVdyePdJZRoR8HvaQ6Ydz5NKj9XqGw2jPKJbUx5k8NVj5p0d3MORasbcPNvWp/8B/P9LgnLkUlfXpP7X4DWSDbYH1HWVGxOwYBlp12y1OsuZv2J/f4WnVGLMEEfrrwebpHhGlEeh96tpOAKcrSayBqCrKmyi6nC1kTtFCcMYa8QMjaRcQYEZ7CIOrd1t9ORym7FwDgxW19VPgPyUiKKx5Wg== X-OriginatorOrg: vaisala.com X-MS-Exchange-CrossTenant-Network-Message-Id: 779ea407-d61d-41ce-186e-08dbd16a7e73 X-MS-Exchange-CrossTenant-AuthSource: AS4PR06MB8447.eurprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Oct 2023 12:45:52.2611 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 6d7393e0-41f5-4c2e-9b12-4c2be5da5c57 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: h1pZDklHjDGrDB1uTbmK7LvbjULPtqyLOD1pfuVkuRC7XePNfaYhExOXgvfWFkFGEFepxZwH9M5DrMjKWLrfuQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR06MB7515 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 20 Oct 2023 12:45:58 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/189523 From: Niko Mauno Commit 4a4d5f78a6962dda5f63e9891825c80a8a87bf66 ("package_rpm: use zstd instead of xz") changed the rpm package compressor from 'xz' to 'zstd' which results in decompression failure with BusyBox-provided 'rpm2cpio' applet and 'rpm' applet when given the '-i' (Install package) option: rpm2cpio: no gzip/bzip2/xz magic In order to maintain compatibility with BusyBox introduce new variable which can be overridden like: RPM_COMPRESSION = "xz" to enable rpm decompression without including the full rpm package in the resulting root filesystem. Signed-off-by: Niko Mauno --- meta/classes-global/package_rpm.bbclass | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/meta/classes-global/package_rpm.bbclass b/meta/classes-global/package_rpm.bbclass index 246106ea4f..da25b7682c 100644 --- a/meta/classes-global/package_rpm.bbclass +++ b/meta/classes-global/package_rpm.bbclass @@ -13,6 +13,9 @@ RPMBUILD = "rpmbuild" PKGWRITEDIRRPM = "${WORKDIR}/deploy-rpms" +# Override variable to use alternative 'xz' or 'none' compression +RPM_COMPRESSION ?= "zstd" + # Maintaining the perfile dependencies has significant overhead when writing the # packages. When set, this value merges them for efficiency. MERGEPERFILEDEPS = "1" @@ -659,6 +662,7 @@ python do_package_rpm () { # Setup the rpmbuild arguments... rpmbuild = d.getVar('RPMBUILD') + rpmcomp = d.getVar('RPM_COMPRESSION') # Too many places in dnf stack assume that arch-independent packages are "noarch". # Let's not fight against this. @@ -682,8 +686,16 @@ python do_package_rpm () { cmd = cmd + " --define '_use_internal_dependency_generator 0'" cmd = cmd + " --define '_binaries_in_noarch_packages_terminate_build 0'" cmd = cmd + " --define '_build_id_links none'" - cmd = cmd + " --define '_binary_payload w19T%d.zstdio'" % int(d.getVar("ZSTD_THREADS")) - cmd = cmd + " --define '_source_payload w19T%d.zstdio'" % int(d.getVar("ZSTD_THREADS")) + if rpmcomp == "zstd": + cmd = cmd + " --define '_binary_payload w19T%d.zstdio'" % int(d.getVar("ZSTD_THREADS")) + cmd = cmd + " --define '_source_payload w19T%d.zstdio'" % int(d.getVar("ZSTD_THREADS")) + elif rpmcomp == 'xz': + cmd = cmd + " --define '_binary_payload w6T%d.xzdio'" % int(d.getVar("XZ_THREADS")) + cmd = cmd + " --define '_source_payload w6T%d.xzdio'" % int(d.getVar("XZ_THREADS")) + elif rpmcomp == 'none': + pass + else: + bb.fatal('unsupported rpm compression method: "%s"' % rpmcomp) cmd = cmd + " --define 'clamp_mtime_to_source_date_epoch 1'" cmd = cmd + " --define 'use_source_date_epoch_as_buildtime 1'" cmd = cmd + " --define '_buildhost reproducible'"