deploykernel.zsh: Various Updates

* Add options for cross compiling
* Put the resulting package in a subdirectory to keep the toplevel clean
* Fix color output
* Use $COLORS from common.zsh

Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
Anna Schumaker 2023-07-19 11:53:10 -04:00
parent 2e9699a52e
commit c843549aa5
1 changed files with 20 additions and 3 deletions

View File

@ -1,14 +1,31 @@
#!/bin/zsh -e
source common.zsh
autoload colors
colors
OPTS=(--clang)
zparseopts -D -K -clang+=OPTS -gcc+=OPTS -arm64+=OPTS -i686+=OPTS
if [ "$#" -lt 1 ]; then
echo "Usage: $0 {remote host, ...}"
exit 1
fi
makepkg -f
deploypkg.zsh $(makepkg --packagelist) $*
case ${OPTS[-1]} in
--clang) export CC=clang ;;
--gcc) export CC=gcc ;;
--arm64) export CC=gcc
export ARCH=arm64
export CROSS_COMPILE=aarch64-linux-gnu-
;;
--i686) export CC=gcc
export ARCH=i386
;;
esac
PKGDEST=packages makepkg -f
PKGDEST=packages deploypkg.zsh $(makepkg --packagelist) $*
pkgname=$(grep ^pkgname PKGBUILD | awk -F= '{print $2}')
@ -22,7 +39,7 @@ echo
vm.zsh reboot $*
echo
tags=($(python /home/anna/bin/colors/vm.py $*))
tags=($(FORCE_COLOR=1 python $COLORS/vm.py $*))
for ((i=1; i<=$#; i++)); do
echo "${tags[i]} $fg_bold[default]$(ssh ${@[i]} uname -rsn)$reset_color"
done