mirror of
https://github.com/crosstool-ng/crosstool-ng.git
synced 2025-03-11 15:04:19 +00:00
Add option to build toolchain tarball
Add TARBALL_RESULT option that will produce a tarball of the final toolchain to make it easier to deploy the toolchain to other machines. The implementation uses `find | sort` instead of `tar --sort` because this was introduced in GNU Tar v1.28, which is not available in some LTS Linux distributions. This is a variation of the command recommended here: https://wiki.debian.org/ReproducibleBuilds/FileOrderInTarballs Closes #1262 Signed-off-by: Chris Packham <judge.packham@gmail.com>
This commit is contained in:
parent
618affc789
commit
376a289777
@ -137,3 +137,31 @@ config STRIP_TARGET_TOOLCHAIN_EXECUTABLES
|
||||
An install-strip make target is provided that installs stripped
|
||||
executables, and may install libraries with unneeded or debugging
|
||||
sections stripped.
|
||||
|
||||
config TARBALL_RESULT
|
||||
bool
|
||||
depends on EXPERIMENTAL
|
||||
prompt "Create binary toolchain tarball"
|
||||
default n
|
||||
help
|
||||
Create tarball of the final binary toolchain.
|
||||
|
||||
if TARBALL_RESULT
|
||||
|
||||
config TARBALL_RESULT_DIR
|
||||
string
|
||||
depends on TARBALL_RESULT
|
||||
prompt "Output directory"
|
||||
default "${CT_TOP_DIR}"
|
||||
help
|
||||
Directory where tarball will be created.
|
||||
|
||||
config TARBALL_RESULT_FILENAME
|
||||
string
|
||||
depends on TARBALL_RESULT
|
||||
prompt "Output filename"
|
||||
default "toolchain${CT_TOOLCHAIN_PKGVERSION:+-${CT_TOOLCHAIN_PKGVERSION}}-${CT_HOST:+HOST-${CT_HOST}-}${CT_TARGET}"
|
||||
help
|
||||
Filename for toolchain tarball, without extension.
|
||||
|
||||
endif
|
||||
|
@ -31,6 +31,7 @@ do_finish() {
|
||||
local strip_args
|
||||
local gcc_version
|
||||
local exe_suffix
|
||||
local tarball
|
||||
|
||||
CT_DoStep INFO "Finalizing the toolchain's directory"
|
||||
|
||||
@ -138,5 +139,19 @@ do_finish() {
|
||||
CT_InstallCopyingInformation
|
||||
fi
|
||||
|
||||
if [ "${CT_TARBALL_RESULT}" = y ]; then
|
||||
tarball="${CT_TARBALL_RESULT_DIR}/${CT_TARBALL_RESULT_FILENAME}.tar.xz"
|
||||
CT_DoLog EXTRA "Creating binary toolchain tarball: ${tarball}"
|
||||
cp "${CT_TOP_DIR}/.config" "${CT_PREFIX_DIR}/${CT_TOOLCHAIN_PKGVERSION}.config"
|
||||
(cd "${CT_PREFIX_DIR}" && \
|
||||
find ./. -print0 | \
|
||||
LC_ALL=C sort -z | \
|
||||
tar --numeric-owner --owner=0 --group=0 \
|
||||
--transform "s,^\./\.,${CT_TARBALL_RESULT_FILENAME},S" \
|
||||
--no-recursion --null -T - -Jcf "${tarball}")
|
||||
CT_DoLog EXTRA "Calculating binary toolchain checksum"
|
||||
sha256sum "${tarball}" > "${tarball}.asc"
|
||||
fi
|
||||
|
||||
CT_EndStep
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user