NAND image conversion utility for the Spitz machines.
PATCH 1/1 NAND image conversion utility for the Spitz machines.
This is a small program that converts NAND Flash images from raw to the format used by hw/nand.c. I don't know if it should be included in qemu (it's handy for me to have it included). What it does:
- takes on standard input flash rootfs partition images generated from some OpenEmbedded-based build systems (i.e. Poky or OpenZaurus)
- offsets the image to the rootfs partition's start,
- inserts proper jffs2 markers in the Out-Of-Band areas in the flash so that Linux doesn't protest. Also inserts empty block jffs2 markers and ECC where necessary.
Cheers,
Andrew
From a6fb0b70ec61a3d37293a895f8d31262a12cbcb8 Mon Sep 17 00:00:00 2001
From: Andrzej Zaborowski <[email protected]>
Date: Fri, 16 Mar 2007 17:36:30 +0100
Subject: [PATCH] NAND Flash image conversion utility for the Spitz machines.
--- Makefile | 15 +++- raw2flash.c | 370 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 384 insertions(+), 1 deletions(-)
Makefile +14 -1
@@ -14,7 +14,7 @@ BASE_CFLAGS += -mcpu=ultrasparc endif CPPFLAGS += -I. -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE LIBS= -TOOLS=qemu-img$(EXESUF) +TOOLS=qemu-img$(EXESUF) raw2flash$(EXESUF) flash2raw$(EXESUF) ifdef CONFIG_STATIC BASE_LDFLAGS += -static endif
@@ -23,6 +23,7 @@ DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 else DOCS= endif +MODELS=spitz akita borzoi terrier ifndef CONFIG_DARWIN ifndef CONFIG_WIN32
@@ -43,6 +44,13 @@ qemu-img$(EXESUF): qemu-img.c cutils.c block.c block-raw.c block-cow.c block-qco dyngen$(EXESUF): dyngen.c $(HOST_CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -o $@ $^ +raw2flash$(EXESUF) flash2raw$(EXESUF): raw2flash.c + $(CC) -D$@ $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $@ $^ + for m in $(MODELS); do \ + [ -e $@.$$m$(EXESUF) ] || \ + ln -s $@ $@.$$m$(EXESUF) ; \ + done + clean: # avoid old build problems by removing potentially incorrect old files rm -f config.mak config.h op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h
@@ -89,6 +97,11 @@ endif for d in $(TARGET_DIRS); do \ $(MAKE) -C $$d $@ || exit 1 ; \ done + for m in $(MODELS); do \ + for n in *.$$m; do \ + $(INSTALL) $$n "$(DESTDIR)$(bindir)"; \ + done; \ + done # various test targets test speed test2: all
raw2flash.c new file +370 -0
370 lines not on this page · raw message
Signature · 1 line
1.4.4.3