01-25-2019 07:02 AM
I have a package that contains only script files. Unfortunately, when I modify its contents and run:
the rootfs.cpio.gz is not recreated, and the generated initramfs still contains the old scripts.
I've tried to explicitly clean my package:
petalinux-build -c my-package -x clean petalinux-build
but it also doesn't help.
The only way to refresh the initramfs is to do:
petalinux-build -x mrproper petalinux-build
which is not a solution, as it takes one hour.
Is there any faster method to enforce recreating the initramfs with the new scripts?
01-25-2019 07:12 AM
I've managed to rebuild the rootfs.cpio.gz by the following sequence of operations:
petalinux-build -c my-package -x do_cleanall petalinux-build -c rootfs -x do_cleanall petalinux-build
It is still quite slow, but much faster than using "mrproper".
01-26-2019 07:33 AM
I'm using Vivado 2017.2 and I do a slightly different sequence of commands. You could try and check if it's faster:
petalinux-build -c your_app -x do_clean petalinux-build -c your_app petalinux-build -x do_populate_sysroot petalinux-build -c rootfs petalinux-build -x package
Since I'm packaging a BOOT.BIN and image.ub to boot from SDCard, my final command is a
petalinux-package --boot --fsbl <...> --fpga <...> --u-boot --force
Not sure if you need that last one.
Actually I run that sequence in only one shell command line:
petalinux-build -c your_app -x do_clean && petalinux-build -c your_app && petalinux-build -x do_populate_sysroot && petalinux-build -c rootfs && petalinux-build -x package && petalinux-package [...]
09-11-2019 05:12 PM
(Using petalinux 2018.2):
Here's a workaround I've found that's a little sloppy, but doesn't take an hour. The problem I was specifically trying to solve was how to force a rebuild of the initramfs after I made a change that updated the contents of one of my user packages. FYI the user package also had issues rebuilding after source changes, so I actually have to rebuild it as well:
petalinux-build -c my-package -x cleanall && petalinux-build -c my-package petalinux-config -c rootfs (add or remove a spurious debug utility program) petalinux-build
The process of petalinux-build will kickoff initramfs construction tasks in the kernel recipe after rootfs is rebuilt. Here are two other things I tried that DIDN'T help:
1. petalinux-build -c kernel -x do_bundle_initramfs -f won't work because it does not force rootfs to be rebuilt, this task appears to be executed after rootfs is done.
2. petalinux-build -c rootfs -x do_rootfs -f won't work because "ERROR: Force building is not supported for image targets"