summaryrefslogtreecommitdiffstats
path: root/reflash-bootloader/build-image.sh
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2011-09-13 21:34:41 -0700
committerBrian Swetland <swetland@google.com>2011-10-12 16:02:35 -0700
commit7086950c4d81546cc8d2eaf5a618bc315953c9c4 (patch)
tree1f63a2c5f509944a65e64692d5a6b304f8b0528e /reflash-bootloader/build-image.sh
parentf92b30b5b608a0dfa0e04c3b33616c6642a16fbf (diff)
downloaddevice_samsung_tuna-7086950c4d81546cc8d2eaf5a618bc315953c9c4.zip
device_samsung_tuna-7086950c4d81546cc8d2eaf5a618bc315953c9c4.tar.gz
device_samsung_tuna-7086950c4d81546cc8d2eaf5a618bc315953c9c4.tar.bz2
tuna: add tool that can reflash bootloader from userspace
Reads bootloader.img from the current directory, parses out the correct xloader for the device, and writes xloader and sbl to the mmc device. Can be run as init to unbrick a device. Change-Id: I5b91e2afd860e7934f7686fbeb638352b217f7c9
Diffstat (limited to 'reflash-bootloader/build-image.sh')
-rwxr-xr-xreflash-bootloader/build-image.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/reflash-bootloader/build-image.sh b/reflash-bootloader/build-image.sh
new file mode 100755
index 0000000..7b0edf5
--- /dev/null
+++ b/reflash-bootloader/build-image.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+DIR=/tmp/reflash_bootloader.$$
+RAMDISK=/tmp/ramdisk.$$.img
+
+mkdir ${DIR}
+cp ${OUT}/system/bin/tuna-reflash-bootloader ${DIR}/init
+cp ${ANDROID_BUILD_TOP}/vendor/samsung/tuna/bootloader.img ${DIR}/bootloader.img
+mkbootfs ${DIR} | minigzip > ${RAMDISK}
+mkbootimg --kernel ${OUT}/kernel --ramdisk ${RAMDISK} -o tuna-reflash-bootloader.img
+rm ${DIR}/init
+rm ${DIR}/bootloader.img
+rmdir ${DIR}
+rm ${RAMDISK}