Skip to content

Commit 47aa896

Browse files
committed
Add script to remove boot0 and make the device unbootable.
1 parent 36af981 commit 47aa896

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,5 +115,7 @@ echo "Downloading and writing to /dev/mmcblk1..."
115115
curl -L -f "$DOWNLOAD_URL" | $ARCHIVER | dd bs=30M of=/dev/mmcblk1
116116
sync
117117
echo ""
118+
echo "You may want to run now pine64_remove_boot.sh to make the current device unbootable."
119+
echo ""
118120

119121
echo "Done."
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/bash
2+
3+
set -eo pipefail
4+
5+
if [[ "$(id -u)" -ne "0" ]]; then
6+
echo "This script requires root."
7+
exit 1
8+
fi
9+
10+
echo "Pine A64/Pinebook boot remover!"
11+
echo "(C) 2017. Kamil Trzciński (https://ayufan.eu)."
12+
echo ""
13+
echo "The purpose of this script is to remove boot0 and make the disk unbootable."
14+
echo ""
15+
16+
usage() {
17+
echo "Usage:"
18+
echo "$ $0 [disk]"
19+
echo ""
20+
echo "If no disk is specified the /dev/mmcblk0 will be used."
21+
exit 1
22+
}
23+
24+
if [[ $# -ne 1 ]] && [[ $# -ne 2 ]]; then
25+
usage
26+
fi
27+
28+
DISK="${1-/dev/mmcblk0}"
29+
30+
echo "Doing this will make the "$DISK" unbootable."
31+
32+
while true; do
33+
echo "Type YES to continue or Ctrl-C to abort."
34+
read CONFIRM
35+
if [[ "$CONFIRM" == "YES" ]]; then
36+
break
37+
fi
38+
done
39+
40+
echo ""
41+
dd conv=notrunc bs=1k seek=8 count=32 oflag=direct if=/dev/zero of="$DISK"
42+
43+
echo "Done."

0 commit comments

Comments
 (0)