From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Sun, 25 Oct 2026 06:09:56 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-ed1-f62.google.com (mail-ed1-f62.google.com [209.85.208.62]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 69P59tJG001190 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 25 Oct 2026 06:09:55 +0100 Received: by mail-ed1-f62.google.com with SMTP id 4fb4d7f45d1cf-6b413b0000esf2008616a12.2 for ; Sat, 24 Oct 2026 22:09:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1792904990; cv=pass; d=google.com; s=arc-20260327; b=i8yZgX0hOAGBnG/celfAqJ3FlWtWwM1SPTYXws56+2UHIF9gMANjIwlXqeD9R+1Ivb nRMHkSG1u77NCi0yK9GYA1CVQlKliwhkiWdU0leU+a51eWXAbFbi3xxVnLyzbz4wirTr KKASFG9QAGgYGLvj1uzoKGNxezG08qmmuSm04mT+m27CuzIDYk5FlK+U7P08qOCJBwgT xsHLW6h//J91ZMZmdoqkPa2+84TtS4MTcgunqBkyvaSvGJc0iS0gLrAxagkz6Pczztsm dN2kEQkUP/ONNgNfK2lHGRVcP++YGTL7SKGadu3p+m+kdaimDeBKi312ESzTkfa51cgQ kXMA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:feedback-id:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=WF5aa7znvsWrT0XR9HtmFEqgn/ThtO1dQHcursKU+3I=; fh=bzruEwzJMyjjgH1QjUS/F+3UTQCmbWWr7yxJbMawT30=; b=jL3t4xKo7a1iwbhRd8N0WM8DbTbpseEKBDc1YoLrxwtzZnddXE9J06TCyHePPlBeaT f13m9RfS/8iTU9tfeJGUQEmYvoU8echHdGXJiqUIBqH3877EQ9nq5SOgZtRlW7Y1JJcP Kt8E62ZLYGpOfaNg7owNDK1NkwN9KI9fZDPltjFO24B6QyGaEhMQ3XUgkaPMnPamGbGE hL+kmyIUbZ9k7KGUm/txY57bWKnMOsS+7WBjYV4t0Gh0lRYRihUWchSJ9N3N/0Ljtil5 zasiPa4ivORP/f7Me0kmyFQF4adcM2w66MPZNUibD8JEnl0wTXOTJuNYSePFhVS0VXgF 6gIg==; darn=ilbers.de ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=DUf1Kcy0; spf=pass (google.com: domain of fm-1333022-20261025050946431fc101460002072a-vc9nfi@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) smtp.mailfrom=fm-1333022-20261025050946431fc101460002072a-VC9nFI@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20251104; t=1792904990; x=1793509790; darn=ilbers.de; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:content-type:reply-to :x-original-authentication-results:x-original-sender:feedback-id :mime-version:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=WF5aa7znvsWrT0XR9HtmFEqgn/ThtO1dQHcursKU+3I=; b=M2GcIpBxjVEntaMtUV5njLEH2aLzc1PzAqctSNknsk82MXxvHGMI7cAfw/4NoIWvGp nH7jILZ8vfPMXDSZNCkCwlriiCLznozeap0z9G3YzL3jhRd7ru0r/4dii0HjYoXeebMt PVUpPXGC9JX57amQbC5Fiw5lB0oLYeFJX29qkZ9UlK8Ju8sT76Jf2OOprSPVWHZOAmIG XkUE2Bhz9K0j47cBEbh8pCev8Uh47UNMxPz2D5h2Liz1aNMj5Hg9Qn5n4/CFdAJw6Jvz Vf/f6CXQa1BjmaJR34Vsm3dZBfn3DU66QyPYPG7pSBJ7lRgAltYNoNwoUrgGgk/taFBv u66Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1792904990; x=1793509790; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :content-type:reply-to:x-original-authentication-results :x-original-sender:feedback-id:mime-version:message-id:date:subject :cc:to:from:x-beenthere:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=WF5aa7znvsWrT0XR9HtmFEqgn/ThtO1dQHcursKU+3I=; b=iLWDc/Q9R2OS2wU6RG8Ut40dWaNMUXJb5rwgQ2GmM2dT4tebEIHgfUJuhO9N99lLyZ 3YzicT3OmWIct/xAcRh58Kz94vVInwiAis2yFMEXmL7N7zvM9W7oXIwkd12CMFRJZAgc KH6of/pj2Nt8bwBxaBT5mgkxD9uIc1S76OYQ4aax1IEpQYEtoNT/gYTmmMLZ4oqRlTtv vYZosDkprQqTRzLyVg/rQJ0HEXWs2f7UfBoHQlkEpSoL9EaySIVW0LLPwxug6Kg4v+O7 0Yh09KH2f4QQQpw1Cz1fty9qRhPuHoGG31I4slKoMMOlNhh5CigPSVJh4160Q4x/8/5x vt9Q== X-Forwarded-Encrypted: i=2; AKwUvByLRE6QquH2YPcpHABrzNSvmTgD+B8gN0dhDf0CrCvwsBfx0pCteLy3vnUr21FdmcXUSTac@ilbers.de X-Gm-Message-State: AFq9FYIXVDnm9DnCF45eb4hYvjtI8Oht6ij436CoYEohfa16e2IgaYe8 Yv1xFAqW9ZF8d3265TBAdDFphko3FrFOj0NSewy682OU7IrdAxQdvvO7 X-Received: by 2002:a05:6402:c513:10b0:6b4:20bc:fab with SMTP id 4fb4d7f45d1cf-6b442fd88damr2639082a12.18.1792904989845; Sat, 24 Oct 2026 22:09:49 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com; h="ATskLdf9PAYsktn6dclWlzOeXQ8GRdglC17F53atOEX/DHjPCw==" Received: by 2002:a05:6402:c511:10b0:6b4:6295:7bc1 with SMTP id 4fb4d7f45d1cf-6b462957f4als52815a12.2.-pod-prod-04-eu; Sat, 24 Oct 2026 22:09:47 -0700 (PDT) X-Received: by 2002:a17:907:9811:b0:c32:1b0d:d774 with SMTP id a640c23a62f3a-c46bdff4139mr356086266b.49.1792904986706; Sat, 24 Oct 2026 22:09:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1792904986; cv=none; d=google.com; s=arc-20260327; b=HSIfc/Aoz42CN1wcKgTRPZ/9SDqUL12E99iJnARj8QxicmA6J85bN05zE0BaIBZGd5 uEQ9yqzU6KFi+Yv9HuRpKljAmG2A9fH4UvtBJNcLbfG/JbH3XXJpQP21NYiw1YI1mNWH EZ4qXaBgVS0ykUs2i3kZrNQyUWkmTTsxg8FhwWcNqoOUxT0IdcePLvhAKEyEZ354/vnB hHSaM6qMKX5x+M1iY7fov8RJLPYZzyp7S4BVuhqG4ZtZhI55lpBDv8yFrVkOoOG0y+Kg NRNfE/1nzQUcP/1yNfy830ZjbLYO/MbjfkvJccFRkExhVm+K4TY/WxLKJZEItyLCud98 Aeqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=feedback-id:content-transfer-encoding:mime-version:message-id:date :subject:cc:to:from:dkim-signature; bh=tWEvlhOgtXMCg3KEyyKFdPaGE4bllUJ0qIbGRfxWvzo=; fh=gz0ZrJn6x76gX3XefOAliLWTyygDYYdGT/FXhQYr+zo=; b=Vhp+mzsjUGHMKUPb2K43ZVbqXFYiH9F1Ye11dbAovEJUmq0GigAS82CBJBzNvou99S CyWKMjChG5wuFmuUD++keM8w5zN6lDadZEVCqy82uylnBmWVTui4VpccDxFQIMLXXu2i LYkZJXF2bjIiWjNQHl5rSC2cUl3vEBq6gk0OyeEphHYBfzUut0TRxGJufGnYESlSjIPK +Bn1B5SItG0Ojji5SmRr/DBrNwKYm2Lfvh6S47a01D3R9vQzg7LhDohkxNmWATXMIu40 9r6Vsu9+KDcfgEqbbWS1wff04s5s5fIQKe+ZvT7Sq/n2dxc0D6v1uaJdmAY687iXAbmp ISXA==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=DUf1Kcy0; spf=pass (google.com: domain of fm-1333022-20261025050946431fc101460002072a-vc9nfi@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) smtp.mailfrom=fm-1333022-20261025050946431fc101460002072a-VC9nFI@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-65-226.siemens.flowmailer.net (mta-65-226.siemens.flowmailer.net. [185.136.65.226]) by gmr-mx.google.com with ESMTPS id a640c23a62f3a-c46bd4da570si4820266b.7.2026.10.24.22.09.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Oct 2026 22:09:46 -0700 (PDT) Received-SPF: pass (google.com: domain of fm-1333022-20261025050946431fc101460002072a-vc9nfi@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) client-ip=185.136.65.226; Received: by mta-65-226.siemens.flowmailer.net with ESMTPSA id 20261025050946431fc101460002072a for ; Sun, 25 Oct 2026 06:09:46 +0100 From: "'Gourav Singh' via isar-users" To: isar-users@googlegroups.com Cc: Gourav Singh Subject: [PATCH] rootfs-add-files: use run_privileged_cmd instead of sudo Date: Sun, 25 Oct 2026 10:39:32 +0530 Message-Id: <20261025050932.69095-1-gouravsingh@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1333022:519-21489:flowmailer X-Original-Sender: gouravsingh@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=DUf1Kcy0; spf=pass (google.com: domain of fm-1333022-20261025050946431fc101460002072a-vc9nfi@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) smtp.mailfrom=fm-1333022-20261025050946431fc101460002072a-VC9nFI@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com X-Original-From: Gourav Singh Reply-To: Gourav Singh Content-Type: text/plain; charset="UTF-8" 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-Spam-Status: No, score=-4.9 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,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-TUID: txnv0mctKWUF rootfs_add_files hard-codes "sudo -E" to create the destination directory and copy the additional files into the rootfs. In rootless (unshare) mode, this leaves e.g. the installer's /install directory owned by the real root, which is not mapped into the user namespace. Subsequent builds then fail in root_cleandirs of do_rootfs_install: rm: cannot remove '.../rootfs/install/.wic.zst': Permission denied Use run_privileged_cmd() instead, so that the files are created with the same privileges as the rest of the rootfs. While at it, also fix the removal of a pre-existing destination file, which ran unprivileged on the host path instead of the path inside the rootfs. Signed-off-by: Gourav Singh --- meta/classes-recipe/rootfs-add-files.bbclass | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/meta/classes-recipe/rootfs-add-files.bbclass b/meta/classes-recipe/rootfs-add-files.bbclass index 38f739ee..d135f6d7 100644 --- a/meta/classes-recipe/rootfs-add-files.bbclass +++ b/meta/classes-recipe/rootfs-add-files.bbclass @@ -18,24 +18,25 @@ ROOTFS_ADDITIONAL_FILES ??= "" python rootfs_add_files() { postprocess_additional_files = d.getVar('ROOTFS_ADDITIONAL_FILES').split() rootfsdir = d.getVar("ROOTFSDIR") + privileged = run_privileged_cmd(d).split() for entry in postprocess_additional_files: additional_file_entry = f"ROOTFS_ADDITIONAL_FILE_{entry}" destination = d.getVarFlag(additional_file_entry, "destination") or "" source = d.getVarFlag(additional_file_entry, "source") or "" - if os.path.exists(f"{rootfsdir}/{destination}"): - bb.process.run([ "/usr/bin/rm", "-f", f"{destination}"]) + if os.path.lexists(f"{rootfsdir}/{destination}"): + bb.process.run(privileged + ["/usr/bin/rm", "-f", f"{rootfsdir}/{destination}"]) dest_dir = os.path.dirname(destination) - bb.process.run(["sudo", "-E", "/usr/bin/mkdir", "-p", f"{rootfsdir}/{dest_dir}" ]) + bb.process.run(privileged + ["/usr/bin/mkdir", "-p", f"{rootfsdir}/{dest_dir}" ]) # empty source creates only an empty destination file if not source: - bb.process.run(["sudo", "-E", "/usr/bin/touch", f"{rootfsdir}/{destination}" ]) + bb.process.run(privileged + ["/usr/bin/touch", f"{rootfsdir}/{destination}" ]) return if not os.path.exists(f"{source}"): bb.error(f"{source} does not exists and cannot be copied to the rootfs!") # no recursive copy only single files - bb.process.run(["sudo", "-E", "/usr/bin/cp", "-a", f"{source}", f"{rootfsdir}/{destination}" ]) + bb.process.run(privileged + ["/usr/bin/cp", "-a", f"{source}", f"{rootfsdir}/{destination}" ]) } ROOTFS_INSTALL_COMMAND += "rootfs_add_files" -- 2.39.5 -- You received this message because you are subscribed to the Google Groups "isar-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/isar-users/20261025050932.69095-1-gouravsingh%40siemens.com.