From 591682d0001a64e40cdfdedf53661c1f3e81dd72 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 25 Sep 2007 16:06:59 +0000 Subject: 2007-09-25 Joel Sherrill * .cvsignore, Makefile, init.c: Switch to using rtems-bin2c for initial filesystem image. --- nfsClientTest/.cvsignore | 3 +++ nfsClientTest/ChangeLog | 5 +++++ nfsClientTest/Makefile | 31 +++++++++++++------------------ nfsClientTest/init.c | 20 +++----------------- 4 files changed, 24 insertions(+), 35 deletions(-) diff --git a/nfsClientTest/.cvsignore b/nfsClientTest/.cvsignore index fecf58a..e1e4b63 100644 --- a/nfsClientTest/.cvsignore +++ b/nfsClientTest/.cvsignore @@ -1 +1,4 @@ o-optimize +FilesystemImage +FilesystemImage.c +FilesystemImage.h diff --git a/nfsClientTest/ChangeLog b/nfsClientTest/ChangeLog index 4b1b63b..35888ab 100644 --- a/nfsClientTest/ChangeLog +++ b/nfsClientTest/ChangeLog @@ -1,3 +1,8 @@ +2007-09-25 Joel Sherrill + + * .cvsignore, Makefile, init.c: Switch to using rtems-bin2c for initial + filesystem image. + 2007-07-18 Joel Sherrill * init.c: Make the NFS server, remote filesystem, and directory to look diff --git a/nfsClientTest/Makefile b/nfsClientTest/Makefile index 782dfab..ff3ac70 100644 --- a/nfsClientTest/Makefile +++ b/nfsClientTest/Makefile @@ -8,7 +8,7 @@ PGM=${ARCH}/$(SAMPLE).exe MANAGERS=all # C source names, if any, go here -- minus the .c -C_PIECES=init dirutils +C_PIECES=init dirutils FilesystemImage C_FILES=$(C_PIECES:%=%.c) C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) @@ -18,7 +18,7 @@ DOCTYPES= DOCS=$(DOCTYPES:%=$(SAMPLE).%) SRCS=$(DOCS) $(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES) -OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES) $(ARCH)/tarfile.o +OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES) PRINT_SRCS=$(DOCS) @@ -40,10 +40,8 @@ CFLAGS_DEBUG_V += -v -qrtems_debug LD_PATHS += -OBJDUMP=$(OBJCOPY:copy=dump) - CFLAGS += -LD_LIBS += -lrtemsNfs +LD_LIBS += -lnfs # # Add your list of files to delete here. The config files @@ -52,26 +50,23 @@ LD_LIBS += -lrtemsNfs # 'make clobber' already includes 'make clean' # -CLEAN_ADDITIONS += tarfile obj_format +CLEAN_ADDITIONS += FilesystemImage FilesystemImage.c FilesystemImage.h CLOBBER_ADDITIONS += -# strip out flags gcc knows but LD doesn't like -- add as needed -LD_CPU_CFLAGS=$(CPU_CFLAGS:-mstrict-align:) - all: ${ARCH} $(SRCS) $(PGM) -obj_format: - $(OBJDUMP) -f $(ARCH)/init.o | grep .o: | \ - sed -e 's/^.*format //' >obj_format - ${PGM}: $(OBJS) $(LINK_FILES) $(make-exe) -$(ARCH)/tarfile.o: $(ARCH) obj_format - cd rootfs ; tar cf ../$(ARCH)/tarfile --exclude CVS . - cp $(ARCH)/tarfile . - $(OBJCOPY) -I binary -O `cat obj_format` tarfile $(ARCH)/tarfile.o - $(LD) $(LD_CPU_CFLAGS) -r -o $(ARCH)/temp.o $(ARCH)/tarfile.o +$(ARCH)/init.o: init.c FilesystemImage.h + +FilesystemImage: $(ARCH) rootfs/etc/host.conf rootfs/etc/hosts rootfs/rtems_logo.jpg + cd rootfs ; \ + tar cf ../FilesystemImage --exclude CVS --exclude .cvsignore . + +FilesystemImage.c: $(ARCH) FilesystemImage + $(PROJECT_ROOT)/bin/bin2c FilesystemImage FilesystemImage + # Install the program(s), appending _g or _p as appropriate. # for include files, just use $(INSTALL) diff --git a/nfsClientTest/init.c b/nfsClientTest/init.c index 8f4713f..75ab285 100644 --- a/nfsClientTest/init.c +++ b/nfsClientTest/init.c @@ -50,7 +50,6 @@ rtems_task Init( #include #include #include -#include #include @@ -63,24 +62,11 @@ rtems_task Init( #include #include "../networkconfig.h" -#include - -#define ARGUMENT 0 /* - * The tarfile is built automatically externally so we need to account - * for the leading symbol on the names. + * The tarfile image is built automatically externally. */ -#if defined(__sh__) - #define SYM(_x) _x -#else - #define SYM(_x) _ ## _x -#endif - -extern int SYM(binary_tarfile_start); -extern int SYM(binary_tarfile_size); -#define TARFILE_START SYM(binary_tarfile_start) -#define TARFILE_SIZE SYM(binary_tarfile_size) +#include "FilesystemImage.h" rtems_task Init( rtems_task_argument argument @@ -96,7 +82,7 @@ rtems_task Init( * Load filesystem image */ printf("=============== Loading filesystem image ===============\n"); - status = Untar_FromMemory((void *)(&TARFILE_START), (size_t)&TARFILE_SIZE); + status = Untar_FromMemory((void *)FilesystemImage, FilesystemImage_size); printf("============== Look at Local Filesystem ==============\n"); printf( "PWD: " ); -- cgit v1.2.3