2008-10-19 23:17:31 +05:30
|
|
|
/* vi: set sw=4 ts=4: */
|
|
|
|
/*
|
|
|
|
* Print UUIDs on all filesystems
|
|
|
|
*
|
|
|
|
* Copyright (C) 2008 Denys Vlasenko.
|
|
|
|
*
|
2010-08-16 23:44:46 +05:30
|
|
|
* Licensed under GPLv2, see file LICENSE in this source tree.
|
2008-10-19 23:17:31 +05:30
|
|
|
*/
|
2016-11-23 16:16:32 +05:30
|
|
|
//config:config BLKID
|
2018-12-28 07:50:17 +05:30
|
|
|
//config: bool "blkid (12 kb)"
|
2016-11-23 16:16:32 +05:30
|
|
|
//config: default y
|
|
|
|
//config: select VOLUMEID
|
|
|
|
//config: help
|
2017-07-21 13:20:55 +05:30
|
|
|
//config: Lists labels and UUIDs of all filesystems.
|
2016-11-23 16:16:32 +05:30
|
|
|
//config:
|
|
|
|
//config:config FEATURE_BLKID_TYPE
|
|
|
|
//config: bool "Print filesystem type"
|
2017-08-06 23:46:28 +05:30
|
|
|
//config: default y
|
2016-11-23 16:16:32 +05:30
|
|
|
//config: depends on BLKID
|
|
|
|
//config: help
|
2017-07-21 13:20:55 +05:30
|
|
|
//config: Show TYPE="filesystem type"
|
2016-11-23 16:16:32 +05:30
|
|
|
|
2017-08-06 23:46:28 +05:30
|
|
|
//applet:IF_BLKID(APPLET_NOEXEC(blkid, blkid, BB_DIR_SBIN, BB_SUID_DROP, blkid))
|
2016-11-23 16:16:32 +05:30
|
|
|
|
|
|
|
//kbuild:lib-$(CONFIG_BLKID) += blkid.o
|
2008-10-19 23:17:31 +05:30
|
|
|
|
2011-04-11 06:59:49 +05:30
|
|
|
//usage:#define blkid_trivial_usage
|
2011-12-06 19:39:27 +05:30
|
|
|
//usage: "[BLOCKDEV]..."
|
2011-04-11 06:59:49 +05:30
|
|
|
//usage:#define blkid_full_usage "\n\n"
|
|
|
|
//usage: "Print UUIDs of all filesystems"
|
|
|
|
|
2008-10-19 23:17:31 +05:30
|
|
|
#include "libbb.h"
|
|
|
|
#include "volume_id.h"
|
|
|
|
|
|
|
|
int blkid_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
2010-12-30 05:10:11 +05:30
|
|
|
int blkid_main(int argc UNUSED_PARAM, char **argv)
|
2008-10-19 23:17:31 +05:30
|
|
|
{
|
2012-03-03 19:39:07 +05:30
|
|
|
int scan_devices = 1;
|
|
|
|
|
2010-12-30 05:10:11 +05:30
|
|
|
while (*++argv) {
|
|
|
|
/* Note: bogus device names don't cause any error messages */
|
|
|
|
add_to_uuid_cache(*argv);
|
2012-03-03 19:39:07 +05:30
|
|
|
scan_devices = 0;
|
2010-12-30 05:10:11 +05:30
|
|
|
}
|
|
|
|
|
2012-03-03 19:39:07 +05:30
|
|
|
display_uuid_cache(scan_devices);
|
2008-10-19 23:17:31 +05:30
|
|
|
return 0;
|
|
|
|
}
|