From: Henning Schild <henning.schild@siemens.com>
To: isar-users@googlegroups.com
Cc: Henning Schild <henning.schild@siemens.com>
Subject: [PATCH 2/3] meta-isar: images: mount /proc around multistrap and configscript
Date: Mon, 9 Oct 2017 16:59:41 +0200 [thread overview]
Message-ID: <84fe6e7b77c835a297accaa6e376d7f84ba8e5c6.1507561035.git.henning.schild@siemens.com> (raw)
In-Reply-To: <cover.1507561035.git.henning.schild@siemens.com>
In-Reply-To: <cover.1507561035.git.henning.schild@siemens.com>
There are packages that expect /proc to be mounted in their
intall-hooks. So we need proc mounted for multistrap. /proc got mounted
in configurescript which is now not needed anymore.
An example for a package that needs /proc mounted is openjdk-8-jre-headless
Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
meta-isar/recipes-core/images/files/debian-configscript.sh | 2 --
meta-isar/recipes-core/images/files/raspbian-configscript.sh | 2 --
meta-isar/recipes-core/images/isar-image-base.bb | 4 ++++
meta/recipes-devtools/buildchroot/buildchroot.bb | 4 ++++
meta/recipes-devtools/buildchroot/files/configscript.sh | 2 --
5 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/meta-isar/recipes-core/images/files/debian-configscript.sh b/meta-isar/recipes-core/images/files/debian-configscript.sh
index 698277c..974ad44 100644
--- a/meta-isar/recipes-core/images/files/debian-configscript.sh
+++ b/meta-isar/recipes-core/images/files/debian-configscript.sh
@@ -45,9 +45,7 @@ export LC_ALL=C LANGUAGE=C LANG=C
# Configuring packages
dpkg --configure -a
-mount proc -t proc /proc
dpkg --configure -a
-umount /proc
# set the root password if that has not been done before
grep "root:\*:" /etc/shadow && echo "root:root" | chpasswd
diff --git a/meta-isar/recipes-core/images/files/raspbian-configscript.sh b/meta-isar/recipes-core/images/files/raspbian-configscript.sh
index 61a1aa5..2f5ad40 100644
--- a/meta-isar/recipes-core/images/files/raspbian-configscript.sh
+++ b/meta-isar/recipes-core/images/files/raspbian-configscript.sh
@@ -49,9 +49,7 @@ rm /var/lib/dpkg/info/raspberrypi-bootloader-nokernel.postinst
# Configuring packages
dpkg --configure -a
-mount proc -t proc /proc
dpkg --configure -a
-umount /proc
# set the root password if that has not been done before
grep "root:\*:" /etc/shadow && echo "root:root" | chpasswd
diff --git a/meta-isar/recipes-core/images/isar-image-base.bb b/meta-isar/recipes-core/images/isar-image-base.bb
index f4b0125..cc0423d 100644
--- a/meta-isar/recipes-core/images/isar-image-base.bb
+++ b/meta-isar/recipes-core/images/isar-image-base.bb
@@ -48,6 +48,9 @@ do_rootfs() {
-e 's|##DIR_HOOKS##|./'"$WORKDIR_REL"'/hooks_multistrap|g' \
"${WORKDIR}/multistrap.conf.in" > "${WORKDIR}/multistrap.conf"
+ install -d -m 555 ${IMAGE_ROOTFS}/proc
+ sudo mount -t proc none ${IMAGE_ROOTFS}/proc
+
# Create root filesystem
sudo multistrap -a ${DISTRO_ARCH} -d "${IMAGE_ROOTFS}" -f "${WORKDIR}/multistrap.conf" || true
@@ -55,6 +58,7 @@ do_rootfs() {
sudo chroot ${IMAGE_ROOTFS} /${DISTRO_CONFIG_SCRIPT} ${MACHINE_SERIAL} ${BAUDRATE_TTY} \
${ROOTFS_DEV}
sudo rm "${IMAGE_ROOTFS}/${DISTRO_CONFIG_SCRIPT}"
+ sudo umount ${IMAGE_ROOTFS}/proc
}
addtask rootfs before do_populate after do_unpack
diff --git a/meta/recipes-devtools/buildchroot/buildchroot.bb b/meta/recipes-devtools/buildchroot/buildchroot.bb
index a5a1896..02e6d39 100644
--- a/meta/recipes-devtools/buildchroot/buildchroot.bb
+++ b/meta/recipes-devtools/buildchroot/buildchroot.bb
@@ -51,6 +51,9 @@ do_build() {
-e 's|##DIR_HOOKS##|./'"$WORKDIR_REL"'/hooks_multistrap|g' \
"${WORKDIR}/multistrap.conf.in" > "${WORKDIR}/multistrap.conf"
+ install -d -m 555 ${IMAGE_ROOTFS}/proc
+ sudo mount -t proc none ${IMAGE_ROOTFS}/proc
+
# Create root filesystem
sudo multistrap -a ${DISTRO_ARCH} -d "${BUILDCHROOT_DIR}" -f "${WORKDIR}/multistrap.conf" || true
@@ -59,4 +62,5 @@ do_build() {
# Configure root filesystem
sudo chroot ${BUILDCHROOT_DIR} /configscript.sh
+ sudo umount ${IMAGE_ROOTFS}/proc
}
diff --git a/meta/recipes-devtools/buildchroot/files/configscript.sh b/meta/recipes-devtools/buildchroot/files/configscript.sh
index 5080ae1..96166e0 100644
--- a/meta/recipes-devtools/buildchroot/files/configscript.sh
+++ b/meta/recipes-devtools/buildchroot/files/configscript.sh
@@ -44,8 +44,6 @@ mount -t devtmpfs -o mode=0755,nosuid devtmpfs /dev
#configuring packages
dpkg --configure -a
-mount proc -t proc /proc
dpkg --configure -a
apt-get update
-umount /proc
umount /dev
--
2.13.6
next prev parent reply other threads:[~2017-10-09 14:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-09 14:59 [PATCH 0/3] a few changes small changes Henning Schild
2017-10-09 14:59 ` [PATCH 1/3] image: set the root password conditionally Henning Schild
2017-10-18 9:58 ` [PATCHv2] " Henning Schild
2017-10-19 12:18 ` [PATCHv3] " Henning Schild
2017-10-19 19:36 ` Alexander Smirnov
2017-10-09 14:59 ` Henning Schild [this message]
2017-10-09 14:59 ` [PATCH 3/3] configscript: remove duplicates of 'dpkg --configure' Henning Schild
2017-10-16 18:47 ` [PATCH 0/3] a few changes small changes Alexander Smirnov
2017-10-18 11:11 ` 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=84fe6e7b77c835a297accaa6e376d7f84ba8e5c6.1507561035.git.henning.schild@siemens.com \
--to=henning.schild@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