blob: b6f33b5138f44c1a6b7477fe2e0019bf32e0325a
1 | /* vi: set sw=4 ts=4: */ |
2 | /* |
3 | * Print UUIDs on all filesystems |
4 | * |
5 | * Copyright (C) 2008 Denys Vlasenko. |
6 | * |
7 | * Licensed under GPLv2, see file LICENSE in this source tree. |
8 | */ |
9 | //config:config BLKID |
10 | //config: bool "blkid" |
11 | //config: default y |
12 | //config: select PLATFORM_LINUX |
13 | //config: select VOLUMEID |
14 | //config: help |
15 | //config: Lists labels and UUIDs of all filesystems. |
16 | //config: WARNING: |
17 | //config: With all submodules selected, it will add ~8k to busybox. |
18 | //config: |
19 | //config:config FEATURE_BLKID_TYPE |
20 | //config: bool "Print filesystem type" |
21 | //config: default n |
22 | //config: depends on BLKID |
23 | //config: help |
24 | //config: Show TYPE="filesystem type" |
25 | |
26 | //applet:IF_BLKID(APPLET(blkid, BB_DIR_SBIN, BB_SUID_DROP)) |
27 | |
28 | //kbuild:lib-$(CONFIG_BLKID) += blkid.o |
29 | |
30 | //usage:#define blkid_trivial_usage |
31 | //usage: "[BLOCKDEV]..." |
32 | //usage:#define blkid_full_usage "\n\n" |
33 | //usage: "Print UUIDs of all filesystems" |
34 | |
35 | #include "libbb.h" |
36 | #include "volume_id.h" |
37 | |
38 | int blkid_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
39 | int blkid_main(int argc UNUSED_PARAM, char **argv) |
40 | { |
41 | int scan_devices = 1; |
42 | |
43 | while (*++argv) { |
44 | /* Note: bogus device names don't cause any error messages */ |
45 | add_to_uuid_cache(*argv); |
46 | scan_devices = 0; |
47 | } |
48 | |
49 | display_uuid_cache(scan_devices); |
50 | return 0; |
51 | } |
52 |