From: claudius.heine.ext@siemens.com
To: isar-users@googlegroups.com
Cc: Claudius Heine <ch@denx.de>
Subject: [PATCH 1/1] meta/ext4-img: refactor to fit current image creation methods
Date: Mon, 18 Feb 2019 14:04:29 +0100 [thread overview]
Message-ID: <20190218130429.9881-2-claudius.heine.ext@siemens.com> (raw)
In-Reply-To: <20190218130429.9881-1-claudius.heine.ext@siemens.com>
From: Claudius Heine <ch@denx.de>
EXT4_IMAGE_FILE does no longer contain the full path to the ext4 image
in the deploy directory.
Signed-off-by: Claudius Heine <ch@denx.de>
---
meta-isar/classes/rpi-sdimg.bbclass | 2 +-
meta/classes/ext4-img.bbclass | 31 +++++++++++------------------
2 files changed, 13 insertions(+), 20 deletions(-)
diff --git a/meta-isar/classes/rpi-sdimg.bbclass b/meta-isar/classes/rpi-sdimg.bbclass
index 91b09cd..4e5d170 100644
--- a/meta-isar/classes/rpi-sdimg.bbclass
+++ b/meta-isar/classes/rpi-sdimg.bbclass
@@ -15,7 +15,7 @@ BOOT_SPACE ?= "40960"
IMAGE_ROOTFS_ALIGNMENT = "4096"
SDIMG = "${DEPLOY_DIR_IMAGE}/${PN}.rpi-sdimg"
-SDIMG_ROOTFS = "${EXT4_IMAGE_FILE}"
+SDIMG_ROOTFS = "${DEPLOY_DIR_IMAGE}/${EXT4_IMAGE_FILE}"
do_rpi_sdimg () {
# Align partitions
diff --git a/meta/classes/ext4-img.bbclass b/meta/classes/ext4-img.bbclass
index 29e5f77..2620de9 100644
--- a/meta/classes/ext4-img.bbclass
+++ b/meta/classes/ext4-img.bbclass
@@ -1,30 +1,23 @@
# This software is a part of ISAR.
# Copyright (C) 2015-2017 ilbers GmbH
-EXT4_IMAGE_FILE = "${DEPLOY_DIR_IMAGE}/${IMAGE_FULLNAME}.ext4.img"
+EXT4_IMAGE_FILE = "${IMAGE_FULLNAME}.ext4.img"
+
+IMAGER_INSTALL += "e2fsprogs"
do_ext4_image[stamp-extra-info] = "${DISTRO}-${MACHINE}"
# Generate ext4 filesystem image
do_ext4_image() {
- rm -f ${EXT4_IMAGE_FILE}
-
- dd if=/dev/zero of=${EXT4_IMAGE_FILE} bs=1k count=${ROOTFS_SIZE}
-
- sudo mkfs.ext4 -F ${EXT4_IMAGE_FILE}
-
- mkdir -p ${WORKDIR}/mnt
- sudo mount -o loop ${EXT4_IMAGE_FILE} ${WORKDIR}/mnt
- _do_ext4_image_cleanup() {
- ret=$?
- sudo umount ${WORKDIR}/mnt 2>/dev/null || true
- sudo rmdir ${WORKDIR}/mnt 2>/dev/null || true
- (exit $ret) || bb_exit_handler
- }
- trap '_do_ext4_image_cleanup' EXIT
- sudo cp -r ${IMAGE_ROOTFS}/* ${WORKDIR}/mnt
- _do_ext4_image_cleanup
+ rm -f '${DEPLOY_DIR_IMAGE}/${EXT4_IMAGE_FILE}'
+
+ truncate -s ${ROOTFS_SIZE}K '${DEPLOY_DIR_IMAGE}/${EXT4_IMAGE_FILE}'
+
+ image_do_mounts
+
+ sudo chroot ${BUILDCHROOT_DIR} /sbin/mke2fs ${MKE2FS_ARGS} \
+ -F -d '${PP_ROOTFS}' '${PP_DEPLOY}/${EXT4_IMAGE_FILE}'
}
-addtask ext4_image before do_build after do_copy_boot_files
+addtask ext4_image before do_build after do_copy_boot_files do_install_imager_deps
do_ext4_image[prefuncs] = 'set_image_size'
--
2.20.1
next prev parent reply other threads:[~2019-02-18 13:04 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-18 13:04 [PATCH 0/1] Refactor ext4 image class claudius.heine.ext
2019-02-18 13:04 ` claudius.heine.ext [this message]
2019-02-19 9:25 ` [PATCH 1/1] meta/ext4-img: refactor to fit current image creation methods Henning Schild
2019-02-26 11:35 ` cedric_hombourger
2019-02-26 11:56 ` Jan Kiszka
2019-02-26 12:12 ` Henning Schild
2019-02-26 12:24 ` Hombourger, Cedric
2019-03-28 9:58 ` Maxim Yu. Osipov
2019-03-28 12:02 ` Hombourger, Cedric
2019-03-29 7:55 ` Adler, Michael
2019-03-29 8:45 ` Maxim Yu. Osipov
2019-02-27 9:28 ` [PATCH 0/1] Refactor ext4 image class Maxim Yu. Osipov
2019-03-28 12:40 ` 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=20190218130429.9881-2-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