image_types: Fix bmaptool support for RSS
PATCH 1/1 image_types: Fix bmaptool support for RSS
With RSS we need to ensure that when making a bmap image that the python3 that we created is found via /usr/bin/env rather than the host python3. Otherwise we're relying on the build host to have bmaptool support installed.
---
I played around with a few ways to try and fix this problem, and this was the best I could come up with. Once this is in we need this in pyro as well as it's broken there too.
--- meta/classes/image_types.bbclass | 3 +++ 1 file changed, 3 insertions(+)
meta/classes/image_types.bbclass +3 -0
@@ -311,3 +311,6 @@ DEPLOYABLE_IMAGE_TYPES ?= "hddimg iso" # The IMAGE_TYPES_MASKED variable will be used to mask out from the IMAGE_FSTYPES, # images that will not be built at do_rootfs time: vmdk, vdi, qcow2, hdddirect, hddimg, iso, etc. IMAGE_TYPES_MASKED ?= "" + +# bmap requires python3 to be in the PATH +EXTRANATIVEPATH += "${@'python3-native' if d.getVar('IMAGE_FSTYPES').find('bmap') else ''}"
Signature · 1 line
1.9.1
Quoted 11 lines · Tom Rini
With RSS we need to ensure that when making a bmap image that the python3 that we created is found via
/usr/bin/envrather than the host python3. Otherwise we're relying on the build host to have bmaptool support installed.Signed-off-by Tom Rini <[email protected]>---
I played around with a few ways to try and fix this problem, and this was the best I could come up with. Once this is in we need this in pyro as well as it's broken there too.
Doesn't bmap in Pyro use Python 2?
Ross
Quoted 7 lines · Ross
Quoted 5 lines · Tom Rini
With RSS we need to ensure that when making a bmap image that the python3 that we created is found via
/usr/bin/envrather than the host python3. Otherwise we're relying on the build host to have bmaptool support installed.
Quoted 7 lines
Quoted 5 lines
Signed-off-by Tom Rini <[email protected]>---
I played around with a few ways to try and fix this problem, and this was the best I could come up with. Once this is in we need this in pyro as well as it's broken there too.Doesn't bmap in Pyro use Python 2?
I hadn't tested my fix in pyro yet, only confirmed that it was broken there. I'll check and get back to you on that part.
Signature · 1 line
Tom
Quoted 14 lines · Tom Rini
Quoted 13 lines · Ross
Quoted 10 lines · Tom Rini
With RSS we need to ensure that when making a bmap image that the python3 that we created is found via
/usr/bin/envrather than the host python3. Otherwise we're relying on the build host to have bmaptool support installed.Signed-off-by Tom Rini <[email protected]>---
I played around with a few ways to try and fix this problem, and this was the best I could come up with. Once this is in we need this in pyro as well as it's broken there too.
Quoted 4 lines
Quoted 1 line
Doesn't bmap in Pyro use Python 2?
I hadn't tested my fix in pyro yet, only confirmed that it was broken there. I'll check and get back to you on that part.
OK, I need to investigate the pyro failure I saw more to see what else was going in there. Just oe-core pyro is fine as bamptool uses python2 and .../recipe-sysroot-native/usr/bin/bmaptool is /usr/bin/env nativepython which is also in usr/bin and is thus found.
Signature · 1 line
Tom
Quoted 19 lines · Tom Rini
With RSS we need to ensure that when making a bmap image that the python3 that we created is found via
/usr/bin/envrather than the host python3. Otherwise we're relying on the build host to have bmaptool support installed.Signed-off-by Tom Rini <[email protected]>---
I played around with a few ways to try and fix this problem, and this was the best I could come up with. Once this is in we need this in pyro as well as it's broken there too.--- meta/classes/image_types.bbclass | 3 +++ 1 file changed, 3 insertions(+)meta/classes/image_types.bbclass +0
-0
meta/classes/image_types.bbclass DEPLOYABLE_IMAGE_TYPES ?= "hddimg iso"
Quoted 7 lines
meta/classes/image_types.bbclass +3
-1@@ -311,3 +311,6 @@ DEPLOYABLE_IMAGE_TYPES ?= "hddimg iso" # The IMAGE_TYPES_MASKED variable will be used to mask out from the IMAGE_FSTYPES, # images that will not be built at do_rootfs time: vmdk, vdi, qcow2, hdddirect, hddimg, iso, etc. IMAGE_TYPES_MASKED ?= "" + +# bmap requires python3 to be in the PATH +EXTRANATIVEPATH += "${@'python3-native' if d.getVar('IMAGE_FSTYPES').find('bmap') else ''}" --
I think somewhere inherit python3native should fix it.
Quoted 7 lines
1.9.1
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Quoted 15 lines · Khem Raj
Quoted 14 lines · Tom Rini
With RSS we need to ensure that when making a bmap image that the python3 that we created is found via
/usr/bin/envrather than the host python3. Otherwise we're relying on the build host to have bmaptool support installed.Signed-off-by Tom Rini <[email protected]>---
I played around with a few ways to try and fix this problem, and this was the best I could come up with. Once this is in we need this in pyro as well as it's broken there too.--- meta/classes/image_types.bbclass | 3 +++ 1 file changed, 3 insertions(+)
Quoted 14 lines
meta/classes/image_types.bbclass DEPLOYABLE_IMAGE_TYPES ?= "hddimg iso"
Quoted 12 lines
meta/classes/image_types.bbclass +3
-1@@ -311,3 +311,6 @@ DEPLOYABLE_IMAGE_TYPES ?= "hddimg iso" # The IMAGE_TYPES_MASKED variable will be used to mask out from the IMAGE_FSTYPES, # images that will not be built at do_rootfs time: vmdk, vdi, qcow2, hdddirect, hddimg, iso, etc. IMAGE_TYPES_MASKED ?= "" + +# bmap requires python3 to be in the PATH +EXTRANATIVEPATH += "${@'python3-native' if d.getVar('IMAGE_FSTYPES').find('bmap') else ''}" --I think somewhere inherit python3native should fix it.
Yes, image_types.bbclass could also inherit python3native but that seemed heavy-handed. There's not some other place that should be doing it as the problem is saying we want to call bmaptool, and that's handled here.
Signature · 1 line
Tom
Quoted 6 lines · Tom Rini
Quoted 5 lines · Khem Raj
Quoted 4 lines · Tom Rini
With RSS we need to ensure that when making a bmap image that the python3 that we created is found via
/usr/bin/envrather than the host python3. Otherwise we're relying on the build host to have bmaptool support installed.
Who is staging python3 native here may be that's where it could be added
Quoted 39 lines
Quoted 6 lines
Quoted 6 lines
Signed-off-by Tom Rini <[email protected]>---
I played around with a few ways to try and fix this problem, and this was the best I could come up with. Once this is in we need this inpyro
Quoted 6 lines
Review
Quoted 6 lines
as well as it's broken there too.
--- meta/classes/image_types.bbclass | 3 +++ 1 file changed, 3 insertions(+)(quoted diff) +0
-0b/meta/classes/image_types.bbclass
Quoted 5 lines
meta/classes/image_types.bbclass DEPLOYABLE_IMAGE_TYPES ?= "hddimg iso" · line 311
Quoted 5 lines
index
61dca626311e..3ff960e3a889100644meta/classes/image_types.bbclass +0
-0@@ -311,3 +311,6 @@ DEPLOYABLE_IMAGE_TYPES ?= "hddimg iso" # The IMAGE_TYPES_MASKED variable will be used to mask out from the
IMAGE_FSTYPES,Quoted 1 line
meta/classes/image_types.bbclass DEPLOYABLE_IMAGE_TYPES ?= "hddimg iso" · line 312
Quoted 1 line
meta/classes/image_types.bbclass +0
-0# images that will not be built at do_rootfs time: vmdk, vdi, qcow2,hdddirect, hddimg, iso, etc.
Quoted 4 lines
meta/classes/image_types.bbclass DEPLOYABLE_IMAGE_TYPES ?= "hddimg iso"
Quoted 4 lines
meta/classes/image_types.bbclass +3
-0IMAGE_TYPES_MASKED ?= "" + +# bmap requires python3 to be in the PATH +EXTRANATIVEPATH += "${@'python3-native' ifd.getVar('IMAGE_FSTYPES').find('bmap') else ''}"
Quoted 3 lines
Quoted 1 line
--
I think somewhere inherit python3native should fix it.
Yes, image_types.bbclass could also inherit python3native but that seemed heavy-handed. There's not some other place that should be doing it as the problem is saying we want to call bmaptool, and that's handled here.
--
Tom
Quoted 10 lines · Khem Raj
Quoted 6 lines · Tom Rini
Quoted 5 lines · Khem Raj
Quoted 4 lines · Tom Rini
With RSS we need to ensure that when making a bmap image that the python3 that we created is found via
/usr/bin/envrather than the host python3. Otherwise we're relying on the build host to have bmaptool support installed.Who is staging python3 native here may be that's where it could be added
What do you mean? Adding whatever.bmap to IMAGE_FSTYPES is valid and how you get the bmap file for the whatever image type. bmap-tool-native is correctly inherit'ing python3native which is why it's staged correctly. It's just that images aren't adding the EXTRANATIVEPATH that's required because nothing is telling them that bmap requires it.
Quoted 40 lines
Quoted 40 lines
Quoted 7 lines
Quoted 7 lines
Signed-off-by Tom Rini <[email protected]>---
I played around with a few ways to try and fix this problem, and this was the best I could come up with. Once this is in we need this inpyro
Quoted 6 lines
Review
Quoted 6 lines
as well as it's broken there too.
--- meta/classes/image_types.bbclass | 3 +++ 1 file changed, 3 insertions(+)(quoted diff) +0
-0b/meta/classes/image_types.bbclass
Quoted 5 lines
meta/classes/image_types.bbclass DEPLOYABLE_IMAGE_TYPES ?= "hddimg iso" · line 311
Quoted 5 lines
index
61dca626311e..3ff960e3a889100644meta/classes/image_types.bbclass +0
-0@@ -311,3 +311,6 @@ DEPLOYABLE_IMAGE_TYPES ?= "hddimg iso" # The IMAGE_TYPES_MASKED variable will be used to mask out from the
IMAGE_FSTYPES,Quoted 1 line
meta/classes/image_types.bbclass DEPLOYABLE_IMAGE_TYPES ?= "hddimg iso" · line 312
Quoted 1 line
meta/classes/image_types.bbclass +0
-0# images that will not be built at do_rootfs time: vmdk, vdi, qcow2,hdddirect, hddimg, iso, etc.
Quoted 4 lines
meta/classes/image_types.bbclass DEPLOYABLE_IMAGE_TYPES ?= "hddimg iso"
Quoted 4 lines
meta/classes/image_types.bbclass +3
-0IMAGE_TYPES_MASKED ?= "" + +# bmap requires python3 to be in the PATH +EXTRANATIVEPATH += "${@'python3-native' ifd.getVar('IMAGE_FSTYPES').find('bmap') else ''}"
Quoted 3 lines
Quoted 1 line
--
I think somewhere inherit python3native should fix it.
Yes, image_types.bbclass could also inherit python3native but that seemed heavy-handed. There's not some other place that should be doing it as the problem is saying we want to call bmaptool, and that's handled here.
--
Tom
Signature · 1 line
Tom
Quoted 10 lines · Tom Rini
Quoted 9 lines · Khem Raj
Quoted 6 lines · Tom Rini
Quoted 5 lines · Khem Raj
Quoted 4 lines · Tom Rini
With RSS we need to ensure that when making a bmap image that the python3 that we created is found via
/usr/bin/envrather than the host python3. Otherwise we're relying on the build host to have bmaptool support installed.
Quoted 7 lines
Quoted 1 line
Who is staging python3 native here may be that's where it could be added
What do you mean? Adding whatever.bmap to
IMAGE_FSTYPESis valid and how you get the bmap file for the whatever image type. bmap-tool-native is correctly inherit'ing python3native which is why it's staged correctly. It's just that images aren't adding the EXTRANATIVEPATH that's required because nothing is telling them that bmap requires it.
hmm, I see, I wonder if these paths should be added unconditionally. During image build.
Quoted 5 lines · Tom Rini
With RSS we need to ensure that when making a bmap image that the python3 that we created is found via
/usr/bin/envrather than the host python3. Otherwise we're relying on the build host to have bmaptool support installed.
Can you suggest how to reproduce the issue you're trying to fix with this patch?
Here is what I did:
1. Checked if bmaptools are available for host python3:
$ python3 -c 'import bmaptools' Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: No module named 'bmaptools'
2. Added cpio.bmap to my build configuration:
$ grep ^IMAGE_FSTYPES ./conf/local.conf IMAGE_FSTYPES = "cpio.bmap"
3. Built core-image-minimal:
[build (master)]$ rm -rf tmp/
[build (master)]$ bitbake core-image-minimal
...
NOTE: Tasks Summary: Attempted 2395 tasks of which 2186 didn't need to be rerun and all succeeded.
4. Checked if bmap file has been generated:
[build (master)]$ ls ./tmp/deploy/images/qemux86-64/ |grep cpio core-image-minimal-qemux86-64-20170928135949.rootfs.cpio.bmap core-image-minimal-qemux86-64.cpio.bmap
Hm, cpio image got removed for some reason. Looks like a bug, but not related to bmaptool. (I remember you're fixing that code some time ago).
Should I use another MACHINE or anything else that can trigger build failure?
PS. I used latest poky master. commit id: fcdfe09d9cc4e2977bd602dfd18f729cd9f6d73d
Quoted 28 lines
Signed-off-by Tom Rini <[email protected]>---
I played around with a few ways to try and fix this problem, and this was the best I could come up with. Once this is in we need this in pyro as well as it's broken there too.--- meta/classes/image_types.bbclass | 3 +++ 1 file changed, 3 insertions(+)meta/classes/image_types.bbclass +3
-0@@ -311,3 +311,6 @@ DEPLOYABLE_IMAGE_TYPES ?= "hddimg iso" # The IMAGE_TYPES_MASKED variable will be used to mask out from the IMAGE_FSTYPES, # images that will not be built at do_rootfs time: vmdk, vdi, qcow2, hdddirect, hddimg, iso, etc. IMAGE_TYPES_MASKED ?= "" + +# bmap requires python3 to be in the PATH +EXTRANATIVEPATH += "${@'python3-native' if d.getVar('IMAGE_FSTYPES').find('bmap') else ''}"Signature · 7 lines
1.9.1 -- _______________________________________________ Openembedded-core mailing list [email protected] http://lists.openembedded.org/mailman/listinfo/openembedded-core
--
Regards,
Ed
Quoted 36 lines · Ed Bartosh
Quoted 5 lines · Tom Rini
With RSS we need to ensure that when making a bmap image that the python3 that we created is found via
/usr/bin/envrather than the host python3. Otherwise we're relying on the build host to have bmaptool support installed.Can you suggest how to reproduce the issue you're trying to fix with this patch?
Here is what I did:
1. Checked if bmaptools are available for host python3:
$ python3 -c 'import bmaptools' Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: No module named 'bmaptools'2. Added cpio.bmap to my build configuration:
$ grep ^IMAGE_FSTYPES ./conf/local.conf IMAGE_FSTYPES = "cpio.bmap"3. Built core-image-minimal:
[build (master)]$ rm -rf tmp/
[build (master)]$ bitbake core-image-minimal
...
NOTE: Tasks Summary: Attempted 2395 tasks of which 2186 didn't need to be rerun and all succeeded.4. Checked if bmap file has been generated:
[build (master)]$ ls ./tmp/deploy/images/qemux86-64/ |grep cpio core-image-minimal-qemux86-64-20170928135949.rootfs.cpio.bmap core-image-minimal-qemux86-64.cpio.bmap
Quoted 7 lines
Hm, cpio image got removed for some reason. Looks like a bug, but not related to bmaptool. (I remember you're fixing that code some time ago).
Should I use another MACHINE or anything else that can trigger build failure?
PS. I used latest poky master. commit id:
fcdfe09d9cc4e2977bd602dfd18f729cd9f6d73d
I'm on oe-core only, abf2e9526a11bcb51b71b90a7b76bd33af656494 and just replicated the problem again. I'm doing ext4.bmap, but that shouldn't matter.
Signature · 1 line
Tom
Quoted 19 lines · Tom Rini
With RSS we need to ensure that when making a bmap image that the python3 that we created is found via
/usr/bin/envrather than the host python3. Otherwise we're relying on the build host to have bmaptool support installed.Signed-off-by Tom Rini <[email protected]>---
I played around with a few ways to try and fix this problem, and this was the best I could come up with. Once this is in we need this in pyro as well as it's broken there too.--- meta/classes/image_types.bbclass | 3 +++ 1 file changed, 3 insertions(+)meta/classes/image_types.bbclass +0
-0
meta/classes/image_types.bbclass DEPLOYABLE_IMAGE_TYPES ?= "hddimg iso" · line 316
Quoted 6 lines
meta/classes/image_types.bbclass +3
-0@@ -311,3 +311,6 @@ DEPLOYABLE_IMAGE_TYPES ?= "hddimg iso" # The IMAGE_TYPES_MASKED variable will be used to mask out from the IMAGE_FSTYPES, # images that will not be built at do_rootfs time: vmdk, vdi, qcow2, hdddirect, hddimg, iso, etc. IMAGE_TYPES_MASKED ?= "" + +# bmap requires python3 to be in the PATH +EXTRANATIVEPATH += "${@'python3-native' if d.getVar('IMAGE_FSTYPES').find('bmap') else ''}"
+1
Would ...find('.bmap') be a bit more safe?
--
Regards,
Ed
Quoted 29 lines · Ed Bartosh
Quoted 19 lines · Tom Rini
With RSS we need to ensure that when making a bmap image that the python3 that we created is found via
/usr/bin/envrather than the host python3. Otherwise we're relying on the build host to have bmaptool support installed.Signed-off-by Tom Rini <[email protected]>---
I played around with a few ways to try and fix this problem, and this was the best I could come up with. Once this is in we need this in pyro as well as it's broken there too.--- meta/classes/image_types.bbclass | 3 +++ 1 file changed, 3 insertions(+)meta/classes/image_types.bbclass +0
-0meta/classes/image_types.bbclass DEPLOYABLE_IMAGE_TYPES ?= "hddimg iso" · line 316
Quoted 6 lines
meta/classes/image_types.bbclass +3
-0@@ -311,3 +311,6 @@ DEPLOYABLE_IMAGE_TYPES ?= "hddimg iso" # The IMAGE_TYPES_MASKED variable will be used to mask out from the IMAGE_FSTYPES, # images that will not be built at do_rootfs time: vmdk, vdi, qcow2, hdddirect, hddimg, iso, etc. IMAGE_TYPES_MASKED ?= "" + +# bmap requires python3 to be in the PATH +EXTRANATIVEPATH += "${@'python3-native' if d.getVar('IMAGE_FSTYPES').find('bmap') else ''}"+1
Quoted 1 line
Would ...find('.bmap') be a bit more safe?
Could be. Do I need to v2 or can someone just fix up while applying? Thanks!
Signature · 1 line
Tom
Quoted 30 lines · Tom Rini
Quoted 29 lines · Ed Bartosh
Quoted 19 lines · Tom Rini
With RSS we need to ensure that when making a bmap image that the python3 that we created is found via
/usr/bin/envrather than the host python3. Otherwise we're relying on the build host to have bmaptool support installed.Signed-off-by Tom Rini <[email protected]>---
I played around with a few ways to try and fix this problem, and this was the best I could come up with. Once this is in we need this in pyro as well as it's broken there too.--- meta/classes/image_types.bbclass | 3 +++ 1 file changed, 3 insertions(+)meta/classes/image_types.bbclass +0
-0meta/classes/image_types.bbclass DEPLOYABLE_IMAGE_TYPES ?= "hddimg iso" · line 316
Quoted 6 lines
meta/classes/image_types.bbclass +3
-0@@ -311,3 +311,6 @@ DEPLOYABLE_IMAGE_TYPES ?= "hddimg iso" # The IMAGE_TYPES_MASKED variable will be used to mask out from the IMAGE_FSTYPES, # images that will not be built at do_rootfs time: vmdk, vdi, qcow2, hdddirect, hddimg, iso, etc. IMAGE_TYPES_MASKED ?= "" + +# bmap requires python3 to be in the PATH +EXTRANATIVEPATH += "${@'python3-native' if d.getVar('IMAGE_FSTYPES').find('bmap') else ''}"+1
Quoted 3 lines
Quoted 1 line
Would ...find('.bmap') be a bit more safe?
Could be. Do I need to v2 or can someone just fix up while applying?
Please send v2.
--
Regards,
Ed
PATCH v2 1/1 image_types: Fix bmaptool support for RSS
In reply to Tom RiniWith RSS we need to ensure that when making a bmap image that the python3 that we created is found via /usr/bin/env rather than the host python3. Otherwise we're relying on the build host to have bmaptool support installed.
---
Changes in v2:
- Switch to checking for '.bmap' not 'bmap', per Ed Bartosh.
--- meta/classes/image_types.bbclass | 3 +++ 1 file changed, 3 insertions(+)
meta/classes/image_types.bbclass +3 -0
@@ -311,3 +311,6 @@ DEPLOYABLE_IMAGE_TYPES ?= "hddimg iso" # The IMAGE_TYPES_MASKED variable will be used to mask out from the IMAGE_FSTYPES, # images that will not be built at do_rootfs time: vmdk, vdi, qcow2, hdddirect, hddimg, iso, etc. IMAGE_TYPES_MASKED ?= "" + +# bmap requires python3 to be in the PATH +EXTRANATIVEPATH += "${@'python3-native' if d.getVar('IMAGE_FSTYPES').find('.bmap') else ''}"
Signature · 1 line
1.9.1
Quoted 5 lines · Tom Rini
With RSS we need to ensure that when making a bmap image that the python3 that we created is found via
/usr/bin/envrather than the host python3. Otherwise we're relying on the build host to have bmaptool support installed.
Thank you for the patch.
+1
Quoted 27 lines
Signed-off-by Tom Rini <[email protected]>---
Changes in v2:
- Switch to checking for '.bmap' not 'bmap', per Ed Bartosh.--- meta/classes/image_types.bbclass | 3 +++ 1 file changed, 3 insertions(+)meta/classes/image_types.bbclass +3
-0@@ -311,3 +311,6 @@ DEPLOYABLE_IMAGE_TYPES ?= "hddimg iso" # The IMAGE_TYPES_MASKED variable will be used to mask out from the IMAGE_FSTYPES, # images that will not be built at do_rootfs time: vmdk, vdi, qcow2, hdddirect, hddimg, iso, etc. IMAGE_TYPES_MASKED ?= "" + +# bmap requires python3 to be in the PATH +EXTRANATIVEPATH += "${@'python3-native' if d.getVar('IMAGE_FSTYPES').find('.bmap') else ''}"Signature · 7 lines
1.9.1 -- _______________________________________________ Openembedded-core mailing list [email protected] http://lists.openembedded.org/mailman/listinfo/openembedded-core
Signature · 3 lines
-- Regards, Ed