[PATCH 1/1] classes/image: Separate image rootfs for machines

14 views
Skip to first unread message

Maxim Yu. Osipov

unread,
Mar 11, 2019, 1:04:17 PM3/11/19
to isar-...@googlegroups.com
Signed-off-by: Maxim Yu. Osipov <mos...@ilbers.de>
---
meta/classes/image.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 2514c88..ed9d6eb 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -3,7 +3,7 @@

IMAGE_INSTALL ?= ""
IMAGE_TYPE ?= "ext4-img"
-IMAGE_ROOTFS = "${WORKDIR}/rootfs"
+IMAGE_ROOTFS = "${WORKDIR}/${MACHINE}/rootfs/"

IMAGE_INSTALL += "${@ ("linux-image-" + d.getVar("KERNEL_NAME", True)) if d.getVar("KERNEL_NAME", True) else ""}"

--
2.11.0

Maxim Yu. Osipov

unread,
Mar 11, 2019, 1:04:17 PM3/11/19
to isar-...@googlegroups.com
Hi everybody,

Image rootfs gets overwritten when running for two targets
with the same pair DISTRO and DISTRO_ARCH, this results start_vm script failure.
This patch fixes the problem.

Regards,
Maxim.

Maxim Yu. Osipov (1):
classes/image: Separate image rootfs for machines

meta/classes/image.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--
2.11.0

Jan Kiszka

unread,
Mar 11, 2019, 2:00:15 PM3/11/19
to Maxim Yu. Osipov, isar-...@googlegroups.com
Hmm, I wonder if that is actually a sufficient change - or a needed one. Just
checked jailhouse-images, and there I do

PN .= "-${MACHINE}"

in the image recipe to ensure that distinct images (in different IMAGE_ROOTFS)
are built. That change above will still run the recipe multiple times,
overwriting at least the logs in confusing ways, if not more, no?

Jan

--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux

cedric_h...@mentor.com

unread,
Mar 11, 2019, 3:43:10 PM3/11/19
to isar-users
That change above will still run the recipe multiple times,
overwriting at least the logs in confusing ways, if not more, no?

agreed. should we align with OE and have tmp/work/${DISTRO_ARCH}-${DISTRO}, tmp/work/all-${DISTRO} and tmp/work/${MACHINE}-${DISTRO} instead of having everything land under tmp/work/${DISTRO}-${DISTRO_ARCH}/?

Jan Kiszka

unread,
Mar 12, 2019, 1:13:17 AM3/12/19
to cedric_h...@mentor.com, isar-users
We just need to be careful not to destroy legitimate sharing of packages this
way, e.g. if I build one kernel for multiple target boards. I think we are way
ahead of OE in this regard with using multiconfig.

Cedric Hombourger

unread,
Mar 12, 2019, 1:57:56 AM3/12/19
to isar-...@googlegroups.com, Cedric Hombourger
Maxim Yu. Osipov reported that the "rootfs" directory created by
Isar to build images gets overwritten when running for two targets
with the same pair DISTRO and DISTRO_ARCH. It became obvious after
looking at start_vm script failures. Place all image build artifacts
in $DISTRO-$MACHINE instead of $DISTRO-$DISTRO_ARCH. This change
remains compatible with multiconfig builds (validated with a CI
build).

Reported-by: Maxim Yu. Osipov <mos...@ilbers.de>
Signed-off-by: Cedric Hombourger <Cedric_H...@mentor.com>
---
meta/classes/isar-image.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/isar-image.bbclass b/meta/classes/isar-image.bbclass
index cdd1651..a7f71a4 100644
--- a/meta/classes/isar-image.bbclass
+++ b/meta/classes/isar-image.bbclass
@@ -19,7 +19,7 @@ DEPENDS += "${IMAGE_INSTALL} ${IMAGE_TRANSIENT_PACKAGES}"

IMAGE_TRANSIENT_PACKAGES += "isar-cfg-localepurge isar-cfg-rootpw"

-WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}"
+WORKDIR = "${TMPDIR}/work/${DISTRO}-${MACHINE}/${PN}"

ISAR_RELEASE_CMD_DEFAULT = "git -C ${LAYERDIR_core} describe --tags --dirty --match 'v[0-9].[0-9]*'"
ISAR_RELEASE_CMD ?= "${ISAR_RELEASE_CMD_DEFAULT}"
--
2.11.0

Maxim Yu. Osipov

unread,
Mar 12, 2019, 4:30:15 AM3/12/19
to Jan Kiszka, isar-...@googlegroups.com
Agree - this is the right approach.

Maxim.




--
Maxim Osipov
ilbers GmbH
Maria-Merian-Str. 8
85521 Ottobrunn
Germany
+49 (151) 6517 6917
mos...@ilbers.de
http://ilbers.de/
Commercial register Munich, HRB 214197
General Manager: Baurzhan Ismagulov

Maxim Yu. Osipov

unread,
Mar 12, 2019, 6:45:33 AM3/12/19
to Cedric Hombourger, isar-...@googlegroups.com
Hi Cedric,

1) I applied it and run 'ci_build -q -f' and build failed:

http://isar-build.org:8080/job/isar_mosipov_develop/52/

2) If we really want to move towards aligning with the OE as you suggest:

>should we align with OE and have tmp/work/${DISTRO_ARCH}-${DISTRO},
>tmp/work/all-${DISTRO} and tmp/work/${MACHINE}-${DISTRO} instead of
> having everything land under tmp/work/${DISTRO}-${DISTRO_ARCH}/?

this is the only first and partial step.

This time I will follow the way suggested by Jan by appending ${MACHINE}
to affected recipes.


Thanks,
Maxim.

Baurzhan Ismagulov

unread,
Mar 14, 2019, 6:54:07 AM3/14/19
to isar-users
Hello Cedric,

On Mon, Mar 11, 2019 at 12:43:10PM -0700, cedric_h...@mentor.com wrote:
> agreed. should we align with OE and have tmp/work/${DISTRO_ARCH}-${DISTRO},
> tmp/work/all-${DISTRO} and tmp/work/${MACHINE}-${DISTRO} instead of having
> everything land under tmp/work/${DISTRO}-${DISTRO_ARCH}/?

Thanks for a nice summary!

To make it clear: Maxim's current patch is a workaround fixing start_vm and CI
for the release. We do plan to fix the problem in a second step through
separating the work directories.

Regarding the structure, I find the separation
tmp/work/${DISTRO}-${DISTRO_ARCH}/${MACHINE} more intuitive, since one can
clearly see from the directory structure what belongs together:

* ${DISTRO}-${DISTRO_ARCH} + machine1
* ${DISTRO}-${DISTRO_ARCH} + machine2

rather than

* ${DISTRO_ARCH}-${DISTRO} + all-${DISTRO} + machine1-${DISTRO}
* ${DISTRO_ARCH}-${DISTRO} + all-${DISTRO} + machine2-${DISTRO}

Besides, all-${DISTRO} requires careful consideration, since OE really builds
them once by default, whereas we would build the _all.debs for every arch. That
is a good point, because we could optimize some bits here (dpkg-buildpackage
--build=all).

With kind regards,
Baurzhan.
Reply all
Reply to author
Forward
0 new messages