[U-Boot] [PATCH V3 1/2] ext4fs ls load support

Wolfgang Denk wd at denx.de
Thu Jan 5 16:32:01 CET 2012


Dear uma.shankar at samsung.com,

In message <1325038933-10587-1-git-send-email-uma.shankar at samsung.com> you wrote:
> From: Uma Shankar <uma.shankar at samsung.com>
> 
> Signed-off-by: Uma Shankar <uma.shankar at samsung.com>
> Signed-off-by: Manjunatha C Achar <a.manjunatha at samsung.com>
> Signed-off-by: Iqbal Shareef <iqbal.ams at samsung.com>
> Signed-off-by: Hakgoo Lee <goodguy.lee at samsung.com>
> ---
> Changes for v2:
> 	- Code cleanup, changed comment style
> 	- camel case removed, resolved code alignment issues
> 	- memory allocation logic changed, removed busybox logic
> 	- Modified ext4 load to remove grub dependency (GPLv3)
> 
> Changes for v1:
> 	- Removed checkpatch warnings and errors
> 	- Moved common API's of ext2 and ext4 to one generic header file
> 
>  Makefile              |    2 +-
>  common/Makefile       |    1 +
>  common/cmd_ext2.c     |    1 +
>  common/cmd_ext4.c     |  249 ++++++++++++++++++++++
>  fs/Makefile           |    1 +
>  fs/ext2/dev.c         |    1 +
>  fs/ext2/ext2fs.c      |  340 +++---------------------------
>  fs/ext4/Makefile      |   51 +++++
>  fs/ext4/ext4_common.c |  565 +++++++++++++++++++++++++++++++++++++++++++++++++
>  fs/ext4/ext4_common.h |   48 +++++
>  fs/ext4/ext4fs.c      |  219 +++++++++++++++++++
>  include/ext2fs.h      |   16 +-
>  include/ext4fs.h      |  133 ++++++++++++
>  include/ext_common.h  |  198 +++++++++++++++++
>  14 files changed, 1501 insertions(+), 324 deletions(-)
>  create mode 100644 common/cmd_ext4.c
>  create mode 100644 fs/ext4/Makefile
>  create mode 100644 fs/ext4/ext4_common.c
>  create mode 100644 fs/ext4/ext4_common.h
>  create mode 100644 fs/ext4/ext4fs.c
>  create mode 100644 include/ext4fs.h
>  create mode 100644 include/ext_common.h

Oops.  No, I cannot apply this.  When I enable  CONFIG_CMD_EXT4  in a
board config file, I get this:

+ ./MAKEALL TQM860L
Configuring for TQM860L board...
common/libcommon.o: In function `do_ext4_load':
/home/wd/git/u-boot/work/common/cmd_ext4.c:143: undefined reference to `ext2fs_set_blk_dev'
common/libcommon.o: In function `do_ext4_ls':
/home/wd/git/u-boot/work/common/cmd_ext4.c:220: undefined reference to `ext2fs_set_blk_dev'
fs/ext4/libext4fs.o: In function `ext4fs_read_file':
/home/wd/git/u-boot/work/fs/ext4/ext4fs.c:152: undefined reference to `ext2fs_devread'
/home/wd/git/u-boot/work/fs/ext4/ext4fs.c:178: undefined reference to `ext2fs_devread'
/home/wd/git/u-boot/work/fs/ext4/ext4fs.c:192: undefined reference to `ext2fs_devread'
fs/ext4/libext4fs.o: In function `ext4fs_ls':
/home/wd/git/u-boot/work/fs/ext4/ext4fs.c:211: undefined reference to `ext2fs_find_file'
/home/wd/git/u-boot/work/fs/ext4/ext4fs.c:218: undefined reference to `ext2fs_iterate_dir'
fs/ext4/libext4fs.o: In function `ext4fs_blockgroup':
/home/wd/git/u-boot/work/fs/ext4/ext4_common.c:1479: undefined reference to `ext2fs_devread'
fs/ext4/libext4fs.o: In function `ext4fs_read_inode':
/home/wd/git/u-boot/work/fs/ext4/ext4_common.c:1506: undefined reference to `ext2fs_devread'
fs/ext4/libext4fs.o: In function `ext4fs_get_extent_block':
/home/wd/git/u-boot/work/fs/ext4/ext4_common.c:1457: undefined reference to `ext2fs_devread'
fs/ext4/libext4fs.o: In function `read_allocated_block':
/home/wd/git/u-boot/work/fs/ext4/ext4_common.c:1601: undefined reference to `ext2fs_devread'
/home/wd/git/u-boot/work/fs/ext4/ext4_common.c:1648: undefined reference to `ext2fs_devread'
fs/ext4/libext4fs.o:/home/wd/git/u-boot/work/fs/ext4/ext4_common.c:1686: more undefined references to `ext2fs_devread' follow
fs/ext4/libext4fs.o: In function `ext4fs_open':
/home/wd/git/u-boot/work/fs/ext4/ext4_common.c:1876: undefined reference to `ext2fs_find_file'
fs/ext4/libext4fs.o: In function `ext4fs_mount':
/home/wd/git/u-boot/work/fs/ext4/ext4_common.c:1907: undefined reference to `ext2fs_devread'
/home/wd/git/u-boot/work/fs/ext4/ext4_common.c:1934: undefined reference to `inode_size'
/home/wd/git/u-boot/work/fs/ext4/ext4_common.c:1936: undefined reference to `ext2fs_root'
make: *** [/work/wd/tmp-ppc/u-boot] Error 1


It seems this happens when you only enable CONFIG_CMD_EXT4, without
explicitly enabling CONFIG_CMD_EXT2 as well.  Please fix this - if the
ext4 code needs ext2, then it should automatically enable this option.

Hm... How much code duplication (for ext2 and ext4 commands) does this
cause?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The trouble with our times is that the future is not what it used  to
be.                                                     - Paul Valery


More information about the U-Boot mailing list