aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-10-12 11:20:08 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-10-12 11:20:08 +0000
commit1e19afd38adae3c44197254255ed43d88ae9726c (patch)
treecb9d153be22d4043e1feffe26b3b42462cc88181
parentd5e305944a9db25f57b252cc9f56c18311e68481 (diff)
downloadbusybox-w32-1e19afd38adae3c44197254255ed43d88ae9726c.tar.gz
busybox-w32-1e19afd38adae3c44197254255ed43d88ae9726c.tar.bz2
busybox-w32-1e19afd38adae3c44197254255ed43d88ae9726c.zip
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
-rw-r--r--include/applets.h1
-rw-r--r--include/usage.h5
-rw-r--r--include/volume_id.h1
-rw-r--r--util-linux/Config.in15
-rw-r--r--util-linux/Kbuild1
-rw-r--r--util-linux/volume_id/Kbuild1
-rw-r--r--util-linux/volume_id/get_devname.c17
7 files changed, 29 insertions, 12 deletions
diff --git a/include/applets.h b/include/applets.h
index 35649d3df..828900e46 100644
--- a/include/applets.h
+++ b/include/applets.h
@@ -80,6 +80,7 @@ USE_AWK(APPLET_NOEXEC(awk, awk, _BB_DIR_USR_BIN, _BB_SUID_NEVER, awk))
80USE_BASENAME(APPLET_NOFORK(basename, basename, _BB_DIR_USR_BIN, _BB_SUID_NEVER, basename)) 80USE_BASENAME(APPLET_NOFORK(basename, basename, _BB_DIR_USR_BIN, _BB_SUID_NEVER, basename))
81USE_BBCONFIG(APPLET(bbconfig, _BB_DIR_BIN, _BB_SUID_NEVER)) 81USE_BBCONFIG(APPLET(bbconfig, _BB_DIR_BIN, _BB_SUID_NEVER))
82//USE_BBSH(APPLET(bbsh, _BB_DIR_BIN, _BB_SUID_NEVER)) 82//USE_BBSH(APPLET(bbsh, _BB_DIR_BIN, _BB_SUID_NEVER))
83USE_BLKID(APPLET(blkid, _BB_DIR_SBIN, _BB_SUID_NEVER))
83USE_BRCTL(APPLET(brctl, _BB_DIR_USR_SBIN, _BB_SUID_NEVER)) 84USE_BRCTL(APPLET(brctl, _BB_DIR_USR_SBIN, _BB_SUID_NEVER))
84USE_BUNZIP2(APPLET(bunzip2, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) 85USE_BUNZIP2(APPLET(bunzip2, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
85USE_BUNZIP2(APPLET_ODDNAME(bzcat, bunzip2, _BB_DIR_USR_BIN, _BB_SUID_NEVER, bzcat)) 86USE_BUNZIP2(APPLET_ODDNAME(bzcat, bunzip2, _BB_DIR_USR_BIN, _BB_SUID_NEVER, bzcat))
diff --git a/include/usage.h b/include/usage.h
index d2478641c..3c110132e 100644
--- a/include/usage.h
+++ b/include/usage.h
@@ -1098,6 +1098,11 @@
1098 "\n -z Delete messages on server" \ 1098 "\n -z Delete messages on server" \
1099 "\n prog Run 'prog <message_file>' on message delivery" \ 1099 "\n prog Run 'prog <message_file>' on message delivery" \
1100 1100
1101#define blkid_trivial_usage \
1102 ""
1103#define blkid_full_usage "\n\n" \
1104 "Print UUIDs of all filesystems."
1105
1101#define findfs_trivial_usage \ 1106#define findfs_trivial_usage \
1102 "LABEL=label or UUID=uuid" 1107 "LABEL=label or UUID=uuid"
1103#define findfs_full_usage "\n\n" \ 1108#define findfs_full_usage "\n\n" \
diff --git a/include/volume_id.h b/include/volume_id.h
index 99cb11ff6..bba32c0ba 100644
--- a/include/volume_id.h
+++ b/include/volume_id.h
@@ -20,3 +20,4 @@
20 20
21char *get_devname_from_label(const char *spec); 21char *get_devname_from_label(const char *spec);
22char *get_devname_from_uuid(const char *spec); 22char *get_devname_from_uuid(const char *spec);
23void display_uuid_cache(void);
diff --git a/util-linux/Config.in b/util-linux/Config.in
index 2ba9f0166..ba0916a50 100644
--- a/util-linux/Config.in
+++ b/util-linux/Config.in
@@ -5,6 +5,15 @@
5 5
6menu "Linux System Utilities" 6menu "Linux System Utilities"
7 7
8config BLKID
9 bool "blkid"
10 default n
11 select VOLUMEID
12 help
13 Lists labels and UUIDs of all filesystems.
14 WARNING:
15 With all submodules selected, it will add ~8k to busybox.
16
8config DMESG 17config DMESG
9 bool "dmesg" 18 bool "dmesg"
10 default n 19 default n
@@ -156,9 +165,7 @@ config FINDFS
156 default n 165 default n
157 select VOLUMEID 166 select VOLUMEID
158 help 167 help
159 This is similar to the findfs program that is part of the e2fsprogs 168 Prints the name of a filesystem with given laver or UUID.
160 package. However, the e2fsprogs version only support ext2/3. This
161 version supports those in addition to FAT, swap, and ReiserFS.
162 WARNING: 169 WARNING:
163 With all submodules selected, it will add ~8k to busybox. 170 With all submodules selected, it will add ~8k to busybox.
164 171
@@ -651,7 +658,7 @@ config FEATURE_MOUNT_LABEL
651 select VOLUMEID 658 select VOLUMEID
652 help 659 help
653 This allows for specifying a device by label or uuid, rather than by 660 This allows for specifying a device by label or uuid, rather than by
654 name. This feature utilizes the same functionality as findfs. 661 name. This feature utilizes the same functionality as blkid/findfs.
655 662
656config FEATURE_MOUNT_NFS 663config FEATURE_MOUNT_NFS
657 bool "Support mounting NFS file systems" 664 bool "Support mounting NFS file systems"
diff --git a/util-linux/Kbuild b/util-linux/Kbuild
index 38569c69b..2d0fc4928 100644
--- a/util-linux/Kbuild
+++ b/util-linux/Kbuild
@@ -5,6 +5,7 @@
5# Licensed under the GPL v2, see the file LICENSE in this tarball. 5# Licensed under the GPL v2, see the file LICENSE in this tarball.
6 6
7lib-y:= 7lib-y:=
8lib-$(CONFIG_BLKID) += blkid.o
8lib-$(CONFIG_DMESG) += dmesg.o 9lib-$(CONFIG_DMESG) += dmesg.o
9lib-$(CONFIG_FBSET) += fbset.o 10lib-$(CONFIG_FBSET) += fbset.o
10lib-$(CONFIG_FDFLUSH) += freeramdisk.o 11lib-$(CONFIG_FDFLUSH) += freeramdisk.o
diff --git a/util-linux/volume_id/Kbuild b/util-linux/volume_id/Kbuild
index 54b95f0c7..d78e4ada5 100644
--- a/util-linux/volume_id/Kbuild
+++ b/util-linux/volume_id/Kbuild
@@ -6,6 +6,7 @@
6 6
7lib-y:= 7lib-y:=
8 8
9lib-$(CONFIG_BLKID) += get_devname.o
9lib-$(CONFIG_FINDFS) += get_devname.o 10lib-$(CONFIG_FINDFS) += get_devname.o
10lib-$(CONFIG_FEATURE_MOUNT_LABEL) += get_devname.o 11lib-$(CONFIG_FEATURE_MOUNT_LABEL) += get_devname.o
11 12
diff --git a/util-linux/volume_id/get_devname.c b/util-linux/volume_id/get_devname.c
index f9a2c905f..83c085650 100644
--- a/util-linux/volume_id/get_devname.c
+++ b/util-linux/volume_id/get_devname.c
@@ -374,24 +374,25 @@ get_spec_by_volume_label(const char *s, int *major, int *minor)
374{ 374{
375 return get_spec_by_x(VOL, s, major, minor); 375 return get_spec_by_x(VOL, s, major, minor);
376} 376}
377#endif // UNUSED
377 378
378static int display_uuid_cache(void) 379/* Used by blkid */
380void display_uuid_cache(void)
379{ 381{
380 struct uuidCache_s *u; 382 struct uuidCache_s *u;
381 size_t i;
382 383
383 uuidcache_init(); 384 uuidcache_init();
384
385 u = uuidCache; 385 u = uuidCache;
386 while (u) { 386 while (u) {
387 printf("%s %s %s\n", u->device, u->label, u->uc_uuid); 387 printf("%s:", u->device);
388 if (u->label[0])
389 printf(" LABEL=\"%s\"", u->label);
390 if (u->uc_uuid[0])
391 printf(" UUID=\"%s\"", u->uc_uuid);
392 bb_putchar('\n');
388 u = u->next; 393 u = u->next;
389 } 394 }
390
391 return 0;
392} 395}
393#endif // UNUSED
394
395 396
396/* Used by mount and findfs */ 397/* Used by mount and findfs */
397 398