From: Henning Schild <henning.schild@siemens.com>
To: Alexander Smirnov <asmirnov@ilbers.de>
Cc: <isar-users@googlegroups.com>
Subject: Re: [PATCH v2 1/5] image: Unify path to image rootfs
Date: Fri, 8 Sep 2017 18:00:27 +0200 [thread overview]
Message-ID: <20170908180027.5c3c04e4@md1em3qc> (raw)
In-Reply-To: <20170908155606.7654-2-asmirnov@ilbers.de>
Am Fri, 8 Sep 2017 18:56:02 +0300
schrieb Alexander Smirnov <asmirnov@ilbers.de>:
> Use dedicated variable to point to generated image rooot filesystem.
root
Henning
> Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
> ---
> meta-isar/classes/rpi-sdimg.bbclass | 2 +-
> meta-isar/recipes-core/images/isar-image-base.bb | 8 +++-----
> meta/classes/ext4-img.bbclass | 8 ++++----
> meta/classes/image.bbclass | 9 +++++----
> 4 files changed, 13 insertions(+), 14 deletions(-)
>
> diff --git a/meta-isar/classes/rpi-sdimg.bbclass
> b/meta-isar/classes/rpi-sdimg.bbclass index 2614c41..91b09cd 100644
> --- a/meta-isar/classes/rpi-sdimg.bbclass
> +++ b/meta-isar/classes/rpi-sdimg.bbclass
> @@ -47,7 +47,7 @@ do_rpi_sdimg () {
> BOOT_BLOCKS=$(LC_ALL=C parted -s ${SDIMG} unit b print | awk '/
> 1 / { print substr($4, 1, length($4 -1)) / 512 /2 }') rm -f
> ${WORKDIR}/boot.img mkfs.vfat -n "${BOOTDD_VOLUME_ID}" -S 512 -C
> ${WORKDIR}/boot.img $BOOT_BLOCKS
> - mcopy -i ${WORKDIR}/boot.img -s ${S}/boot/* ::/
> + mcopy -i ${WORKDIR}/boot.img -s ${IMAGE_ROOTFS}/boot/* ::/
>
> # Burn Partitions
> dd if=${WORKDIR}/boot.img of=${SDIMG} conv=notrunc seek=1
> bs=$(expr ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync diff
> --git a/meta-isar/recipes-core/images/isar-image-base.bb
> b/meta-isar/recipes-core/images/isar-image-base.bb index
> b679d97..94cbc9e 100644 ---
> a/meta-isar/recipes-core/images/isar-image-base.bb +++
> b/meta-isar/recipes-core/images/isar-image-base.bb @@ -18,8 +18,6 @@
> IMAGE_PREINSTALL += "apt \ dbus"
> WORKDIR = "${TMPDIR}/work/${PN}/${MACHINE}/${DISTRO}"
> -S = "${WORKDIR}/rootfs"
> -IMAGE_ROOTFS = "${S}"
>
> do_rootfs[stamp-extra-info] = "${MACHINE}-${DISTRO}"
>
> @@ -46,12 +44,12 @@ do_rootfs() {
> cd ${TOPDIR}
>
> # Create root filesystem
> - sudo multistrap -a ${DISTRO_ARCH} -d "${S}" -f
> "${WORKDIR}/multistrap.conf" || true
> + sudo multistrap -a ${DISTRO_ARCH} -d "${IMAGE_ROOTFS}" -f
> "${WORKDIR}/multistrap.conf" || true
> # Configure root filesystem
> - sudo chroot ${S} /configscript.sh ${MACHINE_SERIAL}
> ${BAUDRATE_TTY} \
> + sudo chroot ${IMAGE_ROOTFS} /configscript.sh ${MACHINE_SERIAL}
> ${BAUDRATE_TTY} \ ${ROOTFS_DEV}
> - sudo rm ${S}/configscript.sh
> + sudo rm ${IMAGE_ROOTFS}/configscript.sh
> }
>
> addtask rootfs before do_populate
> diff --git a/meta/classes/ext4-img.bbclass
> b/meta/classes/ext4-img.bbclass index 8588626..f493037 100644
> --- a/meta/classes/ext4-img.bbclass
> +++ b/meta/classes/ext4-img.bbclass
> @@ -14,23 +14,23 @@ do_ext4_image() {
>
> rm -f ${EXT4_IMAGE_FILE}
>
> - ROOTFS_SIZE=`sudo du -sm ${S} | awk '{print $1 +
> ${ROOTFS_EXTRA};}'`
> + ROOTFS_SIZE=`sudo du -sm ${IMAGE_ROOTFS} | awk '{print $1 +
> ${ROOTFS_EXTRA};}'` dd if=/dev/zero of=${EXT4_IMAGE_FILE} bs=1M
> count=${ROOTFS_SIZE}
> sudo mkfs.ext4 -F ${EXT4_IMAGE_FILE}
>
> mkdir -p ${WORKDIR}/mnt
> sudo mount -o loop ${EXT4_IMAGE_FILE} ${WORKDIR}/mnt
> - sudo cp -r ${S}/* ${WORKDIR}/mnt
> + sudo cp -r ${IMAGE_ROOTFS}/* ${WORKDIR}/mnt
> sudo umount ${WORKDIR}/mnt
> rm -r ${WORKDIR}/mnt
>
> if [ -n "${KERNEL_IMAGE}" ]; then
> - cp ${S}/boot/${KERNEL_IMAGE} ${DEPLOY_DIR_IMAGE}
> + cp ${IMAGE_ROOTFS}/boot/${KERNEL_IMAGE} ${DEPLOY_DIR_IMAGE}
> fi
>
> if [ -n "${INITRD_IMAGE}" ]; then
> - cp ${S}/boot/${INITRD_IMAGE} ${DEPLOY_DIR_IMAGE}
> + cp ${IMAGE_ROOTFS}/boot/${INITRD_IMAGE} ${DEPLOY_DIR_IMAGE}
> fi
> }
>
> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> index a7f0d74..dff2705 100644
> --- a/meta/classes/image.bbclass
> +++ b/meta/classes/image.bbclass
> @@ -6,6 +6,7 @@ INITRD_IMAGE ?= ""
>
> IMAGE_INSTALL ?= ""
> IMAGE_TYPE ?= "ext4-img"
> +IMAGE_ROOTFS = "${WORKDIR}/rootfs"
>
> inherit ${IMAGE_TYPE}
>
> @@ -14,15 +15,15 @@ do_populate[stamp-extra-info] =
> "${MACHINE}-${DISTRO}" # Install Debian packages, that were built
> from sources do_populate() {
> if [ -n "${IMAGE_INSTALL}" ]; then
> - sudo mkdir -p ${S}/deb
> + sudo mkdir -p ${IMAGE_ROOTFS}/deb
>
> for p in ${IMAGE_INSTALL}; do
> - sudo cp ${DEPLOY_DIR_DEB}/${p}_*.deb ${S}/deb
> + sudo cp ${DEPLOY_DIR_DEB}/${p}_*.deb ${IMAGE_ROOTFS}/deb
> done
>
> - sudo chroot ${S} /usr/bin/dpkg -i -R /deb
> + sudo chroot ${IMAGE_ROOTFS} /usr/bin/dpkg -i -R /deb
>
> - sudo rm -rf ${S}/deb
> + sudo rm -rf ${IMAGE_ROOTFS}/deb
> fi
> }
>
next prev parent reply other threads:[~2017-09-08 16:00 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-08 15:56 [PATCH v2 0/5] Unify work space for packages Alexander Smirnov
2017-09-08 15:56 ` [PATCH v2 1/5] image: Unify path to image rootfs Alexander Smirnov
2017-09-08 16:00 ` Henning Schild [this message]
2017-09-08 15:56 ` [PATCH v2 2/5] isar: Change build folders tree Alexander Smirnov
2017-09-08 16:04 ` Henning Schild
2017-09-08 15:56 ` [PATCH v2 3/5] stamps: Name stamps canonicaly and unified Alexander Smirnov
2017-09-08 15:56 ` [PATCH v2 4/5] image: Name image " Alexander Smirnov
2017-09-08 15:56 ` [PATCH v2 5/5] class/dpkg: Unify workplace for packages Alexander Smirnov
2017-09-11 16:47 ` Henning Schild
2017-09-11 18:10 ` Alexander Smirnov
2017-09-08 16:06 ` [PATCH v2 0/5] Unify work space " Henning Schild
2017-09-08 16:10 ` Alexander Smirnov
2017-09-08 16:12 ` Alexander Smirnov
2017-09-08 16:15 ` Henning Schild
2017-09-11 7:36 ` Alexander Smirnov
2017-09-11 8:00 ` Henning Schild
2017-09-11 8:19 ` 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=20170908180027.5c3c04e4@md1em3qc \
--to=henning.schild@siemens.com \
--cc=asmirnov@ilbers.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