diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2007-04-04 15:55:32 +1000 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2007-04-04 15:55:32 +1000 |
commit | d24e0892cd09e9d41793a59e66b7f86a99b40343 (patch) | |
tree | 44493d32624c50a4d9aba6a6f68162e62c8465d6 /petitboot.c | |
parent | 08447507ebe7a7aafdf95c734dd30ec89b1c79f8 (diff) | |
parent | f2c8c4c7197ef61c0378ffbeb4649d28bfcbba06 (diff) | |
download | talos-petitboot-d24e0892cd09e9d41793a59e66b7f86a99b40343.tar.gz talos-petitboot-d24e0892cd09e9d41793a59e66b7f86a99b40343.zip |
Merge branch 'master' of ssh://ozlabs.org/home/jk/git/petitboot
Diffstat (limited to 'petitboot.c')
-rw-r--r-- | petitboot.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/petitboot.c b/petitboot.c index b443280..416434a 100644 --- a/petitboot.c +++ b/petitboot.c @@ -993,8 +993,35 @@ static void sigint(int sig) syscall(__NR_exit); } +static void usage(const char *progname) +{ + fprintf(stderr, "Usage: %s [-u] [-h]\n", progname); +} + int main(int argc, char **argv) { + int c; + int udev_trigger = 0; + + for (;;) { + c = getopt(argc, argv, "u::h"); + if (c == -1) + break; + + switch (c) { + case 'u': + udev_trigger = 1; + break; + case 'h': + usage(argv[0]); + return EXIT_SUCCESS; + default: + fprintf(stderr, "Unknown option '%c'\n", c); + usage(argv[0]); + return EXIT_FAILURE; + } + } + atexit(exitfunc); signal(SIGINT, sigint); @@ -1035,7 +1062,7 @@ int main(int argc, char **argv) pboot_create_rpane(); pboot_create_spane(); - if (!pboot_start_device_discovery()) { + if (!pboot_start_device_discovery(udev_trigger)) { LOG("Couldn't start device discovery!\n"); return 1; } |