4 * Copyright (c) 1995 Waldi Ravens.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. All advertising materials mentioning features or use of this software
16 * must display the following acknowledgement:
17 * This product includes software developed by Waldi Ravens.
18 * 4. The name of the author may not be used to endorse or promote products
19 * derived from this software without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 #include <sys/types.h>
39 int main PROTO((int, char **));
41 static void version PROTO((void)) NORETURN;
42 static void usage PROTO((void)) NORETURN;
47 eprintf("%s\n", "$Revision: 1.1.1.1 $");
54 eprintf("Usage: aptck [OPTIONS] DISK..\n"
55 "where OPTIONS are:\n"
56 "\t-V display version information and exit\n"
57 "\t-h display this help and exit\n"
58 "\t-o FILE send output to FILE instead of stdout\n"
59 "\t-w wait for key press before exiting\n\n"
60 "DISK is the concatenation of BUS, TARGET and LUN.\n"
61 "BUS is one of `i' (IDE), `a' (ACSI) or `s' (SCSI).\n"
62 "TARGET and LUN are one decimal digit each. LUN must\n"
63 "not be specified for IDE devices and is optional for\n"
64 "ACSI/SCSI devices (if omitted, LUN defaults to 0).\n\n"
65 "Examples: a0 refers to ACSI target 0 lun 0\n"
66 " s21 refers to SCSI target 2 lun 1\n"
84 while ((c = getopt(argc, argv, "Vho:w")) != -1) {
87 redirect_output(optarg);
104 error(-1, "missing DISK argument");
109 c = isatty(STDOUT_FILENO);
112 dd = disk_open(*argv++);
114 if (readdisklabel(dd))
120 else rv = EXIT_FAILURE;