build: move not copy files to BIN_DIR s-cp-mv
authorPaul Spooren <mail@aparcar.org>
Fri, 9 Sep 2022 18:57:32 +0000 (20:57 +0200)
committerPaul Spooren <mail@aparcar.org>
Fri, 9 Sep 2022 19:38:48 +0000 (21:38 +0200)
commitb60b469da045c70c3b6255e931945ed3801378ea
treedfeffe44f3877960da523655d7eb62848779dbbe
parentc7c350922668e262068c9301b75434d7bb4b8d10
build: move not copy files to BIN_DIR

Building images usally stores them in KDIR_TMP and then copies them over
to BIN_DIR. This is fine as rebuilding of images overwrites existing
images. When using the EXTRA_IMAGE_NAME variable frequently this fills
up the ImageBuilder KDIR_TMP folder since every built image is stored
forever.

This commit moves every image instead of copying it. I couldn't find any
reason which this shouldn't be done. While at it rename FILE_DIR to
BIN_DIR to lower the entropy inside the codebase.

Below an example how sysupgrade.openwrt.org filled up after the release
of 22.03.0 where every created image contains a hash of the package
selction in the filename:

     aparcar@asu-01:~/asu/worker1/cache/22.03.0$ du -d 1 -h
     400M    ./kirkwood
     260M    ./gemini
     2.0G    ./ipq806x
     1.7G    ./ipq40xx
     8.1G    ./ramips
     4.0K    ./octeon
     495M    ./sunxi
     728M    ./lantiq
     1.8G    ./rockchip
     3.7G    ./mediatek
     4.0K    ./realtek
     5.4G    ./mvebu
     8.9G    ./ath79
     3.0G    ./bcm47xx
     14G     ./bcm27xx
     11G     ./x86
     4.0K    ./bcm63xx
     312M    ./mpc85xx
     600M    ./apm821xx
     5.4G    ./bcm53xx
     66G     .

Signed-off-by: Paul Spooren <mail@aparcar.org>
include/image.mk
scripts/json_add_image_info.py