From patchwork Fri May 17 11:44:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Mikanovich X-Patchwork-Id: 3566 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Fri, 17 May 2024 13:44:58 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-wm1-f56.google.com (mail-wm1-f56.google.com [209.85.128.56]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 44HBiuQx015255 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 17 May 2024 13:44:56 +0200 Received: by mail-wm1-f56.google.com with SMTP id 5b1f17b1804b1-41feab38d16sf33796945e9.3 for ; Fri, 17 May 2024 04:44:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715946291; cv=pass; d=google.com; s=arc-20160816; b=u0uETI+SHtpRSTJXM2q4PxdudvKyEXtn53KjgvNG3BhBR4bBJCLFmWaC00UREgwmq9 f0rV1s1lfOoNPI/qKW18Ord7rRHGD+PCRGfgtzGbZPvhnYIeNkLSADGnd78FZsbzhOhC kr8nfOHwUUJddLPiGzlgOh/ZaYQcRA1dSi1MfZGtl01uZB/G60vACZONvkkuQaBlw8N3 ns1SYhwBIhdMnXnA02oFOZo0IirYFYCI3mi0n4CF0uDY0kUyHEYywWSz5tV402u1rZsR GXOEjOmfmowzDM/wIXhaqldcne7w7cbOyHoX6+12tLFlLH1Qo1MdDDoJ43PBom7GA3+N XkvA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=YdaACNaYezmw/97MTOg6nuN9ZMW5DiJhjqpvPBhz/wo=; fh=O5cUxNuCKnZt8FZ3J3WAb6sqUupnKoaagn4jU7mVH0k=; b=cQJABd+ExoDd4oOk8wzQTmv/mml3mkQ4CJwqKu4C3jWz4ABMUxcAUr4lBLS8OQ8yl7 +yZqdaZuLK0T0/osYn2cdrmur6GTAf6H9lOWOHTK6bGjZUGcJ/HrpxftTu8VObqUxMJF fn35zN/1Pxyo1fbpDtlPrkMwjzZYEeqMsAj4PcvXGTWWT575Qts7FzuqD1wkRDF8LMex fCoWdeszq5RnMRFaoGr+2WWZXupZajVwk6r4DwjIEJJOZMMRy09ZPFrNslm/QSsvX1Y0 6amFYcpSSemw7Esxo5qq8x7AAe0AzfGe914P314U282GhYnUswhBCixE73X0XyxaiORO h9Hg==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=amikan@ilbers.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1715946291; x=1716551091; darn=isar-build.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:sender:from:to:cc:subject:date:message-id :reply-to; bh=YdaACNaYezmw/97MTOg6nuN9ZMW5DiJhjqpvPBhz/wo=; b=ligNVFZBy+FRsUpT6nP0agUas5Adu+7Knm+D3BoiaCwXBv1m8HffzUzZvEqLhKJlzA ozb+lrWNwm3To3mOJ99yjPoF0VpImjyFsDcq/RxnlxJe3LClVA84EHpkB1pWmsr26Uvb AhMt4LRmxtCN2nlg7qFqHJBCvdfGLdZdS4uquaWeH7CfBv5aoQASWVkcwLkphZnEjeBm AsmS8CIxv9z2iG771TtvcRMEYhINksjwXAegXWMAE04MOINTDrBGS30FFlQWUuJKZ/Hv hE8wglHwJNm1IkMA+Qx5QSB1+jkNOuilDdNjD9j1p/mecZAHMZ7HZB1FFBkZn9yg6OvA fstA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715946291; x=1716551091; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-beenthere:x-gm-message-state:sender:from:to:cc:subject:date :message-id:reply-to; bh=YdaACNaYezmw/97MTOg6nuN9ZMW5DiJhjqpvPBhz/wo=; b=RDatIxcvQLNZWxXCUy7UJQCUPQ8GoKDhenY4dVqvIDbSpVfA7VPojOw3Q17kAxUvci Dh3fBYun6P1Z3mVGtwunU0FjlRdoyCqryHOktBmqHCqxjgxrDmM3tiQ7DceJ4ecH0bpu YwKRzTGt0SARFAA6j3Jxg/C3aWJMNluMQc27kZubdp74DqpMznDdaZ15vVq4aAnhsztv lIQ0pL3kLsUBLiD539AuBfSy21EDbTbM5+KaMUjK+xAITzYVwozeKHdnm9HOgxG7qSTQ AaqTexF3b3fxVPoVfjdjkLNjhlOvT3XDH1fUcFrmWGnOFUz9vjZAVlsOQCKafmDNTlcb voQw== Sender: isar-users@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCXKl0hsN9yMTH8MhftzHtTJuzpEdY/zfzcpZUxMRvMhbvRue2Pd/QvaNAyu+OXxQU3eFSLFZD4X6CLli6LKfjv8Xssm9u4= X-Gm-Message-State: AOJu0YzyKJiIj5497Msk3TqLGNwCEgYu3LxxLGcIh6yUmmXnXCRbEMKY 5n9IXjOGl4o4f02dIRZji74z22a3SV7yYHcJl41So6P7/6gSrFSG X-Google-Smtp-Source: AGHT+IGwK5QOs7Qz6IlszseQTLHrAtl/7WEIb4QSfp77JwdKKH4+e2w/Lr85z8Qiuk2vCFiHfBleIQ== X-Received: by 2002:a05:600c:3582:b0:418:29d4:1964 with SMTP id 5b1f17b1804b1-41fea539b5amr164033525e9.0.1715946290977; Fri, 17 May 2024 04:44:50 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:600c:1c19:b0:416:664d:e4c6 with SMTP id 5b1f17b1804b1-41fc20e7e6dls37526325e9.1.-pod-prod-06-eu; Fri, 17 May 2024 04:44:49 -0700 (PDT) X-Received: by 2002:adf:e58d:0:b0:351:da14:9368 with SMTP id ffacd0b85a97d-351da1494demr2795667f8f.40.1715946289017; Fri, 17 May 2024 04:44:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1715946289; cv=none; d=google.com; s=arc-20160816; b=XwG7R9huZbxXHgRS/qnBuMa4OssnmgKcf0kqt93gOPOdJ+nwARCQXgOAgOJ12aVJWt XoCibZyJh/E9eLqf705BPdSJn8oHcgZdrs6yE9iMMIiQXgCOVj5ZuKmyIPmCXr/YJgGF M1pJ+AEITwqrpRjcFrpYsuh4qOS8lG1vOvJcyY1Q4Q6U3N2z0n+42WnJClOKGxHZdIpk iReu0W4qd9VmMtKKZhKQIDcv9n5tt1ant9NeBSNzt9LQeQ42TCMsIzySRzOGBEyuVkPK 7eal85dawm+waQRA8XEvNVQIDvzRkHp7Q0tQS1l34LeaLdwxC/2PDF5wimICXNkii8eT a+dQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=EWhABrc1pmo7/iAWDosg2wG5qUslz0NgDbCOfZlH3Gs=; fh=/h9QQkzJ8EboVkWg45aWwpaUro6WMavIVd2OhN45RtE=; b=p/d7WYSuYLKbRFgw+K4twRcRkfj5f7rMVMKKksEwk3iChyR1R/z4rB3/ZKfTn2guwW njblD3E0qCvqDvom4pTV8OUGzQdU+ssX1/G9LtLdtGy/Gz95YVv7VPm1PRqbGp95jC+b rhavT1A7zAgEZJKUVilbGWdcdFwdlA7QO1PLYTNo4auT28eghTFyg5dgQyRI/fPqcPJ+ ZdLeGQPFqDjM2Lpj6Vu6xKELcF/0h/rxIdyw+RS5LBrqWCcpGUzmCpOTtImwP8bI+YQb Bg1hnKik/qfkniY+N77Hgl1EkHacId+mW1N6G/40/mMe8QW+mEJ3I0fq4dchoQE9LbN0 clyA==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=amikan@ilbers.de Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id ffacd0b85a97d-3502b8a393csi542811f8f.2.2024.05.17.04.44.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 May 2024 04:44:48 -0700 (PDT) Received-SPF: pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Received: from user-B660.promwad.corp ([159.148.83.123]) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPSA id 44HBigmf015192 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 May 2024 13:44:48 +0200 From: Anton Mikanovich To: isar-users@googlegroups.com Cc: Anton Mikanovich Subject: [PATCH v2 4/4] wic: Restore compatibility with old distros Date: Fri, 17 May 2024 14:44:34 +0300 Message-Id: <20240517114434.778656-5-amikan@ilbers.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240517114434.778656-1-amikan@ilbers.de> References: <20240517114434.778656-1-amikan@ilbers.de> MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-Original-Sender: amikan@ilbers.de X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=amikan@ilbers.de Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= After update of WIC it requires sfdisk to support --disk-id command, which is false for Debian Buster and Ubuntu Focal. Do not try to set disk identifier for those distro versions to keep them buildable but with lack of reproducibility. This hack should be removed after deprecation of Buster and Focal. Signed-off-by: Anton Mikanovich --- scripts/lib/wic/plugins/imager/direct.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/lib/wic/plugins/imager/direct.py b/scripts/lib/wic/plugins/imager/direct.py index 33a869ec..a65ae36a 100644 --- a/scripts/lib/wic/plugins/imager/direct.py +++ b/scripts/lib/wic/plugins/imager/direct.py @@ -530,6 +530,13 @@ class PartitionedImage(): exec_native_cmd("parted -s %s mklabel %s" % (device, ptable_format), self.native_sysroot) + def _sfdisk_supports_disk_id(self): + ret, help_out = exec_native_cmd("sfdisk --help", self.native_sysroot) + if 'disk-id' not in help_out: + logger.warn("Current sfdisk version DOES NOT support changing disk ID") + return False + return True + def _write_disk_guid(self): if self.ptable_format in ('gpt', 'gpt-hybrid'): if os.getenv('SOURCE_DATE_EPOCH'): @@ -537,6 +544,11 @@ class PartitionedImage(): else: self.disk_guid = uuid.uuid4() + # Backport compatibility for Debian Buster and Ubuntu Focal + if not self._sfdisk_supports_disk_id(): + logger.warn("Disk identifier can't be set, reproducibility is broken!") + return + logger.debug("Set disk guid %s", self.disk_guid) sfdisk_cmd = "sfdisk --disk-id %s %s" % (self.path, self.disk_guid) exec_native_cmd(sfdisk_cmd, self.native_sysroot)