From: Henning Schild <henning.schild@siemens.com>
To: "Maxim Yu. Osipov" <mosipov@ilbers.de>
Cc: <isar-users@googlegroups.com>
Subject: Re: [RFC PATCH 2/6] isar-debootstrap: split into host and target recipes
Date: Thu, 14 Jun 2018 10:59:56 +0200 [thread overview]
Message-ID: <20180614105956.3f5e6eff@md1pvb1c.ad001.siemens.net> (raw)
In-Reply-To: <20180613135829.3151-3-mosipov@ilbers.de>
Am Wed, 13 Jun 2018 15:58:25 +0200
schrieb "Maxim Yu. Osipov" <mosipov@ilbers.de>:
> From: Alexander Smirnov <asmirnov@ilbers.de>
>
> This is required for ISAR SDK root filesystem development
> to split isar-bootstrap for target platform and host (SDK).
>
> Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
> Signed-off-by: Maxim Yu. Osipov <mosipov@
> ---
> meta-isar/recipes-core/images/isar-image-base.bb | 2 +-
> meta/classes/image.bbclass | 2 +-
> meta/classes/isar-bootstrap-helper.bbclass | 20
> +++++++++++--- .../isar-bootstrap/isar-bootstrap-host.bb |
> 31
> +++++++++++++++++++++ .../isar-bootstrap/isar-bootstrap-target.bb
> | 32 ++++++++++++++++++++++ .../{isar-bootstrap.bb =>
> isar-bootstrap.inc} | 24 ----------------
> meta/recipes-devtools/buildchroot/buildchroot.bb | 4 +-- 7 files
> changed, 83 insertions(+), 32 deletions(-) create mode 100644
> meta/recipes-core/isar-bootstrap/isar-bootstrap-host.bb create mode
> 100644 meta/recipes-core/isar-bootstrap/isar-bootstrap-target.bb
> rename meta/recipes-core/isar-bootstrap/{isar-bootstrap.bb =>
> isar-bootstrap.inc} (89%)
>
> diff --git a/meta-isar/recipes-core/images/isar-image-base.bb
> b/meta-isar/recipes-core/images/isar-image-base.bb index
> 6cdc6b2..947f4fc 100644 ---
> a/meta-isar/recipes-core/images/isar-image-base.bb +++
> b/meta-isar/recipes-core/images/isar-image-base.bb @@ -40,7 +40,7 @@
> devtmpfs /dev devtmpfs
> mode=0755,nosuid 0 0 # End /etc/fstab EOF
>
> - setup_root_file_system --clean --fstab "${WORKDIR}/fstab" \
> + setup_target_root_file_system --clean --fstab "${WORKDIR}/fstab"
> \ "${IMAGE_ROOTFS}" ${IMAGE_PREINSTALL} ${IMAGE_INSTALL}
>
> # Configure root filesystem
> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> index 3bdcb2f..4738cb8 100644
> --- a/meta/classes/image.bbclass
> +++ b/meta/classes/image.bbclass
> @@ -47,7 +47,7 @@ INITRD_IMAGE ?= "${@get_image_name(d,
> 'initrd.img')[1]}" inherit ${IMAGE_TYPE}
>
> do_rootfs[stamp-extra-info] = "${MACHINE}-${DISTRO}"
> -do_rootfs[depends] = "isar-apt:do_cache_config
> isar-bootstrap:do_deploy" +do_rootfs[depends] =
> "isar-apt:do_cache_config isar-bootstrap-target:do_deploy"
> do_rootfs() {
> die "No root filesystem function defined, please implement in
> your recipe" diff --git a/meta/classes/isar-bootstrap-helper.bbclass
> b/meta/classes/isar-bootstrap-helper.bbclass index 7a63914..51b7901
> 100644 --- a/meta/classes/isar-bootstrap-helper.bbclass
> +++ b/meta/classes/isar-bootstrap-helper.bbclass
> @@ -1,4 +1,4 @@
> -# Helper functions for using isar-bootstrap
> +# Helper functions for using isar-bootstrap-*
> #
> # This software is a part of ISAR.
> # Copyright (c) Siemens AG, 2018
> @@ -15,6 +15,10 @@ def reverse_bb_array(d, varname):
> return " ".join(i for i in array)
>
> setup_root_file_system() {
> + DIST="$1"
> + shift
> + ISAR_BOOTSTRAP_DIR="$1"
> + shift
> CLEAN=""
> COPYREPO=""
> FSTAB=""
> @@ -35,7 +39,7 @@ setup_root_file_system() {
> CLEAN_FILES="${ROOTFSDIR}/etc/hostname
> ${ROOTFSDIR}/etc/resolv.conf"
> sudo cp -Trpfx \
> -
> "${DEPLOY_DIR_IMAGE}/isar-bootstrap-${DISTRO}-${DISTRO_ARCH}/" \
> + "${DEPLOY_DIR_IMAGE}/$ISAR_BOOTSTRAP_DIR/" \
> "$ROOTFSDIR"
> [ -n "${FSTAB}" ] && cat ${FSTAB} | sudo tee
> "$ROOTFSDIR/etc/fstab"
> @@ -46,9 +50,9 @@ setup_root_file_system() {
> sudo tee "$ROOTFSDIR/etc/apt/preferences.d/isar" >/dev/null
>
> if [ ${COPYREPO} ]; then
> - sudo cp -Trpfx ${DEPLOY_DIR_APT}/${DISTRO}
> $ROOTFSDIR/isar-apt
> + sudo cp -Trpfx ${DEPLOY_DIR_APT}/${DIST} $ROOTFSDIR/isar-apt
> else
> - sudo mount --bind ${DEPLOY_DIR_APT}/${DISTRO}
> $ROOTFSDIR/isar-apt
> + sudo mount --bind ${DEPLOY_DIR_APT}/${DIST}
> $ROOTFSDIR/isar-apt fi
> sudo mount -t devtmpfs -o mode=0755,nosuid devtmpfs
> $ROOTFSDIR/dev sudo mount -t proc none $ROOTFSDIR/proc
> @@ -87,3 +91,11 @@ setup_root_file_system() {
> sudo rm -f "$ROOTFSDIR/chroot-setup.sh"
> fi
> }
> +
> +setup_host_root_file_system() {
> + setup_root_file_system ${DISTRO_HOST}
> isar-bootstrap-host-${DISTRO}-${DISTRO_ARCH} "$@" +}
> +
> +setup_target_root_file_system() {
> + setup_root_file_system ${DISTRO}
> isar-bootstrap-target-${DISTRO}-${DISTRO_ARCH} "$@" +}
> diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap-host.bb
> b/meta/recipes-core/isar-bootstrap/isar-bootstrap-host.bb new file
> mode 100644 index 0000000..6f7480d
> --- /dev/null
> +++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap-host.bb
> @@ -0,0 +1,31 @@
> +# Minimal debian root file system
> +#
> +# This software is a part of ISAR.
> +# Copyright (c) Siemens AG, 2018
> +#
> +# SPDX-License-Identifier: MIT
> +
> +Description = "Minimal native Debian root file system"
> +
> +include isar-bootstrap.inc
> +
> +do_bootstrap[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
> +do_bootstrap[vardeps] += "DISTRO_APT_SOURCES"
> +do_bootstrap[vardeps] += "DISTRO_APT_PREMIRRORS"
> +do_bootstrap() {
> + if [ -e "${ROOTFSDIR}" ]; then
> + sudo umount -l "${ROOTFSDIR}/dev" || true
> + sudo umount -l "${ROOTFSDIR}/proc" || true
> + sudo rm -rf "${ROOTFSDIR}"
> + fi
> + E="${@bb.utils.export_proxies(d)}"
> + sudo -E "${DEBOOTSTRAP}" --verbose \
> + --variant=minbase \
> + --include=locales \
> + ${@get_distro_components_argument(d)} \
> + ${DEBOOTSTRAP_KEYRING} \
> + "${@get_distro_suite(d)}" \
> + "${ROOTFSDIR}" \
> + "${@get_distro_source(d)}"
> +}
> +addtask bootstrap before do_build after do_generate_keyring
> diff --git
> a/meta/recipes-core/isar-bootstrap/isar-bootstrap-target.bb
> b/meta/recipes-core/isar-bootstrap/isar-bootstrap-target.bb new file
> mode 100644 index 0000000..f65f1dd --- /dev/null
> +++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap-target.bb
> @@ -0,0 +1,32 @@
> +# Minimal debian root file system
> +#
> +# This software is a part of ISAR.
> +# Copyright (c) Siemens AG, 2018
> +#
> +# SPDX-License-Identifier: MIT
> +
> +Description = "Minimal native Debian root file system"
> +
> +include isar-bootstrap.inc
> +
> +do_bootstrap[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
> +do_bootstrap[vardeps] += "DISTRO_APT_SOURCES"
> +do_bootstrap[vardeps] += "DISTRO_APT_PREMIRRORS"
> +do_bootstrap() {
> + if [ -e "${ROOTFSDIR}" ]; then
> + sudo umount -l "${ROOTFSDIR}/dev" || true
> + sudo umount -l "${ROOTFSDIR}/proc" || true
> + sudo rm -rf "${ROOTFSDIR}"
> + fi
> + E="${@bb.utils.export_proxies(d)}"
> + sudo -E "${DEBOOTSTRAP}" --verbose \
> + --variant=minbase \
> + --arch="${DISTRO_ARCH}" \
> + --include=locales \
> + ${@get_distro_components_argument(d)} \
> + ${DEBOOTSTRAP_KEYRING} \
> + "${@get_distro_suite(d)}" \
> + "${ROOTFSDIR}" \
> + "${@get_distro_source(d)}"
> +}
> +addtask bootstrap before do_build after do_generate_keyring
The two DEBOOTSTRAPs are almost the same. You first pull it out and
then create almost identical copies. Cant you just pass the DISTRO
and HOST_DISTRO in and call it DIST like you do in
setup_root_file_system()?
Henning
> diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb
> b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc similarity
> index 89% rename from
> meta/recipes-core/isar-bootstrap/isar-bootstrap.bb rename to
> meta/recipes-core/isar-bootstrap/isar-bootstrap.inc index
> 497a4f4..c473ad6 100644 ---
> a/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb +++
> b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc @@ -5,8 +5,6 @@
> #
> # SPDX-License-Identifier: MIT
>
> -Description = "Minimal debian root file system"
> -
> LICENSE = "gpl-2.0"
> LIC_FILES_CHKSUM =
> "file://${LAYERDIR_isar}/licenses/COPYING.GPLv2;md5=751419260aa954499f7abaabaa882bbe"
> FILESPATH_prepend := "${THISDIR}/files:" @@ -172,28 +170,6 @@ python
> do_apt_config_prepare() { }
> addtask apt_config_prepare before do_build after do_unpack
>
> -do_bootstrap[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
> -do_bootstrap[vardeps] += "DISTRO_APT_SOURCES"
> -do_bootstrap[vardeps] += "DISTRO_APT_PREMIRRORS"
> -do_bootstrap() {
> - if [ -e "${ROOTFSDIR}" ]; then
> - sudo umount -l "${ROOTFSDIR}/dev" || true
> - sudo umount -l "${ROOTFSDIR}/proc" || true
> - sudo rm -rf "${ROOTFSDIR}"
> - fi
> - E="${@bb.utils.export_proxies(d)}"
> - sudo -E "${DEBOOTSTRAP}" --verbose \
> - --variant=minbase \
> - --arch="${DISTRO_ARCH}" \
> - --include=locales \
> - ${@get_distro_components_argument(d)} \
> - ${DEBOOTSTRAP_KEYRING} \
> - "${@get_distro_suite(d)}" \
> - "${ROOTFSDIR}" \
> - "${@get_distro_source(d)}"
> -}
> -addtask bootstrap before do_build after do_generate_keyring
> -
> do_set_locale() {
> sudo install -v -m644 "${WORKDIR}/locale"
> "${ROOTFSDIR}/etc/locale"
> diff --git a/meta/recipes-devtools/buildchroot/buildchroot.bb
> b/meta/recipes-devtools/buildchroot/buildchroot.bb index
> 538c577..5fa8691 100644 ---
> a/meta/recipes-devtools/buildchroot/buildchroot.bb +++
> b/meta/recipes-devtools/buildchroot/buildchroot.bb @@ -66,10 +66,10
> @@ do_build[root_cleandirs] = "${BUILDCHROOT_DIR} \
> ${BUILDCHROOT_DIR}/isar-apt \ ${BUILDCHROOT_DIR}/downloads \
> ${BUILDCHROOT_DIR}/home/builder"
> -do_build[depends] = "isar-apt:do_cache_config
> isar-bootstrap:do_deploy" +do_build[depends] =
> "isar-apt:do_cache_config isar-bootstrap-target:do_deploy"
> do_build() {
> - setup_root_file_system "${BUILDCHROOT_DIR}"
> ${BUILDCHROOT_PREINSTALL}
> + setup_target_root_file_system "${BUILDCHROOT_DIR}"
> ${BUILDCHROOT_PREINSTALL}
> # Install package builder script
> sudo chmod -R a+rw "${BUILDCHROOT_DIR}/home/builder"
next prev parent reply other threads:[~2018-06-14 8:59 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-13 13:58 [RFC PATCH 0/6] ISAR SDK root filesystem Maxim Yu. Osipov
2018-06-13 13:58 ` [RFC PATCH 1/6] isar-bootstrap-helper: Add option --copyrepo to setup_root_file_system() Maxim Yu. Osipov
2018-06-14 8:51 ` Henning Schild
2018-06-13 13:58 ` [RFC PATCH 2/6] isar-debootstrap: split into host and target recipes Maxim Yu. Osipov
2018-06-14 8:59 ` Henning Schild [this message]
2018-06-13 13:58 ` [RFC PATCH 3/6] sdkchroot: Added recipe-devel to create SDK root filesystem Maxim Yu. Osipov
2018-06-14 9:19 ` Henning Schild
2018-06-14 10:46 ` Maxim Yu. Osipov
2018-06-14 11:07 ` Henning Schild
2018-06-13 13:58 ` [RFC PATCH 4/6] meta/class/image: Add do_isar task to trigger SDK rootfs creation Maxim Yu. Osipov
2018-06-14 9:23 ` Henning Schild
2018-06-14 11:49 ` Maxim Yu. Osipov
2018-06-18 9:56 ` Baurzhan Ismagulov
2018-06-13 13:58 ` [RFC PATCH 5/6] scripts: Add helper scripts to mount/umount chroot directory Maxim Yu. Osipov
2018-06-14 9:28 ` Henning Schild
2018-06-13 13:58 ` [RFC PATCH 6/6] doc: Add description of ISAR SDK root filesystem creation Maxim Yu. Osipov
2018-06-14 8:48 ` [RFC PATCH 0/6] ISAR SDK root filesystem Henning Schild
2018-06-14 8:51 ` Jan Kiszka
2018-06-14 9:34 ` Henning Schild
2018-06-14 9:46 ` Maxim Yu. Osipov
2018-06-18 7:08 ` Henning Schild
2018-06-19 7:33 ` 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=20180614105956.3f5e6eff@md1pvb1c.ad001.siemens.net \
--to=henning.schild@siemens.com \
--cc=isar-users@googlegroups.com \
--cc=mosipov@ilbers.de \
/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