UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Scholar wzab
Scholar
405 Views
Registered: ‎08-24-2011

How to enforce rebuilding of rootfs in Petalinux?

I have a package that contains only script files. Unfortunately, when I modify its contents and run:

petalinux-build

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?

 

0 Kudos
3 Replies
Scholar wzab
Scholar
398 Views
Registered: ‎08-24-2011

Re: How to enforce rebuilding of rootfs in Petalinux?

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".

Adventurer
Adventurer
358 Views
Registered: ‎08-07-2014

Re: How to enforce rebuilding of rootfs in Petalinux?

Hello @wzab,

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 [...]

regards

Brasilino

0 Kudos
35 Views
Registered: ‎08-06-2018

Re: How to enforce rebuilding of rootfs in Petalinux?

(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"

0 Kudos