Re: [yocto] Building single package as image, respecting dependencies
Hello Paul, thank you for your suggestion. I will look into it. Meanwhile I worked around my issue by building all python3 packages, but excluding them from the rootfs. Then they get installed into a separate 'rootfs', which I pack as a squashfs image. It might not be that elegant, but it works. Regards, NOrman Mit freundlichen Grüßen / Best regards Norman Stetter SW ENWICKLUNG EMBEDDED SYSTEMS Garz & Fricke GmbH 21079 Hamburg Direct: +49 40 791899 - 477 Fax: +49 40 791899 - 39 norman.stet...@garz-fricke.com www.garz-fricke.com WE MAKE IT YOURS! Sitz der Gesellschaft: D-21079 Hamburg Registergericht: Amtsgericht Hamburg, HRB 60514 Geschäftsführer: Matthias Fricke, Manfred Garz, Marc-Michael Braun > -Ursprüngliche Nachricht- > Von: Paul Barker [mailto:p...@betafive.co.uk] > Gesendet: Tuesday, May 28, 2019 11:37 AM > An: Norman Stetter ; Burton, Ross > > Cc: yocto@yoctoproject.org > Betreff: Re: [yocto] Building single package as image, respecting > dependencies > > On 24/05/2019 15:28, Norman Stetter wrote: > > Is there no way to simply force bitbake to only build the packages I > > want, ignoring dependencies? We used to build the image like this > > before, using PTXDist. > > > > Everything else seems to be a dirty hack. > > Can you just collect the extra packages (ipk/deb/rpm as appropriate), put > them in a package feed and install them on-target as required? > > The package feed doesn't have to be on a webserver, you could put it in a > directory in a separate partition on the target if that's what you need. > > Thanks, > > -- > Paul Barker > Managing Director & Principal Engineer > Beta Five Ltd -- ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto
Re: [yocto] Building single package as image, respecting dependencies
Is there no way to simply force bitbake to only build the packages I want, ignoring dependencies? We used to build the image like this before, using PTXDist. Everything else seems to be a dirty hack. Mit freundlichen Grüßen / Best regards Norman Stetter SW ENWICKLUNG EMBEDDED SYSTEMS Garz & Fricke GmbH 21079 Hamburg Direct: +49 40 791899 - 477 Fax: +49 40 791899 - 39 norman.stet...@garz-fricke.com www.garz-fricke.com<http://www.garz-fricke.com/> WE MAKE IT YOURS! [cid:image001.jpg@01D5124D.B0588270] Sitz der Gesellschaft: D-21079 Hamburg Registergericht: Amtsgericht Hamburg, HRB 60514 Geschäftsführer: Matthias Fricke, Manfred Garz, Marc-Michael Braun Von: Burton, Ross [mailto:ross.bur...@intel.com] Gesendet: Friday, May 24, 2019 11:45 AM An: Norman Stetter Cc: yocto@yoctoproject.org Betreff: Re: [yocto] Building single package as image, respecting dependencies On Fri, 24 May 2019 at 07:30, Norman Stetter mailto:norman.stet...@garz-fricke.com>> wrote: For the OS image I use cpio.gz as file system. It gets booted as a RAMdisk. Sorry, forgot to mention that. Would you consider switching to a proper filesystem? The peril of using a cpio.gz is that every file you add slows the boot down: using a proper filesystem solves this. Ross -- ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto
Re: [yocto] Building single package as image, respecting dependencies
In fact the OS is just a minimal rescue OS. On a second partition we run our main OS, which is ‘properly’ installed. So, I’m afraid using a ‘proper’ file system wouldn’t fit our use case. We run the rescue OS as RAMdisk to be able to self-update it without having to worry about modifying a mounted file system. Norman Mit freundlichen Grüßen / Best regards Norman Stetter SW ENWICKLUNG EMBEDDED SYSTEMS Garz & Fricke GmbH 21079 Hamburg Direct: +49 40 791899 - 477 Fax: +49 40 791899 - 39 norman.stet...@garz-fricke.com www.garz-fricke.com<http://www.garz-fricke.com/> WE MAKE IT YOURS! [cid:image001.jpg@01D51228.BD16AF70] Sitz der Gesellschaft: D-21079 Hamburg Registergericht: Amtsgericht Hamburg, HRB 60514 Geschäftsführer: Matthias Fricke, Manfred Garz, Marc-Michael Braun Von: Burton, Ross [mailto:ross.bur...@intel.com] Gesendet: Friday, May 24, 2019 11:45 AM An: Norman Stetter Cc: yocto@yoctoproject.org Betreff: Re: [yocto] Building single package as image, respecting dependencies On Fri, 24 May 2019 at 07:30, Norman Stetter mailto:norman.stet...@garz-fricke.com>> wrote: For the OS image I use cpio.gz as file system. It gets booted as a RAMdisk. Sorry, forgot to mention that. Would you consider switching to a proper filesystem? The peril of using a cpio.gz is that every file you add slows the boot down: using a proper filesystem solves this. Ross -- ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto
Re: [yocto] Building single package as image, respecting dependencies
For the OS image I use cpio.gz as file system. It gets booted as a RAMdisk. Sorry, forgot to mention that. Building two different images doesn’t suit our use case. We install the image on a device and run different automated test suites on it, some of which need python. But for all of the testing time is critical. I now have it running with the recipe I posted in the first mail in this thread. But I still can’t get rid of busybox in my python image. Mit freundlichen Grüßen / Best regards Norman Stetter SW ENWICKLUNG EMBEDDED SYSTEMS Garz & Fricke GmbH 21079 Hamburg Direct: +49 40 791899 - 477 Fax: +49 40 791899 - 39 norman.stet...@garz-fricke.com www.garz-fricke.com<http://www.garz-fricke.com/> WE MAKE IT YOURS! [cid:image001.jpg@01D5120A.5B66BBD0] Sitz der Gesellschaft: D-21079 Hamburg Registergericht: Amtsgericht Hamburg, HRB 60514 Geschäftsführer: Matthias Fricke, Manfred Garz, Marc-Michael Braun Von: Burton, Ross [mailto:ross.bur...@intel.com] Gesendet: Thursday, May 23, 2019 3:46 PM An: Norman Stetter Cc: yocto@yoctoproject.org Betreff: Re: [yocto] Building single package as image, respecting dependencies On Thu, 23 May 2019 at 13:46, Norman Stetter mailto:norman.stet...@garz-fricke.com>> wrote: That seems to be a misunderstanding. I want to keep the OS image as small as possible to reduce boot time. We only use python for some test scenarios, so it doesn’t have to be included in the OS image. I did some measurements and including python3 in the OS image increased the boot time by over 30%. So the idea is to have it separately, and only mount it, when needed. What filesystem are you using? I wasn't aware of any modern file systems where the number of files installed affected mount performance. Could you just build two images and have a 'normal' image and a 'test image'? This is basically what the tools-testapps image feature is for. Ross -- ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto
Re: [yocto] Building single package as image, respecting dependencies
Hi Ross, thanks for clarifying that there are no dependencies between images. Von: Burton, Ross [mailto:ross.bur...@intel.com] Gesendet: Thursday, May 23, 2019 2:15 PM An: Norman Stetter Cc: yocto@yoctoproject.org Betreff: Re: [yocto] Building single package as image, respecting dependencies On Wed, 22 May 2019 at 14:28, Norman Stetter mailto:norman.stet...@garz-fricke.com>> wrote: Is there a way to have dependencies between images? So I could have the python-image build know which dependencies are already built into my OS image and therefore not include them itself? No. An image is a self-contained file system. About 50% of your image recipe isn't helping your goal of an image that contains a single package. What should be improved to achieve my goal of containing only the python3 package and as little dependencies as possible? I have to query your assumptions though: if you're going to have python3 in a filessytem that you mount when required, how are you saving space? That seems to be a misunderstanding. I want to keep the OS image as small as possible to reduce boot time. We only use python for some test scenarios, so it doesn’t have to be included in the OS image. I did some measurements and including python3 in the OS image increased the boot time by over 30%. So the idea is to have it separately, and only mount it, when needed. Mit freundlichen Grüßen / Best regards Norman Stetter SW ENWICKLUNG EMBEDDED SYSTEMS Garz & Fricke GmbH 21079 Hamburg Direct: +49 40 791899 - 477 Fax: +49 40 791899 - 39 norman.stet...@garz-fricke.com www.garz-fricke.com<http://www.garz-fricke.com/> WE MAKE IT YOURS! [cid:image001.jpg@01D51176.36275C60] Sitz der Gesellschaft: D-21079 Hamburg Registergericht: Amtsgericht Hamburg, HRB 60514 Geschäftsführer: Matthias Fricke, Manfred Garz, Marc-Michael Braun -- ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto
[yocto] Building single package as image, respecting dependencies
Hi there, I am currently working on a minimal CLI only system. The image is based on 'core-image-base' using sysvinit and busybox. To reduce image size and boot time, I removed as many packages as possible. For some application cases I will need python3 though. My idea was to have python3 as some kind of add-on in a squashfs image, that can be mounted only when needed. So I tried to build an image only containing the python3 package, but as little as possible otherwise, like this: inherit image IMAGE_FSTYPES = "squashfs-xz" DEFAULT_TASK_PROVIDER = "" DISTRO_EXTRA_RDEPENDS = "" DISTRO_FEATURES = "" POKY_DEFAULT_EXTRA_RDEPENDS = "" IMAGE_FEATURES = "" IMAGE_LINGUAS = "" CORE_IMAGE_BASE_INSTALL = "" RDEPENDS_${PN} = "" PACKAGE_EXCLUDE = "busybox openssl run-postinsts update-rc.d" VIRTUAL-RUNTIME_dev_manager = "" VIRTUAL-RUNTIME_login_manager = "" VIRTUAL-RUNTIME_init_manager = "" VIRTUAL-RUNTIME_initscripts = "" VIRTUAL-RUNTIME_keymaps = "" VIRTUAL-RUNTIME_base-utils = "" PREFERRED_PROVIDER_virtual/base-utils = "" IMAGE_INSTALL = "python3" But like this I can only manually exclude packages I already have in my main OS image. Some packages can't be excluded at all, as python3 depends on them and won't build if they are excluded. Is there a way to have dependencies between images? So I could have the python-image build know which dependencies are already built into my OS image and therefore not include them itself? Or would it be better to avoid building a second image and rather build 'python3' with my OS-image, adding it to PACKAGE_EXCLUDE and from within this build process pack all python3 files into an image? If I were to pursue this method, any suggestions on how to separate the python3 files from the rest of my rootfs, including the necessary dependencies? Any advice and idea is much appreciated. Mit freundlichen Grüßen / Best regards Norman Stetter SW ENWICKLUNG EMBEDDED SYSTEMS Garz & Fricke GmbH 21079 Hamburg Direct: +49 40 791899 - 477 Fax: +49 40 791899 - 39 norman.stet...@garz-fricke.com www.garz-fricke.com<http://www.garz-fricke.com/> WE MAKE IT YOURS! [cid:image001.jpg@01D510A9.7F9CD640] Sitz der Gesellschaft: D-21079 Hamburg Registergericht: Amtsgericht Hamburg, HRB 60514 Geschäftsführer: Matthias Fricke, Manfred Garz, Marc-Michael Braun -- ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto
[yocto] PermissionError when using image_list_installed_packages
process.kill() File: '/usr/lib/python3.5/subprocess.py', lineno: 947, function: __init__ 0943:startupinfo, creationflags, shell, 0944:p2cread, p2cwrite, 0945:c2pread, c2pwrite, 0946:errread, errwrite, *** 0947:restore_signals, start_new_session) 0948:except: 0949:# Cleanup if the child failed starting. 0950:for f in filter(None, (self.stdin, self.stdout, self.stderr)): 0951:try: File: '/usr/lib/python3.5/subprocess.py', lineno: 1551, function: _execute_child 1547:# The error must be from chdir(cwd). 1548:err_msg += ': ' + repr(cwd) 1549:else: 1550:err_msg += ': ' + repr(orig_executable) *** 1551:raise child_exception_type(errno_num, err_msg) 1552:raise child_exception_type(err_msg) 1553: 1554: 1555:def _handle_exitstatus(self, sts, _WIFSIGNALED=os.WIFSIGNALED, Exception: PermissionError: [Errno 13] Permission denied DEBUG: Python function do_licensesinfo finished ERROR: Function failed: do_licensesinfo So it looks like the invoked 'dnf' can't open a file due to permission issues. But I never experienced any problems during my regular builds, which obviously also use 'image_list_installed_packages'. Does someone know why I encounter this error only, when calling 'image_list_installed_packages' in my own recipe? Regards, Norman Mit freundlichen Grüßen / Best regards Norman Stetter SW ENWICKLUNG EMBEDDED SYSTEMS Garz & Fricke GmbH 21079 Hamburg Direct: +49 40 791899 - 477 Fax: +49 40 791899 - 39 norman.stet...@garz-fricke.com www.garz-fricke.com<http://www.garz-fricke.com/> WE MAKE IT YOURS! [cid:image001.jpg@01D480AD.2A332740] Sitz der Gesellschaft: D-21079 Hamburg Registergericht: Amtsgericht Hamburg, HRB 60514 Geschäftsführer: Matthias Fricke, Manfred Garz, Marc-Michael Braun [cid:image002.jpg@01D480AD.2A332740] -- ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto