Magellan Linux

Contents of /trunk/mkinitrd-magellan/busybox/util-linux/findfs.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 984 - (show annotations) (download)
Sun May 30 11:32:42 2010 UTC (13 years, 11 months ago) by niro
File MIME type: text/plain
File size: 906 byte(s)
-updated to busybox-1.16.1 and enabled blkid/uuid support in default config
1 /* vi: set sw=4 ts=4: */
2 /*
3 * Support functions for mounting devices by label/uuid
4 *
5 * Copyright (C) 2006 by Jason Schoon <floydpink@gmail.com>
6 * Some portions cribbed from e2fsprogs, util-linux, dosfstools
7 *
8 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
9 */
10
11 #include "libbb.h"
12 #include "volume_id.h"
13
14 int findfs_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
15 int findfs_main(int argc UNUSED_PARAM, char **argv)
16 {
17 char *dev = *++argv;
18
19 if (!dev)
20 bb_show_usage();
21
22 if (strncmp(dev, "/dev/", 5) == 0) {
23 /* Just pass any /dev/xxx name right through.
24 * This might aid in some scripts being able
25 * to call this unconditionally */
26 dev = NULL;
27 } else {
28 /* Otherwise, handle LABEL=xxx and UUID=xxx,
29 * fail on anything else */
30 if (!resolve_mount_spec(argv))
31 bb_show_usage();
32 }
33
34 if (*argv != dev) {
35 puts(*argv);
36 return 0;
37 }
38 return 1;
39 }