* [PATCH v2 0/2] Various fixes
@ 2018-09-05 8:16 Maxim Yu. Osipov
2018-09-05 8:16 ` [PATCH v2 1/2] sdk: Move deployment to populate_sdk Maxim Yu. Osipov
2018-09-05 8:16 ` [PATCH v2 2/2] cross-compilation: Fixes build broken with host-distro != target-distro Maxim Yu. Osipov
0 siblings, 2 replies; 5+ messages in thread
From: Maxim Yu. Osipov @ 2018-09-05 8:16 UTC (permalink / raw)
To: isar-users
Hello everybody,
This patchset
* fixes broken cross compilation build when host-distro !=
target-distro
* Corrects sdk generation.
Changes to 'sdk: Move deployment to populate_sdk' v1:
- Copy target-distro prebuilt packages instead of host-distro
- cleanup unmount /proc and /dev
Cross compilation and sdk generation were tested
on host debian-stretch-amd64 for targets
- debian-stretch-arm64
- debian-stretch-arm
- debian-buster-arm
Kind regards,
Maxim.
Jan Kiszka (1):
cross-compilation: Fixes build broken with host-distro !=
target-distro
Maxim Yu. Osipov (1):
sdk: Move deployment to populate_sdk
meta/classes/image.bbclass | 12 ++++++++++++
meta/classes/isar-bootstrap-helper.bbclass | 4 ++--
meta/recipes-devtools/buildchroot/buildchroot-host.bb | 2 +-
meta/recipes-devtools/sdkchroot/sdkchroot.bb | 8 --------
4 files changed, 15 insertions(+), 11 deletions(-)
--
2.11.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 1/2] sdk: Move deployment to populate_sdk
2018-09-05 8:16 [PATCH v2 0/2] Various fixes Maxim Yu. Osipov
@ 2018-09-05 8:16 ` Maxim Yu. Osipov
2018-09-05 8:16 ` [PATCH v2 2/2] cross-compilation: Fixes build broken with host-distro != target-distro Maxim Yu. Osipov
1 sibling, 0 replies; 5+ messages in thread
From: Maxim Yu. Osipov @ 2018-09-05 8:16 UTC (permalink / raw)
To: isar-users
Deploy SDK after Isar packages get deployed to
local Isar apt repo which is copied afterwards
to sdkchroot.
Signed-off-by: Maxim Yu. Osipov <mosipov@ilbers.de>
---
meta/classes/image.bbclass | 12 ++++++++++++
meta/recipes-devtools/sdkchroot/sdkchroot.bb | 8 --------
2 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 6a5f0e9..f3efdd7 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -97,7 +97,19 @@ addtask copy_boot_files before do_build after do_rootfs
do_copy_boot_files[dirs] = "${DEPLOY_DIR_IMAGE}"
do_copy_boot_files[stamp-extra-info] = "${DISTRO}-${MACHINE}"
+SDKCHROOT_DIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/sdkchroot-${HOST_DISTRO}-${HOST_ARCH}"
+
do_populate_sdk() {
+ # Copy isar-apt with deployed Isar packages
+ sudo cp -Trpfx ${DEPLOY_DIR_APT}/${DISTRO} ${SDKCHROOT_DIR}/rootfs/isar-apt
+
+ # Create SDK archive
+ sudo umount ${SDKCHROOT_DIR}/rootfs/dev ${SDKCHROOT_DIR}/rootfs/proc
+ sudo tar -C ${SDKCHROOT_DIR} --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}
}
do_populate_sdk[stamp-extra-info] = "${MACHINE}-${DISTRO}"
diff --git a/meta/recipes-devtools/sdkchroot/sdkchroot.bb b/meta/recipes-devtools/sdkchroot/sdkchroot.bb
index e143ae7..46af3df 100644
--- a/meta/recipes-devtools/sdkchroot/sdkchroot.bb
+++ b/meta/recipes-devtools/sdkchroot/sdkchroot.bb
@@ -53,12 +53,4 @@ do_build() {
# Configure root filesystem
sudo install -m 755 ${WORKDIR}/configscript.sh ${S}
sudo chroot ${S} /configscript.sh ${DISTRO_ARCH}
-
- # Create SDK archive
- sudo umount ${S}/dev ${S}/proc
- sudo tar -C ${WORKDIR} --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 ${S} ${DEPLOY_DIR_IMAGE}/sdk-${DISTRO}-${DISTRO_ARCH}
}
--
2.11.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 2/2] cross-compilation: Fixes build broken with host-distro != target-distro
2018-09-05 8:16 [PATCH v2 0/2] Various fixes Maxim Yu. Osipov
2018-09-05 8:16 ` [PATCH v2 1/2] sdk: Move deployment to populate_sdk Maxim Yu. Osipov
@ 2018-09-05 8:16 ` Maxim Yu. Osipov
2018-09-05 8:29 ` Jan Kiszka
1 sibling, 1 reply; 5+ messages in thread
From: Maxim Yu. Osipov @ 2018-09-05 8:16 UTC (permalink / raw)
To: isar-users
From: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
meta/classes/isar-bootstrap-helper.bbclass | 4 ++--
meta/recipes-devtools/buildchroot/buildchroot-host.bb | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/meta/classes/isar-bootstrap-helper.bbclass b/meta/classes/isar-bootstrap-helper.bbclass
index d45cdd7..4ad552f 100644
--- a/meta/classes/isar-bootstrap-helper.bbclass
+++ b/meta/classes/isar-bootstrap-helper.bbclass
@@ -93,9 +93,9 @@ setup_root_file_system() {
sudo tee "$ROOTFSDIR/etc/apt/preferences.d/isar" >/dev/null
if [ ${COPYISARAPT} ]; then
- sudo cp -Trpfx ${DEPLOY_DIR_APT}/${ROOTFS_DISTRO} $ROOTFSDIR/isar-apt
+ sudo cp -Trpfx ${DEPLOY_DIR_APT}/${DISTRO} $ROOTFSDIR/isar-apt
else
- sudo mount --bind ${DEPLOY_DIR_APT}/${ROOTFS_DISTRO} $ROOTFSDIR/isar-apt
+ sudo mount --bind ${DEPLOY_DIR_APT}/${DISTRO} $ROOTFSDIR/isar-apt
fi
sudo mount -t devtmpfs -o mode=0755,nosuid devtmpfs $ROOTFSDIR/dev
sudo mount -t proc none $ROOTFSDIR/proc
diff --git a/meta/recipes-devtools/buildchroot/buildchroot-host.bb b/meta/recipes-devtools/buildchroot/buildchroot-host.bb
index daf92a2..01d426d 100644
--- a/meta/recipes-devtools/buildchroot/buildchroot-host.bb
+++ b/meta/recipes-devtools/buildchroot/buildchroot-host.bb
@@ -30,5 +30,5 @@ BUILDCHROOT_PREINSTALL_append_arm64 += "binutils-aarch64-linux-gnu \
crossbuild-essential-arm64"
-PARAMS = "--host-arch"
+PARAMS = "--host-arch --host-distro"
do_build[depends] = "isar-apt:do_cache_config isar-bootstrap-host:do_bootstrap"
--
2.11.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 2/2] cross-compilation: Fixes build broken with host-distro != target-distro
2018-09-05 8:16 ` [PATCH v2 2/2] cross-compilation: Fixes build broken with host-distro != target-distro Maxim Yu. Osipov
@ 2018-09-05 8:29 ` Jan Kiszka
2018-09-05 12:48 ` Jan Kiszka
0 siblings, 1 reply; 5+ messages in thread
From: Jan Kiszka @ 2018-09-05 8:29 UTC (permalink / raw)
To: Maxim Yu. Osipov, isar-users
On 2018-09-05 10:16, Maxim Yu. Osipov wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
It's good the see that my workaround is apparently also a solution. But
this still lacks the explanation, and I'm still unable to provide that.
So please help, specifically by answering the questions I raised in the
original bug report.
Thanks,
Jan
> ---
> meta/classes/isar-bootstrap-helper.bbclass | 4 ++--
> meta/recipes-devtools/buildchroot/buildchroot-host.bb | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/meta/classes/isar-bootstrap-helper.bbclass b/meta/classes/isar-bootstrap-helper.bbclass
> index d45cdd7..4ad552f 100644
> --- a/meta/classes/isar-bootstrap-helper.bbclass
> +++ b/meta/classes/isar-bootstrap-helper.bbclass
> @@ -93,9 +93,9 @@ setup_root_file_system() {
> sudo tee "$ROOTFSDIR/etc/apt/preferences.d/isar" >/dev/null
>
> if [ ${COPYISARAPT} ]; then
> - sudo cp -Trpfx ${DEPLOY_DIR_APT}/${ROOTFS_DISTRO} $ROOTFSDIR/isar-apt
> + sudo cp -Trpfx ${DEPLOY_DIR_APT}/${DISTRO} $ROOTFSDIR/isar-apt
> else
> - sudo mount --bind ${DEPLOY_DIR_APT}/${ROOTFS_DISTRO} $ROOTFSDIR/isar-apt
> + sudo mount --bind ${DEPLOY_DIR_APT}/${DISTRO} $ROOTFSDIR/isar-apt
> fi
> sudo mount -t devtmpfs -o mode=0755,nosuid devtmpfs $ROOTFSDIR/dev
> sudo mount -t proc none $ROOTFSDIR/proc
> diff --git a/meta/recipes-devtools/buildchroot/buildchroot-host.bb b/meta/recipes-devtools/buildchroot/buildchroot-host.bb
> index daf92a2..01d426d 100644
> --- a/meta/recipes-devtools/buildchroot/buildchroot-host.bb
> +++ b/meta/recipes-devtools/buildchroot/buildchroot-host.bb
> @@ -30,5 +30,5 @@ BUILDCHROOT_PREINSTALL_append_arm64 += "binutils-aarch64-linux-gnu \
> crossbuild-essential-arm64"
>
>
> -PARAMS = "--host-arch"
> +PARAMS = "--host-arch --host-distro"
> do_build[depends] = "isar-apt:do_cache_config isar-bootstrap-host:do_bootstrap"
>
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 2/2] cross-compilation: Fixes build broken with host-distro != target-distro
2018-09-05 8:29 ` Jan Kiszka
@ 2018-09-05 12:48 ` Jan Kiszka
0 siblings, 0 replies; 5+ messages in thread
From: Jan Kiszka @ 2018-09-05 12:48 UTC (permalink / raw)
To: Maxim Yu. Osipov, isar-users
On 2018-09-05 10:29, [ext] Jan Kiszka wrote:
> On 2018-09-05 10:16, Maxim Yu. Osipov wrote:
>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>
>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>
> It's good the see that my workaround is apparently also a solution. But
> this still lacks the explanation, and I'm still unable to provide that.
> So please help, specifically by answering the questions I raised in the
> original bug report.
>
[...]
>> --- a/meta/recipes-devtools/buildchroot/buildchroot-host.bb
>> +++ b/meta/recipes-devtools/buildchroot/buildchroot-host.bb
>> @@ -30,5 +30,5 @@ BUILDCHROOT_PREINSTALL_append_arm64 +=
>> "binutils-aarch64-linux-gnu \
>> crossbuild-essential-arm64"
>> -PARAMS = "--host-arch"
>> +PARAMS = "--host-arch --host-distro"
>> do_build[depends] = "isar-apt:do_cache_config
>> isar-bootstrap-host:do_bootstrap"
>>
For this part of the commit, I originally had the following written in
my queue:
"Because we were not passing --host-distro to setup_root_file_system,
that helper defaulted to the target distro. And that broke the
crossbuild if the target distro differed from the host one."
If you can provide a reasoning for the first half, either in this patch
or in form of a separate one (I suspect that this will look nicer), I
would be happy.
Jan
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-09-05 12:48 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-05 8:16 [PATCH v2 0/2] Various fixes Maxim Yu. Osipov
2018-09-05 8:16 ` [PATCH v2 1/2] sdk: Move deployment to populate_sdk Maxim Yu. Osipov
2018-09-05 8:16 ` [PATCH v2 2/2] cross-compilation: Fixes build broken with host-distro != target-distro Maxim Yu. Osipov
2018-09-05 8:29 ` Jan Kiszka
2018-09-05 12:48 ` Jan Kiszka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox