From 9f2d121dac940ad719d9c5a0736b39597935baca Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20M=C3=BCller?= <mail@mueller-martin.net>
Date: Tue, 23 Jul 2019 14:36:49 +0200
Subject: [PATCH] Fix tr and dd for macOS

See Unix Stack Exchange question "Filling file with 0xFF gives C3BF in
OSX" at https://superuser.com/a/1349497/150212

and

https://lists.freebsd.org/pipermail/freebsd-questions/2007-October/160961.html
---
 bootloader/build_multi_image.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bootloader/build_multi_image.sh b/bootloader/build_multi_image.sh
index 94a3b46b..15212e43 100755
--- a/bootloader/build_multi_image.sh
+++ b/bootloader/build_multi_image.sh
@@ -6,8 +6,8 @@ BIN1="$2"
 BIN2="$3"
 BINOUT="$4"
 
-dd if=/dev/zero ibs=1k count=448 2>/dev/null | tr "\000" "\377" > "$BINOUT"
+dd if=/dev/zero ibs=1k count=448 2>/dev/null | LANG=C tr "\000" "\377" > "$BINOUT"
 dd if="$BIN1" of="$BINOUT" conv=notrunc 2>/dev/null
-dd if="$BIN2" of="$BINOUT" conv=notrunc oflag=append 2>/dev/null
+dd if="$BIN2" >> "$BINOUT" 2>/dev/null
 
 "$PYTHON" "$(dirname "$0")/crc_patch.py" "$BINOUT"
-- 
GitLab