File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
dev-ayufan/root/usr/local/sbin Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -eo pipefail
4+
5+ source /usr/local/lib/u-boot-rockchip/loader-common
6+
7+ echo " Doing this will erase bootloader stored on your boot device"
8+ echo " and it might break your system."
9+ echo " Use this only if you prefer to boot from SPI ('rock64_write_spi_flash.sh')."
10+ echo " To bring back bootloader run 'rock64_upgrade_bootloader.sh'."
11+ echo " "
12+
13+ confirm
14+
15+ MNT_DEV=$( findmnt /boot/efi -n -o SOURCE)
16+
17+ write_sd () {
18+ case " $1 " in
19+ /dev/mmcblk* p6|/dev/sd* p6|/dev/mapper/loop* p6|/dev/mapper/nvme* p6)
20+ dd if=" $2 " of=" ${1/ p6/ p1} "
21+ ;;
22+
23+ * )
24+ echo " Cannot detect boot device ($MNT_DEV )."
25+ exit 1
26+ ;;
27+ esac
28+ }
29+
30+ write_sd " $MNT_DEV " " /dev/zero"
31+
32+ sync
33+
34+ echo Done.
You can’t perform that action at this time.
0 commit comments