From: Henning Schild <henning.schild@siemens.com>
To: "[ext] claudius.heine.ext@siemens.com" <claudius.heine.ext@siemens.com>
Cc: <isar-users@googlegroups.com>, Claudius Heine <ch@denx.de>
Subject: Re: [PATCH 1/1] meta-isar/isar-image-base and meta/buildchroot: Use fetcher for files
Date: Thu, 21 Sep 2017 11:09:43 +0200 [thread overview]
Message-ID: <20170921110943.10889f11@md1em3qc> (raw)
In-Reply-To: <20170920104645.10475-2-claudius.heine.ext@siemens.com>
Am Wed, 20 Sep 2017 12:46:45 +0200
schrieb "[ext] claudius.heine.ext@siemens.com"
<claudius.heine.ext@siemens.com>:
> From: Claudius Heine <ch@denx.de>
>
> Issue:
> Copying from the recipe directory is currently done by copying from it
> using the "THISDIR" variable. This variable points to the wrong
> directory when recipes are 'required' by other recipes.
Looks good, that will enable layering where i still have a few local
patches. But that one is better than mine.
> Change:
> Use the bitbake fetchers for these files.
>
> Impact:
> No negative impact known.
>
> Signed-off-by: Claudius Heine <ch@denx.de>
> ---
> meta-isar/recipes-core/images/isar-image-base.bb | 41
> +++++++++++++-----------
> meta/recipes-devtools/buildchroot/buildchroot.bb | 34
> +++++++++++--------- 2 files changed, 40 insertions(+), 35
> deletions(-)
>
> diff --git a/meta-isar/recipes-core/images/isar-image-base.bb
> b/meta-isar/recipes-core/images/isar-image-base.bb index
> 5cb8b1c..f4b0125 100644 ---
> a/meta-isar/recipes-core/images/isar-image-base.bb +++
> b/meta-isar/recipes-core/images/isar-image-base.bb @@ -8,6 +8,12 @@
> DESCRIPTION = "Multistrap target filesystem" LICENSE = "gpl-2.0"
> LIC_FILES_CHKSUM =
> "file://${LAYERDIR_isar}/licenses/COPYING.GPLv2;md5=751419260aa954499f7abaabaa882bbe"
> +FILESPATH =. "${LAYERDIR_isar}/recipes-core/images/files:"
> +SRC_URI = "file://multistrap.conf.in \
> + file://${DISTRO_CONFIG_SCRIPT} \
> + file://setup.sh \
> + file://download_dev-random"
> +
> PV = "1.0"
>
> inherit image
> @@ -20,38 +26,35 @@ IMAGE_PREINSTALL += "apt \
> WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}"
>
> do_rootfs[stamp-extra-info] = "${MACHINE}-${DISTRO}"
> +do_rootfs[dirs] = "${WORKDIR}/hooks_multistrap"
I think moving from mkdir to this could be a seperate patch. Same for
buildchroot. The rest looks good.
Henning
> do_rootfs() {
> - install -d -m 755 ${WORKDIR}/hooks_multistrap
> -
> - # Copy config file
> - install -m 644 ${THISDIR}/files/multistrap.conf.in
> ${WORKDIR}/multistrap.conf
> - install -m 755 ${THISDIR}/files/${DISTRO_CONFIG_SCRIPT}
> ${WORKDIR}/configscript.sh
> - install -m 755 ${THISDIR}/files/setup.sh ${WORKDIR}
> - install -m 755 ${THISDIR}/files/download_dev-random
> ${WORKDIR}/hooks_multistrap/
> + chmod +x "${WORKDIR}/${DISTRO_CONFIG_SCRIPT}"
> + chmod +x "${WORKDIR}/setup.sh"
> + install -m 755 "${WORKDIR}/download_dev-random"
> "${WORKDIR}/hooks_multistrap/"
> # Multistrap accepts only relative path in configuration files,
> so get it: cd ${TOPDIR}
> WORKDIR_REL=${@ os.path.relpath(d.getVar("WORKDIR", True))}
>
> # Adjust multistrap config
> - sed -i -e 's|##IMAGE_PREINSTALL##|${IMAGE_PREINSTALL}|g' \
> - -e 's|##DISTRO##|${DISTRO}|g' \
> - -e 's|##DISTRO_APT_SOURCE##|${DISTRO_APT_SOURCE}|g' \
> - -e 's|##DISTRO_SUITE##|${DISTRO_SUITE}|g' \
> - -e 's|##DISTRO_COMPONENTS##|${DISTRO_COMPONENTS}|g' \
> - -e
> 's|##CONFIG_SCRIPT##|./'"$WORKDIR_REL"'/configscript.sh|g' \
> - -e 's|##SETUP_SCRIPT##|./'"$WORKDIR_REL"'/setup.sh|g' \
> - -e
> 's|##DIR_HOOKS##|./'"$WORKDIR_REL"'/hooks_multistrap|g' \
> - ${WORKDIR}/multistrap.conf
> + sed -e 's|##IMAGE_PREINSTALL##|${IMAGE_PREINSTALL}|g' \
> + -e 's|##DISTRO##|${DISTRO}|g' \
> + -e 's|##DISTRO_APT_SOURCE##|${DISTRO_APT_SOURCE}|g' \
> + -e 's|##DISTRO_SUITE##|${DISTRO_SUITE}|g' \
> + -e 's|##DISTRO_COMPONENTS##|${DISTRO_COMPONENTS}|g' \
> + -e
> 's|##CONFIG_SCRIPT##|./'"$WORKDIR_REL"'/${DISTRO_CONFIG_SCRIPT}|g' \
> + -e 's|##SETUP_SCRIPT##|./'"$WORKDIR_REL"'/setup.sh|g' \
> + -e 's|##DIR_HOOKS##|./'"$WORKDIR_REL"'/hooks_multistrap|g' \
> + "${WORKDIR}/multistrap.conf.in" >
> "${WORKDIR}/multistrap.conf"
> # Create root filesystem
> sudo multistrap -a ${DISTRO_ARCH} -d "${IMAGE_ROOTFS}" -f
> "${WORKDIR}/multistrap.conf" || true
> # Configure root filesystem
> - sudo chroot ${IMAGE_ROOTFS} /configscript.sh ${MACHINE_SERIAL}
> ${BAUDRATE_TTY} \
> + sudo chroot ${IMAGE_ROOTFS} /${DISTRO_CONFIG_SCRIPT}
> ${MACHINE_SERIAL} ${BAUDRATE_TTY} \ ${ROOTFS_DEV}
> - sudo rm ${IMAGE_ROOTFS}/configscript.sh
> + sudo rm "${IMAGE_ROOTFS}/${DISTRO_CONFIG_SCRIPT}"
> }
>
> -addtask rootfs before do_populate
> +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
> 30039f2..a5a1896 100644 ---
> a/meta/recipes-devtools/buildchroot/buildchroot.bb +++
> b/meta/recipes-devtools/buildchroot/buildchroot.bb @@ -8,6 +8,11 @@
> DESCRIPTION = "Multistrap development filesystem" LICENSE = "gpl-2.0"
> LIC_FILES_CHKSUM =
> "file://${LAYERDIR_isar}/licenses/COPYING.GPLv2;md5=751419260aa954499f7abaabaa882bbe"
> +FILESPATH =. "${LAYERDIR_core}/recipes-devtools/buildchroot/files:"
> +SRC_URI = "file://multistrap.conf.in \
> + file://configscript.sh \
> + file://setup.sh \
> + file://download_dev-random"
> PV = "1.0"
>
> BUILDCHROOT_PREINSTALL ?= "gcc \
> @@ -24,30 +29,27 @@ BUILDCHROOT_PREINSTALL ?= "gcc \
> WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}"
>
> do_build[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
> +do_build[dirs] = "${WORKDIR}/hooks_multistrap"
>
> do_build() {
> - install -d -m 755 ${WORKDIR}/hooks_multistrap
> -
> - # Copy config files
> - install -m 644 ${THISDIR}/files/multistrap.conf.in
> ${WORKDIR}/multistrap.conf
> - install -m 755 ${THISDIR}/files/configscript.sh ${WORKDIR}
> - install -m 755 ${THISDIR}/files/setup.sh ${WORKDIR}
> - install -m 755 ${THISDIR}/files/download_dev-random
> ${WORKDIR}/hooks_multistrap/
> + chmod +x "${WORKDIR}/setup.sh"
> + chmod +x "${WORKDIR}/configscript.sh"
> + install -m 755 "${WORKDIR}/download_dev-random"
> "${WORKDIR}/hooks_multistrap/"
> # Multistrap accepts only relative path in configuration files,
> so get it: cd ${TOPDIR}
> WORKDIR_REL=${@ os.path.relpath(d.getVar("WORKDIR", True))}
>
> # Adjust multistrap config
> - sed -i -e
> 's|##BUILDCHROOT_PREINSTALL##|${BUILDCHROOT_PREINSTALL}|g' \
> - -e 's|##DISTRO##|${DISTRO}|g' \
> - -e 's|##DISTRO_APT_SOURCE##|${DISTRO_APT_SOURCE}|g' \
> - -e 's|##DISTRO_SUITE##|${DISTRO_SUITE}|g' \
> - -e 's|##DISTRO_COMPONENTS##|${DISTRO_COMPONENTS}|g' \
> - -e
> 's|##CONFIG_SCRIPT##|./'"$WORKDIR_REL"'/configscript.sh|g' \
> - -e 's|##SETUP_SCRIPT##|./'"$WORKDIR_REL"'/setup.sh|g' \
> - -e
> 's|##DIR_HOOKS##|./'"$WORKDIR_REL"'/hooks_multistrap|g' \
> - ${WORKDIR}/multistrap.conf
> + sed -e
> 's|##BUILDCHROOT_PREINSTALL##|${BUILDCHROOT_PREINSTALL}|g' \
> + -e 's|##DISTRO##|${DISTRO}|g' \
> + -e 's|##DISTRO_APT_SOURCE##|${DISTRO_APT_SOURCE}|g' \
> + -e 's|##DISTRO_SUITE##|${DISTRO_SUITE}|g' \
> + -e 's|##DISTRO_COMPONENTS##|${DISTRO_COMPONENTS}|g' \
> + -e
> 's|##CONFIG_SCRIPT##|./'"$WORKDIR_REL"'/configscript.sh|g' \
> + -e 's|##SETUP_SCRIPT##|./'"$WORKDIR_REL"'/setup.sh|g' \
> + -e 's|##DIR_HOOKS##|./'"$WORKDIR_REL"'/hooks_multistrap|g' \
> + "${WORKDIR}/multistrap.conf.in" >
> "${WORKDIR}/multistrap.conf"
> # Create root filesystem
> sudo multistrap -a ${DISTRO_ARCH} -d "${BUILDCHROOT_DIR}" -f
> "${WORKDIR}/multistrap.conf" || true
prev parent reply other threads:[~2017-09-21 9:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-20 10:46 [PATCH 0/1] Use fetcher for images claudius.heine.ext
2017-09-20 10:46 ` [PATCH 1/1] meta-isar/isar-image-base and meta/buildchroot: Use fetcher for files claudius.heine.ext
2017-09-21 9:09 ` Henning Schild [this message]
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=20170921110943.10889f11@md1em3qc \
--to=henning.schild@siemens.com \
--cc=ch@denx.de \
--cc=claudius.heine.ext@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