[U-Boot-Users] [PATCH] Fix CRAMFS failure to compile if CFG_NO_FLASH.

Jonathan McDowell noodles at earth.li
Tue Jun 6 22:13:56 CEST 2006


I'm working on u-boot support for the Amstrad Delta (E3) video phone.
Currently this is running with NAND but not NOR support. However when
JFFS2 support is compiled into u-boot this pulls in CRAMFS, which fails
to compile if CFG_NO_FLASH is set. The attached patch fixes this by
adding stub cramfs functions in the case when this is set, which allows
JFFS2 support to build and run.

Patch is against current git.

J.

-- 
/-\                             |   How I wish, how I wish you were
|@/  Debian GNU/Linux Developer |                here.
\-                              |
-------------- next part --------------
diff --git a/fs/cramfs/cramfs.c b/fs/cramfs/cramfs.c
index 48e7f63..12476f2 100644
--- a/fs/cramfs/cramfs.c
+++ b/fs/cramfs/cramfs.c
@@ -29,6 +29,8 @@ #include <malloc.h>
 
 #if (CONFIG_COMMANDS & CFG_CMD_JFFS2)
 
+#ifndef CFG_NO_FLASH
+
 #include <asm/byteorder.h>
 #include <linux/stat.h>
 #include <jffs2/jffs2.h>
@@ -344,4 +346,28 @@ int cramfs_check (struct part_info *info
 	return 1;
 }
 
+#else /* CFG_NO_FLASH */
+
+int cramfs_check(struct part_info *info)
+{
+	return 0;
+}
+
+int cramfs_info (struct part_info *info)
+{
+	return 0;
+}
+
+int cramfs_load (char *loadoffset, struct part_info *info, char *filename)
+{
+	return -1;
+}
+
+int cramfs_ls (struct part_info *info, char *filename)
+{
+	return -1;
+}
+
+#endif /*CFG_NO_FLASH */
+
 #endif /* CFG_FS_CRAMFS */


More information about the U-Boot mailing list