svn commit: trunk/busybox: include util-linux util-linux/volume_id

vda at busybox.net vda at busybox.net
Sun Oct 12 11:20:09 UTC 2008


Author: vda
Date: 2008-10-12 04:20:08 -0700 (Sun, 12 Oct 2008)
New Revision: 23662

Log:
blkid: new applet. We almost had everything needed for it already

function                                             old     new   delta
display_uuid_cache                                     -      89     +89
blkid_main                                             -       8      +8
applet_names                                        1871    1877      +6
applet_main                                         1140    1144      +4
applet_nameofs                                       570     572      +2
packed_usage                                       24737   24735      -2
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 3/1 up/down: 109/-2)            Total: 107 bytes



Modified:
   trunk/busybox/include/applets.h
   trunk/busybox/include/usage.h
   trunk/busybox/include/volume_id.h
   trunk/busybox/util-linux/Config.in
   trunk/busybox/util-linux/Kbuild
   trunk/busybox/util-linux/volume_id/Kbuild
   trunk/busybox/util-linux/volume_id/get_devname.c


Changeset:
Modified: trunk/busybox/include/applets.h
===================================================================
--- trunk/busybox/include/applets.h	2008-10-12 11:17:49 UTC (rev 23661)
+++ trunk/busybox/include/applets.h	2008-10-12 11:20:08 UTC (rev 23662)
@@ -80,6 +80,7 @@
 USE_BASENAME(APPLET_NOFORK(basename, basename, _BB_DIR_USR_BIN, _BB_SUID_NEVER, basename))
 USE_BBCONFIG(APPLET(bbconfig, _BB_DIR_BIN, _BB_SUID_NEVER))
 //USE_BBSH(APPLET(bbsh, _BB_DIR_BIN, _BB_SUID_NEVER))
+USE_BLKID(APPLET(blkid, _BB_DIR_SBIN, _BB_SUID_NEVER))
 USE_BRCTL(APPLET(brctl, _BB_DIR_USR_SBIN, _BB_SUID_NEVER))
 USE_BUNZIP2(APPLET(bunzip2, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
 USE_BUNZIP2(APPLET_ODDNAME(bzcat, bunzip2, _BB_DIR_USR_BIN, _BB_SUID_NEVER, bzcat))

Modified: trunk/busybox/include/usage.h
===================================================================
--- trunk/busybox/include/usage.h	2008-10-12 11:17:49 UTC (rev 23661)
+++ trunk/busybox/include/usage.h	2008-10-12 11:20:08 UTC (rev 23662)
@@ -1098,6 +1098,11 @@
      "\n	-z		Delete messages on server" \
      "\n	prog		Run 'prog <message_file>' on message delivery" \
 
+#define blkid_trivial_usage \
+       ""
+#define blkid_full_usage "\n\n" \
+       "Print UUIDs of all filesystems."
+
 #define findfs_trivial_usage \
        "LABEL=label or UUID=uuid"
 #define findfs_full_usage "\n\n" \

Modified: trunk/busybox/include/volume_id.h
===================================================================
--- trunk/busybox/include/volume_id.h	2008-10-12 11:17:49 UTC (rev 23661)
+++ trunk/busybox/include/volume_id.h	2008-10-12 11:20:08 UTC (rev 23662)
@@ -20,3 +20,4 @@
 
 char *get_devname_from_label(const char *spec);
 char *get_devname_from_uuid(const char *spec);
+void display_uuid_cache(void);

Modified: trunk/busybox/util-linux/Config.in
===================================================================
--- trunk/busybox/util-linux/Config.in	2008-10-12 11:17:49 UTC (rev 23661)
+++ trunk/busybox/util-linux/Config.in	2008-10-12 11:20:08 UTC (rev 23662)
@@ -5,6 +5,15 @@
 
 menu "Linux System Utilities"
 
+config BLKID
+	bool "blkid"
+	default n
+	select VOLUMEID
+	help
+	  Lists labels and UUIDs of all filesystems.
+	  WARNING:
+	  With all submodules selected, it will add ~8k to busybox.
+
 config DMESG
 	bool "dmesg"
 	default n
@@ -156,9 +165,7 @@
 	default n
 	select VOLUMEID
 	help
-	  This is similar to the findfs program that is part of the e2fsprogs
-	  package. However, the e2fsprogs version only support ext2/3. This
-	  version supports those in addition to FAT, swap, and ReiserFS.
+	  Prints the name of a filesystem with given laver or UUID.
 	  WARNING:
 	  With all submodules selected, it will add ~8k to busybox.
 
@@ -651,7 +658,7 @@
 	select VOLUMEID
 	help
 	  This allows for specifying a device by label or uuid, rather than by
-	  name. This feature utilizes the same functionality as findfs.
+	  name. This feature utilizes the same functionality as blkid/findfs.
 
 config FEATURE_MOUNT_NFS
 	bool "Support mounting NFS file systems"

Modified: trunk/busybox/util-linux/Kbuild
===================================================================
--- trunk/busybox/util-linux/Kbuild	2008-10-12 11:17:49 UTC (rev 23661)
+++ trunk/busybox/util-linux/Kbuild	2008-10-12 11:20:08 UTC (rev 23662)
@@ -5,6 +5,7 @@
 # Licensed under the GPL v2, see the file LICENSE in this tarball.
 
 lib-y:=
+lib-$(CONFIG_BLKID)             += blkid.o
 lib-$(CONFIG_DMESG)             += dmesg.o
 lib-$(CONFIG_FBSET)             += fbset.o
 lib-$(CONFIG_FDFLUSH)           += freeramdisk.o

Modified: trunk/busybox/util-linux/volume_id/Kbuild
===================================================================
--- trunk/busybox/util-linux/volume_id/Kbuild	2008-10-12 11:17:49 UTC (rev 23661)
+++ trunk/busybox/util-linux/volume_id/Kbuild	2008-10-12 11:20:08 UTC (rev 23662)
@@ -6,6 +6,7 @@
 
 lib-y:=
 
+lib-$(CONFIG_BLKID)                             += get_devname.o
 lib-$(CONFIG_FINDFS)                            += get_devname.o
 lib-$(CONFIG_FEATURE_MOUNT_LABEL)               += get_devname.o
 

Modified: trunk/busybox/util-linux/volume_id/get_devname.c
===================================================================
--- trunk/busybox/util-linux/volume_id/get_devname.c	2008-10-12 11:17:49 UTC (rev 23661)
+++ trunk/busybox/util-linux/volume_id/get_devname.c	2008-10-12 11:20:08 UTC (rev 23662)
@@ -374,25 +374,26 @@
 {
 	return get_spec_by_x(VOL, s, major, minor);
 }
+#endif // UNUSED
 
-static int display_uuid_cache(void)
+/* Used by blkid */
+void display_uuid_cache(void)
 {
 	struct uuidCache_s *u;
-	size_t i;
 
 	uuidcache_init();
-
 	u = uuidCache;
 	while (u) {
-		printf("%s %s %s\n", u->device, u->label, u->uc_uuid);
+		printf("%s:", u->device);
+		if (u->label[0])
+			printf(" LABEL=\"%s\"", u->label);
+		if (u->uc_uuid[0])
+			printf(" UUID=\"%s\"", u->uc_uuid);
+		bb_putchar('\n');
 		u = u->next;
 	}
-
-	return 0;
 }
-#endif // UNUSED
 
-
 /* Used by mount and findfs */
 
 char *get_devname_from_label(const char *spec)




More information about the busybox-cvs mailing list