mutualize header

This commit is contained in:
Guillaume Castagnino 2021-06-17 17:59:25 +02:00
parent ef26e8ead9
commit 3881d9e6bc
10 changed files with 50 additions and 113 deletions

View File

@ -14,7 +14,7 @@ clean: $(ZIPS_DIRS:dist-%=clean-%)
# clean targets
$(ZIPS_DIRS:dist-%=clean-%):
rm -f $(@:clean-%=cm-custom-%.zip) $(@:clean-%=cm-custom-%-signed.zip)
rm -rf $(@:clean-%=build-%) $(@:clean-%=cm-custom-%.zip) $(@:clean-%=cm-custom-%-signed.zip)
# signature targets
$(ZIPS_DIRS:dist-%=cm-custom-%-signed.zip): cm-custom-%-signed.zip : cm-custom-%.zip
@ -24,6 +24,10 @@ $(ZIPS_DIRS:dist-%=cm-custom-%-signed.zip): cm-custom-%-signed.zip : cm-custom-%
# build target
$(ZIPS_DIRS:dist-%=cm-custom-%.zip): cm-custom-%.zip : $(FILES_COMMON) $$(shell find dist-$$* -type f)
zip $@ $(FILES_COMMON)
cd dist-$* && \
zip ../$@ $$(find . -type f)
rm -rf build-$*
cp -a dist-$* build-$*
cd build-$* && \
make && \
zip ../$@ $$(find . -type f ! -name Makefile)
rm -rf build-$*

27
common/addon_head Normal file
View File

@ -0,0 +1,27 @@
#!/sbin/sh
#
# ADDOND_VERSION=3
#
# we partially use the script at install, if so, $SYSTEM, $PRODUCT, $SYSTEM_EXT are defined
if [ -z $SYSTEM ]; then
. /tmp/backuptool.functions
# build missing $PRODUCT and $SYSTEM_EXT from $S. Keep them inside system, real path is computed after using the get_output_path function
# see https://github.com/LineageOS/android_vendor_lineage/commit/c63fa8441bb5ad1fc4fb68155a5e5166aa25cac0#diff-9cf467ef8562a8e65ef885b33fe3f29cee408bb251fb05aed28661f08bfe0c64
SYS=$S
PRODUCT="$S/product"
SYSTEM_EXT="$S/system_ext"
else
# install in recovery, script assume $S and $SYS defined
S=$SYSTEM
SYS=$SYSTEM
# PRODUCT AND SYSTEM_EXT defined from recovery
get_output_path() {
# In recovery we mounted all partitions in the right place, so we can rely on symlinks
echo "$1"
}
fi
# path is needed when running from recovery (at install)
export PATH="${PATH}:$S/bin:$S/xbin"

2
dist-font/Makefile Normal file
View File

@ -0,0 +1,2 @@
all:
sed -e '/__HEADER__/ {' -e 'r ../common/addon_head' -e 'd' -e '}' -i cm-data/*.addon

View File

@ -1,32 +1,4 @@
#!/sbin/sh
#
# ADDOND_VERSION=3
#
# /system/addon.d/99-font.sh
#
# we partially use the script at install, if so, $SYSTEM, $PRODUCT, $SYSTEM_EXT are defined
if [ -z $SYSTEM ]; then
. /tmp/backuptool.functions
# build missing $PRODUCT and $SYSTEM_EXT from $S. Keep them inside system, real path is computed after using the get_output_path function
# see https://github.com/LineageOS/android_vendor_lineage/commit/c63fa8441bb5ad1fc4fb68155a5e5166aa25cac0#diff-9cf467ef8562a8e65ef885b33fe3f29cee408bb251fb05aed28661f08bfe0c64
SYS=$S
PRODUCT="$S/product"
SYSTEM_EXT="$S/system_ext"
else
# install in recovery, script assume $S and $SYS defined
S=$SYSTEM
SYS=$SYSTEM
# PRODUCT AND SYSTEM_EXT defined from recovery
get_output_path() {
# In recovery we mounted all partitions in the right place, so we can rely on symlinks
echo "$1"
}
fi
# path is needed when running from recovery (at install)
export PATH="${PATH}:$S/bin:$S/xbin"
__HEADER__
list_files() {
cat <<EOF
@ -82,3 +54,4 @@ case "$1" in
done
;;
esac
# vi: ft=sh

View File

@ -0,0 +1,2 @@
all:
sed -e '/__HEADER__/ {' -e 'r ../common/addon_head' -e 'd' -e '}' -i cm-data/*.addon

View File

@ -1,29 +1,4 @@
#!/sbin/sh
#
# ADDOND_VERSION=3
#
# /system/addon.d/99-perso-google-clean-more.sh
#
# we partially use the script at install, if so, $SYSTEM, $PRODUCT, $SYSTEM_EXT are defined
if [ -z $SYSTEM ]; then
. /tmp/backuptool.functions
# build missing $PRODUCT and $SYSTEM_EXT from $S. Keep them inside system, real path is computed after using the get_output_path function
# see https://github.com/LineageOS/android_vendor_lineage/commit/c63fa8441bb5ad1fc4fb68155a5e5166aa25cac0#diff-9cf467ef8562a8e65ef885b33fe3f29cee408bb251fb05aed28661f08bfe0c64
SYS=$S
PRODUCT="$S/product"
SYSTEM_EXT="$S/system_ext"
else
# install in recovery, script assume $S and $SYS defined
S=$SYSTEM
SYS=$SYSTEM
# PRODUCT AND SYSTEM_EXT defined from recovery
get_output_path() {
# In recovery we mounted all partitions in the right place, so we can rely on symlinks
echo "$1"
}
fi
__HEADER__
# path is needed when running from recovery (at install)
export PATH="${PATH}:$S/bin:$S/xbin"
@ -53,3 +28,4 @@ case "$1" in
rm -rf $(get_output_path $PRODUCT/app/GoogleCalendarSyncAdapter)
;;
esac
# vi: ft=sh

2
dist-google/Makefile Normal file
View File

@ -0,0 +1,2 @@
all:
sed -e '/__HEADER__/ {' -e 'r ../common/addon_head' -e 'd' -e '}' -i cm-data/*.addon

View File

@ -1,29 +1,4 @@
#!/sbin/sh
#
# ADDOND_VERSION=3
#
# /system/addon.d/99-perso-google-clean.sh
#
# we partially use the script at install, if so, $SYSTEM, $PRODUCT, $SYSTEM_EXT are defined
if [ -z $SYSTEM ]; then
. /tmp/backuptool.functions
# build missing $PRODUCT and $SYSTEM_EXT from $S. Keep them inside system, real path is computed after using the get_output_path function
# see https://github.com/LineageOS/android_vendor_lineage/commit/c63fa8441bb5ad1fc4fb68155a5e5166aa25cac0#diff-9cf467ef8562a8e65ef885b33fe3f29cee408bb251fb05aed28661f08bfe0c64
SYS=$S
PRODUCT="$S/product"
SYSTEM_EXT="$S/system_ext"
else
# install in recovery, script assume $S and $SYS defined
S=$SYSTEM
SYS=$SYSTEM
# PRODUCT AND SYSTEM_EXT defined from recovery
get_output_path() {
# In recovery we mounted all partitions in the right place, so we can rely on symlinks
echo "$1"
}
fi
__HEADER__
# path is needed when running from recovery (at install)
export PATH="${PATH}:$S/bin:$S/xbin"
@ -69,3 +44,4 @@ case "$1" in
rm -rf $(get_output_path $SYSTEM_EXT/priv-app/GoogleFeedback)
;;
esac
# vi: ft=sh

2
dist-std/Makefile Normal file
View File

@ -0,0 +1,2 @@
all:
sed -e '/__HEADER__/ {' -e 'r ../common/addon_head' -e 'd' -e '}' -i cm-data/*.addon

View File

@ -1,32 +1,4 @@
#!/sbin/sh
#
# ADDOND_VERSION=3
#
# /system/addon.d/99-perso.sh
#
# we partially use the script at install, if so, $SYSTEM, $PRODUCT, $SYSTEM_EXT are defined
if [ -z $SYSTEM ]; then
. /tmp/backuptool.functions
# build missing $PRODUCT and $SYSTEM_EXT from $S. Keep them inside system, real path is computed after using the get_output_path function
# see https://github.com/LineageOS/android_vendor_lineage/commit/c63fa8441bb5ad1fc4fb68155a5e5166aa25cac0#diff-9cf467ef8562a8e65ef885b33fe3f29cee408bb251fb05aed28661f08bfe0c64
SYS=$S
PRODUCT="$S/product"
SYSTEM_EXT="$S/system_ext"
else
# install in recovery, script assume $S and $SYS defined
S=$SYSTEM
SYS=$SYSTEM
# PRODUCT AND SYSTEM_EXT defined from recovery
get_output_path() {
# In recovery we mounted all partitions in the right place, so we can rely on symlinks
echo "$1"
}
fi
# path is needed when running from recovery (at install)
export PATH="${PATH}:$S/bin:$S/xbin"
__HEADER__
list_files() {
cat <<EOF
@ -143,3 +115,4 @@ case "$1" in
done
;;
esac
# vi: ft=sh