I needed mke2fs and friends, so had to use old_e2fsprogs instead of e2fsprogs.

I managed to get this old_e2fsprogs directory to compile again, in
Busybox 1.8.2.

Here's how, if anybody else is interested.

1) Replace e2fsprogs directory with e2fsprogs/old_e2fsprogs directory:

mv e2fsprogs/old_e2fsprogs .
rm -rf e2fsprogs
mv old_e2fsprogs e2fsprogs

2) Apply this patch (attached):

patch -p1 < old-e2fsprogs.patch

3) It should work now:

make menuconfig
Go enable all of the "new" options in e2fsprogs
make

There's still plenty of warnings, but at least no errors.

Wow, it's bloated, no doubt about that.  I can see why it was deprecated.
On my setup, the size increase is 180480 bytes (217715 bytes unstripped)!

To gain the ability to repair and reformat filesystems on the fly,
that's acceptable for me, though.

If there's a better/cleaner way to do this, please let me know....

Josh
diff -urN busybox-1.8.2-old/e2fsprogs/e2fsck.c busybox-1.8.2-new/e2fsprogs/e2fsck.c
--- busybox-1.8.2-old/e2fsprogs/e2fsck.c	2007-11-09 17:40:52.000000000 -0800
+++ busybox-1.8.2-new/e2fsprogs/e2fsck.c	2008-01-10 21:49:53.000000000 -0800
@@ -45,7 +45,7 @@
 static void e2fsck_pass1_dupblocks(e2fsck_t ctx, char *block_buf);
 
 /* pass1.c */
-static void e2fsck_use_inode_shortcuts(e2fsck_t ctx, int bool);
+static void e2fsck_use_inode_shortcuts(e2fsck_t ctx, int mybool);
 
 /* pass2.c */
 static int e2fsck_process_bad_inode(e2fsck_t ctx, ext2_ino_t dir,
@@ -4560,11 +4560,11 @@
 	return 0;
 }
 
-void e2fsck_use_inode_shortcuts(e2fsck_t ctx, int bool)
+void e2fsck_use_inode_shortcuts(e2fsck_t ctx, int mybool)
 {
 	ext2_filsys fs = ctx->fs;
 
-	if (bool) {
+	if (mybool) {
 		fs->get_blocks = pass1_get_blocks;
 		fs->check_directory = pass1_check_directory;
 		fs->read_inode = pass1_read_inode;
@@ -13202,7 +13202,7 @@
 static const char my_ver_string[] = E2FSPROGS_VERSION;
 static const char my_ver_date[] = E2FSPROGS_DATE;
 
-int e2fsck_main (int argc, char **argv);
+int e2fsck_main (int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
 int e2fsck_main (int argc, char **argv)
 {
 	errcode_t       retval;
diff -urN busybox-1.8.2-old/e2fsprogs/ext2fs/ismounted.c busybox-1.8.2-new/e2fsprogs/ext2fs/ismounted.c
--- busybox-1.8.2-old/e2fsprogs/ext2fs/ismounted.c	2007-11-09 17:40:52.000000000 -0800
+++ busybox-1.8.2-new/e2fsprogs/ext2fs/ismounted.c	2008-01-10 21:49:53.000000000 -0800
@@ -148,7 +148,7 @@
 is_root:
 #define TEST_FILE "/.ismount-test-file"
 		*mount_flags |= EXT2_MF_ISROOT;
-		fd = open(TEST_FILE, O_RDWR|O_CREAT);
+		fd = open(TEST_FILE, O_RDWR|O_CREAT, 0777);
 		if (fd < 0) {
 			if (errno == EROFS)
 				*mount_flags |= EXT2_MF_READONLY;
diff -urN busybox-1.8.2-old/e2fsprogs/mke2fs.c busybox-1.8.2-new/e2fsprogs/mke2fs.c
--- busybox-1.8.2-old/e2fsprogs/mke2fs.c	2007-11-09 17:40:52.000000000 -0800
+++ busybox-1.8.2-new/e2fsprogs/mke2fs.c	2008-01-10 21:49:53.000000000 -0800
@@ -1175,7 +1175,7 @@
 	if (ENABLE_FEATURE_CLEAN_UP && journal_device) free(journal_device);
 }
 
-int mke2fs_main (int argc, char **argv);
+int mke2fs_main (int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
 int mke2fs_main (int argc, char **argv)
 {
 	errcode_t	retval;
diff -urN busybox-1.8.2-old/include/applets.h busybox-1.8.2-new/include/applets.h
--- busybox-1.8.2-old/include/applets.h	2007-11-09 17:40:53.000000000 -0800
+++ busybox-1.8.2-new/include/applets.h	2008-01-10 21:49:53.000000000 -0800
@@ -132,8 +132,8 @@
 USE_DU(APPLET(du, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
 USE_DUMPKMAP(APPLET(dumpkmap, _BB_DIR_BIN, _BB_SUID_NEVER))
 USE_APP_DUMPLEASES(APPLET(dumpleases, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
-//USE_E2FSCK(APPLET(e2fsck, _BB_DIR_SBIN, _BB_SUID_NEVER))
-//USE_E2LABEL(APPLET_NOUSAGE(e2label, tune2fs, _BB_DIR_SBIN, _BB_SUID_NEVER))
+USE_E2FSCK(APPLET(e2fsck, _BB_DIR_SBIN, _BB_SUID_NEVER))
+USE_E2LABEL(APPLET_NOUSAGE(e2label, tune2fs, _BB_DIR_SBIN, _BB_SUID_NEVER))
 USE_ECHO(APPLET_NOFORK(echo, echo, _BB_DIR_BIN, _BB_SUID_NEVER, echo))
 USE_ED(APPLET(ed, _BB_DIR_BIN, _BB_SUID_NEVER))
 USE_FEATURE_GREP_EGREP_ALIAS(APPLET_NOUSAGE(egrep, grep, _BB_DIR_BIN, _BB_SUID_NEVER))
@@ -152,13 +152,13 @@
 USE_FDISK(APPLET(fdisk, _BB_DIR_SBIN, _BB_SUID_NEVER))
 USE_FEATURE_GREP_FGREP_ALIAS(APPLET_NOUSAGE(fgrep, grep, _BB_DIR_BIN, _BB_SUID_NEVER))
 USE_FIND(APPLET_NOEXEC(find, find, _BB_DIR_USR_BIN, _BB_SUID_NEVER, find))
-//USE_FINDFS(APPLET_NOUSAGE(findfs, tune2fs, _BB_DIR_SBIN, _BB_SUID_NEVER))
+USE_FINDFS(APPLET_NOUSAGE(findfs, tune2fs, _BB_DIR_SBIN, _BB_SUID_NEVER))
 USE_FOLD(APPLET(fold, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
 USE_FREE(APPLET(free, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
 USE_FREERAMDISK(APPLET(freeramdisk, _BB_DIR_SBIN, _BB_SUID_NEVER))
 USE_FSCK(APPLET(fsck, _BB_DIR_SBIN, _BB_SUID_NEVER))
-//USE_E2FSCK(APPLET_NOUSAGE(fsck.ext2, e2fsck, _BB_DIR_SBIN, _BB_SUID_NEVER))
-//USE_E2FSCK(APPLET_NOUSAGE(fsck.ext3, e2fsck, _BB_DIR_SBIN, _BB_SUID_NEVER))
+USE_E2FSCK(APPLET_NOUSAGE(fsck.ext2, e2fsck, _BB_DIR_SBIN, _BB_SUID_NEVER))
+USE_E2FSCK(APPLET_NOUSAGE(fsck.ext3, e2fsck, _BB_DIR_SBIN, _BB_SUID_NEVER))
 USE_FSCK_MINIX(APPLET_ODDNAME(fsck.minix, fsck_minix, _BB_DIR_SBIN, _BB_SUID_NEVER, fsck_minix))
 USE_FTPGET(APPLET_ODDNAME(ftpget, ftpgetput, _BB_DIR_USR_BIN, _BB_SUID_NEVER, ftpget))
 USE_FTPPUT(APPLET_ODDNAME(ftpput, ftpgetput, _BB_DIR_USR_BIN, _BB_SUID_NEVER, ftpput))
@@ -234,10 +234,10 @@
 USE_MESG(APPLET(mesg, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
 USE_MICROCOM(APPLET(microcom, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
 USE_MKDIR(APPLET_NOFORK(mkdir, mkdir, _BB_DIR_BIN, _BB_SUID_NEVER, mkdir))
-//USE_MKE2FS(APPLET(mke2fs, _BB_DIR_SBIN, _BB_SUID_NEVER))
+USE_MKE2FS(APPLET(mke2fs, _BB_DIR_SBIN, _BB_SUID_NEVER))
 USE_MKFIFO(APPLET(mkfifo, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
-//USE_MKE2FS(APPLET_NOUSAGE(mkfs.ext2, mke2fs, _BB_DIR_SBIN, _BB_SUID_NEVER))
-//USE_MKE2FS(APPLET_NOUSAGE(mkfs.ext3, mke2fs, _BB_DIR_SBIN, _BB_SUID_NEVER))
+USE_MKE2FS(APPLET_NOUSAGE(mkfs.ext2, mke2fs, _BB_DIR_SBIN, _BB_SUID_NEVER))
+USE_MKE2FS(APPLET_NOUSAGE(mkfs.ext3, mke2fs, _BB_DIR_SBIN, _BB_SUID_NEVER))
 USE_MKFS_MINIX(APPLET_ODDNAME(mkfs.minix, mkfs_minix, _BB_DIR_SBIN, _BB_SUID_NEVER, mkfs_minix))
 USE_MKNOD(APPLET(mknod, _BB_DIR_BIN, _BB_SUID_NEVER))
 USE_MKSWAP(APPLET(mkswap, _BB_DIR_SBIN, _BB_SUID_NEVER))
@@ -352,7 +352,7 @@
 USE_TRUE(APPLET_NOFORK(true, true, _BB_DIR_BIN, _BB_SUID_NEVER, true))
 USE_TTY(APPLET(tty, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
 USE_TTYSIZE(APPLET(ttysize, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
-//USE_TUNE2FS(APPLET(tune2fs, _BB_DIR_SBIN, _BB_SUID_NEVER))
+USE_TUNE2FS(APPLET(tune2fs, _BB_DIR_SBIN, _BB_SUID_NEVER))
 USE_APP_UDHCPC(APPLET(udhcpc, _BB_DIR_SBIN, _BB_SUID_NEVER))
 USE_APP_UDHCPD(APPLET(udhcpd, _BB_DIR_USR_SBIN, _BB_SUID_NEVER))
 USE_UDPSVD(APPLET_ODDNAME(udpsvd, tcpudpsvd, _BB_DIR_USR_BIN, _BB_SUID_NEVER, udpsvd))
diff -urN busybox-1.8.2-old/Makefile busybox-1.8.2-new/Makefile
--- busybox-1.8.2-old/Makefile	2007-11-23 20:31:36.000000000 -0800
+++ busybox-1.8.2-new/Makefile	2008-01-10 21:49:53.000000000 -0800
@@ -433,6 +433,10 @@
 		coreutils/ \
 		coreutils/libcoreutils/ \
 		debianutils/ \
+		e2fsprogs/e2p/ \
+		e2fsprogs/ext2fs/ \
+		e2fsprogs/blkid/ \
+		e2fsprogs/uuid/ \
 		e2fsprogs/ \
 		editors/ \
 		findutils/ \
_______________________________________________
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Reply via email to