Skip to content

Commit 440fdbd

Browse files
committed
Add eGON check to remove_boot0.sh script
1 parent 45cce2e commit 440fdbd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

package/root/usr/local/sbin/pine64_remove_boot0.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ while true; do
3737
fi
3838
done
3939

40+
# Taken from: https://github.com/longsleep/build-pine64-image/blob/master/convert-pine64-image.sh#L28
41+
boot0headerpos=$((8*1024+4))
42+
boot0header=$(xxd -p -s "$boot0headerpos" -l 4 "$DISK")
43+
if [ "$boot0header" != "65474f4e" ]; then
44+
echo "Error: Target image has no eGON header, aborting!"
45+
exit 1
46+
fi
47+
4048
echo ""
4149
dd conv=notrunc bs=1k seek=8 count=32 oflag=direct if=/dev/zero of="$DISK"
4250

0 commit comments

Comments
 (0)