[BusyBox-cvs] busybox/libbb Makefile.in, 1.32, 1.33 loop.c, 1.6, 1.7 mk_loop_h.sh, 1.2, NONE real_loop.h, 1.1, NONE

Erik Andersen andersen at busybox.net
Fri Feb 6 07:16:38 UTC 2004


Update of /var/cvs/busybox/libbb
In directory nail:/tmp/cvs-serv20785

Modified Files:
	Makefile.in loop.c 
Removed Files:
	mk_loop_h.sh real_loop.h 
Log Message:
Make the loop support stuff be much less evil, and make it cope
with 2.6.x asm/posix_types.h, which has done singularly evil thing
by yanking __kernel_dev_t and renaming it.  The loop interface was
really poorly designed in the first place.  The new 64 bit loop
interface looks to be somewhat less horrible, too bad it is only
present in 2.6.x kernels.
 -Erik


--- real_loop.h DELETED ---

Index: Makefile.in
===================================================================
RCS file: /var/cvs/busybox/libbb/Makefile.in,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- Makefile.in	10 Nov 2003 04:33:54 -0000	1.32
+++ Makefile.in	6 Feb 2004 07:16:36 -0000	1.33
@@ -96,9 +96,3 @@
 $(LIBBB_MOBJS3): $(LIBBB_MSRC3)
 	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -DL_$(notdir $*) -c $< -o $@
 
-$(LIBBB_DIR)loop.o: $(LIBBB_DIR)loop.h
-
-$(LIBBB_DIR)loop.h: $(LIBBB_DIR)mk_loop_h.sh
-	@ $(SHELL) $< > $@
-
-

Index: loop.c
===================================================================
RCS file: /var/cvs/busybox/libbb/loop.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- loop.c	14 Jul 2003 21:20:55 -0000	1.6
+++ loop.c	6 Feb 2004 07:16:36 -0000	1.7
@@ -26,7 +26,40 @@
 #include <unistd.h>
 #include <sys/ioctl.h>
 #include "libbb.h"
-#include "loop.h" /* Pull in loop device support */
+
+/* Grumble...  The 2.6.x kernel breaks asm/posix_types.h
+ * so we get to try and cope as best we can... */
+#include <linux/version.h>
+#include <asm/posix_types.h>
+#if LINUX_VERSION_CODE >= 132608
+#define __bb_kernel_dev_t   __kernel_old_dev_t
+#elif LINUX_VERSION_CODE >= 0x20600
+#define __bb_kernel_dev_t   __kernel_dev_t
+#else
+#define __bb_kernel_dev_t   unsigned short
+#endif
+
+/* Stuff stolen from linux/loop.h */
+#define LO_NAME_SIZE        64
+#define LO_KEY_SIZE         32
+#define LOOP_SET_FD         0x4C00
+#define LOOP_CLR_FD         0x4C01
+#define LOOP_SET_STATUS     0x4C02
+#define LOOP_GET_STATUS     0x4C03
+struct loop_info {
+	int                lo_number;
+	__bb_kernel_dev_t  lo_device;
+	unsigned long      lo_inode;
+	__bb_kernel_dev_t  lo_rdevice;
+	int                lo_offset;
+	int                lo_encrypt_type;
+	int                lo_encrypt_key_size;
+	int                lo_flags;
+	char               lo_name[LO_NAME_SIZE];
+	unsigned char      lo_encrypt_key[LO_KEY_SIZE];
+	unsigned long      lo_init[2];
+	char               reserved[4];
+};
 
 extern int del_loop(const char *device)
 {

--- mk_loop_h.sh DELETED ---




More information about the busybox-cvs mailing list