Skip to content

Commit 0d9740a

Browse files
committed
BananaPi BPI-M4-Zero: Add error handling
Check connection with curl before cloning wireless-regdb. Check for the regulatory.db && regulatory.db.p7s files before adding them the img. Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
1 parent 3e0bfa7 commit 0d9740a

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

config/boards/bananapim4zero.conf

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,16 @@ function post_family_tweaks_bsp__bananapi_firmware() {
2525
}
2626

2727
function post_family_tweaks_bsp__bananapi_wireless_regdb() {
28-
mkdir -p $SRC/cache
29-
mkdir -p "${destination}"/lib/firmware/updates
30-
display_alert "$BOARD" "Installing upstream wireless-regdb" "info"
31-
git clone --depth=1 -q git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git $SRC/cache/wireless-regdb
32-
sleep .25
33-
cp -f $SRC/cache/wireless-regdb/regulatory.db "${destination}"/lib/firmware/updates/regulatory.db
34-
cp -f $SRC/cache/wireless-regdb/regulatory.db.p7s "${destination}"/lib/firmware/updates/regulatory.db.p7s
35-
rm -fdr $SRC/cache/wireless-regdb
28+
if [[ `curl -I https://git.kernel.org 2>&1 | grep 'HTTP/2 200'` ]]; then
29+
mkdir -p $SRC/cache
30+
mkdir -p "${destination}"/lib/firmware/updates
31+
display_alert "$BOARD" "Installing upstream wireless-regdb" "info"
32+
git clone --depth=1 -q https://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git $SRC/cache/wireless-regdb
33+
sleep .25
34+
if [[ -f "$SRC/cache/wireless-regdb/regulatory.db" ]] && [[ -f "$SRC/cache/wireless-regdb/regulatory.db.p7s" ]]; then
35+
cp -f $SRC/cache/wireless-regdb/regulatory.db "${destination}"/lib/firmware/updates/regulatory.db
36+
cp -f $SRC/cache/wireless-regdb/regulatory.db.p7s "${destination}"/lib/firmware/updates/regulatory.db.p7s
37+
fi
38+
rm -fdr $SRC/cache/wireless-regdb
39+
fi
3640
}

0 commit comments

Comments
 (0)