summaryrefslogtreecommitdiff
path: root/sd_fuse
diff options
context:
space:
mode:
authorDongjin Kim <tobetter@gmail.com>2018-07-19 07:37:52 +0000
committerDongjin Kim <tobetter@gmail.com>2018-07-24 18:52:11 +0900
commit86446f3d85d4e2c493618f370347f0d992561b9e (patch)
treeb1106ba0213229363748bf23d766fea6f70319a9 /sd_fuse
parent4684937d15d50b4c6ab8b3b1b423483ef3e87e9c (diff)
downloadu-boot-odroid-c1-86446f3d85d4e2c493618f370347f0d992561b9e.tar.gz
ODROID-C3/N2: add new fusing script
The script in this patch is to flash the bootloader image to a memory card, the file 'u-boot.bin' in the current directory will be flashed by default. $ ./sd_fusing.sh <memory/card/device> You can set the environment variable 'UBOOT' with a path of another bootloader image file in another file or in another directory. $ UBOOT=<somewhere/in/your/machine> ./sd_fusing.sh <memory/card/device> Change-Id: I9b4e14d1b3f0933a383eecaeb8726ee2dfdc40f1 Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Diffstat (limited to 'sd_fuse')
-rwxr-xr-xsd_fuse/sd_fusing.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/sd_fuse/sd_fusing.sh b/sd_fuse/sd_fusing.sh
new file mode 100755
index 0000000000..451013f119
--- /dev/null
+++ b/sd_fuse/sd_fusing.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+#
+# Copyright (C) 2018 Hardkernel Co,. Ltd
+# Dongjin Kim <tobetter@gmail.com>
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+abort() {
+ echo $1
+ exit 1
+}
+
+[ -z $1 ] && abort "usage: $0 <your/memory/card/device>"
+[ -z ${UBOOT} ] && UBOOT=${PWD}/u-boot.bin
+[ ! -f ${UBOOT} ] && abort "error: ${UBOOT} is not exist"
+
+sudo dd if=$UBOOT of=$1 conv=fsync,notrunc bs=512 seek=1
+
+sync
+
+sudo eject $1
+echo Finished.