3rdparty/kallisti5: Tool to compress running sysroot into a tar.gz

This commit is contained in:
Alexander von Gluck IV 2017-12-13 08:36:33 -06:00
parent cef24e1a43
commit 453dc171ae

27
3rdparty/kallisti5/mksysroot.sh vendored Executable file
View File

@ -0,0 +1,27 @@
#!/bin/bash
#
# Creates a sysroot from a running Haiku system suitable
# for bootstrapping / cross-compiling Haiku applications
# under other platforms.
#
# Resulting tar.gz is generally extracted at cross-tools-$ARCH/sysroot
#
OS=$(uname -o)
ARCH=$(uname -p)
REV=$(uname -v | awk '{ print $1 }')
EXCLUDE="/boot/system/packages /boot/system/var/swap"
OUTPUT="sysroot-$OS-$ARCH-$REV.tar.gz"
echo "Generating $ARCH sysroot..."
tar $(for i in $EXCLUDE; do echo "--exclude $i"; done) -cvzf $OUTPUT /boot/system /bin /etc /packages /system /tmp
if [ $? -ne 0 ]; then
echo "Error creating sysroot package!"
return 1;
fi
echo "sysroot $OUTPUT successfully created!"