From: "'Jan Kiszka' via isar-users" <isar-users@googlegroups.com>
To: Felix Moessbauer <felix.moessbauer@siemens.com>,
isar-users@googlegroups.com
Cc: quirin.gylstorff@siemens.com
Subject: Re: [RFC 04/12] introduce wrappers for privileged execution
Date: Wed, 18 Feb 2026 15:11:22 +0100 [thread overview]
Message-ID: <3b3f160d-f71b-4c2f-bcf6-ef5a2ef48baa@siemens.com> (raw)
In-Reply-To: <20260218115827.3947145-5-felix.moessbauer@siemens.com>
On 18.02.26 12:58, 'Felix Moessbauer' via isar-users wrote:
> As a preparation to enable rootless builds, we introduce wrappers for
> common cases of privileged command execution. The wrappers are defined
> in the base class where later on the executor dispatching will be
> implemented as well.
>
> The wrappers are introduced throughout the whole codebase and downstream
> layers are also encouraged to use them to increase compatibility with
> upcoming API changes.
>
> Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
> ---
> RECIPE-API-CHANGELOG.md | 16 ++++
> meta/classes-global/base.bbclass | 30 +++++++
> meta/classes-recipe/deb-dl-dir.bbclass | 4 +-
> meta/classes-recipe/dpkg-base.bbclass | 2 +-
> meta/classes-recipe/dpkg.bbclass | 2 +-
> .../image-account-extension.bbclass | 4 +-
> .../image-locales-extension.bbclass | 4 +-
> .../image-postproc-extension.bbclass | 30 +++----
> meta/classes-recipe/image.bbclass | 14 +--
> .../imagetypes_container.bbclass | 26 +++---
> meta/classes-recipe/imagetypes_wic.bbclass | 4 +-
> meta/classes-recipe/rootfs.bbclass | 88 +++++++++----------
> meta/classes-recipe/sbuild.bbclass | 10 +--
> meta/classes-recipe/sdk.bbclass | 14 +--
> meta/classes/sbom.bbclass | 2 +-
> .../isar-mmdebstrap/isar-mmdebstrap.inc | 12 +--
> .../unittests/test_image_account_extension.py | 9 +-
> 17 files changed, 157 insertions(+), 114 deletions(-)
>
> diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
> index 0bad8a44..bc40a403 100644
> --- a/RECIPE-API-CHANGELOG.md
> +++ b/RECIPE-API-CHANGELOG.md
> @@ -962,3 +962,19 @@ INSTALLER_UNATTENDED_ABORT_ENABLE = "1"
> # Optional: set countdown timeout in seconds (default 5)
> INSTALLER_UNATTENDED_ABORT_TIMEOUT = "5"
> ```
> +
> +### Execution of privileged commands
> +
> +When operations require higher privileges than those available to the build user,
> +the following helper functions shall be used:
> +
> +**run_privileged**: Run a command as root while preserving the environment.
> +
> +**run_privileged_here**: Execute commands provided via stdin in a root shell.
From their names, these two commands sound to me like they differ in
where they are running the commands, not how. But from the description
it is the latter. "run_privileged_from_stdin"?
> +
> +**run_in_chroot**: Run a command within a chroot environment. The first argument
> +specifies the rootfs path.
> +
> +Using these helpers instead of direct `sudo` invocations centralizes platform-specific
> +privileged execution logic in `base.bbclass`. Direct use of `sudo` is discouraged
> +in downstream layers.
Are there sudos left in Isar after this conversion? If not, should we
start to catch sudo as invalid afterwards?
Jan
--
Siemens AG, Foundational Technologies
Linux Expert Center
--
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/3b3f160d-f71b-4c2f-bcf6-ef5a2ef48baa%40siemens.com.
next prev parent reply other threads:[~2026-02-18 14:11 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-18 11:58 [RFC 00/12] add support to build isar unprivileged 'Felix Moessbauer' via isar-users
2026-02-18 11:58 ` [RFC 01/12] refactor bootstrap: store rootfs tar with user permissions 'Felix Moessbauer' via isar-users
2026-02-18 11:58 ` [RFC 02/12] deb-dl-dir: export without root privileges 'Felix Moessbauer' via isar-users
2026-02-18 14:01 ` 'Jan Kiszka' via isar-users
2026-02-18 11:58 ` [RFC 03/12] download debs without locking 'Felix Moessbauer' via isar-users
2026-02-18 11:58 ` [RFC 04/12] introduce wrappers for privileged execution 'Felix Moessbauer' via isar-users
2026-02-18 14:11 ` 'Jan Kiszka' via isar-users [this message]
2026-02-18 11:58 ` [RFC 05/12] bootstrap: move cleanup trap to function 'Felix Moessbauer' via isar-users
2026-02-18 11:58 ` [RFC 06/12] rootfs: rework sstate caching of rootfs artifact 'Felix Moessbauer' via isar-users
2026-02-18 11:58 ` [RFC 07/12] rootfs_generate_initramfs: rework deployment to avoid chowning 'Felix Moessbauer' via isar-users
2026-02-18 11:58 ` [RFC 08/12] wic: rework image deploy logic to deploy under correct user 'Felix Moessbauer' via isar-users
2026-02-18 11:58 ` [RFC 09/12] use bitbake function to generate mounting scripts 'Felix Moessbauer' via isar-users
2026-02-18 11:58 ` [RFC 10/12] apt-fetcher: prepare for chroot specific fetching 'Felix Moessbauer' via isar-users
2026-02-18 11:58 ` [RFC 11/12] add support for fully rootless builds 'Felix Moessbauer' via isar-users
2026-02-18 16:09 ` 'Jan Kiszka' via isar-users
2026-02-18 16:50 ` 'Jan Kiszka' via isar-users
2026-02-18 11:58 ` [RFC 12/12] apt-fetcher: implement support for unshare backend 'Felix Moessbauer' via isar-users
2026-02-18 18:20 ` [RFC 00/12] add support to build isar unprivileged 'Jan Kiszka' via isar-users
2026-02-18 18:31 ` 'Jan Kiszka' via isar-users
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3b3f160d-f71b-4c2f-bcf6-ef5a2ef48baa@siemens.com \
--to=isar-users@googlegroups.com \
--cc=felix.moessbauer@siemens.com \
--cc=jan.kiszka@siemens.com \
--cc=quirin.gylstorff@siemens.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox