public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: isar-users <isar-users@googlegroups.com>
Subject: [PATCH 16/26] sdk: Deploy earlier
Date: Mon, 26 Aug 2019 08:26:17 +0200	[thread overview]
Message-ID: <f39794d093429249b28a356021d429fa675373d9.1566800787.git.jan.kiszka@siemens.com> (raw)
In-Reply-To: <cover.1566800787.git.jan.kiszka@siemens.com>
In-Reply-To: <cover.1566800787.git.jan.kiszka@siemens.com>

From: Jan Kiszka <jan.kiszka@siemens.com>

This avoids having to point from image-sdk-extension directly into the
sdkchroot target workdir. It also aligns the sdk with isar-bootstrap and
buildchroot in this regard.

As we now have a deployment target of the sdk rootfs (SDKCHROOT_DIR), we
can drop the previous link in DEPLOY_DIR_IMAGE.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 meta/classes/image-sdk-extension.bbclass     | 20 ++++++++------------
 meta/conf/bitbake.conf                       |  2 ++
 meta/recipes-devtools/sdkchroot/sdkchroot.bb | 11 +++++++++++
 3 files changed, 21 insertions(+), 12 deletions(-)

diff --git a/meta/classes/image-sdk-extension.bbclass b/meta/classes/image-sdk-extension.bbclass
index a53d954..b9f2cf4 100644
--- a/meta/classes/image-sdk-extension.bbclass
+++ b/meta/classes/image-sdk-extension.bbclass
@@ -5,29 +5,25 @@
 #
 # This class extends the image.bbclass to supply the creation of a sdk
 
-SDKCHROOT_DIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/sdkchroot-${HOST_DISTRO}-${HOST_ARCH}-${DISTRO_ARCH}"
-
 do_populate_sdk[stamp-extra-info] = "${DISTRO}-${MACHINE}"
 do_populate_sdk[depends] = "sdkchroot:do_build"
 do_populate_sdk() {
     # Copy isar-apt with deployed Isar packages
-    sudo cp -Trpfx ${REPO_ISAR_DIR}/${DISTRO}  ${SDKCHROOT_DIR}/rootfs/isar-apt
+    sudo cp -Trpfx ${REPO_ISAR_DIR}/${DISTRO}  ${SDKCHROOT_DIR}/isar-apt
 
-    sudo umount -R ${SDKCHROOT_DIR}/rootfs/dev || true
-    sudo umount ${SDKCHROOT_DIR}/rootfs/proc || true
-    sudo umount -R ${SDKCHROOT_DIR}/rootfs/sys || true
+    sudo umount -R ${SDKCHROOT_DIR}/dev || true
+    sudo umount ${SDKCHROOT_DIR}/proc || true
+    sudo umount -R ${SDKCHROOT_DIR}/sys || true
 
     # Remove setup scripts
-    sudo rm -f ${SDKCHROOT_DIR}/rootfs/chroot-setup.sh ${SDKCHROOT_DIR}/rootfs/configscript.sh
+    sudo rm -f ${SDKCHROOT_DIR}/chroot-setup.sh ${SDKCHROOT_DIR}/configscript.sh
 
     # Copy mount_chroot.sh for convenience
-    sudo cp ${ISARROOT}/scripts/mount_chroot.sh ${SDKCHROOT_DIR}/rootfs
+    sudo cp ${ISARROOT}/scripts/mount_chroot.sh ${SDKCHROOT_DIR}
 
     # Create SDK archive
-    sudo tar -C ${SDKCHROOT_DIR} --transform="s|^rootfs|sdk-${DISTRO}-${DISTRO_ARCH}|" \
+    cd -P ${SDKCHROOT_DIR}/..
+    sudo tar --transform="s|^rootfs|sdk-${DISTRO}-${DISTRO_ARCH}|" \
         -c rootfs | xz -T0 > ${DEPLOY_DIR_IMAGE}/sdk-${DISTRO}-${DISTRO_ARCH}.tar.xz
-
-    # Install deployment link for local use
-    ln -Tfsr ${SDKCHROOT_DIR}/rootfs ${DEPLOY_DIR_IMAGE}/sdk-${DISTRO}-${DISTRO_ARCH}
 }
 addtask populate_sdk after do_rootfs
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index f25b20f..e5681bf 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -48,11 +48,13 @@ GITPKGV = "${@bb.fetch2.get_srcrev(d, 'gitpkgv_revision')}"
 WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PF}"
 DEPLOY_DIR_BOOTSTRAP = "${DEPLOY_DIR}/bootstrap"
 DEPLOY_DIR_BUILDCHROOT = "${DEPLOY_DIR}/buildchroot"
+DEPLOY_DIR_SDKCHROOT = "${DEPLOY_DIR}/sdkchroot"
 DEPLOY_DIR_IMAGE = "${DEPLOY_DIR}/images/${MACHINE}"
 DL_DIR ?= "${TOPDIR}/downloads"
 SSTATE_DIR ?= "${TMPDIR}/sstate-cache"
 BUILDCHROOT_HOST_DIR = "${DEPLOY_DIR_BUILDCHROOT}-host/${HOST_DISTRO}-${HOST_ARCH}_${DISTRO}-${DISTRO_ARCH}"
 BUILDCHROOT_TARGET_DIR = "${DEPLOY_DIR_BUILDCHROOT}-target/${DISTRO}-${DISTRO_ARCH}"
+SDKCHROOT_DIR = "${DEPLOY_DIR_SDKCHROOT}/${DISTRO}-${DISTRO_ARCH}"
 CACHE = "${TMPDIR}/cache"
 
 OVERRIDES = "${DISTRO_ARCH}:${MACHINE}:${DISTRO}:forcevariable"
diff --git a/meta/recipes-devtools/sdkchroot/sdkchroot.bb b/meta/recipes-devtools/sdkchroot/sdkchroot.bb
index d2cc92e..84b8808 100644
--- a/meta/recipes-devtools/sdkchroot/sdkchroot.bb
+++ b/meta/recipes-devtools/sdkchroot/sdkchroot.bb
@@ -56,3 +56,14 @@ sdkchroot_install_files() {
     sudo install -m 755 ${WORKDIR}/configscript.sh ${S}
     sudo chroot ${S} /configscript.sh  ${DISTRO_ARCH}
 }
+
+do_sdkchroot_deploy[dirs] = "${DEPLOY_DIR_SDKCHROOT}"
+do_sdkchroot_deploy() {
+    ln -Tfsr "${ROOTFSDIR}" "${SDKCHROOT_DIR}"
+}
+addtask sdkchroot_deploy before do_build after do_rootfs
+
+CLEANFUNCS = "clean_deploy"
+clean_deploy() {
+    rm -f "${SDKCHROOT_DIR}"
+}
-- 
2.16.4


  parent reply	other threads:[~2019-08-26  6:26 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-26  6:26 [PATCH 00/26] Tons of fixes and cleanups Jan Kiszka
2019-08-26  6:26 ` [PATCH 01/26] isar-bootstrap: Consider DISTRO_BOOTSTRAP_KEYS for gnupg installation Jan Kiszka
2019-08-26  6:26 ` [PATCH 02/26] isar-bootstrap: Fix keyring generation Jan Kiszka
2019-09-27 12:03   ` Baurzhan Ismagulov
2019-08-26  6:26 ` [PATCH 03/26] isar-bootstrap: Install DISTRO_BOOTSTRAP_KEYS Jan Kiszka
2019-08-26  6:26 ` [PATCH 04/26] Rework STAMP layout and cleaning Jan Kiszka
2019-08-26  8:30   ` Claudius Heine
2019-08-26  8:38     ` Jan Kiszka
2019-08-26  6:26 ` [PATCH 05/26] dpkg: Fix shared-locking of build task Jan Kiszka
2019-08-26  6:38   ` Cedric Hombourger
2019-08-26  8:30   ` Claudius Heine
2019-08-26  8:38     ` Jan Kiszka
2019-08-26  6:26 ` [PATCH 06/26] dpkg-base: Free do_build task Jan Kiszka
2019-08-26  6:26 ` [PATCH 07/26] base: Clean up build task Jan Kiszka
2019-08-26  8:30   ` Henning Schild
2019-08-26  8:40     ` Jan Kiszka
2019-08-26  6:26 ` [PATCH 08/26] isar-events: Do not start cleanup early Jan Kiszka
2019-08-26  6:26 ` [PATCH 09/26] meta-isar: Move bananapi to buster, remove bogus example Jan Kiszka
2019-09-04  6:53   ` [PATCH v2 " Jan Kiszka
2019-08-26  6:26 ` [PATCH 10/26] bitbake.conf: Reorder PV definition Jan Kiszka
2019-08-26  6:26 ` [PATCH 11/26] example-module: Fix build with mipsel target Jan Kiszka
2019-08-26  6:26 ` [PATCH 12/26] buildchroot: Ignore ISAR_CROSS_COMPILE for i386 on stretch Jan Kiszka
2019-08-26  6:26 ` [PATCH 13/26] buildchroot: Fix downgrades when installing dependencies Jan Kiszka
2019-08-26  6:26 ` [PATCH 14/26] buildchroot: Properly deploy the build result Jan Kiszka
2019-08-26  6:26 ` [PATCH 15/26] sdk: Use clean-package-cache rather than open-coded cleanup Jan Kiszka
2019-08-26  6:26 ` Jan Kiszka [this message]
2019-08-26  6:26 ` [PATCH 17/26] Remove unneeded PF tweakings Jan Kiszka
2019-08-26  6:26 ` [PATCH 18/26] image: Stop changing PF, tune WORKDIR and STAMP directly Jan Kiszka
2019-08-26  8:35   ` Henning Schild
2019-08-26  8:40     ` Jan Kiszka
2019-08-26  6:26 ` [PATCH 19/26] image: Make WORKDIR and STAMPs IMAGE_TYPE-specific Jan Kiszka
2019-08-26  6:26 ` [PATCH 20/26] Adjust STAMP variables to use PN, rather than PF Jan Kiszka
2019-08-26  6:26 ` [PATCH 21/26] Align WORKDIR structure with OE Jan Kiszka
2019-08-26  6:26 ` [PATCH 22/26] isar-bootstrap: Clean up and fix rebuild Jan Kiszka
2019-09-21  8:28   ` Jan Kiszka
2019-08-26  6:26 ` [PATCH 23/26] gitlab-ci: Keep logs as artifacts on failure Jan Kiszka
2019-08-26  6:26 ` [PATCH 24/26] Detect false sharing of recipes Jan Kiszka
2019-08-26  6:26 ` [PATCH 25/26] dpkg-base: Move do_deploy_deb before do_build Jan Kiszka
2019-08-28  7:32   ` Claudius Heine
2019-10-01 11:49     ` Baurzhan Ismagulov
2019-08-26  6:26 ` [PATCH 26/26] base-apt: Move do_cache_config " Jan Kiszka
2019-08-26 21:29 ` [PATCH 27/26] wic-img: Use private tmp dir Jan Kiszka
2019-08-27 15:00   ` [PATCH v2 " Jan Kiszka
2019-10-01 14:43 ` [PATCH 00/26] Tons of fixes and cleanups Baurzhan Ismagulov

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=f39794d093429249b28a356021d429fa675373d9.1566800787.git.jan.kiszka@siemens.com \
    --to=jan.kiszka@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