From: claudius.heine.ext@siemens.com
To: isar-users@googlegroups.com
Cc: Claudius Heine <ch@denx.de>
Subject: [PATCH v2 4/8] meta/classes/buildchroot: add check before each mounting and quotes
Date: Tue, 9 Apr 2019 14:29:11 +0200 [thread overview]
Message-ID: <20190409122915.14249-5-claudius.heine.ext@siemens.com> (raw)
In-Reply-To: <20190409122915.14249-1-claudius.heine.ext@siemens.com>
From: Claudius Heine <ch@denx.de>
Signed-off-by: Claudius Heine <ch@denx.de>
---
meta/classes/buildchroot.bbclass | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/meta/classes/buildchroot.bbclass b/meta/classes/buildchroot.bbclass
index c017b25..1a87bf4 100644
--- a/meta/classes/buildchroot.bbclass
+++ b/meta/classes/buildchroot.bbclass
@@ -25,18 +25,21 @@ buildchroot_do_mounts() {
sudo -s <<'EOSUDO'
( flock 9
set -e
- if ! grep -q ${BUILDCHROOT_DIR}/isar-apt /proc/mounts; then
- mount --bind ${REPO_ISAR_DIR}/${DISTRO} ${BUILDCHROOT_DIR}/isar-apt
- mount --bind ${DL_DIR} ${BUILDCHROOT_DIR}/downloads
- mount --rbind /dev ${BUILDCHROOT_DIR}/dev
- mount --make-rslave ${BUILDCHROOT_DIR}/dev
- mount -t proc none ${BUILDCHROOT_DIR}/proc
- mount --rbind /sys ${BUILDCHROOT_DIR}/sys
- mount --make-rslave ${BUILDCHROOT_DIR}/sys
- fi
+ mountpoint -q '${BUILDCHROOT_DIR}/isar-apt' ||
+ mount --bind '${REPO_ISAR_DIR}/${DISTRO}' '${BUILDCHROOT_DIR}/isar-apt'
+ mountpoint -q '${BUILDCHROOT_DIR}/downloads' ||
+ mount --bind '${DL_DIR}' '${BUILDCHROOT_DIR}/downloads'
+ mountpoint -q '${BUILDCHROOT_DIR}/dev' ||
+ mount --rbind /dev '${BUILDCHROOT_DIR}/dev'
+ mount --make-rslave '${BUILDCHROOT_DIR}/dev'
+ mountpoint -q '${BUILDCHROOT_DIR}/proc' ||
+ mount -t proc none '${BUILDCHROOT_DIR}/proc'
+ mountpoint -q '${BUILDCHROOT_DIR}/sys' ||
+ mount --rbind /sys '${BUILDCHROOT_DIR}/sys'
+ mount --make-rslave '${BUILDCHROOT_DIR}/sys'
# Refresh /etc/resolv.conf at this chance
- cp -L /etc/resolv.conf ${BUILDCHROOT_DIR}/etc
- ) 9>${MOUNT_LOCKFILE}
+ cp -L /etc/resolv.conf '${BUILDCHROOT_DIR}/etc'
+ ) 9>'${MOUNT_LOCKFILE}'
EOSUDO
}
--
2.20.1
next prev parent reply other threads:[~2019-04-09 12:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-09 12:29 [PATCH v2 0/8] Implement ROOTFS postprocess commands claudius.heine.ext
2019-04-09 12:29 ` [PATCH v2 1/8] image.bbclass: make KERNEL_IMAGE & INITRD_IMAGE variable fixed claudius.heine.ext
2019-04-09 12:29 ` [PATCH v2 2/8] image.bbclass: limit `du` to only one file system claudius.heine.ext
2019-04-09 12:29 ` [PATCH v2 3/8] meta/classes/targz-img: limit tarball creation to " claudius.heine.ext
2019-04-09 12:29 ` claudius.heine.ext [this message]
2019-04-09 12:29 ` [PATCH v2 5/8] meta/image classes: refactor task stamps claudius.heine.ext
2019-04-09 12:29 ` [PATCH v2 6/8] meta/classes/*-img: remove 'inherit image' statements claudius.heine.ext
2019-04-09 12:29 ` [PATCH v2 7/8] meta/classes/image*: refactor image pipeline and image.bbclass claudius.heine.ext
2019-04-09 12:29 ` [PATCH v2 8/8] meta/classes/image: implement ROOTFS_POSTPROCESS_COMMAND claudius.heine.ext
2019-04-16 5:05 ` [PATCH v2 0/8] Implement ROOTFS postprocess commands Maxim Yu. Osipov
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=20190409122915.14249-5-claudius.heine.ext@siemens.com \
--to=claudius.heine.ext@siemens.com \
--cc=ch@denx.de \
--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