From: Henning Schild <henning.schild@siemens.com>
To: isar-users@googlegroups.com
Cc: Henning Schild <henning.schild@siemens.com>
Subject: [PATCH] images: base-image: pass ROOTFS_TYPE to fstab generator in configscript
Date: Wed, 28 Feb 2018 17:07:46 +0100 [thread overview]
Message-ID: <20180228160746.5528-1-henning.schild@siemens.com> (raw)
When not using ext4-img the hardcoded /etc/fstab is actually wrong. To
allow poeple to implement their own imager classes, allow to control the
type.
Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
meta-isar/recipes-core/images/files/debian-configscript.sh | 3 ++-
meta-isar/recipes-core/images/files/raspbian-configscript.sh | 3 ++-
meta-isar/recipes-core/images/isar-image-base.bb | 4 ++--
meta/classes/ext4-img.bbclass | 2 ++
4 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/meta-isar/recipes-core/images/files/debian-configscript.sh b/meta-isar/recipes-core/images/files/debian-configscript.sh
index 33b2b53..f2fa2d9 100755
--- a/meta-isar/recipes-core/images/files/debian-configscript.sh
+++ b/meta-isar/recipes-core/images/files/debian-configscript.sh
@@ -8,6 +8,7 @@ set -e
readonly MACHINE_SERIAL="$1"
readonly BAUDRATE_TTY="$2"
readonly ROOTFS_DEV="$3"
+readonly ROOTFS_TYPE="$4"
cat >> /etc/default/locale << EOF
LANG=en_US.UTF-8
@@ -51,7 +52,7 @@ grep "root:\*:" /etc/shadow && echo "root:root" | chpasswd
cat > /etc/fstab << EOF
# Begin /etc/fstab
-/dev/$ROOTFS_DEV / ext4 defaults 1 1
+/dev/$ROOTFS_DEV / $ROOTFS_TYPE defaults 1 1
proc /proc proc nosuid,noexec,nodev 0 0
sysfs /sys sysfs nosuid,noexec,nodev 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
diff --git a/meta-isar/recipes-core/images/files/raspbian-configscript.sh b/meta-isar/recipes-core/images/files/raspbian-configscript.sh
index 4cb004b..1a85c40 100644
--- a/meta-isar/recipes-core/images/files/raspbian-configscript.sh
+++ b/meta-isar/recipes-core/images/files/raspbian-configscript.sh
@@ -8,6 +8,7 @@ set -e
readonly MACHINE_SERIAL="$1"
readonly BAUDRATE_TTY="$2"
readonly ROOTFS_DEV="$3"
+readonly ROOTFS_TYPE="$4"
cat >> /etc/default/locale << EOF
LANG=en_US.UTF-8
@@ -55,7 +56,7 @@ grep "root:\*:" /etc/shadow && echo "root:root" | chpasswd
cat > /etc/fstab << EOF
# Begin /etc/fstab
-/dev/$ROOTFS_DEV / ext4 defaults 1 1
+/dev/$ROOTFS_DEV / $ROOTFS_TYPE defaults 1 1
proc /proc proc nosuid,noexec,nodev 0 0
sysfs /sys sysfs nosuid,noexec,nodev 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
diff --git a/meta-isar/recipes-core/images/isar-image-base.bb b/meta-isar/recipes-core/images/isar-image-base.bb
index b444258..80cb666 100644
--- a/meta-isar/recipes-core/images/isar-image-base.bb
+++ b/meta-isar/recipes-core/images/isar-image-base.bb
@@ -69,8 +69,8 @@ do_rootfs() {
sudo -E multistrap -a ${DISTRO_ARCH} -d "${IMAGE_ROOTFS}" -f "${WORKDIR}/multistrap.conf"
# Configure root filesystem
- sudo chroot ${IMAGE_ROOTFS} /${DISTRO_CONFIG_SCRIPT} ${MACHINE_SERIAL} ${BAUDRATE_TTY} \
- ${ROOTFS_DEV}
+ sudo chroot ${IMAGE_ROOTFS} /${DISTRO_CONFIG_SCRIPT} ${MACHINE_SERIAL} \
+ ${BAUDRATE_TTY} ${ROOTFS_DEV} ${ROOTFS_TYPE}
sudo rm "${IMAGE_ROOTFS}/${DISTRO_CONFIG_SCRIPT}"
sudo umount ${IMAGE_ROOTFS}/proc 2>/dev/null || true
diff --git a/meta/classes/ext4-img.bbclass b/meta/classes/ext4-img.bbclass
index 83cb137..8a978e6 100644
--- a/meta/classes/ext4-img.bbclass
+++ b/meta/classes/ext4-img.bbclass
@@ -4,6 +4,8 @@
# Extra space for rootfs in MB
ROOTFS_EXTRA ?= "64"
+ROOTFS_TYPE = "ext4"
+
EXT4_IMAGE_FILE = "${DEPLOY_DIR_IMAGE}/${PN}-${DISTRO}-${MACHINE}.ext4.img"
do_ext4_image[stamp-extra-info] = "${DISTRO}-${MACHINE}"
--
2.16.1
next reply other threads:[~2018-02-28 16:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-28 16:07 Henning Schild [this message]
2018-03-02 12:27 ` Jan Kiszka
2018-03-05 9:59 ` 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=20180228160746.5528-1-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