[BusyBox] errors compiling mke2fs.c in Busybox 0.60.3

Vladimir N. Oleynik dzo at simtreas.ru
Wed Jun 26 02:18:03 UTC 2002


Doug,

> I'm trying to compile mke2fs.c into BusyBox 0.60.3 with uClibc
> (snapshot dated June 6) on ppc running the 2.4.12 kernel. When I run
> "make" I get a whole bunch of errors.  If I take the applet out, it
> compiles fine.  There are too many errors to list them all (about 5
> pages of printout), but here's the first few:
> 
> Has anyone has anyone had success using this applet?  I found it at:
> 
> ftp://ftp.simtreas.ru/pub/my/bb/spec/mke2fs.c.gz
> 
> If anyone has an idea why I'm getting these errors, I'd be grateful.

I do not recommend to use this /spec/ directory as final integration with
busybox. Only for demonstrate and VERY ADVANCED users.
Full integrated applets placed into /ports/ directory only.


Brendan,

> I'm currently using busybox-0.60.2.  I think I'm about to upgrade to 
> 0.60.3 but I would really like some basic ext2 support (mainly fsck and 
> mkfs).  Does 0.60.3 support ext2 ?  What about snapshots or CVS ?

Not.

The simple way of integration consists of the following points:

HOWTO:

1) Get e2fsprogs-last-version source.
2) Configure and compile.
3) Find functions main() in e2fsprogs sources and replace to applet_main
(example: mke2fs_main for mke2fs applet)
4) Run make again. This exited with error:

$ make
cc  -o mke2fs mke2fs.o ../lib/libext2fs.a ../lib/libcom_err.a ../lib/libuuid.a
/usr/lib/crt1.o(.text+0x18): undefined reference to `main'
make: *** [mke2fs] Error 1          

5) Writing in promt

$ ldd -r

and copy and paste all arguments for cc without "cc". Result:

$ ldd -r -o mke2fs mke2fs.o ../lib/libext2fs.a ../lib/libcom_err.a
../lib/libuuid.a

6) Move mke2fs to busybox soutrce tree with name mke2fs_.o

$ mv mke2fs ../../busybox-0.60.3/mke2fs_.o

7) (For VERY ADVANCED users): do:

$ objcopy --strip-unneeded -K mke2fs_main mke2fs_.o

8) Place into busybox source tree "empty" mke2fs.c file:

~/busybox-0.60.3$ cat > mke2fs.c

/*
 * mke2fs.c - Make a ext2fs filesystem.
 * Precompiled as binary module mke2fs_.o
 *
*/
<Ctrl>-D
~/busybox-0.60.3$

9) Open in editor Config.h file and find line: // End of Applications List
10) Add before up line:
#define BB_MKE2FS

11) Open applets.h and find place with alphabetical metod for insert 
applet declaration. For mke2fs example add 3 lines after

#ifdef BB_MKDIR
        APPLET(mkdir, mkdir_main, _BB_DIR_BIN)
#endif

#ifdef BB_MKE2FS
        APPLET_NOUSAGE(mke2fs, mke2fs_main, _BB_DIR_SBIN)
#endif

12) Open in editor Makefile and find
#LIBRARIES = 

Change to

LIBRARIES = mke2fs_.o

13) make busybox.


End. Uhh.


--w
vodz



More information about the busybox mailing list