From patchwork Fri May 17 11:44:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Mikanovich X-Patchwork-Id: 3563 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:53 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-lj1-f186.google.com (mail-lj1-f186.google.com [209.85.208.186]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 44HBirIg015228 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 17 May 2024 13:44:53 +0200 Received: by mail-lj1-f186.google.com with SMTP id 38308e7fff4ca-2e41bd70238sf84748411fa.1 for ; Fri, 17 May 2024 04:44:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715946288; cv=pass; d=google.com; s=arc-20160816; b=aqftKXQtc1PhkAMl+wTL2/1kvqAT4/H9RSTg/7BT7PmL7mpLZDn+2CJJxp/8/LViN2 62/g7PNXDRVavKa6B5ZhMbo7yPLrVRyPu7t9d1rEE9idDU92K5wP+zcbkPYopaL+Qu/r sr2RL6SA3mqh6oBVn+1FjF/UmW50qhOD9jXu0uXczgGiwIb+1Ksn5p66xoGd1zrHCATk Pxi8AKKgJfPqnGtTOgShEwPGgjjviUYtLq8lO0blrKwEkQ5tdQXzrWjHtfV+0oKmF/XL Y1vGPaTs5UpALekYyhZPYBXDGhMhRtklEvZ0FDsds2bnWvskv03KrtK5rE5ZL2oissu8 UDWw== 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=df1gxKsb7CDAOvFOv0FAlheQfTP9eFJzL8UnmlaIgfI=; fh=6Ad4DMl3E8VdRsT1Ae5VndBP+sLHeUqtOwfAN0uQzSw=; b=NumER/B7uHdA2FCh7h1n8Oo7MR88+9cYskpKFQDhBwKANUVSsamrswK8eCAlnYpwkQ 8oq7gO5j4bjJQhY5OjPsJJonjWt17wvMZVPDOAqxAQXnROztpSlPHkX2FLAUO8La114e qIvGeCRadR3P1zayoNfNO3dQ04+hiFlk66jZT2SrpyKBxgmAYswgodjewv+eGTniTJ6/ p5VDuRu4mmQIRAqJxt2W/jRbdfliJVWCnCbpZhw40BeMEt/tXajMhnhJTuwyvBRvAN1U ML3zLtPJC1SHWO4kjWRKWNlkc029aL7oY4N+1BvcXJQhh2DB85EBnJniHGhnsK5jvwkh +WCg==; 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=1715946288; x=1716551088; 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=df1gxKsb7CDAOvFOv0FAlheQfTP9eFJzL8UnmlaIgfI=; b=vfplzQjO5Gg4LOsnjmjrNI6QZerKbZuU2EfnXcheamMFOJokAJQsNBhiGWze+EojgK SyEdrcXb8Tw+odNZqrEK/36JVnoAnv7qO3WF8wt6WlTPw99jOXn+N4Xx4V1fAhQ3/PSB lyC/14Cvam+79lTgo72QmT6LKJZb/fC63rV8oBDA3XyHtVTpudp8wFVpTia0jzks8xh5 VQScOT7fBzs3hHH6v/j7BRFHYi+H3s98390+qpZ+PJpz2mQLnWos9AkCfDMIXL53MDAY o9JD95hP2a+Dna55F4NX/9XmkOWXzzFCXMPfE1AbuDBcPNoaUSNY0Rai2IfRUO1DeF7O Tv+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715946288; x=1716551088; 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=df1gxKsb7CDAOvFOv0FAlheQfTP9eFJzL8UnmlaIgfI=; b=pdq6Aka9ETk1jYtXGTtlxQ31SELPvD5/JyJP1paldzUyqq7QWhf5Sz2LhhPmetb9qs fIDk7MBidGvLqYLfTLEdNE+CgkHjr9pESZ5nlGN+/lRDp82rZfsxVCQV9Q1iN2rqDX3g 3Ml10lmvDw82uqE4xWlAbStUOZH7Yhsl13B5nqmtPU1AfeYg/rwr7/kwj70IAxvMVlg0 45S/2UOFKOInyNJPS5Q9J/sU5vWQNdzrCYqYGsRHFNhoifU/bKYzITTWUfBjOGce02Ub 8c/DC3nUWA+TeZ7Yn4lpQQ0S9fkWtuZ+Erb5tWLhwJ7s+kaxaBrN5UcQkdsh5rtkCNdE 2mpg== Sender: isar-users@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCXK6L87SUj84YJAAp7cD/kYt8JiLH6Ltz3U2a/+77ZK3j9/g+SZAZEUGvDNPX1S2L4gLbi+i5KzkLYIh3znmcRnLsuXaaA= X-Gm-Message-State: AOJu0YxEFBPfSlhisY4VZno1MHouzOMT6/wEJ3fjcvEVUSFm/W7VjcI9 iKRWQmKM/H1grdH5lzq9mULM6IqcAiErv4KdvPYn4+uWJ7bFj014 X-Google-Smtp-Source: AGHT+IGZhcEIBneYGAq5NNEE1jTaU8uoBOoRGHvq4OdmSeOx+MT1HPqOoQF3/Yy4jMrScztENmk6ZQ== X-Received: by 2002:a2e:2c13:0:b0:2e1:e8fa:4f56 with SMTP id 38308e7fff4ca-2e52028e665mr128138541fa.42.1715946287592; Fri, 17 May 2024 04:44:47 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a2e:3516:0:b0:2e2:872:6886 with SMTP id 38308e7fff4ca-2e4b572170cls4406211fa.0.-pod-prod-03-eu; Fri, 17 May 2024 04:44:45 -0700 (PDT) X-Received: by 2002:a2e:860e:0:b0:2de:8685:d07b with SMTP id 38308e7fff4ca-2e5203a4659mr135834591fa.46.1715946285545; Fri, 17 May 2024 04:44:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1715946285; cv=none; d=google.com; s=arc-20160816; b=qq1zy1qWmpGaN2O4rp4stoJkljO6pdwC6NDDni0jyxqfe3oBb9WjDStjBlU5ZwUJ9D kLF2c9w8k8JTxLr7HqQZlnmezPDB/Mxfl6CDsfzIhnu6yNJ9neAwuw9zF30xSJJn83co rHPvt4StN5eUWrX2t7ZJnZO+pTBv5Q9vAiCLAyu7ZFTbdvt5cBjKqfUhM2TP3tgIbZM+ btHV8V34TnnBCp2T57mFfrV9tGME8Gi9tZ2tjN54xzk6RXbCtHJjAawh73Ai3rmNLlvb dYZTwqcyqSMMCVY5xkTcYVVmztv44zjUDtRTkka9g17xdrWC6pRHPDuYjj7DhwK5+4Ud zmyg== 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=QoKdWOLrUgrdXlIIt53DfqDEj09TTNNqvtno49+zFtg=; fh=/h9QQkzJ8EboVkWg45aWwpaUro6WMavIVd2OhN45RtE=; b=s3zh1KtkRDLNBcI5+QCqZbRCbmjD/UEKdmzGk7YN2R65le/+A+5hFJltYxQnzuwp7a aVAj3a6kiBF1rgFEAS2NM1nXw/aRndT2aF/nyNTnMQaF2MxQhpo+VjvtZ0GEk6d7nwFP e8zAimToUMHJcWylJmn/MQ2uM5iH3fZf1H/yChbDFaFYPaTUu05L6cIcgkdaS99D6Tax IygoHlOMN7JtHg2tzphBlWSpULkez+C19wazpTY1EM4z1gFkGmo8vZZCY/r1PkKJRwR8 sVBVwivBY1l/a4BnjqCEWVLxK1pleXk5hyP7qqhbnLkz4LL6oGeXt3JMYjgV6hrA8Clo ObSg==; 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 38308e7fff4ca-2e4d18385dbsi4999711fa.8.2024.05.17.04.44.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 May 2024 04:44:45 -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 44HBigmc015192 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 May 2024 13:44:44 +0200 From: Anton Mikanovich To: isar-users@googlegroups.com Cc: Anton Mikanovich Subject: [PATCH v2 1/4] Revert "wic/plugins/images/direct: Allow changes in fstab on rootfs" Date: Fri, 17 May 2024 14:44:31 +0300 Message-Id: <20240517114434.778656-2-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?= This change was reverted in oe-core. This reverts commit a4237f08e67ad677e26d47a64d68e32417545a14. Signed-off-by: Anton Mikanovich --- scripts/lib/wic/plugins/imager/direct.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/lib/wic/plugins/imager/direct.py b/scripts/lib/wic/plugins/imager/direct.py index c44159b2..da483dae 100644 --- a/scripts/lib/wic/plugins/imager/direct.py +++ b/scripts/lib/wic/plugins/imager/direct.py @@ -117,7 +117,7 @@ class DirectPlugin(ImagerPlugin): updated = False for part in self.parts: if not part.realnum or not part.mountpoint \ - or not part.mountpoint.startswith('/'): + or part.mountpoint == "/" or not part.mountpoint.startswith('/'): continue if part.use_uuid: From patchwork Fri May 17 11:44:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Mikanovich X-Patchwork-Id: 3565 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:56 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-lj1-f186.google.com (mail-lj1-f186.google.com [209.85.208.186]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 44HBis6B015237 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 17 May 2024 13:44:54 +0200 Received: by mail-lj1-f186.google.com with SMTP id 38308e7fff4ca-2e233a3d4b0sf94418281fa.3 for ; Fri, 17 May 2024 04:44:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715946289; cv=pass; d=google.com; s=arc-20160816; b=khwnLR3iwYTRNaw014XoFlfO7uAKP8BQS404RGqR08HORw5Y/8PY07CSAwZKW9R5bK Z4Jr+S6wHecZqXX4uMCc1HJXLDnp7QE6z62V7JFPPYdzN7Ds9LaHIU3bhV8eHk55jr0C E4M8ZUaBUEIAuJcm/TJG8tGtORRATtYuiQfB9YLutcGxYyYtAs37Akc2s1H6dDnSYqrF MjZZsAU8tgtD2bs8uCkNohbMrXYfRsajfqArUS3hgJqT9bxO6/Gop12v1DLDPNt8ZRgq 0w+YrmthdcSC6Aliq2zVkT/DIiRrq6u/vPbGBgX9ydezuD6xJD4OSjdO+D66CHgracq8 ZkhQ== 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=7HNjIfaU7pj4zkA7HhG18V5q/enO4Y16iBRUkmzIWEU=; fh=97hD/59fY12+ekTyOLiaaHSSC0nxeEyZrPbo+mf3GqM=; b=kyxvckw9Zys3Yzrj6OXDx1tLGiwTJRUaSdA+oPoSlLuuQxKTFCZvGynaRNTAyEndtk hEgsW7waPJeZXSqyE56EMDIdRSS1muhlLexw22mwCquqDMhjVztxRmKrhLePoJiQShEF wMRqOC3h/lD+MUHlEzPolE3vjZrZQDniTxr6dSgdCa8LkxhKGPdZ0XwGGAqVx4a0+kz3 U7/PUFB+mWxI6RrcCsnUI7pjh2E1zm6S+kTrKSnNSdrJT7HoMXvvG4mtITe2/8dusD7i vt8hJGsZUbg4aq/Gasj2m7o5PkFUqa34YJmuJ1oTIoAA7TMpmetZDrM0In+ueksNaNmr tldg==; 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=1715946289; x=1716551089; 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=7HNjIfaU7pj4zkA7HhG18V5q/enO4Y16iBRUkmzIWEU=; b=EWvVZnc6jKJNIl4VbPOiI+ay/deFWkZXpFbzbis6XcQx4XHpGJ7fg4kmw0Yiul/NAR PXQymdFN1tHFvthkX0Ijo9HlwIjl7ZfrfzUJ+iA/Nh4ZN3yasa5Z1tumGNGzVt64Wibk xgJCnOh5BYd+g0q7RuMWHnXJenfTJ0lgWvxh5yY/d+MhKtzGt9twbq7cdbNYl6WiEf1t aep6/INJPq6VVtobRW7cMyZEQmaF5tjlwmStcDv3KtEcEMv2MrZmdBnYMBbrhOv+73Om R31k2Ro3L52Duc1CvtFmQWxZQP7OsvIbGime5r8ary/2YYfQxkE8P7+cM2Q4G6daYXbr pTjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715946289; x=1716551089; 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=7HNjIfaU7pj4zkA7HhG18V5q/enO4Y16iBRUkmzIWEU=; b=CRK/Oyh01tG+QJ6ZTAGH2UTvzipwNekSOCM8qSP16rQB5j7orwvG/NcWi1qMd9KH/S qGtiM9MCelVVv+iEN3R0wLSBYsuYkIC1iRvzoa8BfcD8rRxfTFNR/+dpmtWjeteMGA2p tlIrQDiNJSEKxt8a8Cm1cYm7Y/CguAd9kO6iPIzsk01Cx6WyaPxpdoybOJUyNDrBNr8n /CDlY6M4Y2mMyUkdWcOh6hgqkhlHzq9AeXQ9eBjsJv3+8+aDq6yM37YBKDdLWW2VOSCO t6jxEuWeGQQkZxBmA7kqN3vYqFlWUnYIP8FmZkAwXv9yj71Gv2YImN5U8tkbleEsufuC 57bA== Sender: isar-users@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCWxhxQ6gi1vibA/IaaFkUSvdzy/bMyf2IXFbb1LRjbrJodDs2y3dcH99q/5cRAD8RR4mnHp9L2BwUvQNJBGsAQhICRfFLg= X-Gm-Message-State: AOJu0YxVxWjyVK+9m8ZWxxX+OkFNVhg+qI3gyCqKXQVLUA+l+eWuEFZi SIC7rZmpErbLglcyH3IEjj/vsJjA7wlsrJr6g28tIuPxm4sBtKNt X-Google-Smtp-Source: AGHT+IHSsoOPDPSCbxutxU8ku8MSTlVDVWXpTuogv4Lf9S4YP0Tg3wvAoxvHfGhWWqo2nfsNhILA0w== X-Received: by 2002:a2e:b0d9:0:b0:2d6:c43e:f0b3 with SMTP id 38308e7fff4ca-2e5203a50a2mr142620511fa.50.1715946289224; Fri, 17 May 2024 04:44:49 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a2e:9ac3:0:b0:2db:b3e0:6b80 with SMTP id 38308e7fff4ca-2e4b6e6832bls4414551fa.2.-pod-prod-03-eu; Fri, 17 May 2024 04:44:47 -0700 (PDT) X-Received: by 2002:a05:6512:1305:b0:51f:452f:927b with SMTP id 2adb3069b0e04-52210070208mr16964311e87.45.1715946287045; Fri, 17 May 2024 04:44:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1715946287; cv=none; d=google.com; s=arc-20160816; b=lqB1EPQnmXfgM5pG+Fwgs3fz5YYBrcHXbB3VCwDutsGxsjUEhXHff01kA4lS0pVJDe mvfQpsTwqb0EW612Zq9j7cnB91Fp4lE1499ppcpXUJA+E6bL1aoHn0kRamCfjIiQh6Hb OMulNkNlnssmRNKTWZAOnUpWCOcpuRv+W/VORV9T0tL+Zo9fdodMAliCea8FHSFHgmRl W1eeE7YA6oIoEAaKeiWdJmvKiV6FEavH9iKhlIfz580sNTOJBR9xP7E5OIDKlT4zfl/c 9tlb4xi1ZvOXsfq8ivADH5U5EdnKpzOfCRMV1tJJ0ocd1BGUUn74sOo3WMoIBUdh4y/k UYiw== 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=wBWaNjogBXatQ6VXojTAHTnCTFsh45cCv54UfQByEsg=; fh=/h9QQkzJ8EboVkWg45aWwpaUro6WMavIVd2OhN45RtE=; b=Pd07CXv6n2VxKm07MDSFApm06+I+dAcOemMjQ+V4eHXxbUZ/lM7eXjEROiZXIYqP1j oIfoHrnQ/VVe0B/Ilc07aLSZ/PXcKYtkruMMg6x+9FU7SnNJMghJQquA5jY+reIPRSf4 nf5sxjiEgs7nevXdq0ER0IihSsaAv8g7o7THT+de67ff2zD/B+a1+XGmHbmbGMXgRf9k trKONNafp5WilefysPzqJ8npwje1SuEyPwLP0XTyNbpOIvdzVih98+IP0uBcs3fyMiBd 08jIKQ23z4qq/KtE45cqrx6GK18ciYxh21ZVPlW/jvlyWExbTT3vnIe6rfIYps4Q/Hcn RLVA==; 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 2adb3069b0e04-521f35ae09dsi543572e87.1.2024.05.17.04.44.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 May 2024 04:44:47 -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 44HBigmd015192 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 May 2024 13:44:45 +0200 From: Anton Mikanovich To: isar-users@googlegroups.com Cc: Anton Mikanovich Subject: [PATCH v2 2/4] wic: Update to the latest revision Date: Fri, 17 May 2024 14:44:32 +0300 Message-Id: <20240517114434.778656-3-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?= OE-core Revision: 7ef767d84d56b25498e45db83bb8f9d9caebeaf9. Signed-off-by: Anton Mikanovich --- .../lib/wic/canned-wks/efi-bootdisk.wks.in | 2 +- .../lib/wic/canned-wks/qemux86-directdisk.wks | 2 +- scripts/lib/wic/filemap.py | 7 + scripts/lib/wic/help.py | 2 +- scripts/lib/wic/ksparser.py | 6 +- scripts/lib/wic/misc.py | 2 +- scripts/lib/wic/partition.py | 47 ++++++- scripts/lib/wic/plugins/imager/direct.py | 122 ++++++++++++++---- scripts/lib/wic/plugins/source/bootimg-efi.py | 108 +++++++++++++--- .../wic/plugins/source/bootimg-partition.py | 9 +- .../lib/wic/plugins/source/bootimg-pcbios.py | 6 +- scripts/lib/wic/plugins/source/empty.py | 59 ++++++++- scripts/lib/wic/plugins/source/rawcopy.py | 9 +- scripts/lib/wic/plugins/source/rootfs.py | 4 +- 14 files changed, 324 insertions(+), 61 deletions(-) diff --git a/scripts/lib/wic/canned-wks/efi-bootdisk.wks.in b/scripts/lib/wic/canned-wks/efi-bootdisk.wks.in index 7300e65e..2fd286ff 100644 --- a/scripts/lib/wic/canned-wks/efi-bootdisk.wks.in +++ b/scripts/lib/wic/canned-wks/efi-bootdisk.wks.in @@ -1,3 +1,3 @@ bootloader --ptable gpt -part /boot --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/boot --fstype=vfat --label boot --active --align 1024 --use-uuid --overhead-factor 1.0 +part /boot --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/boot --fstype=vfat --label boot --active --align 1024 --use-uuid --overhead-factor 1.1 part / --source rootfs --fstype=ext4 --label root --align 1024 --exclude-path boot/ diff --git a/scripts/lib/wic/canned-wks/qemux86-directdisk.wks b/scripts/lib/wic/canned-wks/qemux86-directdisk.wks index 22b45217..80899761 100644 --- a/scripts/lib/wic/canned-wks/qemux86-directdisk.wks +++ b/scripts/lib/wic/canned-wks/qemux86-directdisk.wks @@ -4,5 +4,5 @@ include common.wks.inc -bootloader --timeout=0 --append="rw oprofile.timer=1 rootfstype=ext4 " +bootloader --timeout=0 --append="rw oprofile.timer=1 rootfstype=ext4 console=tty console=ttyS0 " diff --git a/scripts/lib/wic/filemap.py b/scripts/lib/wic/filemap.py index 4d9da281..85b39d5d 100644 --- a/scripts/lib/wic/filemap.py +++ b/scripts/lib/wic/filemap.py @@ -46,6 +46,13 @@ def get_block_size(file_obj): bsize = stat.st_blksize else: raise IOError("Unable to determine block size") + + # The logic in this script only supports a maximum of a 4KB + # block size + max_block_size = 4 * 1024 + if bsize > max_block_size: + bsize = max_block_size + return bsize class ErrorNotSupp(Exception): diff --git a/scripts/lib/wic/help.py b/scripts/lib/wic/help.py index 73e3380c..163535e4 100644 --- a/scripts/lib/wic/help.py +++ b/scripts/lib/wic/help.py @@ -1118,7 +1118,7 @@ COMMAND: TOPIC: overview - Presents an overall overview of Wic plugins - Presents an overview and API for Wic plugins - kickstart - Presents a Wic kicstart file reference + kickstart - Presents a Wic kickstart file reference Examples: diff --git a/scripts/lib/wic/ksparser.py b/scripts/lib/wic/ksparser.py index a49b7b97..7ef3dc83 100644 --- a/scripts/lib/wic/ksparser.py +++ b/scripts/lib/wic/ksparser.py @@ -159,7 +159,7 @@ class KickStart(): part.add_argument('--fstype', default='vfat', choices=('ext2', 'ext3', 'ext4', 'btrfs', 'squashfs', 'vfat', 'msdos', 'erofs', - 'swap')) + 'swap', 'none')) part.add_argument('--mkfs-extraopts', default='') part.add_argument('--label') part.add_argument('--use-label', action='store_true') @@ -171,6 +171,7 @@ class KickStart(): part.add_argument('--rootfs-dir') part.add_argument('--type', default='primary', choices = ('primary', 'logical')) + part.add_argument('--hidden', action='store_true') # --size and --fixed-size cannot be specified together; options # ----extra-space and --overhead-factor should also raise a parser @@ -187,11 +188,12 @@ class KickStart(): part.add_argument('--uuid') part.add_argument('--fsuuid') part.add_argument('--no-fstab-update', action='store_true') + part.add_argument('--mbr', action='store_true') bootloader = subparsers.add_parser('bootloader') bootloader.add_argument('--append') bootloader.add_argument('--configfile') - bootloader.add_argument('--ptable', choices=('msdos', 'gpt'), + bootloader.add_argument('--ptable', choices=('msdos', 'gpt', 'gpt-hybrid'), default='msdos') bootloader.add_argument('--timeout', type=int) bootloader.add_argument('--source') diff --git a/scripts/lib/wic/misc.py b/scripts/lib/wic/misc.py index 2b90821b..1a7c140f 100644 --- a/scripts/lib/wic/misc.py +++ b/scripts/lib/wic/misc.py @@ -25,7 +25,7 @@ from wic import WicError logger = logging.getLogger('wic') # executable -> recipe pairs for exec_native_cmd -NATIVE_RECIPES = {"bmaptool": "bmap-tools", +NATIVE_RECIPES = {"bmaptool": "bmaptool", "dumpe2fs": "e2fsprogs", "grub-mkimage": "grub-efi", "isohybrid": "syslinux", diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py index e50871b8..795707ec 100644 --- a/scripts/lib/wic/partition.py +++ b/scripts/lib/wic/partition.py @@ -59,6 +59,8 @@ class Partition(): self.updated_fstab_path = None self.has_fstab = False self.update_fstab_in_rootfs = False + self.hidden = args.hidden + self.mbr = args.mbr self.lineno = lineno self.source_file = "" @@ -133,6 +135,8 @@ class Partition(): self.update_fstab_in_rootfs = True if not self.source: + if self.fstype == "none" or self.no_table: + return if not self.size and not self.fixed_size: raise WicError("The %s partition has a size of zero. Please " "specify a non-zero --size/--fixed-size for that " @@ -280,6 +284,20 @@ class Partition(): extraopts = self.mkfs_extraopts or "-F -i 8192" + if os.getenv('SOURCE_DATE_EPOCH'): + sde_time = int(os.getenv('SOURCE_DATE_EPOCH')) + if pseudo: + pseudo = "export E2FSPROGS_FAKE_TIME=%s;%s " % (sde_time, pseudo) + else: + pseudo = "export E2FSPROGS_FAKE_TIME=%s; " % sde_time + + # Set hash_seed to generate deterministic directory indexes + namespace = uuid.UUID("e7429877-e7b3-4a68-a5c9-2f2fdf33d460") + if self.fsuuid: + namespace = uuid.UUID(self.fsuuid) + hash_seed = str(uuid.uuid5(namespace, str(sde_time))) + extraopts += " -E hash_seed=%s" % hash_seed + label_str = "" if self.label: label_str = "-L %s" % self.label @@ -300,6 +318,30 @@ class Partition(): mkfs_cmd = "fsck.%s -pvfD %s" % (self.fstype, rootfs) exec_native_cmd(mkfs_cmd, native_sysroot, pseudo=pseudo) + if os.getenv('SOURCE_DATE_EPOCH'): + sde_time = hex(int(os.getenv('SOURCE_DATE_EPOCH'))) + debugfs_script_path = os.path.join(cr_workdir, "debugfs_script") + files = [] + for root, dirs, others in os.walk(rootfs_dir): + base = root.replace(rootfs_dir, "").rstrip(os.sep) + files += [ "/" if base == "" else base ] + files += [ base + "/" + n for n in dirs + others ] + with open(debugfs_script_path, "w") as f: + f.write("set_current_time %s\n" % (sde_time)) + if self.updated_fstab_path and self.has_fstab and not self.no_fstab_update: + f.write("set_inode_field /etc/fstab mtime %s\n" % (sde_time)) + f.write("set_inode_field /etc/fstab mtime_extra 0\n") + for file in set(files): + for time in ["atime", "ctime", "crtime"]: + f.write("set_inode_field \"%s\" %s %s\n" % (file, time, sde_time)) + f.write("set_inode_field \"%s\" %s_extra 0\n" % (file, time)) + for time in ["wtime", "mkfs_time", "lastcheck"]: + f.write("set_super_value %s %s\n" % (time, sde_time)) + for time in ["mtime", "first_error_time", "last_error_time"]: + f.write("set_super_value %s 0\n" % (time)) + debugfs_cmd = "debugfs -w -f %s %s" % (debugfs_script_path, rootfs) + exec_native_cmd(debugfs_cmd, native_sysroot) + self.check_for_Y2038_problem(rootfs, native_sysroot) def prepare_rootfs_btrfs(self, rootfs, cr_workdir, oe_builddir, rootfs_dir, @@ -353,7 +395,7 @@ class Partition(): exec_native_cmd(mcopy_cmd, native_sysroot) if self.updated_fstab_path and self.has_fstab and not self.no_fstab_update: - mcopy_cmd = "mcopy -i %s %s ::/etc/fstab" % (rootfs, self.updated_fstab_path) + mcopy_cmd = "mcopy -m -i %s %s ::/etc/fstab" % (rootfs, self.updated_fstab_path) exec_native_cmd(mcopy_cmd, native_sysroot) chmod_cmd = "chmod 644 %s" % rootfs @@ -381,6 +423,9 @@ class Partition(): (extraopts, self.fsuuid, rootfs, rootfs_dir) exec_native_cmd(erofs_cmd, native_sysroot, pseudo=pseudo) + def prepare_empty_partition_none(self, rootfs, oe_builddir, native_sysroot): + pass + def prepare_empty_partition_ext(self, rootfs, oe_builddir, native_sysroot): """ diff --git a/scripts/lib/wic/plugins/imager/direct.py b/scripts/lib/wic/plugins/imager/direct.py index da483dae..a1d15265 100644 --- a/scripts/lib/wic/plugins/imager/direct.py +++ b/scripts/lib/wic/plugins/imager/direct.py @@ -117,7 +117,7 @@ class DirectPlugin(ImagerPlugin): updated = False for part in self.parts: if not part.realnum or not part.mountpoint \ - or part.mountpoint == "/" or not part.mountpoint.startswith('/'): + or part.mountpoint == "/" or not (part.mountpoint.startswith('/') or part.mountpoint == "swap"): continue if part.use_uuid: @@ -149,6 +149,9 @@ class DirectPlugin(ImagerPlugin): self.updated_fstab_path = os.path.join(self.workdir, "fstab") with open(self.updated_fstab_path, "w") as f: f.writelines(fstab_lines) + if os.getenv('SOURCE_DATE_EPOCH'): + fstab_time = int(os.getenv('SOURCE_DATE_EPOCH')) + os.utime(self.updated_fstab_path, (fstab_time, fstab_time)) def _full_path(self, path, name, extention): """ Construct full file path to a file we generate. """ @@ -310,7 +313,10 @@ class PartitionedImage(): # all partitions (in bytes) self.ptable_format = ptable_format # Partition table format # Disk system identifier - self.identifier = random.SystemRandom().randint(1, 0xffffffff) + if os.getenv('SOURCE_DATE_EPOCH'): + self.identifier = random.Random(int(os.getenv('SOURCE_DATE_EPOCH'))).randint(1, 0xffffffff) + else: + self.identifier = random.SystemRandom().randint(1, 0xffffffff) self.partitions = partitions self.partimages = [] @@ -336,7 +342,7 @@ class PartitionedImage(): # generate parition and filesystem UUIDs for part in self.partitions: if not part.uuid and part.use_uuid: - if self.ptable_format == 'gpt': + if self.ptable_format in ('gpt', 'gpt-hybrid'): part.uuid = str(uuid.uuid4()) else: # msdos partition table part.uuid = '%08x-%02d' % (self.identifier, part.realnum) @@ -392,6 +398,10 @@ class PartitionedImage(): raise WicError("setting custom partition type is not " \ "implemented for msdos partitions") + if part.mbr and self.ptable_format != 'gpt-hybrid': + raise WicError("Partition may only be included in MBR with " \ + "a gpt-hybrid partition table") + # Get the disk where the partition is located self.numpart += 1 if not part.no_table: @@ -400,7 +410,7 @@ class PartitionedImage(): if self.numpart == 1: if self.ptable_format == "msdos": overhead = MBR_OVERHEAD - elif self.ptable_format == "gpt": + elif self.ptable_format in ("gpt", "gpt-hybrid"): overhead = GPT_OVERHEAD # Skip one sector required for the partitioning scheme overhead @@ -484,7 +494,7 @@ class PartitionedImage(): # Once all the partitions have been layed out, we can calculate the # minumim disk size self.min_size = self.offset - if self.ptable_format == "gpt": + if self.ptable_format in ("gpt", "gpt-hybrid"): self.min_size += GPT_OVERHEAD self.min_size *= self.sector_size @@ -505,22 +515,49 @@ class PartitionedImage(): return exec_native_cmd(cmd, self.native_sysroot) + def _write_identifier(self, device, identifier): + logger.debug("Set disk identifier %x", identifier) + with open(device, 'r+b') as img: + img.seek(0x1B8) + img.write(identifier.to_bytes(4, 'little')) + + def _make_disk(self, device, ptable_format, min_size): + logger.debug("Creating sparse file %s", device) + with open(device, 'w') as sparse: + os.ftruncate(sparse.fileno(), min_size) + + logger.debug("Initializing partition table for %s", device) + exec_native_cmd("parted -s %s mklabel %s" % (device, ptable_format), + self.native_sysroot) + + def _write_disk_guid(self): + if self.ptable_format in ('gpt', 'gpt-hybrid'): + if os.getenv('SOURCE_DATE_EPOCH'): + self.disk_guid = uuid.UUID(int=int(os.getenv('SOURCE_DATE_EPOCH'))) + else: + self.disk_guid = uuid.uuid4() + + 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) + def create(self): - logger.debug("Creating sparse file %s", self.path) - with open(self.path, 'w') as sparse: - os.ftruncate(sparse.fileno(), self.min_size) + self._make_disk(self.path, + "gpt" if self.ptable_format == "gpt-hybrid" else self.ptable_format, + self.min_size) - logger.debug("Initializing partition table for %s", self.path) - exec_native_cmd("parted -s %s mklabel %s" % - (self.path, self.ptable_format), self.native_sysroot) + self._write_identifier(self.path, self.identifier) + self._write_disk_guid() - logger.debug("Set disk identifier %x", self.identifier) - with open(self.path, 'r+b') as img: - img.seek(0x1B8) - img.write(self.identifier.to_bytes(4, 'little')) + if self.ptable_format == "gpt-hybrid": + mbr_path = self.path + ".mbr" + self._make_disk(mbr_path, "msdos", self.min_size) + self._write_identifier(mbr_path, self.identifier) logger.debug("Creating partitions") + hybrid_mbr_part_num = 0 + for part in self.partitions: if part.num == 0: continue @@ -565,11 +602,19 @@ class PartitionedImage(): self._create_partition(self.path, part.type, parted_fs_type, part.start, part.size_sec) - if part.part_name: + if self.ptable_format == "gpt-hybrid" and part.mbr: + hybrid_mbr_part_num += 1 + if hybrid_mbr_part_num > 4: + raise WicError("Extended MBR partitions are not supported in hybrid MBR") + self._create_partition(mbr_path, "primary", + parted_fs_type, part.start, part.size_sec) + + if self.ptable_format in ("gpt", "gpt-hybrid") and (part.part_name or part.label): + partition_label = part.part_name if part.part_name else part.label logger.debug("partition %d: set name to %s", - part.num, part.part_name) + part.num, partition_label) exec_native_cmd("sgdisk --change-name=%d:%s %s" % \ - (part.num, part.part_name, + (part.num, partition_label, self.path), self.native_sysroot) if part.part_type: @@ -579,32 +624,55 @@ class PartitionedImage(): (part.num, part.part_type, self.path), self.native_sysroot) - if part.uuid and self.ptable_format == "gpt": + if part.uuid and self.ptable_format in ("gpt", "gpt-hybrid"): logger.debug("partition %d: set UUID to %s", part.num, part.uuid) exec_native_cmd("sgdisk --partition-guid=%d:%s %s" % \ (part.num, part.uuid, self.path), self.native_sysroot) - if part.label and self.ptable_format == "gpt": - logger.debug("partition %d: set name to %s", - part.num, part.label) - exec_native_cmd("parted -s %s name %d %s" % \ - (self.path, part.num, part.label), - self.native_sysroot) - if part.active: - flag_name = "legacy_boot" if self.ptable_format == 'gpt' else "boot" + flag_name = "legacy_boot" if self.ptable_format in ('gpt', 'gpt-hybrid') else "boot" logger.debug("Set '%s' flag for partition '%s' on disk '%s'", flag_name, part.num, self.path) exec_native_cmd("parted -s %s set %d %s on" % \ (self.path, part.num, flag_name), self.native_sysroot) + if self.ptable_format == 'gpt-hybrid' and part.mbr: + exec_native_cmd("parted -s %s set %d %s on" % \ + (mbr_path, hybrid_mbr_part_num, "boot"), + self.native_sysroot) if part.system_id: exec_native_cmd("sfdisk --part-type %s %s %s" % \ (self.path, part.num, part.system_id), self.native_sysroot) + if part.hidden and self.ptable_format == "gpt": + logger.debug("Set hidden attribute for partition '%s' on disk '%s'", + part.num, self.path) + exec_native_cmd("sfdisk --part-attrs %s %s RequiredPartition" % \ + (self.path, part.num), + self.native_sysroot) + + if self.ptable_format == "gpt-hybrid": + # Write a protective GPT partition + hybrid_mbr_part_num += 1 + if hybrid_mbr_part_num > 4: + raise WicError("Extended MBR partitions are not supported in hybrid MBR") + + # parted cannot directly create a protective GPT partition, so + # create with an arbitrary type, then change it to the correct type + # with sfdisk + self._create_partition(mbr_path, "primary", "fat32", 1, GPT_OVERHEAD) + exec_native_cmd("sfdisk --part-type %s %d 0xee" % (mbr_path, hybrid_mbr_part_num), + self.native_sysroot) + + # Copy hybrid MBR + with open(mbr_path, "rb") as mbr_file: + with open(self.path, "r+b") as image_file: + mbr = mbr_file.read(512) + image_file.write(mbr) + def cleanup(self): pass diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wic/plugins/source/bootimg-efi.py index 634a808d..13a9cddf 100644 --- a/scripts/lib/wic/plugins/source/bootimg-efi.py +++ b/scripts/lib/wic/plugins/source/bootimg-efi.py @@ -220,6 +220,8 @@ class BootimgEFIPlugin(SourcePlugin): cls.do_configure_grubefi(hdddir, creator, cr_workdir, source_params) elif source_params['loader'] == 'systemd-boot': cls.do_configure_systemdboot(hdddir, creator, cr_workdir, source_params) + elif source_params['loader'] == 'uefi-kernel': + pass else: raise WicError("unrecognized bootimg-efi loader: %s" % source_params['loader']) except KeyError: @@ -330,40 +332,78 @@ class BootimgEFIPlugin(SourcePlugin): shutil.copyfileobj(in_file, initrd) initrd.close() + # Searched by systemd-boot: + # https://systemd.io/BOOT_LOADER_SPECIFICATION/#type-2-efi-unified-kernel-images + install_cmd = "install -d %s/EFI/Linux" % hdddir + exec_cmd(install_cmd) + + staging_dir_host = get_bitbake_var("STAGING_DIR_HOST") + target_sys = get_bitbake_var("TARGET_SYS") + + objdump_cmd = "%s-objdump" % target_sys + objdump_cmd += " -p %s" % efi_stub + objdump_cmd += " | awk '{ if ($1 == \"SectionAlignment\"){print $2} }'" + + ret, align_str = exec_native_cmd(objdump_cmd, native_sysroot) + align = int(align_str, 16) + + objdump_cmd = "%s-objdump" % target_sys + objdump_cmd += " -h %s | tail -2" % efi_stub + ret, output = exec_native_cmd(objdump_cmd, native_sysroot) + + offset = int(output.split()[2], 16) + int(output.split()[3], 16) + + osrel_off = offset + align - offset % align + osrel_path = "%s/usr/lib/os-release" % staging_dir_host + osrel_sz = os.stat(osrel_path).st_size + + cmdline_off = osrel_off + osrel_sz + cmdline_off = cmdline_off + align - cmdline_off % align + cmdline_sz = os.stat(cmdline.name).st_size + + dtb_off = cmdline_off + cmdline_sz + dtb_off = dtb_off + align - dtb_off % align + dtb = source_params.get('dtb') if dtb: if ';' in dtb: raise WicError("Only one DTB supported, exiting") - dtb_params = '--add-section .dtb=%s/%s --change-section-vma .dtb=0x40000' % \ - (deploy_dir, dtb) + dtb_path = "%s/%s" % (deploy_dir, dtb) + dtb_params = '--add-section .dtb=%s --change-section-vma .dtb=0x%x' % \ + (dtb_path, dtb_off) + linux_off = dtb_off + os.stat(dtb_path).st_size + linux_off = linux_off + align - linux_off % align else: dtb_params = '' + linux_off = dtb_off - # Searched by systemd-boot: - # https://systemd.io/BOOT_LOADER_SPECIFICATION/#type-2-efi-unified-kernel-images - install_cmd = "install -d %s/EFI/Linux" % hdddir - exec_cmd(install_cmd) + linux_path = "%s/%s" % (staging_kernel_dir, kernel) + linux_sz = os.stat(linux_path).st_size - staging_dir_host = get_bitbake_var("STAGING_DIR_HOST") - target_sys = get_bitbake_var("TARGET_SYS") + initrd_off = linux_off + linux_sz + initrd_off = initrd_off + align - initrd_off % align # https://www.freedesktop.org/software/systemd/man/systemd-stub.html objcopy_cmd = "%s-objcopy" % target_sys - objcopy_cmd += " --add-section .osrel=%s/usr/lib/os-release" % staging_dir_host - objcopy_cmd += " --change-section-vma .osrel=0x20000" + objcopy_cmd += " --enable-deterministic-archives" + objcopy_cmd += " --preserve-dates" + objcopy_cmd += " --add-section .osrel=%s" % osrel_path + objcopy_cmd += " --change-section-vma .osrel=0x%x" % osrel_off objcopy_cmd += " --add-section .cmdline=%s" % cmdline.name - objcopy_cmd += " --change-section-vma .cmdline=0x30000" + objcopy_cmd += " --change-section-vma .cmdline=0x%x" % cmdline_off objcopy_cmd += dtb_params - objcopy_cmd += " --add-section .linux=%s/%s" % (staging_kernel_dir, kernel) - objcopy_cmd += " --change-section-vma .linux=0x2000000" + objcopy_cmd += " --add-section .linux=%s" % linux_path + objcopy_cmd += " --change-section-vma .linux=0x%x" % linux_off objcopy_cmd += " --add-section .initrd=%s" % initrd.name - objcopy_cmd += " --change-section-vma .initrd=0x3000000" + objcopy_cmd += " --change-section-vma .initrd=0x%x" % initrd_off objcopy_cmd += " %s %s/EFI/Linux/linux.efi" % (efi_stub, hdddir) + exec_native_cmd(objcopy_cmd, native_sysroot) else: - install_cmd = "install -m 0644 %s/%s %s/%s" % \ - (staging_kernel_dir, kernel, hdddir, kernel) - exec_cmd(install_cmd) + if source_params.get('install-kernel-into-boot-dir') != 'false': + install_cmd = "install -m 0644 %s/%s %s/%s" % \ + (staging_kernel_dir, kernel, hdddir, kernel) + exec_cmd(install_cmd) if get_bitbake_var("IMAGE_EFI_BOOT_FILES"): for src_path, dst_path in cls.install_task: @@ -385,6 +425,28 @@ class BootimgEFIPlugin(SourcePlugin): for mod in [x for x in os.listdir(kernel_dir) if x.startswith("systemd-")]: cp_cmd = "cp %s/%s %s/EFI/BOOT/%s" % (kernel_dir, mod, hdddir, mod[8:]) exec_cmd(cp_cmd, True) + elif source_params['loader'] == 'uefi-kernel': + kernel = get_bitbake_var("KERNEL_IMAGETYPE") + if not kernel: + raise WicError("Empty KERNEL_IMAGETYPE %s\n" % target) + target = get_bitbake_var("TARGET_SYS") + if not target: + raise WicError("Unknown arch (TARGET_SYS) %s\n" % target) + + if re.match("x86_64", target): + kernel_efi_image = "bootx64.efi" + elif re.match('i.86', target): + kernel_efi_image = "bootia32.efi" + elif re.match('aarch64', target): + kernel_efi_image = "bootaa64.efi" + elif re.match('arm', target): + kernel_efi_image = "bootarm.efi" + else: + raise WicError("UEFI stub kernel is incompatible with target %s" % target) + + for mod in [x for x in os.listdir(kernel_dir) if x.startswith(kernel)]: + cp_cmd = "cp %s/%s %s/EFI/BOOT/%s" % (kernel_dir, mod, hdddir, kernel_efi_image) + exec_cmd(cp_cmd, True) else: raise WicError("unrecognized bootimg-efi loader: %s" % source_params['loader']) @@ -396,6 +458,11 @@ class BootimgEFIPlugin(SourcePlugin): cp_cmd = "cp %s %s/" % (startup, hdddir) exec_cmd(cp_cmd, True) + for paths in part.include_path or []: + for path in paths: + cp_cmd = "cp -r %s %s/" % (path, hdddir) + exec_cmd(cp_cmd, True) + du_cmd = "du -bks %s" % hdddir out = exec_cmd(du_cmd) blocks = int(out.split()[0]) @@ -410,6 +477,13 @@ class BootimgEFIPlugin(SourcePlugin): logger.debug("Added %d extra blocks to %s to get to %d total blocks", extra_blocks, part.mountpoint, blocks) + # required for compatibility with certain devices expecting file system + # block count to be equal to partition block count + if blocks < part.fixed_size: + blocks = part.fixed_size + logger.debug("Overriding %s to %d total blocks for compatibility", + part.mountpoint, blocks) + # dosfs image, created by mkdosfs bootimg = "%s/boot.img" % cr_workdir diff --git a/scripts/lib/wic/plugins/source/bootimg-partition.py b/scripts/lib/wic/plugins/source/bootimg-partition.py index 5dbe2558..94183174 100644 --- a/scripts/lib/wic/plugins/source/bootimg-partition.py +++ b/scripts/lib/wic/plugins/source/bootimg-partition.py @@ -1,4 +1,6 @@ # +# Imported from openembedded-core +# # SPDX-License-Identifier: GPL-2.0-only # # DESCRIPTION @@ -30,6 +32,7 @@ class BootimgPartitionPlugin(SourcePlugin): """ name = 'bootimg-partition' + image_boot_files_var_name = 'IMAGE_BOOT_FILES' @classmethod def do_configure_partition(cls, part, source_params, cr, cr_workdir, @@ -54,12 +57,12 @@ class BootimgPartitionPlugin(SourcePlugin): else: var = "" - boot_files = get_bitbake_var("IMAGE_BOOT_FILES" + var) + boot_files = get_bitbake_var(cls.image_boot_files_var_name + var) if boot_files is not None: break if boot_files is None: - raise WicError('No boot files defined, IMAGE_BOOT_FILES unset for entry #%d' % part.lineno) + raise WicError('No boot files defined, %s unset for entry #%d' % (cls.image_boot_files_var_name, part.lineno)) logger.debug('Boot files: %s', boot_files) @@ -110,7 +113,7 @@ class BootimgPartitionPlugin(SourcePlugin): # Use a custom configuration for extlinux.conf extlinux_conf = custom_cfg logger.debug("Using custom configuration file " - "%s for extlinux.cfg", configfile) + "%s for extlinux.conf", configfile) else: raise WicError("configfile is specified but failed to " "get it from %s." % configfile) diff --git a/scripts/lib/wic/plugins/source/bootimg-pcbios.py b/scripts/lib/wic/plugins/source/bootimg-pcbios.py index 32e47f18..a207a835 100644 --- a/scripts/lib/wic/plugins/source/bootimg-pcbios.py +++ b/scripts/lib/wic/plugins/source/bootimg-pcbios.py @@ -122,7 +122,7 @@ class BootimgPcbiosPlugin(SourcePlugin): syslinux_conf += "DEFAULT boot\n" syslinux_conf += "LABEL boot\n" - kernel = "/vmlinuz" + kernel = "/" + get_bitbake_var("KERNEL_IMAGETYPE") syslinux_conf += "KERNEL " + kernel + "\n" syslinux_conf += "APPEND label=boot root=%s %s\n" % \ @@ -155,8 +155,8 @@ class BootimgPcbiosPlugin(SourcePlugin): kernel = "%s-%s.bin" % \ (get_bitbake_var("KERNEL_IMAGETYPE"), get_bitbake_var("INITRAMFS_LINK_NAME")) - cmds = ("install -m 0644 %s/%s %s/vmlinuz" % - (staging_kernel_dir, kernel, hdddir), + cmds = ("install -m 0644 %s/%s %s/%s" % + (staging_kernel_dir, kernel, hdddir, get_bitbake_var("KERNEL_IMAGETYPE")), "install -m 444 %s/syslinux/ldlinux.sys %s/ldlinux.sys" % (bootimg_dir, hdddir), "install -m 0644 %s/syslinux/vesamenu.c32 %s/vesamenu.c32" % diff --git a/scripts/lib/wic/plugins/source/empty.py b/scripts/lib/wic/plugins/source/empty.py index 041617d6..c1903ca5 100644 --- a/scripts/lib/wic/plugins/source/empty.py +++ b/scripts/lib/wic/plugins/source/empty.py @@ -1,4 +1,6 @@ # +# Imported from openembedded-core +# # SPDX-License-Identifier: MIT # @@ -7,9 +9,19 @@ # To use it you must pass "empty" as argument for the "--source" parameter in # the wks file. For example: # part foo --source empty --ondisk sda --size="1024" --align 1024 +# +# The plugin supports writing zeros to the start of the +# partition. This is useful to overwrite old content like +# filesystem signatures which may be re-recognized otherwise. +# This feature can be enabled with +# '--sourceparams="[fill|size=[S|s|K|k|M|G]][,][bs=[S|s|K|k|M|G]]"' +# Conflicting or missing options throw errors. import logging +import os +from wic import WicError +from wic.ksparser import sizetype from wic.pluginbase import SourcePlugin logger = logging.getLogger('wic') @@ -17,6 +29,16 @@ logger = logging.getLogger('wic') class EmptyPartitionPlugin(SourcePlugin): """ Populate unformatted empty partition. + + The following sourceparams are supported: + - fill + Fill the entire partition with zeros. Requires '--fixed-size' option + to be set. + - size=[S|s|K|k|M|G] + Set the first N bytes of the partition to zero. Default unit is 'K'. + - bs=[S|s|K|k|M|G] + Write at most N bytes at a time during source file creation. + Defaults to '1M'. Default unit is 'K'. """ name = 'empty' @@ -29,4 +51,39 @@ class EmptyPartitionPlugin(SourcePlugin): Called to do the actual content population for a partition i.e. it 'prepares' the partition to be incorporated into the image. """ - return + get_byte_count = sizetype('K', True) + size = 0 + + if 'fill' in source_params and 'size' in source_params: + raise WicError("Conflicting source parameters 'fill' and 'size' specified, exiting.") + + # Set the size of the zeros to be written to the partition + if 'fill' in source_params: + if part.fixed_size == 0: + raise WicError("Source parameter 'fill' only works with the '--fixed-size' option, exiting.") + size = get_byte_count(part.fixed_size) + elif 'size' in source_params: + size = get_byte_count(source_params['size']) + + if size == 0: + # Nothing to do, create empty partition + return + + if 'bs' in source_params: + bs = get_byte_count(source_params['bs']) + else: + bs = get_byte_count('1M') + + # Create a binary file of the requested size filled with zeros + source_file = os.path.join(cr_workdir, 'empty-plugin-zeros%s.bin' % part.lineno) + if not os.path.exists(os.path.dirname(source_file)): + os.makedirs(os.path.dirname(source_file)) + + quotient, remainder = divmod(size, bs) + with open(source_file, 'wb') as file: + for _ in range(quotient): + file.write(bytearray(bs)) + file.write(bytearray(remainder)) + + part.size = (size + 1024 - 1) // 1024 # size in KB rounded up + part.source_file = source_file diff --git a/scripts/lib/wic/plugins/source/rawcopy.py b/scripts/lib/wic/plugins/source/rawcopy.py index 7c90cd3c..73017e86 100644 --- a/scripts/lib/wic/plugins/source/rawcopy.py +++ b/scripts/lib/wic/plugins/source/rawcopy.py @@ -1,4 +1,6 @@ # +# Imported from openembedded-core +# # SPDX-License-Identifier: GPL-2.0-only # @@ -23,6 +25,10 @@ class RawCopyPlugin(SourcePlugin): @staticmethod def do_image_label(fstype, dst, label): + # don't create label when fstype is none + if fstype == 'none': + return + if fstype.startswith('ext'): cmd = 'tune2fs -L %s %s' % (label, dst) elif fstype in ('msdos', 'vfat'): @@ -52,7 +58,8 @@ class RawCopyPlugin(SourcePlugin): decompressor = { ".bz2": "bzip2", ".gz": "gzip", - ".xz": "xz" + ".xz": "xz", + ".zst": "zstd -f", }.get(extension) if not decompressor: raise WicError("Not supported compressor filename extension: %s" % extension) diff --git a/scripts/lib/wic/plugins/source/rootfs.py b/scripts/lib/wic/plugins/source/rootfs.py index fc06312e..c990143c 100644 --- a/scripts/lib/wic/plugins/source/rootfs.py +++ b/scripts/lib/wic/plugins/source/rootfs.py @@ -43,7 +43,7 @@ class RootfsPlugin(SourcePlugin): # directory, or modify a directory outside OpenEmbedded). full_path = os.path.realpath(os.path.join(rootfs_dir, path)) if not full_path.startswith(os.path.realpath(rootfs_dir)): - logger.error("%s: Must point inside the rootfs:" % (cmd, path)) + logger.error("%s: Must point inside the rootfs: %s" % (cmd, path)) sys.exit(1) return full_path @@ -224,7 +224,7 @@ class RootfsPlugin(SourcePlugin): if part.update_fstab_in_rootfs and part.has_fstab and not part.no_fstab_update: fstab_path = os.path.join(new_rootfs, "etc/fstab") # Assume that fstab should always be owned by root with fixed permissions - install_cmd = "install -m 0644 %s %s" % (part.updated_fstab_path, fstab_path) + install_cmd = "install -m 0644 -p %s %s" % (part.updated_fstab_path, fstab_path) if new_pseudo: pseudo = cls.__get_pseudo(native_sysroot, new_rootfs, new_pseudo) else: From patchwork Fri May 17 11:44:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Mikanovich X-Patchwork-Id: 3564 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:56 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-ed1-f60.google.com (mail-ed1-f60.google.com [209.85.208.60]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 44HBisHB015244 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 17 May 2024 13:44:55 +0200 Received: by mail-ed1-f60.google.com with SMTP id 4fb4d7f45d1cf-574f70ca409sf2399922a12.1 for ; Fri, 17 May 2024 04:44:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715946289; cv=pass; d=google.com; s=arc-20160816; b=zs5Ub18I1KCVv6Cnd1lpNX9qbarWKzBEA/9eYnBescHpBXEHT1j7GTEWeqP+pJN8T0 WyIN9cCtaXMJB1KjRzoZrRvLCQHKi5+t1cDw/DqThNN2LFszriDo8GdoREKhSGfoM6sY w62WP1lEDeiD/y0SFL4TtkI9BMhesNnAViFy9ezaRvreRS5Fm73TLUSFz/veFRpDhC3/ wy11+tV6xgcd/xMYOMYQHf8gf+h/Gw3mWgarTtXfdd4tI9B/lQeVSgnjcq3JdnYxw0gP 9X+Y/to9MDu+b4H3Pvhv3a1ajuwgF6dxnM7jnNw57WwK+96EBOigoai/tFYOaB5ybeVy 1gGg== 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=/O9FO7+qdHhLo5Q3roj+C3eHu1707JAMvk5mKTxPk/k=; fh=/RmOecdCL4go75i3cXI7tQtKubYoLWa7B8ROShq0C9I=; b=G9aY+lZRcONVf/xQaQ3FZoLbROce7PzW+u+92t4SLGuynRh2vzZViTxPvCpkp46fJ7 ResTCTEJKQPonrT38NqHrbDAJqgC++lW0pqRh2D5edHcjCz2jCqesFWxK1SWwhZJlJk/ tUpzThVvmbLsLnHxssckrp9rfhz9qVQtZX6PeTN0E3/gnuOLRP60yf4yZSvXC8G8yU2+ xwV4E3VSK6KjaRBq8FR6GDxcb0YGmI2FvPAjmzOiboB7rD49Ll4kXm4YRF+6CZH8PnmO ys/Hv4P1cJRhnMqNkH84yDwpLIjL+wsLFm6spyK/gfRTFJjN3W7m0buYf+UVNJaV9j6S C2xw==; 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=1715946289; x=1716551089; 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=/O9FO7+qdHhLo5Q3roj+C3eHu1707JAMvk5mKTxPk/k=; b=T+GYGyAsmTevGIWMJmFeDDAC6tMsICpE1GZ6aBFtg+/tQj6sIdvA1gLdM5q55RbTjD Os/GVohXtU8NijODYAUpDVGGaLG7V5x3dz9KzIAQAvPjgpBrN7UHSjbReEl6g1Xqt8Rg 7nFQlFvZJ1iwTlIPJJgqk+6ut1J7ND38c4AEtpKqw4u1LayzwuQoCaO7HiAEOvQEjkvs OiU7EK/4AJW707vcOfenkVB1mOGKmnlriC5GZTVPDNRIvwJkftOamV/drJzNLfcSgJWS cXeCABExI7c2wzKVL9lD6BEnW4u3tPYiN4xJJu7iyWenfSyizLuWuGGrRQ83luakApvi BcOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715946289; x=1716551089; 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=/O9FO7+qdHhLo5Q3roj+C3eHu1707JAMvk5mKTxPk/k=; b=V7PDvO+qEuMJqJL0COsTQkY3oEMKmsUAPXZKZuyn9IJcnlweQz3rhgn5+UcwRr2cRX GKgaBWedRyTyGdC5K7IuVCyrUFypCeq7G1IAmYkAy9DRf4oA0zUR/I1c9wfopxjuF20h +7aEeq3NqptTLWih9QaznZiC1Z7EyEBWw8Ve91JBt+4+5ZGORHXKAd1h62WqDs7+nGBD FZekBpIqyqz0urx/6HsZl5pEx8pQi2zVqbAPYmCn2t9AZo+9hjtaEM7kWe7GqeH6Ib4f KCaNOxLSv4zrDoTOeVe4dI9xrvtxTHGWaPO7kJb11NMdel9QhwkcPpWinU2OBublhnas dhow== Sender: isar-users@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCUmGfCH8T+kW2rg7u1GWuv/qn+/ye7DUBRYeRBEKl2eRbUsf5fUd/3+g2AkYA02VLney28yH0L8Df834hZujBKr0mCcDYY= X-Gm-Message-State: AOJu0YzNmZro2wNh4QRamiGWPkEZIl4MuFBUxmND3OrqvtnWTVYhfLmk 4g6wYmGmXmrpviXTv8wv7RM3mFNSJhBysPZ7zSm4nGYS/sp0LBQg X-Google-Smtp-Source: AGHT+IHHsdUJs4MGhb7U6HWnN9M+lfFKPnSAI5HlnHQw0xdThqiRaV9CHwkIY50n7Q7hCFeFdWpQJg== X-Received: by 2002:a50:ab02:0:b0:572:a06e:e406 with SMTP id 4fb4d7f45d1cf-5734d6f6e3cmr15231885a12.33.1715946289495; Fri, 17 May 2024 04:44:49 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6402:4018:b0:572:5cf0:969d with SMTP id 4fb4d7f45d1cf-5733331e54els810373a12.1.-pod-prod-06-eu; Fri, 17 May 2024 04:44:47 -0700 (PDT) X-Received: by 2002:a50:d69b:0:b0:572:7280:89db with SMTP id 4fb4d7f45d1cf-5734d6edcc1mr13519111a12.30.1715946287602; Fri, 17 May 2024 04:44:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1715946287; cv=none; d=google.com; s=arc-20160816; b=XQJsPRhPNoWrzJUwllhMZ+UlHV+rHEI4WmnxVKzHa0DSXmaVRjIrqvVjQvXPLWpJnT RHfvufLHBnVG2hrzEapNrSQ4vWj107qWjdV7oSrsAy1QgB/4I2yI4ij2VIHMefrTp9dZ Pmy3+EkOdLGES+eRCoVxTnDfgz4sDvxcVXfIT3z4J+5s1jNLl/YSfQn6QxcmkzKSOQM/ Vksgv0CkqaULvO+OUahx7ZNyiEHpWn3MDkmB40yfO8HS6+FScD42YLcmbfCkA1aKmoIv tXbjddz8omUbOWHXcEhLTsD71iFyUrg1atRVReY9s0fwLf2LfX/f4cLNSdntETt3y1SL H6+Q== 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=8fSe3V2DXghz0qYtIv78ANashg0adky6TGQXIAKkDls=; fh=/h9QQkzJ8EboVkWg45aWwpaUro6WMavIVd2OhN45RtE=; b=XdGJBYxZ7JYdtFiZnk0NhAlZDJUgaPhtEGA28p8tD+TYb6g7H1v3krVKIoFuDGfeN6 a/bU/M1SkLCiLjwWIKKGhxly22u7Z6P6iIpZgs02cBs5rtrzGg8nqqTP/ZjxSpdkh2LV ANwulWx5WufaKlzIMukX9aLxkElzD3aEypkwBr4JHAwlnDmI60J85cI2EVrpvMEqERgH MQUOwJh4EBo57lorP7n82iM9eWMHYOi1HW2LBZPGoGmjinn2XU93diVYwYi2IiDFEehV RhvF86aZTEZAve2M9tvBFfUfgvKvUMJapuqQ6Rc502WHUeNWNa7h/CZrW0F8ftSLKTYs LHqw==; 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 4fb4d7f45d1cf-5733be9586dsi947521a12.1.2024.05.17.04.44.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 May 2024 04:44:47 -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 44HBigme015192 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 May 2024 13:44:46 +0200 From: Anton Mikanovich To: isar-users@googlegroups.com Cc: Anton Mikanovich Subject: [PATCH v2 3/4] Revert "Revert "wic/plugins/images/direct: Allow changes in fstab on rootfs"" Date: Fri, 17 May 2024 14:44:33 +0300 Message-Id: <20240517114434.778656-4-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?= Commit a4237f08 was reverted in oe-core, but still needs in Isar. Revert it back until other implementation will be done. This reverts commit 045e0da5ef147d3e9e0dc4ea8db95c0746984efa. Signed-off-by: Anton Mikanovich --- scripts/lib/wic/plugins/imager/direct.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/lib/wic/plugins/imager/direct.py b/scripts/lib/wic/plugins/imager/direct.py index a1d15265..33a869ec 100644 --- a/scripts/lib/wic/plugins/imager/direct.py +++ b/scripts/lib/wic/plugins/imager/direct.py @@ -117,7 +117,7 @@ class DirectPlugin(ImagerPlugin): updated = False for part in self.parts: if not part.realnum or not part.mountpoint \ - or part.mountpoint == "/" or not (part.mountpoint.startswith('/') or part.mountpoint == "swap"): + or not (part.mountpoint.startswith('/') or part.mountpoint == "swap"): continue if part.use_uuid: 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)