Stop building unnecessary tarballs.

Test: treehugger
Change-Id: Iaba2aa6d09ad891f37171cc76778d08c78c78f93
This commit is contained in:
Elliott Hughes 2019-07-11 18:35:20 -07:00
parent f5c3510081
commit 440c99f1f2
5 changed files with 1 additions and 154 deletions

View file

@ -2362,36 +2362,6 @@ endif # BUILDING_SYSTEM_IMAGE
.PHONY: sync syncsys
sync syncsys: $(INTERNAL_SYSTEMIMAGE_FILES)
#######
## system tarball
define build-systemtarball-target
$(call pretty,"Target system fs tarball: $(INSTALLED_SYSTEMTARBALL_TARGET)")
$(call create-system-vendor-symlink)
$(call create-system-product-symlink)
$(call create-system-system_ext-symlink)
$(MKTARBALL) $(FS_GET_STATS) \
$(PRODUCT_OUT) system $(PRIVATE_SYSTEM_TAR) \
$(INSTALLED_SYSTEMTARBALL_TARGET) $(TARGET_OUT)
endef
ifndef SYSTEM_TARBALL_FORMAT
SYSTEM_TARBALL_FORMAT := bz2
endif
system_tar := $(PRODUCT_OUT)/system.tar
INSTALLED_SYSTEMTARBALL_TARGET := $(system_tar).$(SYSTEM_TARBALL_FORMAT)
$(INSTALLED_SYSTEMTARBALL_TARGET): PRIVATE_SYSTEM_TAR := $(system_tar)
$(INSTALLED_SYSTEMTARBALL_TARGET): $(FS_GET_STATS) $(INTERNAL_SYSTEMIMAGE_FILES)
$(build-systemtarball-target)
.PHONY: systemtarball-nodeps
systemtarball-nodeps: $(FS_GET_STATS) \
$(filter-out systemtarball-nodeps stnod,$(MAKECMDGOALS))
$(build-systemtarball-target)
.PHONY: stnod
stnod: systemtarball-nodeps
# -----------------------------------------------------------------
## platform.zip: system, plus other files to be used in PDK fusion build,
## in a zip file
@ -2493,34 +2463,6 @@ endif
endif # BUILD_PLATFORM_ZIP
# -----------------------------------------------------------------
## boot tarball
define build-boottarball-target
$(hide) echo "Target boot fs tarball: $(INSTALLED_BOOTTARBALL_TARGET)"
$(hide) mkdir -p $(PRODUCT_OUT)/boot
$(hide) cp -f $(INTERNAL_BOOTIMAGE_FILES) $(PRODUCT_OUT)/boot/.
$(hide) echo $(INTERNAL_KERNEL_CMDLINE) > $(PRODUCT_OUT)/boot/cmdline
$(hide) $(MKTARBALL) $(FS_GET_STATS) \
$(PRODUCT_OUT) boot $(PRIVATE_BOOT_TAR) \
$(INSTALLED_BOOTTARBALL_TARGET) $(TARGET_OUT)
endef
ifndef BOOT_TARBALL_FORMAT
BOOT_TARBALL_FORMAT := bz2
endif
boot_tar := $(PRODUCT_OUT)/boot.tar
INSTALLED_BOOTTARBALL_TARGET := $(boot_tar).$(BOOT_TARBALL_FORMAT)
$(INSTALLED_BOOTTARBALL_TARGET): PRIVATE_BOOT_TAR := $(boot_tar)
$(INSTALLED_BOOTTARBALL_TARGET): $(FS_GET_STATS) $(INTERNAL_BOOTIMAGE_FILES)
$(build-boottarball-target)
.PHONY: boottarball-nodeps btnod
boottarball-nodeps btnod: $(FS_GET_STATS) \
$(filter-out boottarball-nodeps btnod,$(MAKECMDGOALS))
$(build-boottarball-target)
# -----------------------------------------------------------------
# data partition image
INTERNAL_USERDATAIMAGE_FILES := \
@ -2570,29 +2512,6 @@ ASAN_SYSTEM_INSTALL_OPTIONS := --owner=1000 --group=1000
$(ASAN_IN_SYSTEM_INSTALLED): $(INSTALLED_USERDATAIMAGE_TARGET_DEPS)
tar cfj $(ASAN_IN_SYSTEM_INSTALLED) $(ASAN_SYSTEM_INSTALL_OPTIONS) -C $(TARGET_OUT_DATA)/.. $(ASAN_OUT_DIRS_FOR_SYSTEM_INSTALL) >/dev/null
#######
## data partition tarball
define build-userdatatarball-target
$(call pretty,"Target userdata fs tarball: " \
"$(INSTALLED_USERDATATARBALL_TARGET)")
$(MKTARBALL) $(FS_GET_STATS) \
$(PRODUCT_OUT) data $(PRIVATE_USERDATA_TAR) \
$(INSTALLED_USERDATATARBALL_TARGET) $(TARGET_OUT)
endef
userdata_tar := $(PRODUCT_OUT)/userdata.tar
INSTALLED_USERDATATARBALL_TARGET := $(userdata_tar).bz2
$(INSTALLED_USERDATATARBALL_TARGET): PRIVATE_USERDATA_TAR := $(userdata_tar)
$(INSTALLED_USERDATATARBALL_TARGET): $(FS_GET_STATS) $(INTERNAL_USERDATAIMAGE_FILES)
$(build-userdatatarball-target)
$(call dist-for-goals,userdatatarball,$(INSTALLED_USERDATATARBALL_TARGET))
.PHONY: userdatatarball-nodeps
userdatatarball-nodeps: $(FS_GET_STATS)
$(build-userdatatarball-target)
# -----------------------------------------------------------------
# partition table image
ifdef BOARD_BPT_INPUT_FILES

View file

@ -584,7 +584,6 @@ MKSQUASHFSUSERIMG := $(HOST_OUT_EXECUTABLES)/mksquashfsimage.sh
MKF2FSUSERIMG := $(HOST_OUT_EXECUTABLES)/mkf2fsuserimg.sh
SIMG2IMG := $(HOST_OUT_EXECUTABLES)/simg2img$(HOST_EXECUTABLE_SUFFIX)
E2FSCK := $(HOST_OUT_EXECUTABLES)/e2fsck$(HOST_EXECUTABLE_SUFFIX)
MKTARBALL := build/make/tools/mktarball.sh
TUNE2FS := $(HOST_OUT_EXECUTABLES)/tune2fs$(HOST_EXECUTABLE_SUFFIX)
JARJAR := $(HOST_OUT_JAVA_LIBRARIES)/jarjar.jar
DATA_BINDING_COMPILER := $(HOST_OUT_JAVA_LIBRARIES)/databinding-compiler.jar
@ -1154,8 +1153,7 @@ endef
# in the source tree.
dont_bother_goals := out \
snod systemimage-nodeps \
stnod systemtarball-nodeps \
userdataimage-nodeps userdatatarball-nodeps \
userdataimage-nodeps \
cacheimage-nodeps \
bptimage-nodeps \
vnod vendorimage-nodeps \

View file

@ -1573,12 +1573,6 @@ ramdisk: $(INSTALLED_RAMDISK_TARGET)
.PHONY: ramdisk_debug
ramdisk_debug: $(INSTALLED_DEBUG_RAMDISK_TARGET)
.PHONY: systemtarball
systemtarball: $(INSTALLED_SYSTEMTARBALL_TARGET)
.PHONY: boottarball
boottarball: $(INSTALLED_BOOTTARBALL_TARGET)
.PHONY: userdataimage
userdataimage: $(INSTALLED_USERDATAIMAGE_TARGET)
@ -1586,9 +1580,6 @@ ifneq (,$(filter userdataimage, $(MAKECMDGOALS)))
$(call dist-for-goals, userdataimage, $(BUILT_USERDATAIMAGE_TARGET))
endif
.PHONY: userdatatarball
userdatatarball: $(INSTALLED_USERDATATARBALL_TARGET)
.PHONY: cacheimage
cacheimage: $(INSTALLED_CACHEIMAGE_TARGET)

View file

@ -16,7 +16,6 @@ PARSE_TIME_MAKE_GOALS := \
all \
ECLIPSE-% \
AUX-% \
boottarball-nodeps \
brillo_tests \
btnod \
build-art% \
@ -44,7 +43,6 @@ PARSE_TIME_MAKE_GOALS := \
snod \
stnod \
systemimage-nodeps \
systemtarball-nodeps \
target-files-package \
test-art% \
user \

View file

@ -1,59 +0,0 @@
#!/bin/bash
# $1: path to fs_get_stats program
# $2: start dir
# $3: subdir to tar up (from $2)
# $4: target tar name
# $5: target tarball name (usually $(3).bz2)
# $6: TARGET_OUT path to query device specific FS configs
if [ $# -ne 6 ]; then
echo "Error: wrong number of arguments in cmd: $0 $* "
exit 1
fi
fs_get_stats=`readlink -f $1`
start_dir=`readlink -f $2`
dir_to_tar=$3
target_tar=`readlink -f $4`
target_tarball=`readlink -f $5`
target_out=`readlink -f $6`
cd $2
#tar --no-recursion -cvf ${target_tar} ${dir_to_tar}
rm ${target_tar} > /dev/null 2>&1
# do dirs first
subdirs=`find ${dir_to_tar} -type d -print`
files=`find ${dir_to_tar} \! -type d -print`
for f in ${subdirs} ${files} ; do
curr_perms=`stat -c 0%a $f`
[ -d "$f" ] && is_dir=1 || is_dir=0
new_info=`${fs_get_stats} ${curr_perms} ${is_dir} ${f} ${target_out}`
new_uid=`echo ${new_info} | awk '{print $1;}'`
new_gid=`echo ${new_info} | awk '{print $2;}'`
new_perms=`echo ${new_info} | awk '{print $3;}'`
# echo "$f: dir: $is_dir curr: $curr_perms uid: $new_uid gid: $new_gid "\
# "perms: $new_perms"
tar --no-recursion --numeric-owner --owner $new_uid \
--group $new_gid --mode $new_perms -rf ${target_tar} ${f}
done
if [ $? -eq 0 ] ; then
case "${target_tarball}" in
*.bz2 )
bzip2 -c ${target_tar} > ${target_tarball}
;;
*.gz )
gzip -c ${target_tar} > ${target_tarball}
;;
esac
success=$?
[ $success -eq 0 ] || rm -f ${target_tarball}
rm -f ${target_tar}
exit $success
fi
rm -f ${target_tar}
exit 1