Skip to contentSkip to conversation

xen: run do_deploy after do_compile and do_populate_sysroot

PATCH In review Diego Sueiro 4 participants 9 messages Oct 27, 2020 – Nov 3, 2020 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 xen: run do_deploy after do_compile and do_populate_sysroot

When having rm_work and bitbake needs to re-run do_deploy, we need to ensure that the ${B} is re-generated, otherwise the deploy-xen will be empty.

---
 recipes-extended/xen/xen-hypervisor.inc | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
recipes-extended/xen/xen-hypervisor.inc +5 -3
index 3bfee8e..6a75d16 100644
@@ -76,11 +76,13 @@ do_deploy() {
 #   at least run afer that task has completed
 # - the hypervisor binaries may be included in the image filesystem, so we
 #   must ensure that the binaries deployed match what is staged in the sysroot:
-#   so do deploy must run after do_populate_sysroot -- which is always after
-#   do_compile, so that handles 'after do_compile' too
+#   so do_deploy must run after do_populate_sysroot and after do_compile is
+#   also needed for when having rm_work and bitbake needs to re-run do_deploy,
+#   we ensure that the ${B} is re-generated, otherwise the deploy-xen will be
+#   empty
 # - add the task before do_build to ensure that deployment has completed when
 #   the recipe build done stamp is written
-addtask deploy after do_populate_sysroot before do_build
+addtask deploy after do_compile do_populate_sysroot before do_build
 # To ensure that a deployed hypervisor has matching tools, add a dependency to
 # make sure that the tools have built and been staged:
 do_deploy[depends] += "xen-tools:do_populate_sysroot"
Signature · 1 line
2.17.1
#1 lore raw

PATCH 2/2 xen: extend SYSROOT_DIRS

The do_install task also ships files to /boot and /usr/lib64. Hence, extend SYSROOT_DIRS to include these paths.

---
 recipes-extended/xen/xen-hypervisor.inc | 2 ++
 1 file changed, 2 insertions(+)
recipes-extended/xen/xen-hypervisor.inc +2 -0
index 6a75d16..916bd3c 100644
@@ -55,6 +55,8 @@ do_compile() {
 do_install() {
     oe_runmake DESTDIR="${D}" install-xen
 }
+# The do_install also ships files in /boot and /usr/lib64
+SYSROOT_DIRS += "/boot ${exec_prefix}/lib64"
 
 do_deploy() {
     install -d ${DEPLOYDIR}
Signature · 1 line
2.17.1
Reviewed-by on v1 2/2
#2 lore raw

Re: [meta-virtualization] [PATCH 2/2] xen: extend SYSROOT_DIRS

Hi,

Quoted 6 lines · Diego Sueiro via lists.yoctoproject.org

The do_install task also ships files to /boot and /usr/lib64. Hence, extend SYSROOT_DIRS to include these paths.

Cheers
Bertrand

Quoted 23 lines

---
recipes-extended/xen/xen-hypervisor.inc | 2 ++

1 file changed, 2 insertions(+)
recipes-extended/xen/xen-hypervisor.inc +2 -0
index 6a75d16..916bd3c 100644
@@ -55,6 +55,8 @@ do_compile() {
 do_install() {
    oe_runmake DESTDIR="${D}" install-xen
 }
+# The do_install also ships files in /boot and /usr/lib64
+SYSROOT_DIRS += "/boot ${exec_prefix}/lib64"
 
 do_deploy() {
    install -d ${DEPLOYDIR}
Signature · 1 line
2.17.1
Reviewed-by on v1 1/2
#3 lore raw
In reply to Diego Sueiro

Hi,

Quoted 4 lines · Diego Sueiro via lists.yoctoproject.org

When having rm_work and bitbake needs to re-run do_deploy, we need to ensure that the ${B} is re-generated, otherwise the deploy-xen will be empty.

I can confirm this was encountered by me to and this is solving it.

Quoted 2 lines

Cheers
Bertrand

Quoted 31 lines

---
recipes-extended/xen/xen-hypervisor.inc | 8 +++++---

1 file changed, 5 insertions(+), 3 deletions(-)
recipes-extended/xen/xen-hypervisor.inc +5 -3
index 3bfee8e..6a75d16 100644
@@ -76,11 +76,13 @@ do_deploy() {
 #   at least run afer that task has completed
 # - the hypervisor binaries may be included in the image filesystem, so we
 #   must ensure that the binaries deployed match what is staged in the sysroot:
-#   so do deploy must run after do_populate_sysroot -- which is always after
-#   do_compile, so that handles 'after do_compile' too
+#   so do_deploy must run after do_populate_sysroot and after do_compile is
+#   also needed for when having rm_work and bitbake needs to re-run do_deploy,
+#   we ensure that the ${B} is re-generated, otherwise the deploy-xen will be
+#   empty
 # - add the task before do_build to ensure that deployment has completed when
 #   the recipe build done stamp is written
-addtask deploy after do_populate_sysroot before do_build
+addtask deploy after do_compile do_populate_sysroot before do_build
 # To ensure that a deployed hypervisor has matching tools, add a dependency to
 # make sure that the tools have built and been staged:

do_deploy[depends] += "xen-tools:do_populate_sysroot"

Signature · 1 line
2.17.1
Reviewed-by
#4 lore raw
Quoted 9 lines · Bertrand Marquis

Hi,

Quoted 4 lines · Diego Sueiro via lists.yoctoproject.org

When having rm_work and bitbake needs to re-run do_deploy, we need to ensure that the ${B} is re-generated, otherwise the deploy-xen will be empty.

I can confirm this was encountered by me to and this is solving it.

This change makes sense and thanks for including the update to comment in the commit.

Quoted 2 lines
Quoted 1 line

Christopher

Quoted 36 lines

Cheers
Bertrand

Quoted 31 lines

---
recipes-extended/xen/xen-hypervisor.inc | 8 +++++---

1 file changed, 5 insertions(+), 3 deletions(-)
recipes-extended/xen/xen-hypervisor.inc +5 -3
index 3bfee8e..6a75d16 100644
@@ -76,11 +76,13 @@ do_deploy() {
 #   at least run afer that task has completed
 # - the hypervisor binaries may be included in the image filesystem, so we
 #   must ensure that the binaries deployed match what is staged in the sysroot:
-#   so do deploy must run after do_populate_sysroot -- which is always after
-#   do_compile, so that handles 'after do_compile' too
+#   so do_deploy must run after do_populate_sysroot and after do_compile is
+#   also needed for when having rm_work and bitbake needs to re-run do_deploy,
+#   we ensure that the ${B} is re-generated, otherwise the deploy-xen will be
+#   empty
 # - add the task before do_build to ensure that deployment has completed when
 #   the recipe build done stamp is written
-addtask deploy after do_populate_sysroot before do_build
+addtask deploy after do_compile do_populate_sysroot before do_build
 # To ensure that a deployed hypervisor has matching tools, add a dependency to
 # make sure that the tools have built and been staged:

do_deploy[depends] += "xen-tools:do_populate_sysroot" --
2.17.1

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw

Re: [meta-virtualization] [PATCH 2/2] xen: extend SYSROOT_DIRS

Quoted 10 lines

-----Original Message-----
From: [email protected] <meta- [email protected]> On Behalf Of Diego Sueiro via lists.yoctoproject.org
Sent: 27 October 2020 15:56
To: [email protected]
Cc: nd <[email protected]>; Diego Sueiro <[email protected]>; [email protected]; [email protected]
Subject: [meta-virtualization] [PATCH 2/2] xen: extend SYSROOT_DIRS

Quoted 4 lines

The do_install task also ships files to /boot and /usr/lib64. Hence, extend SYSROOT_DIRS to include these paths.

@Christopher,
Can you please also review this patch?

Thanks,

--
Diego Sueiro

Quoted 19 lines

---
recipes-extended/xen/xen-hypervisor.inc | 2 ++

1 file changed, 2 insertions(+)
recipes- renamed from recipes-extended/xen/xen-hypervisor.inc +0 -0

extended/xen/xen-hypervisor.inc
index 6a75d16..916bd3c 100644

recipes-extended/xen/xen-hypervisor.inc +2 -1
@@ -55,6 +55,8 @@ do_compile() {
 do_install() {
    oe_runmake DESTDIR="${D}" install-xen  }
+# The do_install also ships files in /boot and /usr/lib64 SYSROOT_DIRS
++= "/boot ${exec_prefix}/lib64"
 
 do_deploy() {
    install -d ${DEPLOYDIR}
--

2.17.1

#7 lore raw

Re: [meta-virtualization] [PATCH 2/2] xen: extend SYSROOT_DIRS

Quoted 16 lines · Diego Sueiro



Quoted 11 lines

-----Original Message-----
From: [email protected] <meta- [email protected]> On Behalf Of Diego Sueiro via lists.yoctoproject.org
Sent: 27 October 2020 15:56
To: [email protected]
Cc: nd <[email protected]>; Diego Sueiro <[email protected]>; [email protected]; [email protected]
Subject: [meta-virtualization] [PATCH 2/2] xen: extend SYSROOT_DIRS

Quoted 7 lines
Quoted 4 lines

The do_install task also ships files to /boot and /usr/lib64. Hence, extend SYSROOT_DIRS to include these paths.

@Christopher,
Can you please also review this patch?

Hi Diego,

I started on reviewing this but it took a little longer than I'd anticipated as it requires it digging into what the SYSROOT_DIRS variable does.

The variables you use for the directories being added look ok, given that the recipe does install to there, but I don't quite understand why they need to be added to SYSROOT_DIRS. Does every directory that the recipe installs to need to be listed in that variable? I saw that ${bindir} is not listed as included in it by default in the Yocto mega-manual docs. What behaviour is this change intended to fix? Could it be described in the commit message?

Christopher

Quoted 26 lines

Thanks,

--
Diego Sueiro

Quoted 19 lines

---
recipes-extended/xen/xen-hypervisor.inc | 2 ++

1 file changed, 2 insertions(+)
recipes- renamed from recipes-extended/xen/xen-hypervisor.inc +0 -0

extended/xen/xen-hypervisor.inc
index 6a75d16..916bd3c 100644

recipes-extended/xen/xen-hypervisor.inc +2 -1
@@ -55,6 +55,8 @@ do_compile() {
 do_install() {
   oe_runmake DESTDIR="${D}" install-xen  }
+# The do_install also ships files in /boot and /usr/lib64 SYSROOT_DIRS
++= "/boot ${exec_prefix}/lib64"
 
 do_deploy() {
   install -d ${DEPLOYDIR}
--

2.17.1

#8 lore raw

Re: [meta-virtualization] [PATCH 2/2] xen: extend SYSROOT_DIRS

Quoted 39 lines

-----Original Message-----
From: [email protected] <meta- [email protected]> On Behalf Of Christopher Clark via lists.yoctoproject.org
Sent: 30 October 2020 18:09
To: Diego Sueiro <[email protected]>
Cc: [email protected]; nd <[email protected]>; [email protected]
Subject: Re: [meta-virtualization] [PATCH 2/2] xen: extend SYSROOT_DIRS

Quoted 14 lines · Diego Sueiro
Quoted 13 lines

-----Original Message-----
From: [email protected] <meta- [email protected]> On Behalf Of Diego Sueiro via lists.yoctoproject.org
Sent: 27 October 2020 15:56
To: [email protected]
Cc: nd <[email protected]>; Diego Sueiro <[email protected]>; [email protected]; [email protected]
Subject: [meta-virtualization] [PATCH 2/2] xen: extend SYSROOT_DIRS

Quoted 7 lines
Quoted 4 lines

The do_install task also ships files to /boot and /usr/lib64. Hence, extend SYSROOT_DIRS to include these paths.

@Christopher,
Can you please also review this patch?

Hi Diego,

I started on reviewing this but it took a little longer than I'd anticipated as it requires it digging into what the SYSROOT_DIRS variable does.

Quoted 7 lines

The variables you use for the directories being added look ok, given that the recipe does install to there, but I don't quite understand why they need to be added to SYSROOT_DIRS. Does every directory that the recipe installs to need to be listed in that variable? I saw that ${bindir} is not listed as included in it by default in the Yocto mega-manual docs.
What behaviour is this change intended to fix? Could it be described in the commit message?

Quoting the manual (https://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#new-sharing-files-between-recipes):
" A subset of the files installed by the do_install task are used by the do_populate_sysroot task as defined by the the SYSROOT_DIRS variable to automatically populate the sysroot. It is possible to modify the list of directories that populate the sysroot. The following example shows how you could add the /opt directory to the list of directories within a recipe:

     SYSROOT_DIRS += "/opt"

"

If a recipe DEPENDS_${PN} = "xen", it expects all the installed files to be in the RECIPE_SYSROOT. In the case of xen, specially the shipped binaries, as of today only the sysroot is only including the /usr/lib/debug/xen-syms-4.14.0[.map] files.

I'll add more words in the commit message.

--
Diego Sueiro

Quoted 29 lines

Christopher

Quoted 26 lines

Thanks,

--
Diego Sueiro

Quoted 19 lines

---
recipes-extended/xen/xen-hypervisor.inc | 2 ++

1 file changed, 2 insertions(+)
recipes- renamed from recipes-extended/xen/xen-hypervisor.inc +0 -0

extended/xen/xen-hypervisor.inc index 6a75d16..916bd3c 100644

recipes-extended/xen/xen-hypervisor.inc +3 -1
@@ -55,6 +55,8 @@ do_compile() {
 do_install() {
   oe_runmake DESTDIR="${D}" install-xen  }
+# The do_install also ships files in /boot and /usr/lib64
+SYSROOT_DIRS
++= "/boot ${exec_prefix}/lib64"
 
 do_deploy() {
   install -d ${DEPLOYDIR}
--

2.17.1

#9 lore raw

Re: [meta-virtualization] [PATCH v2 2/2] xen: extend SYSROOT_DIRS to include installed binaries

In reply to Diego Sueiro

v2 looks good to me as well (FWIW: I had to do the same thing when implementing initramfs and qemu to ensure that extra parts of the qemu build were availble to recipes).

This is now merged.

Bruce

In message: [meta-virtualization] [PATCH v2 2/2] xen: extend SYSROOT_DIRS to include installed binaries

Quoted 32 lines · on 02/11/2020 Diego Sueiro wrote:

If a recipe DEPENDS on xen we should include its binaries in the sysroot. The do_install task also ships files to /boot and /usr/lib64. Hence, extend SYSROOT_DIRS to include these paths.

---
Changes in v2:
- Updated commit subject and message

 recipes-extended/xen/xen-hypervisor.inc | 2 ++
 1 file changed, 2 insertions(+)
recipes-extended/xen/xen-hypervisor.inc +2 -0
index 6a75d16..916bd3c 100644
@@ -55,6 +55,8 @@ do_compile() {
 do_install() {
     oe_runmake DESTDIR="${D}" install-xen
 }
+# The do_install also ships files in /boot and /usr/lib64
+SYSROOT_DIRS += "/boot ${exec_prefix}/lib64"
 
 do_deploy() {
     install -d ${DEPLOYDIR}
Signature · 1 line
2.17.1