* [PATCH 1/6] sdk: Add support for adding self-defined sdk packages
2020-03-22 8:37 [PATCH 0/6] Evolve SDK to chroot-free usage Jan Kiszka
@ 2020-03-22 8:37 ` Jan Kiszka
2020-03-22 8:37 ` [PATCH 2/6] sdk: Make all links in the SDK chroot relative Jan Kiszka
` (5 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Jan Kiszka @ 2020-03-22 8:37 UTC (permalink / raw)
To: isar-users; +Cc: Chao Zeng, Le Jin
From: Jan Kiszka <jan.kiszka@siemens.com>
We do not yet have a good algorithm for automatically adding build
dependencies to the sdk beyond the basic set, let's allow users to
append what they need by appending SDK_PREINSTALL. Analogously to other
images, also allow to install self-built packages, consequently using
SDK_INSTALL.
Based on original patch by Le Jin.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
doc/user_manual.md | 1 +
meta/recipes-devtools/sdkchroot/sdkchroot.bb | 25 +++++++++++++++----------
2 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/doc/user_manual.md b/doc/user_manual.md
index 0582ac74..6d95f26b 100644
--- a/doc/user_manual.md
+++ b/doc/user_manual.md
@@ -744,6 +744,7 @@ target binary artifacts. Developer chroots to sdk rootfs and develops applicatio
User manually triggers creation of SDK root filesystem for his target platform by launching the task `do_populate_sdk` for target image, f.e.
`bitbake -c do_populate_sdk mc:${MACHINE}-${DISTRO}:isar-image-base`.
+Packages that should be additionally installed into the SDK can be appended to `SDK_PREINSTALL` (external repositories) and `SDK_INSTALL` (self-built).
The resulting SDK rootfs is archived into `tmp/deploy/images/${MACHINE}/sdk-${DISTRO}-${DISTRO_ARCH}.tar.xz`.
It is additionally available for direct use under `tmp/deploy/images/${MACHINE}/sdk-${DISTRO}-${DISTRO_ARCH}/`.
diff --git a/meta/recipes-devtools/sdkchroot/sdkchroot.bb b/meta/recipes-devtools/sdkchroot/sdkchroot.bb
index 467e6824..ab0a66dc 100644
--- a/meta/recipes-devtools/sdkchroot/sdkchroot.bb
+++ b/meta/recipes-devtools/sdkchroot/sdkchroot.bb
@@ -13,6 +13,10 @@ SRC_URI = " \
file://README.sdk"
PV = "0.1"
+SDK_INSTALL ?= ""
+
+DEPENDS += "${SDK_INSTALL}"
+
TOOLCHAIN = "crossbuild-essential-${DISTRO_ARCH}"
TOOLCHAIN_${HOST_ARCH} = "build-essential"
TOOLCHAIN_i386 = "build-essential"
@@ -21,7 +25,7 @@ inherit rootfs
ROOTFS_ARCH = "${HOST_ARCH}"
ROOTFS_DISTRO = "${HOST_DISTRO}"
ROOTFSDIR = "${S}"
-ROOTFS_PACKAGES = "${SDKCHROOT_PREINSTALL} ${TOOLCHAIN}"
+ROOTFS_PACKAGES = "${SDK_PREINSTALL} ${SDK_INSTALL} ${TOOLCHAIN}"
ROOTFS_FEATURES += "clean-package-cache generate-manifest"
ROOTFS_MANIFEST_DEPLOY_DIR = "${DEPLOY_DIR_SDKCHROOT}"
@@ -31,15 +35,16 @@ python() {
d.getVar("ROOTFS_ARCH")))
}
-SDKCHROOT_PREINSTALL := "debhelper \
- autotools-dev \
- dpkg \
- locales \
- docbook-to-man \
- apt \
- automake \
- devscripts \
- equivs"
+SDK_PREINSTALL += " \
+ debhelper \
+ autotools-dev \
+ dpkg \
+ locales \
+ docbook-to-man \
+ apt \
+ automake \
+ devscripts \
+ equivs"
S = "${WORKDIR}/rootfs"
--
2.16.4
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/6] sdk: Make all links in the SDK chroot relative
2020-03-22 8:37 [PATCH 0/6] Evolve SDK to chroot-free usage Jan Kiszka
2020-03-22 8:37 ` [PATCH 1/6] sdk: Add support for adding self-defined sdk packages Jan Kiszka
@ 2020-03-22 8:37 ` Jan Kiszka
2020-03-22 8:37 ` [PATCH 3/6] sdk: Add script to relocate SDK Jan Kiszka
` (4 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Jan Kiszka @ 2020-03-22 8:37 UTC (permalink / raw)
To: isar-users; +Cc: Chao Zeng, Le Jin
From: Jan Kiszka <jan.kiszka@siemens.com>
This, in combination with interp and rpatch rewriting, will allow to use
the SDK outside of its chroot.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
meta/classes/image-sdk-extension.bbclass | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/meta/classes/image-sdk-extension.bbclass b/meta/classes/image-sdk-extension.bbclass
index b9f2cf4a..84ac9c6d 100644
--- a/meta/classes/image-sdk-extension.bbclass
+++ b/meta/classes/image-sdk-extension.bbclass
@@ -18,6 +18,20 @@ do_populate_sdk() {
# Remove setup scripts
sudo rm -f ${SDKCHROOT_DIR}/chroot-setup.sh ${SDKCHROOT_DIR}/configscript.sh
+ # Make all links relative
+ for link in $(find ${SDKCHROOT_DIR}/ -type l); do
+ target=$(readlink $link)
+
+ if [ "${target#/}" != "${target}" ]; then
+ basedir=$(dirname $link)
+ new_target=$(realpath --no-symlinks -m --relative-to=$basedir ${SDKCHROOT_DIR}/${target})
+
+ # remove first to allow rewriting directory links
+ sudo rm $link
+ sudo ln -s $new_target $link
+ fi
+ done
+
# Copy mount_chroot.sh for convenience
sudo cp ${ISARROOT}/scripts/mount_chroot.sh ${SDKCHROOT_DIR}
--
2.16.4
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 3/6] sdk: Add script to relocate SDK
2020-03-22 8:37 [PATCH 0/6] Evolve SDK to chroot-free usage Jan Kiszka
2020-03-22 8:37 ` [PATCH 1/6] sdk: Add support for adding self-defined sdk packages Jan Kiszka
2020-03-22 8:37 ` [PATCH 2/6] sdk: Make all links in the SDK chroot relative Jan Kiszka
@ 2020-03-22 8:37 ` Jan Kiszka
2020-03-22 8:37 ` [PATCH 4/6] sdk: Do not ship the isar-apt repo Jan Kiszka
` (3 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Jan Kiszka @ 2020-03-22 8:37 UTC (permalink / raw)
To: isar-users; +Cc: Chao Zeng, Le Jin
From: Jan Kiszka <jan.kiszka@siemens.com>
When run inside the unpacked SDK, this script tunes interp and rpath
entry in relevant binaries so that the cross conpilation tool can be
called outside of the chroot, irrespective of the host distribution.
Then only "--sysroot /path/to/sdkroot" needs to be passed to the
compiler.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
.../sdkchroot/files/relocate-sdk.sh | 29 ++++++++++++++++++++++
meta/recipes-devtools/sdkchroot/sdkchroot.bb | 2 ++
2 files changed, 31 insertions(+)
create mode 100755 meta/recipes-devtools/sdkchroot/files/relocate-sdk.sh
diff --git a/meta/recipes-devtools/sdkchroot/files/relocate-sdk.sh b/meta/recipes-devtools/sdkchroot/files/relocate-sdk.sh
new file mode 100755
index 00000000..98827139
--- /dev/null
+++ b/meta/recipes-devtools/sdkchroot/files/relocate-sdk.sh
@@ -0,0 +1,29 @@
+#!/bin/sh
+#
+# This software is a part of ISAR.
+# Copyright (c) Siemens AG, 2020
+#
+# SPDX-License-Identifier: MIT
+
+sdkroot=$(realpath $(dirname $0))
+arch=$(uname -m)
+
+if [ -z $(which patchelf 2>/dev/null) ]; then
+ echo "Please install 'patchelf' package first."
+ exit 1
+fi
+
+echo -n "Adjusting path of SDK to '${sdkroot}'... "
+
+for binary in $(find ${sdkroot}/usr/bin ${sdkroot}/usr/sbin ${sdkroot}/usr/lib/gcc* -executable -type f); do
+ interpreter=$(patchelf --print-interpreter ${binary} 2>/dev/null)
+ oldpath=${interpreter%/lib*/ld-linux*}
+ interpreter=${interpreter#${oldpath}}
+ if [ -n "${interpreter}" ]; then
+ patchelf --set-interpreter ${sdkroot}${interpreter} \
+ --set-rpath ${sdkroot}/usr/lib:${sdkroot}/usr/lib/${arch}-linux-gnu \
+ $binary 2>/dev/null
+ fi
+done
+
+echo "done"
diff --git a/meta/recipes-devtools/sdkchroot/sdkchroot.bb b/meta/recipes-devtools/sdkchroot/sdkchroot.bb
index ab0a66dc..2bc9d291 100644
--- a/meta/recipes-devtools/sdkchroot/sdkchroot.bb
+++ b/meta/recipes-devtools/sdkchroot/sdkchroot.bb
@@ -10,6 +10,7 @@ LIC_FILES_CHKSUM = "file://${LAYERDIR_core}/licenses/COPYING.GPLv2;md5=751419260
SRC_URI = " \
file://configscript.sh \
+ file://relocate-sdk.sh \
file://README.sdk"
PV = "0.1"
@@ -58,6 +59,7 @@ ROOTFS_POSTPROCESS_COMMAND =+ "sdkchroot_install_files"
sdkchroot_install_files() {
# Configure root filesystem
sudo install -m 644 ${WORKDIR}/README.sdk ${S}
+ sudo install -m 755 ${WORKDIR}/relocate-sdk.sh ${S}
sudo install -m 755 ${WORKDIR}/configscript.sh ${S}
sudo chroot ${S} /configscript.sh ${DISTRO_ARCH}
}
--
2.16.4
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 4/6] sdk: Do not ship the isar-apt repo
2020-03-22 8:37 [PATCH 0/6] Evolve SDK to chroot-free usage Jan Kiszka
` (2 preceding siblings ...)
2020-03-22 8:37 ` [PATCH 3/6] sdk: Add script to relocate SDK Jan Kiszka
@ 2020-03-22 8:37 ` Jan Kiszka
2020-03-22 8:37 ` [PATCH 5/6] sdk: Inject sysroot path when calling relocated toolchain Jan Kiszka
` (2 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Jan Kiszka @ 2020-03-22 8:37 UTC (permalink / raw)
To: isar-users; +Cc: Chao Zeng, Le Jin
From: Jan Kiszka <jan.kiszka@siemens.com>
Users can add what should be included via SDK_INSTALL now.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
meta/classes/image-sdk-extension.bbclass | 6 +++---
meta/recipes-devtools/sdkchroot/sdkchroot.bb | 6 ------
2 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/meta/classes/image-sdk-extension.bbclass b/meta/classes/image-sdk-extension.bbclass
index 84ac9c6d..6e76b04d 100644
--- a/meta/classes/image-sdk-extension.bbclass
+++ b/meta/classes/image-sdk-extension.bbclass
@@ -8,13 +8,13 @@
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}/isar-apt
-
sudo umount -R ${SDKCHROOT_DIR}/dev || true
sudo umount ${SDKCHROOT_DIR}/proc || true
sudo umount -R ${SDKCHROOT_DIR}/sys || true
+ # Remove isar-apt repo entry
+ sudo rm -f ${SDKCHROOT_DIR}/etc/apt/sources.list.d/isar-apt.list
+
# Remove setup scripts
sudo rm -f ${SDKCHROOT_DIR}/chroot-setup.sh ${SDKCHROOT_DIR}/configscript.sh
diff --git a/meta/recipes-devtools/sdkchroot/sdkchroot.bb b/meta/recipes-devtools/sdkchroot/sdkchroot.bb
index 2bc9d291..dc765046 100644
--- a/meta/recipes-devtools/sdkchroot/sdkchroot.bb
+++ b/meta/recipes-devtools/sdkchroot/sdkchroot.bb
@@ -49,12 +49,6 @@ SDK_PREINSTALL += " \
S = "${WORKDIR}/rootfs"
-ROOTFS_CONFIGURE_COMMAND += "rootfs_configure_isar_apt_dir"
-rootfs_configure_isar_apt_dir() {
- # Copy isar-apt instead of mounting:
- sudo cp -Trpfx ${REPO_ISAR_DIR}/${DISTRO} ${ROOTFSDIR}/isar-apt
-}
-
ROOTFS_POSTPROCESS_COMMAND =+ "sdkchroot_install_files"
sdkchroot_install_files() {
# Configure root filesystem
--
2.16.4
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 5/6] sdk: Inject sysroot path when calling relocated toolchain
2020-03-22 8:37 [PATCH 0/6] Evolve SDK to chroot-free usage Jan Kiszka
` (3 preceding siblings ...)
2020-03-22 8:37 ` [PATCH 4/6] sdk: Do not ship the isar-apt repo Jan Kiszka
@ 2020-03-22 8:37 ` Jan Kiszka
2020-03-22 8:55 ` [PATCH v2 " Jan Kiszka
2020-03-22 8:37 ` [PATCH 6/6] sdk: Update README.sdk Jan Kiszka
2020-03-27 23:48 ` [PATCH 0/6] Evolve SDK to chroot-free usage Christopher Larson
6 siblings, 1 reply; 10+ messages in thread
From: Jan Kiszka @ 2020-03-22 8:37 UTC (permalink / raw)
To: isar-users; +Cc: Chao Zeng, Le Jin
From: Jan Kiszka <jan.kiszka@siemens.com>
This removes the need to specify --sysroot=/path/to/sdkroot when calling
gcc or ld from the SDK.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
meta/classes/image-sdk-extension.bbclass | 8 ++++++++
meta/recipes-devtools/sdkchroot/files/relocate-sdk.sh | 3 +++
meta/recipes-devtools/sdkchroot/sdkchroot.bb | 2 ++
3 files changed, 13 insertions(+)
diff --git a/meta/classes/image-sdk-extension.bbclass b/meta/classes/image-sdk-extension.bbclass
index 6e76b04d..aed8408c 100644
--- a/meta/classes/image-sdk-extension.bbclass
+++ b/meta/classes/image-sdk-extension.bbclass
@@ -32,6 +32,14 @@ do_populate_sdk() {
fi
done
+ # Set up sysroot wrapper
+ for tool_pattern in "gcc-[0-9]*" "g++-[0-9]*" "cpp-[0-9]*" "ld.bfd" "ld.gold"; do
+ for tool in $(find ${SDKCHROOT_DIR}/usr/bin -type f -name "*-linux-gnu-${tool_pattern}"); do
+ sudo mv "${tool}" "${tool}.bin"
+ sudo ln -sf gcc-sysroot-wrapper.sh ${tool}
+ done
+ done
+
# Copy mount_chroot.sh for convenience
sudo cp ${ISARROOT}/scripts/mount_chroot.sh ${SDKCHROOT_DIR}
diff --git a/meta/recipes-devtools/sdkchroot/files/relocate-sdk.sh b/meta/recipes-devtools/sdkchroot/files/relocate-sdk.sh
index 98827139..6be8d82f 100755
--- a/meta/recipes-devtools/sdkchroot/files/relocate-sdk.sh
+++ b/meta/recipes-devtools/sdkchroot/files/relocate-sdk.sh
@@ -26,4 +26,7 @@ for binary in $(find ${sdkroot}/usr/bin ${sdkroot}/usr/sbin ${sdkroot}/usr/lib/g
fi
done
+sed -i 's|^GCC_SYSROOT=.*|GCC_SYSROOT="'"${sdkroot}"'"|' \
+ ${sdkroot}/usr/bin/gcc-sysroot-wrapper.sh
+
echo "done"
diff --git a/meta/recipes-devtools/sdkchroot/sdkchroot.bb b/meta/recipes-devtools/sdkchroot/sdkchroot.bb
index dc765046..bf3f6fb4 100644
--- a/meta/recipes-devtools/sdkchroot/sdkchroot.bb
+++ b/meta/recipes-devtools/sdkchroot/sdkchroot.bb
@@ -11,6 +11,7 @@ LIC_FILES_CHKSUM = "file://${LAYERDIR_core}/licenses/COPYING.GPLv2;md5=751419260
SRC_URI = " \
file://configscript.sh \
file://relocate-sdk.sh \
+ file://gcc-sysroot-wrapper.sh \
file://README.sdk"
PV = "0.1"
@@ -54,6 +55,7 @@ sdkchroot_install_files() {
# Configure root filesystem
sudo install -m 644 ${WORKDIR}/README.sdk ${S}
sudo install -m 755 ${WORKDIR}/relocate-sdk.sh ${S}
+ sudo install -m 755 ${WORKDIR}/gcc-sysroot-wrapper.sh ${S}/usr/bin
sudo install -m 755 ${WORKDIR}/configscript.sh ${S}
sudo chroot ${S} /configscript.sh ${DISTRO_ARCH}
}
--
2.16.4
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v2 5/6] sdk: Inject sysroot path when calling relocated toolchain
2020-03-22 8:37 ` [PATCH 5/6] sdk: Inject sysroot path when calling relocated toolchain Jan Kiszka
@ 2020-03-22 8:55 ` Jan Kiszka
0 siblings, 0 replies; 10+ messages in thread
From: Jan Kiszka @ 2020-03-22 8:55 UTC (permalink / raw)
To: isar-users; +Cc: Chao Zeng, Le Jin
From: Jan Kiszka <jan.kiszka@siemens.com>
This removes the need to specify --sysroot=/path/to/sdkroot when calling
gcc or ld from the SDK.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
Changes in v2:
- include forgotten gcc-sysroot-wrapper.sh
meta/classes/image-sdk-extension.bbclass | 8 ++++++++
.../sdkchroot/files/gcc-sysroot-wrapper.sh | 16 ++++++++++++++++
meta/recipes-devtools/sdkchroot/files/relocate-sdk.sh | 3 +++
meta/recipes-devtools/sdkchroot/sdkchroot.bb | 2 ++
4 files changed, 29 insertions(+)
create mode 100755 meta/recipes-devtools/sdkchroot/files/gcc-sysroot-wrapper.sh
diff --git a/meta/classes/image-sdk-extension.bbclass b/meta/classes/image-sdk-extension.bbclass
index 6e76b04d..aed8408c 100644
--- a/meta/classes/image-sdk-extension.bbclass
+++ b/meta/classes/image-sdk-extension.bbclass
@@ -32,6 +32,14 @@ do_populate_sdk() {
fi
done
+ # Set up sysroot wrapper
+ for tool_pattern in "gcc-[0-9]*" "g++-[0-9]*" "cpp-[0-9]*" "ld.bfd" "ld.gold"; do
+ for tool in $(find ${SDKCHROOT_DIR}/usr/bin -type f -name "*-linux-gnu-${tool_pattern}"); do
+ sudo mv "${tool}" "${tool}.bin"
+ sudo ln -sf gcc-sysroot-wrapper.sh ${tool}
+ done
+ done
+
# Copy mount_chroot.sh for convenience
sudo cp ${ISARROOT}/scripts/mount_chroot.sh ${SDKCHROOT_DIR}
diff --git a/meta/recipes-devtools/sdkchroot/files/gcc-sysroot-wrapper.sh b/meta/recipes-devtools/sdkchroot/files/gcc-sysroot-wrapper.sh
new file mode 100755
index 00000000..feead1a1
--- /dev/null
+++ b/meta/recipes-devtools/sdkchroot/files/gcc-sysroot-wrapper.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+#
+# This software is a part of ISAR.
+# Copyright (c) Siemens AG, 2020
+#
+# SPDX-License-Identifier: MIT
+
+GCC_SYSROOT=
+
+NEXT_TARGET=$0
+until [ "${NEXT_TARGET##*/}" = "gcc-sysroot-wrapper.sh" ]; do
+ TARGET=${NEXT_TARGET}
+ NEXT_TARGET=$(dirname ${TARGET})/$(readlink ${TARGET})
+done
+
+${TARGET}.bin --sysroot=${GCC_SYSROOT} "$@"
diff --git a/meta/recipes-devtools/sdkchroot/files/relocate-sdk.sh b/meta/recipes-devtools/sdkchroot/files/relocate-sdk.sh
index 98827139..6be8d82f 100755
--- a/meta/recipes-devtools/sdkchroot/files/relocate-sdk.sh
+++ b/meta/recipes-devtools/sdkchroot/files/relocate-sdk.sh
@@ -26,4 +26,7 @@ for binary in $(find ${sdkroot}/usr/bin ${sdkroot}/usr/sbin ${sdkroot}/usr/lib/g
fi
done
+sed -i 's|^GCC_SYSROOT=.*|GCC_SYSROOT="'"${sdkroot}"'"|' \
+ ${sdkroot}/usr/bin/gcc-sysroot-wrapper.sh
+
echo "done"
diff --git a/meta/recipes-devtools/sdkchroot/sdkchroot.bb b/meta/recipes-devtools/sdkchroot/sdkchroot.bb
index dc765046..bf3f6fb4 100644
--- a/meta/recipes-devtools/sdkchroot/sdkchroot.bb
+++ b/meta/recipes-devtools/sdkchroot/sdkchroot.bb
@@ -11,6 +11,7 @@ LIC_FILES_CHKSUM = "file://${LAYERDIR_core}/licenses/COPYING.GPLv2;md5=751419260
SRC_URI = " \
file://configscript.sh \
file://relocate-sdk.sh \
+ file://gcc-sysroot-wrapper.sh \
file://README.sdk"
PV = "0.1"
@@ -54,6 +55,7 @@ sdkchroot_install_files() {
# Configure root filesystem
sudo install -m 644 ${WORKDIR}/README.sdk ${S}
sudo install -m 755 ${WORKDIR}/relocate-sdk.sh ${S}
+ sudo install -m 755 ${WORKDIR}/gcc-sysroot-wrapper.sh ${S}/usr/bin
sudo install -m 755 ${WORKDIR}/configscript.sh ${S}
sudo chroot ${S} /configscript.sh ${DISTRO_ARCH}
}
--
2.16.4
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 6/6] sdk: Update README.sdk
2020-03-22 8:37 [PATCH 0/6] Evolve SDK to chroot-free usage Jan Kiszka
` (4 preceding siblings ...)
2020-03-22 8:37 ` [PATCH 5/6] sdk: Inject sysroot path when calling relocated toolchain Jan Kiszka
@ 2020-03-22 8:37 ` Jan Kiszka
2020-03-27 23:48 ` [PATCH 0/6] Evolve SDK to chroot-free usage Christopher Larson
6 siblings, 0 replies; 10+ messages in thread
From: Jan Kiszka @ 2020-03-22 8:37 UTC (permalink / raw)
To: isar-users; +Cc: Chao Zeng, Le Jin
From: Jan Kiszka <jan.kiszka@siemens.com>
Document the out-of-chroot invocation and make it the preferred option.
Also remove irrelevant information.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
meta/recipes-devtools/sdkchroot/files/README.sdk | 66 +++++++++++-------------
1 file changed, 31 insertions(+), 35 deletions(-)
diff --git a/meta/recipes-devtools/sdkchroot/files/README.sdk b/meta/recipes-devtools/sdkchroot/files/README.sdk
index 9c1af6d3..1b228e4f 100644
--- a/meta/recipes-devtools/sdkchroot/files/README.sdk
+++ b/meta/recipes-devtools/sdkchroot/files/README.sdk
@@ -1,42 +1,38 @@
-Building applications for targets in ISAR takes a lot of time as they are built under QEMU.
-SDK helps to develop applications for target platform in crossbuild environment.
+ISAR Target SDK
+===============
-SDK contains cross-toolchain for target architecture and a copy of isar-apt repo with
-locally prebuilt target debian packages.
+This SDK helps to develop applications for an ISAR target platform in a
+crossbuild environment. It contains a cross-toolchain and development packages
+corresponding to the original target.
- - First one have to mount the system directories for proper operation in chroot environement.
-Just call supplied with sdk tarball in udo rootfs as an argument to the script `mount_chroot.sh`:
+The SDK can be used in two ways, described in the following.
-$ sudo mount_chroot.sh <sdk_rootfs>
- - chroot to isar SDK rootfs:
+Option 1 (recommended): Use cross-compiler in host environment
+--------------------------------------------------------------
+
+After unpacking the SDK at the desired location, it has to be relocated once:
+
+$ <sdk_rootfs>/relocate-sdk.sh
+
+Now you can add <sdk_rootfs>/usr/bin to the local path or adjust your project
+to call the cross-compiler from the SDK.
+
+
+Option 2 (fallback): Build inside chroot
+----------------------------------------
+
+First you have to mount the system directories for proper operation into the
+chroot environment. Call the helper script supplied with SDK tarball:
+
+$ sudo <sdk_rootfs>/mount_chroot.sh <sdk_rootfs>
+
+Bind-mount the project into the rootfs:
+
+$ sudo mount -o bind /path/to/project <sdk_rootfs>/mnt
+
+Then chroot into the SDK rootfs:
$ sudo chroot <sdk_rootfs>
- - Check that cross toolchains are installed
-
-:~# dpkg -l | grep crossbuild-essential-armhf
-ii crossbuild-essential-armhf 12.3 all Informational list of cross-build-essential packages
-
- - Install needed prebuilt target packages.
-
-:~# apt-get update
-:~# apt-get install libhello-dev:armhf
-
- - Check the contents of the installed target package
-
-:~# dpkg -L libhello-dev
-/.
-/usr
-/usr/include
-/usr/include/hello.h
-/usr/lib
-/usr/lib/arm-linux-gnueabihf
-/usr/lib/arm-linux-gnueabihf/libhello.a
-/usr/lib/arm-linux-gnueabihf/libhello.la
-/usr/share
-/usr/share/doc
-/usr/share/doc/libhello-dev
-/usr/share/doc/libhello-dev/changelog.gz
-/usr/share/doc/libhello-dev/copyright
-~#
+Now you can build the project under /mnt.
--
2.16.4
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 0/6] Evolve SDK to chroot-free usage
2020-03-22 8:37 [PATCH 0/6] Evolve SDK to chroot-free usage Jan Kiszka
` (5 preceding siblings ...)
2020-03-22 8:37 ` [PATCH 6/6] sdk: Update README.sdk Jan Kiszka
@ 2020-03-27 23:48 ` Christopher Larson
2020-03-28 7:33 ` Jan Kiszka
6 siblings, 1 reply; 10+ messages in thread
From: Christopher Larson @ 2020-03-27 23:48 UTC (permalink / raw)
To: Jan Kiszka; +Cc: isar-users, Chao Zeng, Le Jin
[-- Attachment #1: Type: text/plain, Size: 2931 bytes --]
This series seems like a definite improvement, but I'd suggest explicitly
noting in the README that once you've run the relocate-sdk.sh script, the
second not recommended option of entering the chroot will no longer
function due to the changed interpreter paths.
On Sun, Mar 22, 2020 at 1:37 AM Jan Kiszka <jan.kiszka@siemens.com> wrote:
> Currently, our SDK can primarily be used by chroot'ing into it, taking
> the to-be-built project with you (bind mount etc.). This was enough for
> a start but we can do better.
>
> This series enhance the SDK to become usage as a normal cross-toolchain
> on your host system. For that purpose, we add a script that relocates
> the toolchain after installation, adjust binary search paths and
> sysroot. So, the only remaining difference to a yocto or buildroot
> toolchain is the need to run the relocation script once after unpacking
> the SDK.
>
> The series furthermore allows to customize the SDK content via the
> image-generating layer.
>
> The series (together with all other pending patching of mine) can also
> be found at https://github.com/siemens/isar/commits/jan/queue.
>
> While I already shrunk the SDK a bit by removing the now obsolete
> isar-apt repo, I suspect we could further reduce the deployment size by
> dropping chroot support completely, only including the compiler and
> their library dependencies. OTOH, sdk-debian-buster-arm64.tar.xz is now
> 142M here, unpacked 680M, while ARM's
> gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu.tar.xz has
> 260M packed and 1.5G(!) unpacked. So we are either not really off or are
> still missing something.
>
> Jan
>
> Jan Kiszka (6):
> sdk: Add support for adding self-defined sdk packages
> sdk: Make all links in the SDK chroot relative
> sdk: Add script to relocate SDK
> sdk: Do not ship the isar-apt repo
> sdk: Inject sysroot path when calling relocated toolchain
> sdk: Update README.sdk
>
> doc/user_manual.md | 1 +
> meta/classes/image-sdk-extension.bbclass | 28 ++++++++-
> meta/recipes-devtools/sdkchroot/files/README.sdk | 66
> ++++++++++------------
> .../sdkchroot/files/relocate-sdk.sh | 32 +++++++++++
> meta/recipes-devtools/sdkchroot/sdkchroot.bb | 35 ++++++------
> 5 files changed, 108 insertions(+), 54 deletions(-)
> create mode 100755 meta/recipes-devtools/sdkchroot/files/relocate-sdk.sh
>
> --
> 2.16.4
>
> --
> You received this message because you are subscribed to the Google Groups
> "isar-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to isar-users+unsubscribe@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/isar-users/cover.1584866240.git.jan.kiszka%40siemens.com
> .
>
--
Christopher Larson
kergoth at gmail dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Senior Software Engineer, Mentor Graphics
[-- Attachment #2: Type: text/html, Size: 3960 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 0/6] Evolve SDK to chroot-free usage
2020-03-27 23:48 ` [PATCH 0/6] Evolve SDK to chroot-free usage Christopher Larson
@ 2020-03-28 7:33 ` Jan Kiszka
0 siblings, 0 replies; 10+ messages in thread
From: Jan Kiszka @ 2020-03-28 7:33 UTC (permalink / raw)
To: Christopher Larson; +Cc: isar-users, Chao Zeng, Le Jin
On 28.03.20 00:48, Christopher Larson wrote:
> This series seems like a definite improvement, but I'd suggest
> explicitly noting in the README that once you've run the relocate-sdk.sh
> script, the second not recommended option of entering the chroot will no
> longer function due to the changed interpreter paths.
Correct. But we can enhance the relocation script so that it is also
able to restore the chroot mode. At least as long as we support both
modes, there is likely value in this. Will adjust it and the README.
Thanks,
Jan
>
> On Sun, Mar 22, 2020 at 1:37 AM Jan Kiszka <jan.kiszka@siemens.com
> <mailto:jan.kiszka@siemens.com>> wrote:
>
> Currently, our SDK can primarily be used by chroot'ing into it, taking
> the to-be-built project with you (bind mount etc.). This was enough for
> a start but we can do better.
>
> This series enhance the SDK to become usage as a normal cross-toolchain
> on your host system. For that purpose, we add a script that relocates
> the toolchain after installation, adjust binary search paths and
> sysroot. So, the only remaining difference to a yocto or buildroot
> toolchain is the need to run the relocation script once after unpacking
> the SDK.
>
> The series furthermore allows to customize the SDK content via the
> image-generating layer.
>
> The series (together with all other pending patching of mine) can also
> be found at https://github.com/siemens/isar/commits/jan/queue.
>
> While I already shrunk the SDK a bit by removing the now obsolete
> isar-apt repo, I suspect we could further reduce the deployment size by
> dropping chroot support completely, only including the compiler and
> their library dependencies. OTOH, sdk-debian-buster-arm64.tar.xz is now
> 142M here, unpacked 680M, while ARM's
> gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu.tar.xz has
> 260M packed and 1.5G(!) unpacked. So we are either not really off or are
> still missing something.
>
> Jan
>
> Jan Kiszka (6):
> sdk: Add support for adding self-defined sdk packages
> sdk: Make all links in the SDK chroot relative
> sdk: Add script to relocate SDK
> sdk: Do not ship the isar-apt repo
> sdk: Inject sysroot path when calling relocated toolchain
> sdk: Update README.sdk
>
> doc/user_manual.md | 1 +
> meta/classes/image-sdk-extension.bbclass | 28 ++++++++-
> meta/recipes-devtools/sdkchroot/files/README.sdk | 66
> ++++++++++------------
> .../sdkchroot/files/relocate-sdk.sh | 32 +++++++++++
> meta/recipes-devtools/sdkchroot/sdkchroot.bb
> <http://sdkchroot.bb> | 35 ++++++------
> 5 files changed, 108 insertions(+), 54 deletions(-)
> create mode 100755
> meta/recipes-devtools/sdkchroot/files/relocate-sdk.sh
>
> --
> 2.16.4
>
> --
> You received this message because you are subscribed to the Google
> Groups "isar-users" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to isar-users+unsubscribe@googlegroups.com
> <mailto:isar-users%2Bunsubscribe@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/isar-users/cover.1584866240.git.jan.kiszka%40siemens.com.
>
>
>
> --
> Christopher Larson
> kergoth at gmail dot com
> Founder - BitBake, OpenEmbedded, OpenZaurus
> Senior Software Engineer, Mentor Graphics
^ permalink raw reply [flat|nested] 10+ messages in thread