]> git.zerfleddert.de Git - m1-debian/blobdiff - gpu.sh
improve shell scripts
[m1-debian] / gpu.sh
diff --git a/gpu.sh b/gpu.sh
index 3c5db607dad0925512919f14aaee43eddfd06911..61508fd351211dcda0af860aa92554ffabea44a1 100644 (file)
--- a/gpu.sh
+++ b/gpu.sh
@@ -1,9 +1,13 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # SPDX-License-Identifier: MIT
 
-set -x
-set -e
+set -o errexit
+set -o nounset
+set -o pipefail
+set -o xtrace
+
+cd "$(dirname "$0")"
 
 unset LC_CTYPE
 unset LANG
@@ -40,17 +44,14 @@ build_uboot()
         test -d u-boot || git clone https://github.com/AsahiLinux/u-boot
         cd u-boot
         git fetch -a -t
-        # For tag, see https://github.com/AsahiLinux/PKGBUILDs/blob/main/uboot-asahi/PKGBUILD
         git reset --hard origin/asahi;
         curl -s https://tg.st/u/0001-usb-request-on-8-bytes-for-USB_SPEED_FULL-bMaxPacket.patch | git am -
         make apple_m1_defconfig
         make -j `nproc`
 )
-
         cat m1n1/build/m1n1.bin   `find linux/arch/arm64/boot/dts/apple/ -name \*.dtb` <(gzip -c u-boot/u-boot-nodtb.bin) > u-boot.bin
         sudo cp /boot/efi/m1n1/boot.bin /boot/efi/m1n1/`date +%Y%m%d%H%M`.bin
         sudo cp u-boot.bin /boot/efi/m1n1/boot.bin
-
 }
 
 mkdir -p build
Impressum, Datenschutz