From fdfd2889ad3e59444275e063ada5247727cb079d Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Fri, 20 May 2011 18:27:36 +0300 Subject: fs-tests: integck: implement MTD reattaching This patch adds -m option to integck and teaches integck to re-attach the MTD device to UBI in case of an emulated power cut event. This is needed for the new UBI power cut and unstable bits emulation infrastructure: when UBI emulates a power cut the only way to recover form this is to re-attach the MTD device. Signed-off-by: Artem Bityutskiy --- tests/fs-tests/integrity/Makefile | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'tests/fs-tests/integrity/Makefile') diff --git a/tests/fs-tests/integrity/Makefile b/tests/fs-tests/integrity/Makefile index 2cdd470..509a94e 100644 --- a/tests/fs-tests/integrity/Makefile +++ b/tests/fs-tests/integrity/Makefile @@ -4,8 +4,11 @@ CC = gcc endif COMMON_HEADERS_DIR := ../../../include +LIBUBI_PATH=../../../ubi-utils/ +LIBUBI_SRC_PATH=../../../ubi-utils/src/ +LIBUBI_HEADER_PATH=../../../ubi-utils/include -CFLAGS := $(CFLAGS) -Wall -g -O2 -I$(COMMON_HEADERS_DIR) +CFLAGS := $(CFLAGS) -Wall -g -O2 -I$(COMMON_HEADERS_DIR) -I$(LIBUBI_HEADER_PATH) LDFLAGS := $(LDFLAGS) @@ -13,10 +16,17 @@ TARGETS = integck all: $(TARGETS) +# Compile ubilib +libubi.a: + $(CC) $(CFLAGS) -I $(LIBUBI_SRC_PATH) -c $(LIBUBI_SRC_PATH)/libubi.c -o libubi.o + ar cr libubi.a libubi.o + +$(TARGETS): libubi.a + # Disable optimizations to make it possible to use gdb comfortably # Use -rdynamic to have stack backtraces -debug: - gcc $(CFLAGS) -O0 -D INTEGCK_DEBUG -rdynamic integck.c -o integck +debug: libubi.a + gcc $(CFLAGS) -O0 -D INTEGCK_DEBUG -rdynamic integck.c libubi.a -o integck clean: - rm -f *.o $(TARGETS) + rm -f *.o $(TARGETS) libubi.a -- cgit v1.2.3