diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2019-08-11 12:58:01 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2019-09-02 16:06:19 +0200 |
commit | f8a3a0c3cbbac8701a08f2ebba9a09b99cf26713 (patch) | |
tree | 528b50885d75058e938156dd79cb1258cff07a29 /scripts | |
parent | 3bc1c725a27c442e2a794ede8ee29e22d67706fe (diff) | |
download | OSELAS.Toolchain-f8a3a0c3cbbac8701a08f2ebba9a09b99cf26713.tar.gz OSELAS.Toolchain-f8a3a0c3cbbac8701a08f2ebba9a09b99cf26713.tar.xz |
image-toolchain-tgz: strip host binaries only for the tarball
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/lib/ptxd_make_image_tgz.sh | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/scripts/lib/ptxd_make_image_tgz.sh b/scripts/lib/ptxd_make_image_tgz.sh new file mode 100644 index 0000000..cd1cb5e --- /dev/null +++ b/scripts/lib/ptxd_make_image_tgz.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# +# Copyright (C) 2019 by Michael Olbrich <m.olbrich@pengutronix.de> +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + + +ptxd_make_image_tgz() { + ptxd_make_image_init || return + + local prefix_cross="$(ptxd_get_ptxconf PTXCONF_PREFIX_CROSS)" + local src="${PTX_AUTOBUILD_DESTDIR}${prefix_cross}" + local dst="${pkg_dir}/$(dirname ${prefix_cross})" + local sysroot="${pkg_dir}${prefix_cross}" + local -a host_dirs=( \ + "${sysroot}/lib" \ + "${sysroot}/libexec" \ + "${sysroot}/bin" \ + "${sysroot}/${ptxconf_gnu_target}/bin" \ + ) + + rm -rf "${pkg_dir}" && + rm -f "${image_image}" && + mkdir -p "${dst}" && + cp -a "${src}" "${dst}" || return + + # strip all host binaries + find "${host_dirs[@]}" \ + -wholename "${PTXDIST_SYSROOT_CROSS}${prefix_cross}/lib/gcc" -prune -o \ + -type f \( -executable -o -name "*.so*" \) -print0 \ + | xargs -0 -n1 --verbose strip --preserve-dates + + mkdir -p "$(dirname "${image_image}")" && + echo "Creating $(ptxd_print_path "${image_image}") ..." && + cd "${pkg_dir}/$(ptxd_get_ptxconf PTXCONF_PREFIX)" && + echo "tar -cJf '${image_image}' *" | fakeroot && + rm -rf "${pkg_dir}" +} +export -f ptxd_make_image_tgz |