openwrtv3/target/linux/s3c24xx/patches-2.6.24/1258-add-build-makerecovery.patch.patch

43 lines
1.1 KiB
Diff

From c596d9067aa789a62e51df89917680eabe6453e2 Mon Sep 17 00:00:00 2001
From: Andy Green <andy@openmoko.com>
Date: Thu, 7 Aug 2008 12:20:37 +0100
Subject: [PATCH] add-build-makerecovery.patch
This patch adds a script that creates a "recovery kernel" image
from a recovery-uImage-moredrivers-... image. The use of these
recovery images is explained here:
http://wiki.openmoko.org/wiki/Freerunner_backup_kernel
Signed-off-by: Andy Green <andy@openmoko.com>
---
makerecovery | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
create mode 100755 makerecovery
diff --git a/makerecovery b/makerecovery
new file mode 100755
index 0000000..e158638
--- /dev/null
+++ b/makerecovery
@@ -0,0 +1,17 @@
+#!/bin/sh
+#
+# make 6MB recovery image from two moredrivers type kernels
+# placed at start and at +4MBytes
+
+if [ -z "$1" ] ; then
+ echo "Usage: $0 uImage-moredrivers-..."
+ exit 1
+fi
+cat $1 > recovery-$1
+SIZE=`ls -l $1 | tr -s ' ' ' ' | cut -d' ' -f5`
+SPACE=$(( 4 * 1024 * 1024 - $SIZE ))
+dd if=/dev/zero of=_spacer bs=1 count=$SPACE
+cat _spacer >> recovery-$1
+rm -f _spacer
+cat $1 >> recovery-$1
+
--
1.5.6.5