wic: bootimg-pcbios.py: optionally pass 'initrd' from .wks(.in) via sourceparams
PATCH v2 1/1 wic: bootimg-pcbios.py: optionally pass 'initrd' from .wks(.in) via sourceparams
optionally allow to pass 'initrd' from .wks(.in) via sourceparams
--- .../lib/wic/plugins/source/bootimg-pcbios.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
scripts/lib/wic/plugins/source/bootimg-pcbios.py +19 -0
@@ -169,6 +169,25 @@ class BootimgPcbiosPlugin(SourcePlugin): for install_cmd in cmds: exec_cmd(install_cmd) + # this is hardcoded to where the cpio.gz is deployed to + deploy_dir_image = get_bitbake_var("DEPLOY_DIR_IMAGE") + # this can be passed from the .wks.in file via sourceparams + initrd = source_params.get('initrd') + # for convenience added together + initrd_dir_and_file = os.path.join(deploy_dir_image, initrd) + + # in case we have a separate cpio.gz let's copy it to + # the boot partition + if os.path.isfile(initrd_dir_and_file): + logger.debug("Found %s", initrd_dir_and_file) + else: + logger.debug("Did not find %s", initrd_dir_and_file) + + new_cmd = ("install -m 444 %s %s" % + (initrd_dir_and_file, hdddir)) + + exec_cmd(new_cmd) + du_cmd = "du -bks %s" % hdddir out = exec_cmd(du_cmd) blocks = int(out.split()[0])
Signature · 1 line
2.17.1
Quoted 4 lines · Robert Berger via lists.openembedded.org
optionally allow to pass 'initrd' from .wks(.in) via sourceparams
Signed-off-by Robert Berger <[email protected]>---
Hi,
I believe this patch is the source of the following error on the autobuilder:
File "/srv/pokybuild/yocto-worker/wic/build/scripts/lib/wic/plugins/source/bootimg-pcbios.py", line 177, in do_prepare_partition
initrd_dir_and_file = os.path.join(deploy_dir_image, initrd)
File "<frozen posixpath>", line 89, in join
File "<frozen genericpath>", line 188, in _check_arg_types
TypeError: join() argument must be str, bytes, or os.PathLike object, not 'NoneType'
https://valkyrie.yoctoproject.org/#/builders/15/builds/580/steps/12/logs/stdio
Can you have a look at this issue, please ?
Signature · 3 lines
Mathieu Dubois-Briand, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Hi,
Quoted 8 lines · Mathieu Dubois-Briand
Quoted 4 lines · Robert Berger via lists.openembedded.org
optionally allow to pass 'initrd' from .wks(.in) via sourceparams
Signed-off-by Robert Berger <[email protected]>---
Hi,
Quoted 8 lines
I believe this patch is the source of the following error on the autobuilder:
File "
/srv/pokybuild/yocto-worker/wic/build/scripts/lib/wic/plugins/source/bootimg-pcbios.py", line 177, indo_prepare_partition
initrd_dir_and_file=os.path.join(deploy_dir_image, initrd)
File "<frozen posixpath>", line 89, in join
File "<frozen genericpath>", line 188, in_check_arg_types
TypeError:join()argument must be str, bytes, or os.PathLike object, not 'NoneType'
Hmm yes this looks suspicious.
Quoted 6 lines
https://valkyrie.yoctoproject.org/#/builders/15/builds/580/steps/12/logs/stdio
Can you have a look at this issue, please ?
Can you tell me what you tried to build to get this error?
I guess the problem is, that it's not quite that "optional" as it should be so when you don't pass the initrd you get the error.
Regards
Robert
Signature · 11 lines
Robert Berger Embedded Software Evangelist Reliable Embedded Systems Consulting Training Engineering URL: https://www.reliableembeddedsystems.com Schedule a web meeting: https://calendly.com/reliableembeddedsystems/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --
Quoted 1 line · Robert Berger via lists.openembedded.org
Can you tell me what you tried to build to get this error?
This requires a bit of specialist knowledge: you need to look at the top of the page that the build was using 'wic' configuration, and that configuration can be found here:
https://git.yoctoproject.org/yocto-autobuilder-helper/tree/config.json#n1056
Alex
Hi,
Quoted 17 lines · Mathieu Dubois-Briand
Quoted 4 lines · Robert Berger via lists.openembedded.org
optionally allow to pass 'initrd' from .wks(.in) via sourceparams
Signed-off-by Robert Berger <[email protected]>---
Hi,
I believe this patch is the source of the following error on the autobuilder:
File "
/srv/pokybuild/yocto-worker/wic/build/scripts/lib/wic/plugins/source/bootimg-pcbios.py", line 177, indo_prepare_partition
initrd_dir_and_file=os.path.join(deploy_dir_image, initrd)
File "<frozen posixpath>", line 89, in join
File "<frozen genericpath>", line 188, in_check_arg_types
TypeError:join()argument must be str, bytes, or os.PathLike object, not 'NoneType'
Quoted 5 lines
https://valkyrie.yoctoproject.org/#/builders/15/builds/580/steps/12/logs/stdio
Can you have a look at this issue, please ?
Please drop that patch for now - it will take me some time to find my example which uses it ;)
Regards,
Robert
Signature · 11 lines
Robert Berger Embedded Software Evangelist Reliable Embedded Systems Consulting Training Engineering URL: https://www.reliableembeddedsystems.com Schedule a web meeting: https://calendly.com/reliableembeddedsystems/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --