Skip to content

Commit

Permalink
add diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
marcone committed Mar 29, 2024
1 parent a1affeb commit 18dfa3c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions setup/pi/setup-teslausb
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,13 @@ function cmd_upgrade_finish {
reboot
}

function checkmounted() {
if ! findmnt "$1" &> /dev/null
then
echo "ERROR: $1 is not mounted"
fi
}

function checkfsrw() {
local -r opts=$(findmnt -n -o options "$1")
local -r rw=${opts:0:2}
Expand Down Expand Up @@ -690,6 +697,8 @@ function diagnose {
fi
checkfsrw /backingfiles rw
checkfsrw /mutable rw
checkmounted /var/www/html/TeslaCam
checkmounted /var/www/html/fs

echo -e "====== disk / images ======"
parted -s "${BOOT_DISK}" print || true
Expand Down Expand Up @@ -738,6 +747,9 @@ function diagnose {
echo "no fstab found"
fi

echo -e "====== mounts ======"
mount

echo -e "====== initial setup boot log ======"
mkdir /tmp/root$$
mount --bind / /tmp/root$$
Expand Down

0 comments on commit 18dfa3c

Please sign in to comment.