From patchwork Mon Oct 28 07:32:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uladzimir Bely X-Patchwork-Id: 3888 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Mon, 28 Oct 2024 08:33:02 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-lf1-f57.google.com (mail-lf1-f57.google.com [209.85.167.57]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 49S7Wt0Z004749 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 28 Oct 2024 08:32:55 +0100 Received: by mail-lf1-f57.google.com with SMTP id 2adb3069b0e04-53b1eddcf4asf2810923e87.3 for ; Mon, 28 Oct 2024 00:32:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1730100765; cv=pass; d=google.com; s=arc-20240605; b=lC61R4aAHw92qWvTifisoTd6t+idcikP0zP8mpD7dWc8LWGaZV48mHiiRbaL0UT/Yq Pqy4KRNM0RMb00s7xXJEcfAZz+SMio0+1j49KlINTBKHlN8l0YPp/dep/itIxQiLut8r fD9saQGRN5d1uOuynaiUs8ba7vNJ8SUixys0dZgLYCmirpzwIGKqmmBqCN8ndqt/qBIb EMZv8DFiwiiJMJMd4zhks0Tq9c2y0N78+eyLG4oqfkdk2+oKx8kwRbcTnTTWDX0pSkl5 ey+OjC7voo14PnbrEHvtHX/0FIldaAt99dZphLSUPfpIx8ykIV6vBRgtZ1S6jzYPaO7c uq1w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:message-id:date :subject:to:from:sender:dkim-signature; bh=Rr4A7Awzc8tZw6CHYhMNO0XF9m9L/bTVK+Gf1kJqVO4=; fh=aYqWqbK96FxS7sW/7cDuZw74jOCYgAU5vJJ18zQP3ak=; b=QVtNFLc21yD7hS1GsmF1w08k9j88oCuZeZ7Y7PBwDbXJ+jGdsH4ayyqVmJDxs3F6hG g24JKiSidRS6EHuaNIUrMWrwSp3yrPJUHAdIIymCEWCAU8onlRxOhA/hZNW5QSS0CmdE 22Ya7qV2SwvM2Cej4KZyy12mcU0MIpmeyhp4NYRGFpxoP5ISHghEdEj9vtByyUeBNT3R /gZQBl2KUGTYfSf4DFjbK+bJREmUXvkIPKOGeb4hfrUi5XJaOJzItLQWWqZ4DfD8evKy ptn606cN/WPxRdj5/Xp35a0bkEtvQJrsL4FlCM9VGWyIhqr5RNr+hKM9KPHj9QRkyOWQ cKKA==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1730100765; x=1730705565; 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:message-id:date:subject:to:from :sender:from:to:cc:subject:date:message-id:reply-to; bh=Rr4A7Awzc8tZw6CHYhMNO0XF9m9L/bTVK+Gf1kJqVO4=; b=GjDyz/Lkai2JklvjwQoSAww/vGsBu5s6mFNFKDwq/Wilkb04ForOQlrJI2BSV1RIC8 +/uder42OAMz5KoazwvU2B8UBe/nbq+jOFfqwwKSrlqyGafDUS4oP7my9xf5KSEZbtl8 9i5hlR2ykBKRf/RhVRwQrOnRSViG7D7UDMujvg/xeOxl563j19E3ldN30PLYJXRPCdzR zuAJRTC7zkcSvlEfUFJRCRfcOxpMSViJnpI0fDX45XjJYQ3ha2bZDFKDnj8zg+JfVlw1 o22KcLugU2nIF3NQel2LY3uY0pIF1hY+HoJMh+q+ytkuqji0L6RU8Tgm0eHJ+6EKYZjR nfaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730100765; x=1730705565; 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 :message-id:date:subject:to:from:x-beenthere:x-gm-message-state :sender:from:to:cc:subject:date:message-id:reply-to; bh=Rr4A7Awzc8tZw6CHYhMNO0XF9m9L/bTVK+Gf1kJqVO4=; b=BKIHYWVtWP3hT0zOiKknNwgc7twMz74JRPt4B+3tGkIyDrVM/eGWGC+prJZyuoXfpE oshJvgwBIeEVhMhlVRp/gwNg7pufkWCqoxlkYjFPCfrOtIZ/WlHXNwJY3zA6uv6P/N25 zf+wFJA9W3kU0t+Xtw7suY6WbGEVzYZeoBqZgc7dI6NmzdS7dumKbxQGFDKtzVJEG6kf KvcnT3biJIn2656YtB5+bp3dUi4ZCyQzNgCAXZXwGeBeH6rnRZWL+T9cGQr3VF1gQsB4 MF/nprTauoBD7jiEMjct36rHd+JT3WkKHI2J/Oj2h4h39nO0SQkn0+R45vnDLkFa+akP 8sXg== Sender: isar-users@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCXd9znJos63w5AgplvW0cqayGtDQK9dYkDfQ/kjSfNR/Ib5aviesyAaIxJxThIOrQivjJz1z2w=@isar-build.org X-Gm-Message-State: AOJu0YyZqDSV5wtvVPgyZ5I33mYWdcgxQLZfygILIOrLtN9QbSQJYuc2 X1xZCYBMzRhEqSqFjcucZPn4ZyLCneqNoHNxNKfDo8zxwI2Ib/ZH X-Google-Smtp-Source: AGHT+IH2FPD/RsDjQWQNGAAlLbRWxXAWdKGv60alf++kt6RTDaFXs2MVCT9d+yQFyrCL15l5+bGZkQ== X-Received: by 2002:a05:6512:1104:b0:536:a275:9d61 with SMTP id 2adb3069b0e04-53b348ceaafmr2800240e87.21.1730100764028; Mon, 28 Oct 2024 00:32:44 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6512:1116:b0:539:e021:5376 with SMTP id 2adb3069b0e04-53b2148fbb0ls1571075e87.1.-pod-prod-04-eu; Mon, 28 Oct 2024 00:32:41 -0700 (PDT) X-Received: by 2002:a05:6512:2388:b0:53b:1526:3a63 with SMTP id 2adb3069b0e04-53b34a33f5bmr2421370e87.56.1730100761530; Mon, 28 Oct 2024 00:32:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1730100761; cv=none; d=google.com; s=arc-20240605; b=Jne1VAl9VHQ1kXogBSOB1O7NNji2FfSkdsHDkFz3NdFTu1H5zBUpjdjVIUjKPs2cJY 0PY8rVkXLRYviZFc+VUCev/SEr2UwH+24vtiCLAUh9OBPHLaguJ0vFPs2vV6R5YdVhcN WHmVMlFMoGRwj8i19/7y93WPjQQCr22dWucgmEDYD5wsZv/PBi2hDGGPipe4PZoChoWT xYl4Bx9iFfgMBDEpQun/T9xfmaCb9P5VYayAtHhRhjTSJruKX210VT9wjEoInfzorBhn x7CeFMIweEW7k169t4jl0FQpDYxwgRGtGEddFFKYsFMYeF/K8SlOadaPQgRa95FwJ2V5 UzAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from; bh=ntQ3zWtSofqzTypMINaliQfFsWJ1N8HhwIqlctM9qL0=; fh=7tclEdh7YbwSQowgJ6LNq720O7H5HTEaqj22NJWRE2E=; b=Bf7dRpv1jgkmapHQ/XyLlt87cf8FV1Q6NM9DH/p+oCPmqnYp2j/j0fqdMavXhANxK/ FGZLUVxXFxSWOJAUB5PoUNT5WvzvKQI75xXHn3otE4xERfJ11PnG6AdXFElbvjgx41XW Tbn6nG8QPbrfT/nZloRqTRXhTDepokgcfhl07ZG/J8/M6G+Vfl9a1r0qCe0gvHxYkwZ5 vhu/xCbQLpSp8XMfSiq9W9FBqQRnMy3tZ4RCS7Yk9ipY1QHn9K62aQXb8uZ9dKS6CnYP g8nSl79RuhdqnFOfC596Pha0WEDOQEEsRjNzNMIjwuxS5iHFKairNLo0/1U7W9Stg7Vv saSA==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id 5b1f17b1804b1-4317d02bc69si9206575e9.0.2024.10.28.00.32.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 Oct 2024 00:32:41 -0700 (PDT) Received-SPF: pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Received: from home.localdomain (44-208-124-178-static.mgts.by [178.124.208.44] (may be forged)) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPSA id 49S7Wahh004744 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 28 Oct 2024 08:32:36 +0100 From: Uladzimir Bely To: isar-users@googlegroups.com Subject: [PATCH] isar-bootstrap: Run setup-chroot.sh after dpkg upgraded Date: Mon, 28 Oct 2024 10:32:24 +0300 Message-ID: <20241028073231.14162-1-ubely@ilbers.de> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, RCVD_IN_PSBL,RCVD_IN_RP_CERTIFIED,RCVD_IN_RP_RNBL,RCVD_IN_RP_SAFE, 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: ubely@ilbers.de X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@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?= By calling "chroot-setup.sh setup" right after debootstrap we do dpkg-divert for `/usr/sbin/start-stop-daemon`. This replaces the original script with a stub that is called during the build. At the end of the build, in "rootfs_finalize" task for target image, the original file is restored so package installation on a real target should be full-functional. But if `apt-get update` followed by debootstrap stage requires an upgrade of "dpkg" package itself (e.g. if new version exists in "-updates"), this may lead for diversion reset and original script gets restored. This results in following things: - "real" start-stop-daemon is called in all chroots during build; - start-stop-daemon is removed on target rootfs by "rootfs_finalize". Currently, it happens only for rpi-bookworm targets where debootsrapped "dpkg_1.21.22_arm64.deb" package is upgraded with a newer version "dpkg_1.22.6~bpo12+rpt3_arm64.deb" at "apt-get update" stage. With this change, we run "chroot-setup.sh" after explicite upgrade of "dpkg". Thus we guarantee start-stop-daemon stub is used during build and undirsion is done only at the end of the rootfs creation. Signed-off-by: Uladzimir Bely --- meta/recipes-core/isar-bootstrap/isar-bootstrap.inc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc index 92974eb5..e155aade 100644 --- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc +++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc @@ -370,10 +370,6 @@ do_bootstrap() { sed -i '/en_US.UTF-8 UTF-8/s/^#//g' "${ROOTFSDIR}/etc/locale.gen" chroot "${ROOTFSDIR}" /usr/sbin/locale-gen - # setup chroot - install -v -m755 "${WORKDIR}/chroot-setup.sh" "${ROOTFSDIR}/chroot-setup.sh" - "${ROOTFSDIR}/chroot-setup.sh" "setup" "${ROOTFSDIR}" - # update APT mount -o bind,private /dev ${ROOTFSDIR}/dev mount -o bind,private /dev/pts "${ROOTFSDIR}/dev/pts" @@ -394,6 +390,13 @@ do_bootstrap() { chroot "${ROOTFSDIR}" /usr/bin/apt-get update -y \ -o APT::Update::Error-Mode=any + + chroot "${ROOTFSDIR}" /usr/bin/apt-get install -y dpkg + + # setup chroot + install -v -m755 "${WORKDIR}/chroot-setup.sh" "${ROOTFSDIR}/chroot-setup.sh" + "${ROOTFSDIR}/chroot-setup.sh" "setup" "${ROOTFSDIR}" + chroot "${ROOTFSDIR}" /usr/bin/apt-get install -y -f chroot "${ROOTFSDIR}" /usr/bin/apt-get dist-upgrade -y \ -o Debug::pkgProblemResolver=yes