busybox e2fsprogs on powerpc

Rob Landley rob at landley.net
Mon Jan 23 19:58:24 UTC 2006


On Monday 23 January 2006 11:37, Ken McGuire wrote:
> On 23 Jan 2006 at 9:56, Ken McGuire wrote:
> > On 23 Jan 2006 at 10:03, Rob Landley wrote:
> >
> > I'll give it a look, no guarantees, the patches may be ugly(tm).
> >
> > (<ken>Cross compiling is easy with buildroot!</ken>)
>
> Well Rob, here is a patch, about as ugly as yours, but it now builds a
> filesystem that is not byte-swapped. Seems to work, and both bb's fsck and
> e2fsprogs-1.38 fsck likes it too.
>
>    ...ken...

Hmmm, so this fixes it?  (Fiddle fiddle...)

Ok, swapfs.c is surrounded by an #ifdef so adding that to the makefile should 
be a NOP when it's not used, but native.c is kinda pointless 
(ext2fs_native_flag() should really be a macro or inline or some such in the 
headers)..  I'll fix that.

Our CONFIG_ infrastructure is migrating to ENABLE_, and I'm pretty sure that 
when I added that the e2fs code that used ENABLE_SWAPFS hadn't gone in yet.  
(Not that we're likely to have a CONFIG_SWAPFS, but still.)  Possibly I 
should rename ENABLE_SWAPFS to something else...

> diff -urN ../e2fsprogs.orig/e2fsbb.h e2fsprogs/e2fsbb.h
> --- ../e2fsprogs.orig/e2fsbb.h 2006-01-10 22:44:12.000000000 -0700
> +++ e2fsprogs/e2fsbb.h 2006-01-23 10:12:36.000000000 -0700
> @@ -53,5 +53,9 @@
>  #define HAVE_SYS_TIME_H 1
>  #define HAVE_SYS_TYPES_H 1
>  #define HAVE_UNISTD_H 1
> +#if __BYTE_ORDER== __BIG_ENDIAN
> +#define ENABLE_SWAPFS 1
> +#define WORDS_BIGENDIAN 1
> +#endif
>
>  #endif /* __E2FSBB_H__ */
> diff -urN ../e2fsprogs.orig/ext2fs/ext2fs.h e2fsprogs/ext2fs/ext2fs.h
> --- ../e2fsprogs.orig/ext2fs/ext2fs.h 2006-01-10 22:44:12.000000000 -0700
> +++ e2fsprogs/ext2fs/ext2fs.h 2006-01-23 08:03:21.000000000 -0700
> @@ -34,7 +34,8 @@
>   * has been configured or if we're being built on a CPU architecture
>   * with a non-native byte order.
>   */
> -#if defined(ENABLE_SWAPFS) || defined(WORDS_BIGENDIAN)
> +//#if defined(ENABLE_SWAPFS) || defined(WORDS_BIGENDIAN)
> +#if defined(ENABLE_SWAPFS) || defined(WORDS_BIGENDIAN)|| __BYTE_ORDER==
> __BIG_ENDIAN #define EXT2FS_ENABLE_SWAPFS
>  #endif

Just confirming: you define WORDS_BIGENDIAN above, but need the separate 
__BYTE_ORDER check later?

Rob
-- 
Steve Ballmer: Innovation!  Inigo Montoya: You keep using that word.
I do not think it means what you think it means.



More information about the busybox mailing list