Denis Vlasenko | bff06fe | 2008-10-19 17:47:31 +0000 | [diff] [blame] | 1 | /* vi: set sw=4 ts=4: */ |
| 2 | /* |
| 3 | * Print UUIDs on all filesystems |
| 4 | * |
| 5 | * Copyright (C) 2008 Denys Vlasenko. |
| 6 | * |
Denys Vlasenko | 0ef64bd | 2010-08-16 20:14:46 +0200 | [diff] [blame] | 7 | * Licensed under GPLv2, see file LICENSE in this source tree. |
Denis Vlasenko | bff06fe | 2008-10-19 17:47:31 +0000 | [diff] [blame] | 8 | */ |
Denys Vlasenko | dd898c9 | 2016-11-23 11:46:32 +0100 | [diff] [blame] | 9 | //config:config BLKID |
Denys Vlasenko | b097a84 | 2018-12-28 03:20:17 +0100 | [diff] [blame] | 10 | //config: bool "blkid (12 kb)" |
Denys Vlasenko | dd898c9 | 2016-11-23 11:46:32 +0100 | [diff] [blame] | 11 | //config: default y |
Denys Vlasenko | dd898c9 | 2016-11-23 11:46:32 +0100 | [diff] [blame] | 12 | //config: select VOLUMEID |
| 13 | //config: help |
Denys Vlasenko | 72089cf | 2017-07-21 09:50:55 +0200 | [diff] [blame] | 14 | //config: Lists labels and UUIDs of all filesystems. |
Denys Vlasenko | dd898c9 | 2016-11-23 11:46:32 +0100 | [diff] [blame] | 15 | //config: |
| 16 | //config:config FEATURE_BLKID_TYPE |
| 17 | //config: bool "Print filesystem type" |
Denys Vlasenko | bf18239 | 2017-08-06 20:16:28 +0200 | [diff] [blame] | 18 | //config: default y |
Denys Vlasenko | dd898c9 | 2016-11-23 11:46:32 +0100 | [diff] [blame] | 19 | //config: depends on BLKID |
| 20 | //config: help |
Denys Vlasenko | 72089cf | 2017-07-21 09:50:55 +0200 | [diff] [blame] | 21 | //config: Show TYPE="filesystem type" |
Denys Vlasenko | dd898c9 | 2016-11-23 11:46:32 +0100 | [diff] [blame] | 22 | |
Denys Vlasenko | bf18239 | 2017-08-06 20:16:28 +0200 | [diff] [blame] | 23 | //applet:IF_BLKID(APPLET_NOEXEC(blkid, blkid, BB_DIR_SBIN, BB_SUID_DROP, blkid)) |
Denys Vlasenko | dd898c9 | 2016-11-23 11:46:32 +0100 | [diff] [blame] | 24 | |
| 25 | //kbuild:lib-$(CONFIG_BLKID) += blkid.o |
Denis Vlasenko | bff06fe | 2008-10-19 17:47:31 +0000 | [diff] [blame] | 26 | |
Pere Orga | 5bc8c00 | 2011-04-11 03:29:49 +0200 | [diff] [blame] | 27 | //usage:#define blkid_trivial_usage |
Denys Vlasenko | 2f8ccc1 | 2011-12-06 15:09:27 +0100 | [diff] [blame] | 28 | //usage: "[BLOCKDEV]..." |
Pere Orga | 5bc8c00 | 2011-04-11 03:29:49 +0200 | [diff] [blame] | 29 | //usage:#define blkid_full_usage "\n\n" |
| 30 | //usage: "Print UUIDs of all filesystems" |
| 31 | |
Denis Vlasenko | bff06fe | 2008-10-19 17:47:31 +0000 | [diff] [blame] | 32 | #include "libbb.h" |
| 33 | #include "volume_id.h" |
| 34 | |
Denis Vlasenko | bff06fe | 2008-10-19 17:47:31 +0000 | [diff] [blame] | 35 | int blkid_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
Denys Vlasenko | 90615a0 | 2010-12-30 00:40:11 +0100 | [diff] [blame] | 36 | int blkid_main(int argc UNUSED_PARAM, char **argv) |
Denis Vlasenko | bff06fe | 2008-10-19 17:47:31 +0000 | [diff] [blame] | 37 | { |
Denys Vlasenko | e8cfc3f | 2012-03-03 15:09:07 +0100 | [diff] [blame] | 38 | int scan_devices = 1; |
| 39 | |
Denys Vlasenko | 90615a0 | 2010-12-30 00:40:11 +0100 | [diff] [blame] | 40 | while (*++argv) { |
| 41 | /* Note: bogus device names don't cause any error messages */ |
| 42 | add_to_uuid_cache(*argv); |
Denys Vlasenko | e8cfc3f | 2012-03-03 15:09:07 +0100 | [diff] [blame] | 43 | scan_devices = 0; |
Denys Vlasenko | 90615a0 | 2010-12-30 00:40:11 +0100 | [diff] [blame] | 44 | } |
| 45 | |
Denys Vlasenko | e8cfc3f | 2012-03-03 15:09:07 +0100 | [diff] [blame] | 46 | display_uuid_cache(scan_devices); |
Denis Vlasenko | bff06fe | 2008-10-19 17:47:31 +0000 | [diff] [blame] | 47 | return 0; |
| 48 | } |