How to clean only target in buildroot
Buildroot tracks build progress with .stamp_xxx in each package build dir.
target install is actually the last stage for each package. So removing the .stamp_target_installed file from each package build dir would cause it to reinstall to target
In the latest buildroot, you can simply do the following:
rm -rf output/target
find output/ -name ".stamp_target_installed" -delete
rm -f output/build/host-gcc-final-*/.stamp_host_installed
In some older buildroot, there are a few other files in output that tracks the creation of the target dir with the skeleton. Citing the mailing list message, we could summarize following:
Does a "rm -rf output/target && make" work?
As Thomas said, it does not work. But, some unofficial hacks exist:
- remove
build/.root
will force to reinstall skeleton- remove
build/*/.stamp_target_installed
force reinstall each target package- depending of you toolchain, you can reinstall libc and co by removing:
stamps/ext-toolchain-installed
(external)stamps/ct-ng-toolchain-installed
(ctng)target/lib/libc.so.0
(buildroot)
And then simply do make again.
Remind, there are ton of reasons these tips could do wrong things. The only
current official way to rebuild target is "make clean".
Buildroot clean my dependencies after change my source code
After post in other places the same answer, a buildroot user answer with correct way, that is use @STAGING directory when compile instead of @TARGET directory.
In my makefile i compile it using @TARGET_DIR/usr/[folder], but the correct is @STAGING_DIR/usr[folder].
Thanks.
Creating a clean root filesystem (with overlay) without rebuilding all the packages
Every time you invoke "make", the root filesystem image is completely re-created from the contents of output/target/, the post-build scripts are executed and the rootfs overlays are copied.
So if you make a change to a rootfs overlay, a change to a post-build script, or you add/remove stuff from output/target/, simply running "make" is sufficient.
However, if your aim is to remove output/target/ completely with the hope that it will reinstall all packages, then indeed this doesn't work, and we have good reasons for not supporting this, because there are many situations where this can give an incorrect result.
How to specify buildroot build process variable to be called on make package-dirclean
make foo-dirclean
is a simple tool that just deletes the package build directory. In most cases, when the list of files installed by a package does not change over time (only files content changes) you can simply rebuild the package and the target directory will be rebuilt correctly.
If you want you can implement your own foo-myclean
step that implements your own logic. However you must understand deleting files in the target directory is not supported by Buildroot and thus you are on your own.
Related Topics
How to Use Source Command Within Jenkins Pipeline Script
How to Specify Which Version of Perl to Use on Centos
Too Many Open Files Error on Lucene
What Is The Linux Equivalent to Msvc++'s Option /D1Reportsingleclasslayout
Are Mlock()-Ed Pages Static, or Can They Be Moved in Physical Ram
How to Translate X11 Keycode Back to Scancode or Hid Usage Id Reliably
Is Number of Frame = Number of Pages(Linux)
Gcloud - How to Automate Installation of Gcloud on a Server
How to Assign Execute Permission to a .Sh File in Windows to Be Executed in Linux
How to Measure Mispredictions for a Single Branch on Linux
How to Sort The Output of "Grep -L" Chronologically by Newest Modification Date Last
How to Exit The Wh Mode in Gdb
Find The Number of Files in a Directory
Installing Oracle Instantclient on Linux Without Setting Environment Variables
Sudo Apt-Get Update Fail on Ubuntu 17.04
Qemu on Raspberry Pi Arch Linux Latest Sd Image
Linux - Check If There Is an Empty Line at The End of a File