blkid.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 kb)"
  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:
  17. //config:config FEATURE_BLKID_TYPE
  18. //config: bool "Print filesystem type"
  19. //config: default y
  20. //config: depends on BLKID
  21. //config: help
  22. //config: Show TYPE="filesystem type"
  23. //applet:IF_BLKID(APPLET_NOEXEC(blkid, blkid, BB_DIR_SBIN, BB_SUID_DROP, blkid))
  24. //kbuild:lib-$(CONFIG_BLKID) += blkid.o
  25. //usage:#define blkid_trivial_usage
  26. //usage: "[BLOCKDEV]..."
  27. //usage:#define blkid_full_usage "\n\n"
  28. //usage: "Print UUIDs of all filesystems"
  29. #include "libbb.h"
  30. #include "volume_id.h"
  31. int blkid_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
  32. int blkid_main(int argc UNUSED_PARAM, char **argv)
  33. {
  34. int scan_devices = 1;
  35. while (*++argv) {
  36. /* Note: bogus device names don't cause any error messages */
  37. add_to_uuid_cache(*argv);
  38. scan_devices = 0;
  39. }
  40. display_uuid_cache(scan_devices);
  41. return 0;
  42. }