Skip to contentSkip to conversation

Makefile: add target to clean targetfs

Buildroot Derek Atkins 1 participant 1 message Feb 9, 2022

lore
Share & tools
lore
#0 lore raw

Hi,

Sorry to raise up a 6-year-old thread, but I'm looking to use Jenkins to implement a CI/CD solution to build a BuildRoot system, but I need to be able to "clean out" the target directory between each build to ensure that different branches don't contaminate each other. I don't want to delete all of 'build' because 90% (or more) of the build *is* consistent between branches, and I'd like to not require 3 hours per build to rebuild e.g. the whole toolchain.

I've found that the patch as updated per the thread from 2015 does mostly work:

target-clean:

	$(RM) -rf $(BR_DIR)/output/target $(BR_DIR)/output/staging \
		$(BR_DIR)/output/build/.root \
		$(BR_DIR)/output/build/*/.stamp_target_installed \
		$(BR_DIR)/output/build/*/.stamp_staging_installed \
		$(BR_DIR)/output/build/host-gcc-final-*/.stamp_host_installed

When I rebuild using this rule, and then run the proposed rsync command (see below), the resulting target directory matches -- except for a few obvious changes like etc/issue and usr/lib/os-release (as the git release is now "dirty"). Strangely, lib/libpthread-2.32.so is different.

rsync -rvncl --delete --exclude '*.pyc' --exclude '*.pyo' --exclude 'tmp/ldconfig/aux-cache' output/target/ output/target.orig/

HOWEVER, there are a few side-effects here that I'd like to ask about.

Specifically, it looks like GLIBC and parts of the final-stage gcc actually recompile (I see a lot of instances of arm-buildroot-linux-gnueabi-gcc and xgcc in the logs). I would have just expected it to reinstall.

Moreover, busybox seems to recompile, too.

I am happy to share my config and makelog output if it would help, but I was trying to keep this message short.

Any suggestions would be highly appreciated.

Thanks,

-derek

PS: I have mail delivery turned off for the list, so I would appreciate if you could CC me on any replies. Thanks again.

Signature · 8 lines
       Derek Atkins                 617-623-3745
       [email protected]             www.ihtfp.com
       Computer and Internet Security Consultant

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot