From 24c4c14ab24f961afe38812539237ef1fe15fa44 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 9 Feb 2020 02:11:32 +0100 Subject: [PATCH 1/3] scripts/build: allow installation of *.o files commit c468820ba9bab93c9d2fd34eba765e52b703b3ee "scripts/build: cleanup" started to silently remove *.o files from the installation without giving an explanation why this should be needed. Drop that as it prevents packages from including *.o files in the image, which eg is needed to include IR BPF decoders in LibreELEC. Packages which install *.o files that should not end up in the image should manually remove these in post_makeinstall_target. Signed-off-by: Matthias Reichl --- scripts/build | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/build b/scripts/build index 82419f992d..dfbb5d6252 100755 --- a/scripts/build +++ b/scripts/build @@ -468,7 +468,6 @@ if [ "${TARGET}" = "target" -o "${TARGET}" = "init" ]; then rm -rf ${INSTALL}/{usr/local/,usr/,}var find ${INSTALL} \( -name "*.orig" \ -o -name "*.rej" \ - -o -name "*.o" \ -o -name "*.in" \ -o -name ".git*" \) \ -exec rm -f {} \; 2>/dev/null || : From e96a892a100f42f3ec7c293734a2e6ad8ae9e595 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 9 Feb 2020 02:54:53 +0100 Subject: [PATCH 2/3] config/functions: fix safe_remove of multiple files Several packages call safe_remove with a wildcard to remove multiple files but safe_remove only deleted the first one. Fix this by iterating over all arguments passed into safe_remove so unwanted files don't end up in the image. Signed-off-by: Matthias Reichl --- config/functions | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/config/functions b/config/functions index ee9b636886..6c50307457 100644 --- a/config/functions +++ b/config/functions @@ -132,17 +132,17 @@ build_msg() { # prints a warning if the file slated for removal doesn't exist # this allows us to continue instead of bailing out with just "rm" safe_remove() { - local path="$1" + local path - [ -z "${path}" ] && return 0 - - if [ -e "${path}" -o -L "${path}" ]; then - rm -r "${path}" - elif [ -n "${PKG_NAME}" ]; then - print_color CLR_WARNING "safe_remove: path does not exist: [${PKG_NAME}]: ${path}\n" - else - print_color CLR_WARNING "safe_remove: path does not exist: ${path}\n" - fi + for path in "$@" ; do + if [ -e "${path}" -o -L "${path}" ]; then + rm -r "${path}" + elif [ -n "${PKG_NAME}" ]; then + print_color CLR_WARNING "safe_remove: path does not exist: [${PKG_NAME}]: ${path}\n" + else + print_color CLR_WARNING "safe_remove: path does not exist: ${path}\n" + fi + done } ### BUILDSYSTEM HELPERS ### From 7b790015cc21382defdc162839b2b93ce57f82fa Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 9 Feb 2020 03:00:14 +0100 Subject: [PATCH 3/3] Python3: don't install python.o file into image Signed-off-by: Matthias Reichl --- packages/lang/Python3/package.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/lang/Python3/package.mk b/packages/lang/Python3/package.mk index 0d6b0e4d00..2c641f1e19 100644 --- a/packages/lang/Python3/package.mk +++ b/packages/lang/Python3/package.mk @@ -130,6 +130,8 @@ post_makeinstall_target() { rm -rf $INSTALL/usr/bin/python*-config rm -rf $INSTALL/usr/bin/smtpd.py $INSTALL/usr/bin/smtpd.py.* + find $INSTALL -name '*.o' -delete + python_compile $PKG_INSTALL_PATH_LIB # strip