Introduced btrfs file-system with btrload command
Subsystems (4)
PATCH v11 1/2 Introduced btrfs file-system with btrload command
Introduces btrfs file-system to read file from volume/sub-volumes with btrload command. This implementation has read-only support.
This btrfs implementation is based on syslinux btrfs code, commit 269ebc845ebc8b46ef4b0be7fa0005c7fdb95b8d.
v11: Mirro super block check.
v10: patch problem reworked. v5: merged with master. v4: btrls command added.
--- Makefile | 1 + common/Makefile | 1 + common/cmd_btr.c | 65 +++ fs/btrfs/Makefile | 51 ++ fs/btrfs/btrfs.c | 1344 ++++++++++++++++++++++++++++++++++++++++++++ fs/fs.c | 10 + include/btrfs.h | 416 ++++++++++++++ include/config_fallbacks.h | 4 + include/crc.h | 8 + include/fs.h | 1 + lib/Makefile | 1 + lib/crc32_c.c | 40 ++ 12 files changed, 1942 insertions(+) create mode 100644 common/cmd_btr.c create mode 100644 fs/btrfs/Makefile create mode 100644 fs/btrfs/btrfs.c create mode 100644 include/btrfs.h create mode 100644 lib/crc32_c.c
Makefile +1 -0
@@ -257,6 +257,7 @@ endif LIBS-$(CONFIG_OF_EMBED) += dts/libdts.o LIBS-y += arch/$(ARCH)/lib/lib$(ARCH).o LIBS-y += fs/libfs.o \ + fs/btrfs/libbtrfs.o \ fs/cbfs/libcbfs.o \ fs/cramfs/libcramfs.o \ fs/ext4/libext4fs.o \
common/Makefile +1 -0
@@ -73,6 +73,7 @@ COBJS-$(CONFIG_CMD_BEDBUG) += bedbug.o cmd_bedbug.o COBJS-$(CONFIG_CMD_BMP) += cmd_bmp.o COBJS-$(CONFIG_CMD_BOOTLDR) += cmd_bootldr.o COBJS-$(CONFIG_CMD_BOOTSTAGE) += cmd_bootstage.o +COBJS-$(CONFIG_CMD_BTR) += cmd_btr.o COBJS-$(CONFIG_CMD_CACHE) += cmd_cache.o COBJS-$(CONFIG_CMD_CBFS) += cmd_cbfs.o COBJS-$(CONFIG_CMD_CONSOLE) += cmd_console.o
common/cmd_btr.c new file +65 -0
65 lines not on this page · raw message
fs/btrfs/Makefile new file +51 -0
51 lines not on this page · raw message
fs/btrfs/btrfs.c new file +1344 -0
1,344 lines not on this page · raw message
fs/fs.c +10 -0
@@ -17,6 +17,7 @@#include <config.h> #include <common.h> #include <part.h> +#include <btrfs.h> #include <ext4fs.h> #include <fat.h> #include <fs.h>
@@ -88,6 +89,15 @@ static struct fstype_info fstypes[] = { .read = fs_read_sandbox, },#endif +#ifdef CONFIG_FS_BTR + { + .fstype = FS_TYPE_BTR, + .probe = btrfs_probe, + .close = btrfs_close, + .ls = btrfs_ls, + .read = btrfs_read_file, + }, +#endif { .fstype = FS_TYPE_ANY, .probe = fs_probe_unsupported,
include/btrfs.h new file +416 -0
416 lines not on this page · raw message
include/config_fallbacks.h +4 -0
@@ -26,4 +26,8 @@#define CONFIG_EXT4_WRITE #endif +#if defined(CONFIG_CMD_BTR ) && !defined(CONFIG_FS_BTR ) +#define CONFIG_FS_BTR +#endif +#endif /* __CONFIG_FALLBACKS_H */
include/crc.h +8 -0
@@ -97,4 +97,12 @@ cyg_ether_crc32_accumulate(uint32_t crc, unsigned char *s, int len);extern uint16_t cyg_crc16 (unsigned char *s,int len); +/* CRC init for btrfs file-system*/ + +void crc32c_init (u32 *crc32c_table,u32 pol); + +/* CRC calculate for btrfs file-system*/ + +u32 crc32c_cal (u32 crc,const char *data,size_t length,u32 *crc32c_table); +#endif /* _SERVICES_CRC_CRC_H_ */
include/fs.h +1 -0
@@ -22,6 +22,7 @@#define FS_TYPE_FAT 1#define FS_TYPE_EXT 2#define FS_TYPE_SANDBOX 3 +#define FS_TYPE_BTR 4/* * Tell the fs layer which block device an partition to use for future
lib/Makefile +1 -0
@@ -67,6 +67,7 @@ COBJS-$(CONFIG_SPL_NET_SUPPORT) += hashtable.o COBJS-$(CONFIG_SPL_NET_SUPPORT) += net_utils.o endif COBJS-y += crc32.o +COBJS-y += crc32_c.o COBJS-y += ctype.o COBJS-y += div64.o COBJS-y += linux_string.o
lib/crc32_c.c new file +40 -0
@@ -0,0 +1,40 @@ +/* +* Copied from Linux kernel crypto/crc32c.c +* Copyright (c) 2004 Cisco Systems, Inc. +* Copyright (c) 2008 Herbert Xu <[email protected]> +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License as published by the Free +* Software Foundation; either version 2 of the License, or (at your option) +* any later version. +* +*/ +#include <linux/stat.h> +#include <command.h> +#include <asm/byteorder.h> +#include <linux/compiler.h> +#include <common.h> +#include <config.h> + +u32 crc32c_cal (u32 crc,const char *data,size_t length,u32 *crc32c_table) +{ +while (length--) + crc = crc32c_table[(u8)(crc ^ *data++)] ^ (crc >>8 ); + +return crc; +} + +void crc32c_init (u32 *crc32c_table,u32 pol) +{ +int i, j; +u32 v; +const u32 poly = pol;/* Bit-reflected CRC32C polynomial */ + +for (i =0 ; i <256 ; i++) { + v = i; +for (j =0 ; j <8 ; j++) + v = (v >>1 ) ^ ((v &1 ) ? poly :0 ); + + crc32c_table[i] = v; + } +}
Signature · 1 line
1.7.9.5
PATCH v11 2/2 Enable btrfs support in mx53loco config
Enable btrfs support in mx53loco config
--- include/configs/mx53loco.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
include/configs/mx53loco.h +3 -1
@@ -56,6 +56,8 @@#define CONFIG_GENERIC_MMC #define CONFIG_CMD_FAT #define CONFIG_CMD_EXT2 +#define CONFIG_CMD_BTR +#define CONFIG_CMD_FS_GENERIC #define CONFIG_DOS_PARTITION /* Eth Configs */
@@ -128,7 +130,7 @@"mmcroot=/dev/mmcblk0p3 rw rootwait\0" \"mmcargs=setenv bootargs console=ttymxc0,${baudrate} root=${mmcroot}\0" \"loadbootscript=" \ -"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ +"btrload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \"bootscript=echo Running bootscript from mmc ...; " \"source\0" \"loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
Signature · 1 line
1.7.9.5
PATCH v11 2/2 Enable btrfs support in mx53loco config
Quoted 21 lines · Adnan Ali
Enable btrfs support in mx53loco config
Signed-off-by Adnan Ali <[email protected]>--- include/configs/mx53loco.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)include/configs/mx53loco.h +2
-0@@ -56,6 +56,8 @@#define CONFIG_GENERIC_MMC #define CONFIG_CMD_FAT #define CONFIG_CMD_EXT2 +#define CONFIG_CMD_BTR +#define CONFIG_CMD_FS_GENERIC #define CONFIG_DOS_PARTITION /* Eth Configs */
include/configs/mx53loco.h line 133
Quoted 5 lines
include/configs/mx53loco.h +1
-1@@ -128,7 +130,7 @@"mmcroot=/dev/mmcblk0p3 rw rootwait\0" \"mmcargs=setenv bootargs console=ttymxc0,${baudrate} root=${mmcroot}\0" \"loadbootscript=" \ -"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ +"btrload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
Instead of changing this to btrload for everyone, wouldn't it make more sense to use the generic "load" command? As your already setting "CONFIG_CMD_FS_GENERIC"
Once you do that, you might as well also enable:
#define CONFIG_CMD_EXT4
Quoted 5 lines
include/configs/mx53loco.h +0
-1"bootscript=echo Running bootscript from mmc ...; " \"source\0" \"loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \ --1.7.9.5
Regards,
Signature · 2 lines
Robert Nelson http://www.rcn-ee.com/
PATCH v11 2/2 Enable btrfs support in mx53loco config
Quoted 20 lines · Robert Nelson
Quoted 19 lines · Adnan Ali
Enable btrfs support in mx53loco config
Signed-off-by Adnan Ali <[email protected]>--- include/configs/mx53loco.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)include/configs/mx53loco.h +2
-0@@ -56,6 +56,8 @@#define CONFIG_GENERIC_MMC #define CONFIG_CMD_FAT #define CONFIG_CMD_EXT2 +#define CONFIG_CMD_BTR +#define CONFIG_CMD_FS_GENERIC #define CONFIG_DOS_PARTITION
Quoted 10 lines
include/configs/mx53loco.h line 133
Quoted 7 lines
include/configs/mx53loco.h +1
-1/* Eth Configs */ @@ -128,7 +130,7 @@"mmcroot=/dev/mmcblk0p3 rw rootwait\0" \"mmcargs=setenv bootargs console=ttymxc0,${baudrate} root=${mmcroot}\0" \"loadbootscript=" \ -"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ +"btrload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \Instead of changing this to btrload for everyone, wouldn't it make more sense to use the generic "load" command? As your already setting "
CONFIG_CMD_FS_GENERIC"
Well idea of adding that was to enable btrfs and to show its
associated commands.
Yes you can use generic 'load' command. Defaults was using fatload so i change
it to btrload.
Quoted 11 lines
Once you do that, you might as well also enable:
#defineCONFIG_CMD_EXT4Quoted 5 lines
include/configs/mx53loco.h +0
-1"bootscript=echo Running bootscript from mmc ...; " \"source\0" \"loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \ --1.7.9.5
Regards,
PATCH v11 2/2 Enable btrfs support in mx53loco config
Quoted 39 lines · Adnan Ali
Quoted 23 lines · Robert Nelson
Quoted 20 lines · Adnan Ali
Enable btrfs support in mx53loco config
Signed-off-by Adnan Ali <[email protected]>--- include/configs/mx53loco.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)include/configs/mx53loco.h +2
-0@@ -56,6 +56,8 @@#define CONFIG_GENERIC_MMC #define CONFIG_CMD_FAT #define CONFIG_CMD_EXT2 +#define CONFIG_CMD_BTR +#define CONFIG_CMD_FS_GENERIC #define CONFIG_DOS_PARTITION Quoted 14 lines
include/configs/mx53loco.h line 136
Quoted 10 lines
include/configs/mx53loco.h +1
-1/* Eth Configs */ @@ -128,7 +130,7 @@"mmcroot=/dev/mmcblk0p3 rw rootwait\0" \"mmcargs=setenv bootargs console=ttymxc0,${baudrate} root=${mmcroot}\0" \"loadbootscript=" \ -"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ + "btrload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \Instead of changing this to btrload for everyone, wouldn't it make more sense to use the generic "load" command? As your already setting "
CONFIG_CMD_FS_GENERIC"
Quoted 5 lines
Well idea of adding that was to enable btrfs and to show its associated
commands.
Yes you can use generic 'load' command. Defaults was using fatload so i change
it to btrload.
That's perfectly fine for showing the btrfs command's as an RFC patch, but if this was heading for mainline as-is, it would be nice to use the "load" command instead of moving from one partition format that's been default for a couple years to a new format with less users. (not that I don't like the btrfs format. ;) as i've been running it on a few omap boards for a couple years now..)
Regards,
Signature · 2 lines
Robert Nelson http://www.rcn-ee.com/
PATCH v11 2/2 Enable btrfs support in mx53loco config
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 37 lines · Robert Nelson
Quoted 31 lines · Adnan Ali
Quoted 18 lines · Robert Nelson
Quoted 15 lines · Adnan Ali
Enable btrfs support in mx53loco config
Signed-off-by Adnan Ali <[email protected]> ---
include/configs/mx53loco.h| 4 +++- 1 file changed, 3
insertions(+), 1 deletion(-)(quoted diff) +0
-0
b/include/configs/mx53loco.hindex a4b610f..62e9a76 100644 ---a/include/configs/mx53loco.h+++b/include/configs/mx53loco.h@@ -56,6 +56,8 @@ #defineCONFIG_GENERIC_MMC#defineCONFIG_CMD_FAT#defineCONFIG_CMD_EXT2+#defineCONFIG_CMD_BTR+#defineCONFIG_CMD_FS_GENERIC#defineCONFIG_DOS_PARTITIONQuoted 11 lines
Quoted 7 lines
/* Eth Configs */ @@ -128,7 +130,7 @@ "mmcroot=/dev/mmcblk0p3 rw rootwait\0" \ "mmcargs=setenv bootargs console=ttymxc0,${baudrate} root=${mmcroot}\0" \
"loadbootscript=" \ - "fatload mmc
${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ + "btrload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \Instead of changing this to btrload for everyone, wouldn't it make more sense to use the generic "load" command? As your already setting "
CONFIG_CMD_FS_GENERIC"Quoted 3 lines
Well idea of adding that was to enable btrfs and to show its associated commands. Yes you can use generic 'load' command. Defaults was using fatload so i change it to btrload.
Quoted 6 lines
That's perfectly fine for showing the btrfs command's as an RFC patch, but if this was heading for mainline as-is, it would be nice to use the "load" command instead of moving from one partition format that's been default for a couple years to a new format with less users. (not that I don't like the btrfs format. ;) as i've been running it on a few omap boards for a couple years now..)
Exactly. The code needs to be built somewhere, to not be considered dead code. The next change here, to loadbootscript needs to be done in a forward-compatible way like 'load' so now it just works for everyone. Thanks!
- --
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQIcBAEBAgAGBQJRWw9wAAoJENk4IS6UOR1WwicP/iQiFRK3FAl6dqOTo+tfbeKX Aqbak7P+ULhKB4UtuYrAVP56GdGykTu8q/SdbQqXveFm2qGvsu1TIg1ZehJDOLxu AP8KMt9XssoaZerFIBCUlySBTeqDwbdaKM6zLsiey5RRvs5yy6Sgg3q/ssrxbmxE KYTiX4rVtQcTYdYZnlUkBZ7YBzT2rwUb9ZsWIvEPwv8NPvP8e2qNfsmgtOb2Z8nX 3EQ2Ssgf6VeAVdiQxmNrzcZM84vOyo9cfYNGSgURBQ76L6ZSchQ3ciqS0H/3Xkca 7dAVeQxFxK7U+hqDUZV0g69vwm0BZxsk58HelFXjdt5ZXKkDbK1UIIE/6XxCo+5g KQfrYhUQG7iF7pNRvTU+yn1YDijc7R4i4/6XbT8mgSvogOAyZajQzHnbkRcS7ssP RXV2V0HpdFuCBE0HNIjxnurEQPbT6O7Fb0/oRXWwWfHDJP2PBwsk0lWSyQoqog9B U2RmDG4iIBcqFAhzeREhxSQRwXLezujDwiTWklHjWeFMYavYa7mOdiuUpKucA7Y8 F4B1IJIUlP5X51A/7jA6PmboeYx6n0VzZNW3pjOK3smY+64cj9WVHCwQM5ypbsgv s+qCHDh7AYhbFCn0nPdUpuqMsDJVoVkeo3si0exs1Zh0+2jA7fAAYhjmFEhgK378 w/4Ajy/H8LSVlCd4duzl
=gDdz
-----END PGP SIGNATURE-----
PATCH v11 2/2 Enable btrfs support in mx53loco config
Quoted 42 lines · Tom Rini
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1Quoted 32 lines · Robert Nelson
Quoted 27 lines · Adnan Ali
Quoted 16 lines · Robert Nelson
Quoted 14 lines · Adnan Ali
Enable btrfs support in mx53loco config
Signed-off-by Adnan Ali <[email protected]> ---
include/configs/mx53loco.h| 4 +++- 1 file changed, 3
insertions(+), 1 deletion(-)(quoted diff) +0
-0
b/include/configs/mx53loco.hindex a4b610f..62e9a76 100644 ---a/include/configs/mx53loco.h+++b/include/configs/mx53loco.h@@ -56,6 +56,8 @@ #defineCONFIG_GENERIC_MMC#defineCONFIG_CMD_FAT#defineCONFIG_CMD_EXT2+#defineCONFIG_CMD_BTR+#defineCONFIG_CMD_FS_GENERIC#defineCONFIG_DOS_PARTITIONQuoted 10 lines
Quoted 7 lines
/* Eth Configs */ @@ -128,7 +130,7 @@ "mmcroot=/dev/mmcblk0p3 rw rootwait\0" \ "mmcargs=setenv bootargs console=ttymxc0,${baudrate} root=${mmcroot}\0" \
"loadbootscript=" \ - "fatload mmc
${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ + "btrload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \Instead of changing this to btrload for everyone, wouldn't it make more sense to use the generic "load" command? As your already setting "
CONFIG_CMD_FS_GENERIC"Quoted 3 lines
Well idea of adding that was to enable btrfs and to show its associated commands. Yes you can use generic 'load' command. Defaults was using fatload so i change it to btrload.
Quoted 6 lines
That's perfectly fine for showing the btrfs command's as an RFC patch, but if this was heading for mainline as-is, it would be nice to use the "load" command instead of moving from one partition format that's been default for a couple years to a new format with less users. (not that I don't like the btrfs format. ;) as i've been running it on a few omap boards for a couple years now..)
Quoted 4 lines
Exactly. The code needs to be built somewhere, to not be considered dead code. The next change here, to loadbootscript needs to be done in a forward-compatible way like 'load' so now it just works for everyone. Thanks!
I will need to send this as separate patch.
[snip]
Thanks
Adnan
PATCH v11 2/2 Enable btrfs support in mx53loco config
In reply to Tom RiniHi
Quoted 42 lines · Tom Rini
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1Quoted 32 lines · Robert Nelson
Quoted 27 lines · Adnan Ali
Quoted 16 lines · Robert Nelson
Quoted 14 lines · Adnan Ali
Enable btrfs support in mx53loco config
Signed-off-by Adnan Ali <[email protected]> ---
include/configs/mx53loco.h| 4 +++- 1 file changed, 3
insertions(+), 1 deletion(-)(quoted diff) +0
-0
b/include/configs/mx53loco.hindex a4b610f..62e9a76 100644 ---a/include/configs/mx53loco.h+++b/include/configs/mx53loco.h@@ -56,6 +56,8 @@ #defineCONFIG_GENERIC_MMC#defineCONFIG_CMD_FAT#defineCONFIG_CMD_EXT2+#defineCONFIG_CMD_BTR+#defineCONFIG_CMD_FS_GENERIC#defineCONFIG_DOS_PARTITIONQuoted 10 lines
Quoted 7 lines
/* Eth Configs */ @@ -128,7 +130,7 @@ "mmcroot=/dev/mmcblk0p3 rw rootwait\0" \ "mmcargs=setenv bootargs console=ttymxc0,${baudrate} root=${mmcroot}\0" \
"loadbootscript=" \ - "fatload mmc
${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ + "btrload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \Instead of changing this to btrload for everyone, wouldn't it make more sense to use the generic "load" command? As your already setting "
CONFIG_CMD_FS_GENERIC"Quoted 3 lines
Well idea of adding that was to enable btrfs and to show its associated commands. Yes you can use generic 'load' command. Defaults was using fatload so i change it to btrload.
Quoted 6 lines
That's perfectly fine for showing the btrfs command's as an RFC patch, but if this was heading for mainline as-is, it would be nice to use the "load" command instead of moving from one partition format that's been default for a couple years to a new format with less users. (not that I don't like the btrfs format. ;) as i've been running it on a few omap boards for a couple years now..)
Quoted 6 lines
Exactly. The code needs to be built somewhere, to not be considered dead code. The next change here, to loadbootscript needs to be done in a forward-compatible way like 'load' so now it just works for everyone. Thanks!
- --
Don't know whether you have read my previous mail or not.
What i meant was that you can review the patch v11 and i will send themx53loco_config with that change later.
Quoted 1 line
Thanks
Adnan Ali
PATCH v11 2/2 Enable btrfs support in mx53loco config
In reply to Adnan AliQuoted 39 lines · Adnan Ali
Quoted 23 lines · Robert Nelson
Quoted 20 lines · Adnan Ali
Enable btrfs support in mx53loco config
Signed-off-by Adnan Ali <[email protected]>--- include/configs/mx53loco.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)include/configs/mx53loco.h +2
-0@@ -56,6 +56,8 @@#define CONFIG_GENERIC_MMC #define CONFIG_CMD_FAT #define CONFIG_CMD_EXT2 +#define CONFIG_CMD_BTR +#define CONFIG_CMD_FS_GENERIC #define CONFIG_DOS_PARTITION Quoted 14 lines
include/configs/mx53loco.h line 136
Quoted 10 lines
include/configs/mx53loco.h +1
-1/* Eth Configs */ @@ -128,7 +130,7 @@"mmcroot=/dev/mmcblk0p3 rw rootwait\0" \"mmcargs=setenv bootargs console=ttymxc0,${baudrate} root=${mmcroot}\0" \"loadbootscript=" \ -"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ + "btrload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \Instead of changing this to btrload for everyone, wouldn't it make more sense to use the generic "load" command? As your already setting "
CONFIG_CMD_FS_GENERIC"
Quoted 5 lines
Well idea of adding that was to enable btrfs and to show its associated
commands.
Yes you can use generic 'load' command. Defaults was using fatload so i change
it to btrload.
If you use the generic load I would be OK in changing it.
--
Otavio Salvador O.S. Systems
E-mail: otavio at ossystems.com.br http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br
PATCH v11 2/2 Enable btrfs support in mx53loco config
Quoted 36 lines · Otavio Salvador
Quoted 35 lines · Adnan Ali
Quoted 34 lines · Robert Nelson
Quoted 21 lines · Adnan Ali
Enable btrfs support in mx53loco config
Signed-off-by Adnan Ali <[email protected]>--- include/configs/mx53loco.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)include/configs/mx53loco.h +2
-0@@ -56,6 +56,8 @@#define CONFIG_GENERIC_MMC #define CONFIG_CMD_FAT #define CONFIG_CMD_EXT2 +#define CONFIG_CMD_BTR +#define CONFIG_CMD_FS_GENERIC #define CONFIG_DOS_PARTITION /* Eth Configs */ include/configs/mx53loco.h line 136
Quoted 8 lines
include/configs/mx53loco.h +1
-1@@ -128,7 +130,7 @@"mmcroot=/dev/mmcblk0p3 rw rootwait\0" \"mmcargs=setenv bootargs console=ttymxc0,${baudrate} root=${mmcroot}\0" \"loadbootscript=" \ -"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ + "btrload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \Instead of changing this to btrload for everyone, wouldn't it make more sense to use the generic "load" command? As your already setting "
CONFIG_CMD_FS_GENERIC"
Quoted 6 lines
Quoted 5 lines
Well idea of adding that was to enable btrfs and to show its associated
commands.
Yes you can use generic 'load' command. Defaults was using fatload so i change
it to btrload.If you use the generic load I would be OK in changing it.
I will send this as separate patch. But I leave it until
btrfs patch get accepted. If you are happy with that. ;)
Quoted 5 lines
--
Otavio SalvadorO.S. Systems
E-mail: otavio at ossystems.com.br http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br
Otavio Salvador
NAKPATCH v11 2/2 Enable btrfs support in mx53loco config
In reply to Adnan AliQuoted 3 lines · Adnan Ali
Enable btrfs support in mx53loco config
Signed-off-by Adnan Ali <[email protected]>
NACK!
This break current uses.
--
Otavio Salvador O.S. Systems
E-mail: otavio at ossystems.com.br http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br
PATCH v11 1/2 Introduced btrfs file-system with btrload command
In reply to Adnan AliQuoted 6 lines · Adnan Ali
Introduces btrfs file-system to read file from volume/sub-volumes with btrload command. This implementation has read-only support.
This btrfs implementation is based on syslinux btrfs code, commit269ebc845ebc8b46ef4b0be7fa0005c7fdb95b8d.
Quoted 6 lines
v11: Mirro super block check.
v10: patch problem reworked. v5: merged with master. v4: btrls command added.Signed-off-by Adnan Ali <[email protected]>
With ELDK 5.3 toolchain, I see:btrfs.c: In function 'insert_map':
btrfs.c:144:4: warning: implicit declaration of function 'malloc' [-Wimplicit-function-declaration] btrfs.c: In function 'btrfs_read_super_block':
btrfs.c:281:5: warning: unused variable 'boots' [-Wunused-variable]
btrfs.c:279:6: warning: unused variable 'ret' [-Wunused-variable]btrfs.c: In function 'btrfs_read_chunk_tree':
btrfs.c:507:4: warning: format '%d' expects argument of type 'int', but argument 2 has type 'uint64_t' [-Wformat] btrfs.c:503:6: warning: unused variable 'status' [-Wunused-variable]btrfs.c: In function 'btrfs_iget_by_inr':
btrfs.c:563:24: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] btrfs.c:583:26: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] btrfs.c:591:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] btrfs.c: In function 'btrfs_iget':
btrfs.c:607:26: warning: initialization from incompatible pointer type [enabled by default] btrfs.c:621:22: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] btrfs.c: In function 'btrfs_readlink':
btrfs.c:628:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] btrfs.c:629:21: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] btrfs.c: In function 'btrfs_readdir':
btrfs.c:637:26: warning: initialization from incompatible pointer type [enabled by default] btrfs.c: In function 'btrfs_next_extent':
btrfs.c:682:26: warning: initialization from incompatible pointer type [enabled by default] btrfs.c:695:25: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] btrfs.c:720:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] btrfs.c: In function 'btrfs_getfssec':
btrfs.c:729:26: warning: initialization from incompatible pointer type [enabled by default] btrfs.c:730:12: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] btrfs.c:741:8: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] btrfs.c:729:21: warning: unused variable 'fs' [-Wunused-variable]btrfs.c: In function 'put_inode':
btrfs.c:844:4: warning: implicit declaration of function 'free' [-Wimplicit-function-declaration] btrfs.c: In function 'alloc_inode':
btrfs.c:854:24: warning: initialization makes pointer from integer without a cast [enabled by default] btrfs.c:857:13: warning: assignment from incompatible pointer type [enabled by default] btrfs.c: In function 'btrfs_open_file':
btrfs.c:952:2: warning: implicit declaration of function 'searchdir' [-Wimplicit-function-declaration] btrfs.c: In function 'searchdir':
btrfs.c:1029:14: warning: assignment makes pointer from integer without a cast [enabled by default] btrfs.c:1058:17: warning: pointer targets in assignment differ in signedness [-Wpointer-sign] btrfs.c: In function 'getfssec':
btrfs.c:1114:11: warning: unused variable 'handle' [-Wunused-variable]btrfs.c: In function 'generic_getfssec':
btrfs.c:1132:26: warning: initialization from incompatible pointer type [enabled by default] btrfs.c:1132:21: warning: unused variable 'fs' [-Wunused-variable]
fs.c:97:3: warning: initialization from incompatible pointer type [enabled by default] fs.c:97:3: warning: (near initialization for 'fstypes[2].ls') [enabled by default]
And with ELDK 4.2:btrfs.c: In function 'insert_map':
btrfs.c:144: warning: implicit declaration of function 'malloc'btrfs.c: In function 'btrfs_read_super_block':
btrfs.c:281: warning: unused variable 'boots'
btrfs.c:279: warning: unused variable 'ret'btrfs.c: In function 'btrfs_read_chunk_tree':
btrfs.c:507: warning: format '%d' expects type 'int', but argument 2 has type 'uint64_t' btrfs.c:503: warning: unused variable 'status'btrfs.c: In function 'btrfs_iget':
btrfs.c:607: warning: initialization from incompatible pointer type btrfs.c: In function 'btrfs_readdir':
btrfs.c:637: warning: initialization from incompatible pointer type btrfs.c: In function 'btrfs_next_extent':
btrfs.c:682: warning: initialization from incompatible pointer type btrfs.c: In function 'btrfs_getfssec':
btrfs.c:729: warning: initialization from incompatible pointer type btrfs.c:729: warning: unused variable 'fs'btrfs.c: In function 'put_inode':
btrfs.c:844: warning: implicit declaration of function 'free'btrfs.c: In function 'alloc_inode':
btrfs.c:854: warning: initialization makes pointer from integer without a cast btrfs.c:857: warning: assignment from incompatible pointer typebtrfs.c: In function 'btrfs_open_file':
btrfs.c:952: warning: implicit declaration of function 'searchdir' btrfs.c: In function 'searchdir':
btrfs.c:1029: warning: assignment makes pointer from integer without a cast btrfs.c:1058: warning: pointer targets in assignment differ in signedness btrfs.c: In function 'getfssec':
btrfs.c:1114: warning: unused variable 'handle'btrfs.c: In function 'generic_getfssec':
btrfs.c:1132: warning: initialization from incompatible pointer type btrfs.c:1132: warning: unused variable 'fs'
fs.c:97: warning: initialization from incompatible pointer type
Please fix. I can test ELDK 4.2 if you fix the ELDK 5.3 warnings (which also show up with other toolchains).
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130403/cb88c3e2/attachment.pgp>
PATCH v11 1/2 Introduced btrfs file-system with btrload command
Quoted 97 lines · Tom Rini
Quoted 6 lines · Adnan Ali
Introduces btrfs file-system to read file from volume/sub-volumes with btrload command. This implementation has read-only support.
This btrfs implementation is based on syslinux btrfs code, commit269ebc845ebc8b46ef4b0be7fa0005c7fdb95b8d.Quoted 6 lines
v11: Mirro super block check.
v10: patch problem reworked. v5: merged with master. v4: btrls command added.Signed-off-by Adnan Ali <[email protected]>With ELDK 5.3 toolchain, I see:
btrfs.c: In function 'insert_map':
btrfs.c:144:4: warning: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]btrfs.c: In function 'btrfs_read_super_block':
btrfs.c:281:5: warning: unused variable 'boots' [-Wunused-variable]
btrfs.c:279:6: warning: unused variable 'ret' [-Wunused-variable]btrfs.c: In function 'btrfs_read_chunk_tree':
btrfs.c:507:4: warning: format '%d' expects argument of type 'int', but argument 2 has type 'uint64_t' [-Wformat] btrfs.c:503:6: warning: unused variable 'status' [-Wunused-variable]btrfs.c: In function 'btrfs_iget_by_inr':
btrfs.c:563:24: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] btrfs.c:583:26: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] btrfs.c:591:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]btrfs.c: In function 'btrfs_iget':
btrfs.c:607:26: warning: initialization from incompatible pointer type [enabled by default] btrfs.c:621:22: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]btrfs.c: In function 'btrfs_readlink':
btrfs.c:628:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] btrfs.c:629:21: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]btrfs.c: In function 'btrfs_readdir':
btrfs.c:637:26: warning: initialization from incompatible pointer type [enabled by default]btrfs.c: In function 'btrfs_next_extent':
btrfs.c:682:26: warning: initialization from incompatible pointer type [enabled by default] btrfs.c:695:25: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] btrfs.c:720:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]btrfs.c: In function 'btrfs_getfssec':
btrfs.c:729:26: warning: initialization from incompatible pointer type [enabled by default] btrfs.c:730:12: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] btrfs.c:741:8: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] btrfs.c:729:21: warning: unused variable 'fs' [-Wunused-variable]btrfs.c: In function 'put_inode':
btrfs.c:844:4: warning: implicit declaration of function 'free' [-Wimplicit-function-declaration]btrfs.c: In function 'alloc_inode':
btrfs.c:854:24: warning: initialization makes pointer from integer without a cast [enabled by default] btrfs.c:857:13: warning: assignment from incompatible pointer type [enabled by default]btrfs.c: In function 'btrfs_open_file':
btrfs.c:952:2: warning: implicit declaration of function 'searchdir' [-Wimplicit-function-declaration]btrfs.c: In function 'searchdir':
btrfs.c:1029:14: warning: assignment makes pointer from integer without a cast [enabled by default] btrfs.c:1058:17: warning: pointer targets in assignment differ in signedness [-Wpointer-sign]btrfs.c: In function 'getfssec':
btrfs.c:1114:11: warning: unused variable 'handle' [-Wunused-variable]btrfs.c: In function 'generic_getfssec':
btrfs.c:1132:26: warning: initialization from incompatible pointer type [enabled by default] btrfs.c:1132:21: warning: unused variable 'fs' [-Wunused-variable]
fs.c:97:3: warning: initialization from incompatible pointer type [enabled by default] fs.c:97:3: warning: (near initialization for 'fstypes[2].ls') [enabled by default]And with ELDK 4.2:
btrfs.c: In function 'insert_map':
btrfs.c:144: warning: implicit declaration of function 'malloc'btrfs.c: In function 'btrfs_read_super_block':
btrfs.c:281: warning: unused variable 'boots'
btrfs.c:279: warning: unused variable 'ret'btrfs.c: In function 'btrfs_read_chunk_tree':
btrfs.c:507: warning: format '%d' expects type 'int', but argument 2 has type 'uint64_t' btrfs.c:503: warning: unused variable 'status'btrfs.c: In function 'btrfs_iget':
btrfs.c:607: warning: initialization from incompatible pointer typebtrfs.c: In function 'btrfs_readdir':
btrfs.c:637: warning: initialization from incompatible pointer typebtrfs.c: In function 'btrfs_next_extent':
btrfs.c:682: warning: initialization from incompatible pointer typebtrfs.c: In function 'btrfs_getfssec':
btrfs.c:729: warning: initialization from incompatible pointer type btrfs.c:729: warning: unused variable 'fs'btrfs.c: In function 'put_inode':
btrfs.c:844: warning: implicit declaration of function 'free'btrfs.c: In function 'alloc_inode':
btrfs.c:854: warning: initialization makes pointer from integer without a cast btrfs.c:857: warning: assignment from incompatible pointer typebtrfs.c: In function 'btrfs_open_file':
btrfs.c:952: warning: implicit declaration of function 'searchdir'btrfs.c: In function 'searchdir':
btrfs.c:1029: warning: assignment makes pointer from integer without a cast btrfs.c:1058: warning: pointer targets in assignment differ in signednessbtrfs.c: In function 'getfssec':
btrfs.c:1114: warning: unused variable 'handle'btrfs.c: In function 'generic_getfssec':
btrfs.c:1132: warning: initialization from incompatible pointer type btrfs.c:1132: warning: unused variable 'fs'
fs.c:97: warning: initialization from incompatible pointer type
Quoted 3 lines
Please fix. I can test ELDK 4.2 if you fix the ELDK 5.3 warnings (which also show up with other toolchains).
But initially you said you will do it. But ok
Thanks
Adnan Ali
PATCH v11 1/2 Introduced btrfs file-system with btrload command
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 105 lines · Adnan Ali
Quoted 104 lines · Tom Rini
Quoted 11 lines · Adnan Ali
Introduces btrfs file-system to read file from volume/sub-volumes with btrload command. This implementation has read-only support. This btrfs implementation is based on syslinux btrfs code, commit
269ebc845ebc8b46ef4b0be7fa0005c7fdb95b8d.v11: Mirro super block check. v10: patch problem reworked. v5: merged with master. v4: btrls commandadded.
Signed-off-by Adnan Ali <[email protected]>With ELDK 5.3 toolchain, I see:
btrfs.c: In function 'insert_map': btrfs.c:144:4: warning: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]btrfs.c: In function 'btrfs_read_super_block': btrfs.c:281:5: warning: unused variable 'boots' [-Wunused-variable] btrfs.c:279:6: warning:
unused variable 'ret' [-Wunused-variable]btrfs.c: In function 'btrfs_read_chunk_tree': btrfs.c:507:4: warning: format '%d' expects argument of type 'int', but argument 2 has type 'uint64_t' [-Wformat] btrfs.c:503:6: warning: unused variable 'status' [-Wunused-variable]btrfs.c: In function 'btrfs_iget_by_inr': btrfs.c:563:24: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] btrfs.c:583:26: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] btrfs.c:591:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]btrfs.c: In function 'btrfs_iget':
btrfs.c:607:26: warning: initialization from incompatible pointer type [enabled by default] btrfs.c:621:22: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]btrfs.c: In function 'btrfs_readlink':
btrfs.c:628:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] btrfs.c:629:21:
warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]btrfs.c: In function 'btrfs_readdir': btrfs.c:637:26: warning: initialization from incompatible pointer type [enabled by default]btrfs.c: In function 'btrfs_next_extent': btrfs.c:682:26: warning:
initialization from incompatible pointer type [enabled by default] btrfs.c:695:25: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] btrfs.c:720:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]btrfs.c: In function 'btrfs_getfssec': btrfs.c:729:26: warning:
initialization from incompatible pointer type [enabled by default] btrfs.c:730:12: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] btrfs.c:741:8: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] btrfs.c:729:21:
warning: unused variable 'fs' [-Wunused-variable]btrfs.c: In function 'put_inode': btrfs.c:844:4: warning: implicit declaration of function 'free' [-Wimplicit-function-declaration]btrfs.c: In function 'alloc_inode': btrfs.c:854:24: warning:
initialization makes pointer from integer without a cast [enabled by default] btrfs.c:857:13: warning: assignment from incompatible pointer type [enabled by default]btrfs.c: In function 'btrfs_open_file': btrfs.c:952:2: warning: implicit declaration of function 'searchdir' [-Wimplicit-function-declaration]btrfs.c: In function 'searchdir': btrfs.c:1029:14: warning:
assignment makes pointer from integer without a cast [enabled by default] btrfs.c:1058:17: warning: pointer targets in assignment differ in signedness [-Wpointer-sign]btrfs.c: In function 'getfssec': btrfs.c:1114:11: warning: unused variable 'handle' [-Wunused-variable]btrfs.c: In function 'generic_getfssec':
btrfs.c:1132:26: warning: initialization from incompatible pointer type [enabled by default] btrfs.c:1132:21: warning:
unused variable 'fs' [-Wunused-variable] fs.c:97:3: warning:
initialization from incompatible pointer type [enabled by default] fs.c:97:3: warning: (near initialization for 'fstypes[2].ls') [enabled by default]And with ELDK 4.2:
btrfs.c: In function 'insert_map':
btrfs.c:144: warning: implicit declaration of function 'malloc'btrfs.c: In function 'btrfs_read_super_block': btrfs.c:281:
warning: unused variable 'boots' btrfs.c:279: warning: unused variable 'ret'btrfs.c: In function 'btrfs_read_chunk_tree':
btrfs.c:507: warning: format '%d' expects type 'int', but argument 2 has type 'uint64_t' btrfs.c:503: warning: unused variable 'status'btrfs.c: In function 'btrfs_iget': btrfs.c:607:
warning: initialization from incompatible pointer typebtrfs.c:
In function 'btrfs_readdir': btrfs.c:637: warning: initialization from incompatible pointer typebtrfs.c: In function 'btrfs_next_extent': btrfs.c:682: warning: initialization from incompatible pointer typebtrfs.c: In function 'btrfs_getfssec':
btrfs.c:729: warning: initialization from incompatible pointer type btrfs.c:729: warning: unused variable 'fs'btrfs.c: In function 'put_inode': btrfs.c:844: warning: implicit declaration of function 'free'btrfs.c: In function 'alloc_inode':
btrfs.c:854: warning: initialization makes pointer from integer without a cast btrfs.c:857: warning: assignment from incompatible pointer typebtrfs.c: In function 'btrfs_open_file': btrfs.c:952:
warning: implicit declaration of function 'searchdir'btrfs.c: In function 'searchdir': btrfs.c:1029: warning: assignment makes pointer from integer without a cast btrfs.c:1058: warning:
pointer targets in assignment differ in signednessbtrfs.c: In function 'getfssec': btrfs.c:1114: warning: unused variable 'handle'btrfs.c: In function 'generic_getfssec': btrfs.c:1132:
warning: initialization from incompatible pointer type btrfs.c:1132: warning: unused variable 'fs' fs.c:97: warning:
initialization from incompatible pointer type
Quoted 4 lines
Quoted 3 lines
Please fix. I can test ELDK 4.2 if you fix the ELDK 5.3 warnings (which also show up with other toolchains).
But initially you said you will do it. But ok
Sorry I was unclear. I said I would take care of the fact that you're duplicating syslinux's generic inode structure as well inside of the btrfs code as U-Boot is bad in this regard and doesn't have a generic inode struct that filesystems can work from (and all filesystems do something like this), as a later cleanup.
- --
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQIcBAEBAgAGBQJRXG8TAAoJENk4IS6UOR1WD7cQAJK4fnp89OzOxXg1GRdSvOUd cl2wxnsedhPD1O7lEcgdf+/6l1ikbx1Y5gFpMUiPeGNv+cYyKE7pj1wHc+88SqAQ +1IuMAncIQcwp7X9H4LbKSFDpoXr4X6P5v96QS62qcRhZgzD/Jg+h3A7sQqPQTct K+kKRo66xO1vmymY4qC8BxyRJW4lZVfc7J3NvMv1nSl6C191S5IfhfID45Oi3HOn 0Ybf9IgzVsH5TUUL/8ZOFzELtrCwYZ+R4UHoyvQruXV6htQ91qoxY9KXYtJV/6Zk AxPHFGm2hHQU8KrpDnMcSqdt+xh4MVU6DWNCbSTBpE9h4CKmgQdf+beE9/10Yzs/ 5pqfqvNfsIUJ6HHh+U7+vQ+1BlUNIiLcxISTDa4uRoavSSDjUZy9vXLCkV5Y071h KCkNmpww2/NJ+5ZrL8Ws2LGEw4y2Ll8Xygh6Ps/fouSO2b/FuDcIHo3zJr43yBvD 7rtf9zIJkM/4RvECnppthXMhotk+5CcSti3UIzNMRvu1MjOn5t/o/YEf7YeVFtQh Iz2cvBglbLZxe2J3QSHAnhM+ds0QT3HqFWWSAXj610SNyKccGL4luTHNPIgWE4er aX8NqyZMqbE87INy2TsWxSPuF9rRhbSESULiyW1CdxpZF/IR2Zybu1puuuPR9qTy 6Qh7KDXcUwML+Ou2pDv5
=4GJz
-----END PGP SIGNATURE-----