[PATCH] avoid double slash in generated rootfs umount paths

16 views
Skip to first unread message

srinuv...@siemens.com

unread,
Sep 11, 2026, 6:15:43 AM (9 days ago) Sep 11
to isar-...@googlegroups.com, Srinuvasan A
From: Srinuvasan A <srinuv...@siemens.com>

ROOTFS_MOUNTS inner paths are absolute, e.g. /isar-apt and
/isar-work. insert_isar_umounts added another slash between ROOTFSDIR
and the inner path, producing paths like rootfs//isar-apt in the
expanded rootfs_do_umounts_priv task.

Strip the leading slash from the inner mount path when building the
mountpoint, matching the logic already used by insert_isar_mounts.

Logs:
mountpoint -q /work/build/tmp/work/debian-trixie-amd64/isar-image-base-qemuamd64/1.0-r0/rootfs//isar-apt &&
umount /work/build/tmp/work/debian-trixie-amd64/isar-image-base-qemuamd64/1.0-r0/rootfs//isar-apt

mountpoint -q /work/build/tmp/work/debian-trixie-amd64/isar-image-base-qemuamd64/1.0-r0/rootfs//isar-work &&
umount /work/build/tmp/work/debian-trixie-amd64/isar-image-base-qemuamd64/1.0-r0/rootfs//isar-work

Signed-off-by: Srinuvasan A <srinuv...@siemens.com>
---
meta/classes-global/base.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes-global/base.bbclass b/meta/classes-global/base.bbclass
index 8f81ab70..be663fe7 100644
--- a/meta/classes-global/base.bbclass
+++ b/meta/classes-global/base.bbclass
@@ -432,7 +432,7 @@ def insert_isar_umounts(d, rootfs, mounts):

for m in mounts.split():
host, inner = m.split(':') if ':' in m else (m, m)
- mp = '{}/{}'.format(rootfs, inner)
+ mp = '{}/{}'.format(rootfs, inner[1:])
lines.append('mountpoint -q {} && umount {}'.format(mp, mp))
lines.append('[ -d {} ] && rmdir --ignore-fail-on-non-empty {}'.format(mp, mp))
return '\n'.join(lines)
--
2.39.5

MOESSBAUER, Felix

unread,
Sep 11, 2026, 6:41:30 AM (9 days ago) Sep 11
to Arjunan, Srinu, isar-...@googlegroups.com
On Fri, 2026-09-11 at 15:46 +0530, srinuvasan.a via isar-users wrote:
> From: Srinuvasan A <srinuv...@siemens.com>
>
> ROOTFS_MOUNTS inner paths are absolute, e.g. /isar-apt and
> /isar-work. insert_isar_umounts added another slash between ROOTFSDIR
> and the inner path, producing paths like rootfs//isar-apt in the
> expanded rootfs_do_umounts_priv task.
>
> Strip the leading slash from the inner mount path when building the
> mountpoint, matching the logic already used by insert_isar_mounts.

Thanks!

Reviewed-by: Felix Moessbauer <felix.mo...@siemens.com>

>
> Logs:
> mountpoint -q /work/build/tmp/work/debian-trixie-amd64/isar-image-base-qemuamd64/1.0-r0/rootfs//isar-apt &&
> umount /work/build/tmp/work/debian-trixie-amd64/isar-image-base-qemuamd64/1.0-r0/rootfs//isar-apt
>
> mountpoint -q /work/build/tmp/work/debian-trixie-amd64/isar-image-base-qemuamd64/1.0-r0/rootfs//isar-work &&
> umount /work/build/tmp/work/debian-trixie-amd64/isar-image-base-qemuamd64/1.0-r0/rootfs//isar-work
>
> Signed-off-by: Srinuvasan A <srinuv...@siemens.com>
> ---
> meta/classes-global/base.bbclass | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/classes-global/base.bbclass b/meta/classes-global/base.bbclass
> index 8f81ab70..be663fe7 100644
> --- a/meta/classes-global/base.bbclass
> +++ b/meta/classes-global/base.bbclass
> @@ -432,7 +432,7 @@ def insert_isar_umounts(d, rootfs, mounts):
>
> for m in mounts.split():
> host, inner = m.split(':') if ':' in m else (m, m)
> - mp = '{}/{}'.format(rootfs, inner)
> + mp = '{}/{}'.format(rootfs, inner[1:])
> lines.append('mountpoint -q {} && umount {}'.format(mp, mp))
> lines.append('[ -d {} ] && rmdir --ignore-fail-on-non-empty {}'.format(mp, mp))
> return '\n'.join(lines)
> --
> 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+...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/isar-users/20260911101616.748091-1-srinuvasan.a%40siemens.com.

Jan Kiszka

unread,
Sep 11, 2026, 6:49:31 AM (9 days ago) Sep 11
to srinuv...@siemens.com, isar-...@googlegroups.com
This looks fragile. Why not strip off '/', rather than blindly cutting
the last char?

Jan

> lines.append('mountpoint -q {} && umount {}'.format(mp, mp))
> lines.append('[ -d {} ] && rmdir --ignore-fail-on-non-empty {}'.format(mp, mp))
> return '\n'.join(lines)

--
Siemens AG, Foundational Technologies
Linux Expert Center

Srinuvasan Arjunan

unread,
Sep 11, 2026, 7:12:44 AM (9 days ago) Sep 11
to isar-users
  Thanks for the comments,

  Here, inner[1:] strips the leading /, as we always assume the paths in ROOTFS_MOUNTS are absolute.

  For example:

  ROOTFS_MOUNTS ??= "${REPO_ISAR_DIR}/${DISTRO}:/isar-apt ${WORKDIR}:/isar-work"

  This also follows the same pattern already used by insert_isar_mounts.

  Many thanks,

  Srinu

Jan Kiszka

unread,
Sep 11, 2026, 7:21:00 AM (9 days ago) Sep 11
to Srinuvasan Arjunan, isar-users
Yeah, confused that.

>
>   For example:
>
>   ROOTFS_MOUNTS ??= "${REPO_ISAR_DIR}/${DISTRO}:/isar-apt ${WORKDIR}:/
> isar-work"
>
>   This also follows the same pattern already used by insert_isar_mounts.
>

It would still be clearer, not requiring a (missing) comment or reading
the commit message to understand what is cut off here. And maybe other
code would benefit from a clearer pattern as well.

Jan

Zhihang Wei

unread,
Sep 16, 2026, 3:44:44 AM (4 days ago) Sep 16
to Srinuvasan Arjunan, isar-users, Jan Kiszka
Will there be a v2?

Zhihang

Reply all
Reply to author
Forward
0 new messages