public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "'Jan Kiszka' via isar-users" <isar-users@googlegroups.com>
To: "Hombourger,
	Cedric (FT FDS CES LX)" <cedric.hombourger@siemens.com>,
	"isar-users@googlegroups.com" <isar-users@googlegroups.com>
Cc: "Moessbauer, Felix (FT RPD CED OES-DE)" <felix.moessbauer@siemens.com>
Subject: Re: [PATCH v3 1/6] rootfs: introduce wrapper to run commands against a rootfs
Date: Mon, 15 Sep 2025 12:04:02 +0200	[thread overview]
Message-ID: <6c970587-5544-4be4-bd57-ec81847dd8aa@siemens.com> (raw)
In-Reply-To: <40ffc532715cbb285f2e41ec11909a7ff145da05.camel@siemens.com>

On 15.09.25 10:57, Hombourger, Cedric (FT FDS CES LX) wrote:
> On Mon, 2025-09-15 at 10:28 +0200, Jan Kiszka wrote:
>> On 25.06.25 21:37, 'Cedric Hombourger' via isar-users wrote:
>>> "sudo chroot" is used in several places to run commands inside
>>> rootfs
>>> directories constructed by Isar. There are cases where a command
>>> could
>>> be used without elevated privileges as long as special folders such
>>> as
>>> /isar-apt are mounted (they are often referenced as /isar-apt in
>>> configuration files found in the target rootfs). For such cases,
>>> bubblewrap may be used to create a non-privileged namespace (either
>>> in a bare/native environment or within a docker/podman container)
>>> where the command will be executed as if chroot had been used. The
>>> rootfs may also be the host root file-system: this should however
>>> be used with care to avoid host contamination problems (note: Isar
>>> already relies on a number of host tools).
>>
>> Where does this take the commands from then, the host env or some
>> better
>> defined rootfs that is aligned with the target rootfs release-wise?
>> Is
>> that controlled by the caller or implicitly by the wrapper.
> 
> rootfs_cmd is a general-purpose helper and does not select a rootfs of
> its own where it will run commands from. This is left to the caller to
> decide. given a rootfs, it will let bubblewrap create a namespace with
> relevant mappings, optionally chdir to a specified directory and run
> the user-specified command.

So none of the patches 2..6 changes the source rootfs for the command to
run?

> 
>>
>> I have to remind that we cannot blindly use host-side tools on the
>> target rootfs (except for the very basic ones) as the latter may be
>> newer than the former and not necessarily compatible.
> 
> Agreed. if we agree on introducing rootfs_cmd then uses shall be
> audited. Reliance on host-tools shall be kept to a minimum to avoid
> host-contamination problems but also avoid incompatibilities as you
> have correctly noted.
> 
> We can debate whether the 1st user of rootfs_cmd from this patch series
> (using apt to download source packages from a target rootfs) should
> have used apt from / (hopefully a kas-container but not guaranteed) or
> from Isar's host rootfs. With mmdebstrap (used from /) using apt (also
> from /), I felt that it was ok.

Really? mmdebstrap builds an maintains a sid rootfs via a bookworm or
even older toolset?

> 
> If you prefer that I switch to have rootfs_cmd call apt from an Isar
> host rootfs then I can rework the patch series to do so. We may have
> other cases where we need a host tool (pulled into an Isar's host
> rootfs) to operate on a target rootfs.

See my question above: If this series does not change the behavior in
step 1, we can move forward and change the tooling source later on. If
it does already, we should address that in the same run.

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/6c970587-5544-4be4-bd57-ec81847dd8aa%40siemens.com.

  reply	other threads:[~2025-09-15 10:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-25 19:37 [PATCH v3 0/6] non-privileged commands in chroot 'Cedric Hombourger' via isar-users
2025-06-25 19:37 ` [PATCH v3 1/6] rootfs: introduce wrapper to run commands against a rootfs 'Cedric Hombourger' via isar-users
2025-09-15  8:28   ` 'Jan Kiszka' via isar-users
2025-09-15  8:57     ` 'cedric.hombourger@siemens.com' via isar-users
2025-09-15 10:04       ` 'Jan Kiszka' via isar-users [this message]
2025-09-15 13:04         ` 'cedric.hombourger@siemens.com' via isar-users
2025-06-25 19:37 ` [PATCH v3 2/6] deb-dl-dir: optimize caching of source packages using apt natively 'Cedric Hombourger' via isar-users
2025-06-25 19:37 ` [PATCH v3 3/6] image-postproc-extension: refactor systemd version checks 'Cedric Hombourger' via isar-users
2025-06-25 19:37 ` [PATCH v3 4/6] image-postproc-extension: extract systemd's version using rootfs_cmd 'Cedric Hombourger' via isar-users
2025-06-25 19:37 ` [PATCH v3 5/6] bootstrap: create lock for downloads/deb without sudo 'Cedric Hombourger' via isar-users
2025-06-25 19:37 ` [PATCH v3 6/6] rootfs: do not get elevated privileges when downloading packages 'Cedric Hombourger' via isar-users
2025-08-20 15:38 ` [PATCH v3 0/6] non-privileged commands in chroot 'MOESSBAUER, Felix' via isar-users
2025-09-16 15:53   ` Andreas Naumann
2025-09-16 16:45     ` '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=6c970587-5544-4be4-bd57-ec81847dd8aa@siemens.com \
    --to=isar-users@googlegroups.com \
    --cc=cedric.hombourger@siemens.com \
    --cc=felix.moessbauer@siemens.com \
    --cc=jan.kiszka@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