summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2019-08-11 12:58:01 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2019-09-02 16:06:19 +0200
commitf8a3a0c3cbbac8701a08f2ebba9a09b99cf26713 (patch)
tree528b50885d75058e938156dd79cb1258cff07a29
parent3bc1c725a27c442e2a794ede8ee29e22d67706fe (diff)
downloadOSELAS.Toolchain-f8a3a0c3cbbac8701a08f2ebba9a09b99cf26713.tar.gz
image-toolchain-tgz: strip host binaries only for the tarball
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rwxr-xr-xbuild_all_v2.mk2
-rwxr-xr-xdebian/rules1
-rw-r--r--rules/image-toolchain-tgz.make12
-rw-r--r--rules/post/cleanup.make21
-rw-r--r--scripts/lib/ptxd_make_image_tgz.sh41
5 files changed, 47 insertions, 30 deletions
diff --git a/build_all_v2.mk b/build_all_v2.mk
index 8f0f47d..dc294b0 100755
--- a/build_all_v2.mk
+++ b/build_all_v2.mk
@@ -19,7 +19,7 @@ BENICE := true
PTXDIST := ./p --force
ARG := images
-export PTXDIST_ENV_WHITELIST += CROSS_GDB_WITHOUT_PYTHON PTXDIST_TOOLCHCAIN_KEEP_DEBUG
+export PTXDIST_ENV_WHITELIST += CROSS_GDB_WITHOUT_PYTHON
export CROSS_GDB_WITHOUT_PYTHON ?= y
ifdef BENICE
diff --git a/debian/rules b/debian/rules
index 2876221..9abd8ea 100755
--- a/debian/rules
+++ b/debian/rules
@@ -21,7 +21,6 @@ debian/ptxdistrc:
fi >> $@
PTXDIST_ENV := \
- PTXDIST_TOOLCHCAIN_KEEP_DEBUG=1 \
PTXDIST_PTXRC=$(CURDIR)/debian/ptxdistrc \
CROSS_GDB_WITHOUT_PYTHON=n
diff --git a/rules/image-toolchain-tgz.make b/rules/image-toolchain-tgz.make
index dfd821c..c7321b0 100644
--- a/rules/image-toolchain-tgz.make
+++ b/rules/image-toolchain-tgz.make
@@ -17,20 +17,18 @@ IMAGE_PACKAGES-$(PTXCONF_IMAGE_TOOLCHAIN_TGZ) += image-toolchain-tgz
# Paths and names
#
IMAGE_TOOLCHAIN_TGZ_VERSION := $(shell ./scripts/setlocalversion ./.tarball-version)
+IMAGE_TOOLCHAIN_TGZ := image-toolchain-tgz-$(IMAGE_TOOLCHAIN_TGZ_VERSION)
+IMAGE_TOOLCHAIN_TGZ_DIR := $(BUILDDIR)/$(IMAGE_TOOLCHAIN_TGZ)
IMAGE_TOOLCHAIN_TGZ_IMAGE := $(PTXDIST_WORKSPACE)/dist/oselas.toolchain-$(IMAGE_TOOLCHAIN_TGZ_VERSION)-$(subst _,-,$(PTXCONF_PLATFORM))_$(PTX_TOOLCHAIN_HOST_ARCH).tar.xz
# ----------------------------------------------------------------------------
# Image
# ----------------------------------------------------------------------------
-$(IMAGE_TOOLCHAIN_TGZ_IMAGE): $(STATEDIR)/world.cleanup
+$(IMAGE_TOOLCHAIN_TGZ_IMAGE): $(STATEDIR)/world.targetinstall
@$(call targetinfo)
- @mkdir -p $(dir $@)
- @echo 'tar -C "$(PTX_AUTOBUILD_DESTDIR)$(PTXCONF_PREFIX)" \
- --exclude=gcc-first \
- -cJf "$(@)" \
- "${PTXCONF_PROJECT}/$(PTXCONF_GNU_TARGET)/$(PTXCONF_PREFIX_TCID)"' \
- | fakeroot
+ @$(call world/image/env, IMAGE_TOOLCHAIN_TGZ) \
+ ptxd_make_image_tgz
@$(call finish)
# vim: syntax=make
diff --git a/rules/post/cleanup.make b/rules/post/cleanup.make
deleted file mode 100644
index 6978311..0000000
--- a/rules/post/cleanup.make
+++ /dev/null
@@ -1,21 +0,0 @@
-
-TOOLCHAIN_CLEANUP_HOST_DIRS := \
- "$(PTXCONF_SYSROOT_CROSS)/lib" \
- "$(PTXCONF_SYSROOT_CROSS)/libexec" \
- "$(PTXCONF_SYSROOT_CROSS)/bin" \
- "$(PTXCONF_SYSROOT_CROSS)/$(call remove_quotes,$(PTXCONF_GNU_TARGET))/bin"
-
-$(STATEDIR)/world.cleanup: $(STATEDIR)/world.targetinstall
- @$(call targetinfo)
-ifndef PTXDIST_TOOLCHCAIN_KEEP_DEBUG
-# # strip all host binaries
- find $(TOOLCHAIN_CLEANUP_HOST_DIRS) \
- -wholename "$(PTXCONF_SYSROOT_CROSS)/lib/gcc" -prune -o \
- -type f \( -executable -o -name "*.so*" \) -print0 \
- | xargs -0 -n1 --verbose strip --preserve-dates || true
-endif
- @$(call touch)
-
-world: $(STATEDIR)/world.cleanup
-
-# vim: syntax=make
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