public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Christian Storm <christian.storm@siemens.com>
To: isar-users@googlegroups.com
Subject: Re: [PATCH] isar-image-base: fix some dangling mounts
Date: Mon, 13 Nov 2017 15:24:43 +0100	[thread overview]
Message-ID: <20171113142443.hczmlzhnlligt62m@MD1KR9XC.ww002.siemens.net> (raw)
In-Reply-To: <875ca5fe-4116-ac26-bef6-20b6225aa809@ilbers.de>

> [...]
> Here I see that you insert quite similar patterns across the Isar code, 
> would it be better to have one global clean up function like?
> 
> do_isar_mount_cleanup () {
>      if [ -d "${WORKDIR}/mnt" ]; then
>          # umount and remove
>      fi
> 
>      if [ -d "${WORKDIR}/rootfs/proc" ]; then
>          # umount and remove
>      fi
> 
>      if [ -d "${BUILDCHROOT_DIR}/proc" ]; then
>          # umount and remove
>      fi
> 
>      etc...
> }
> 
> This approach will significantly simplify maintenance of clean up traps 
> and adding of new possible mounts to Isar. What do you think?

I'd say it depends :)
It breaks if you rely on keeping something mounted while executing a
child script that does unmount everything, following your proposal. If
we can make sure that such a situation never occurs, we may consolidate
this. For now, it's rather local just undoing the mounts done in the
scope of the script.
So, in the end, I think it's a matter of taste and contracts between the
different parts of Isar.

What one may consider to "de-duplicate" is a stack of mounted directories
being pushed to and unmounted on script exit. So, something like
  push_umount ${IMAGE_ROOTFS}/proc
and then the EXIT trap enumerates all those entries, unmounting them.
The same has to be done for removing the directories, if applicable.



Besten Gru�,
   Christian

-- 
Dr. Christian Storm
Siemens AG, Corporate Technology, CT RDA ITP SES-DE
Otto-Hahn-Ring 6, 81739 M�nchen, Germany

  reply	other threads:[~2017-11-13 14:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-13 12:22 Christian Storm
2017-11-13 12:50 ` Alexander Smirnov
2017-11-13 12:57   ` Christian Storm
2017-11-13 13:53 ` Alexander Smirnov
2017-11-13 14:24   ` Christian Storm [this message]
2017-11-13 14:47     ` Alexander Smirnov
2017-11-14  7:36       ` Christian Storm
2017-11-14  7:48         ` Alexander Smirnov
2017-11-14  8:58           ` Christian Storm
2017-11-13 13:57 ` Henning Schild
2017-11-14 16:01 ` Alexander Smirnov

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=20171113142443.hczmlzhnlligt62m@MD1KR9XC.ww002.siemens.net \
    --to=christian.storm@siemens.com \
    --cc=isar-users@googlegroups.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