-
Notifications
You must be signed in to change notification settings - Fork 2
/
usage.c
112 lines (105 loc) · 3.64 KB
/
usage.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/*
* Copyright (c) 2001-2007 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*
* usage.c
* bless
*
* Created by Shantonu Sen <ssen@apple.com> on Wed Nov 14 2001.
* Copyright (c) 2001-2007 Apple Inc. All Rights Reserved.
*
* $Id: usage.c,v 1.31 2005/12/05 12:59:30 ssen Exp $
*
*/
#include <stdlib.h>
#include <stdio.h>
#include "bless.h"
#include "enums.h"
#include "structs.h"
#include "protos.h"
void usage(void) {
fprintf(stderr, "Usage: %s [options]\n", getprogname());
fputs(
"\t--help\t\tThis usage statement\n"
"\n"
"Info Mode:\n"
"\t--info [dir]\tPrint blessing information for a specific volume, or the\n"
"\t\t\tcurrently active boot volume if <dir> is not specified\n"
"\t--getBoot\tSuppress normal output and print the active boot volume\n"
"\t--version\tPrint bless version number\n"
"\t--plist\t\tFor any output type, use a plist representation\n"
"\t--verbose\tVerbose output\n"
"\n"
"File/Folder Mode:\n"
"\t--file file\tSet <file> as the blessed boot file\n"
"\t--folder dir\tSet <dir> as the blessed directory\n"
"\t--bootinfo [file]\tUse <file> to create a \"BootX\" file in the\n"
"\t\t\tblessed dir\n"
"\t--bootefi [file]\tUse <file> to create a \"boot.efi\" file in the\n"
"\t\t\tblessed dir\n"
"\t--setBoot\tSet firmware to boot from this volume\n"
"\t--openfolder dir\tSet <dir> to be the visible Finder directory\n"
"\t--create-snapshot\t Create an APFS snapshot of this volume\n"
"\t--last-sealed-snapshot\t Revert back to the previously signed APFS snapshot\n"
"\t--verbose\tVerbose output\n"
"\n"
"Mount Mode:\n"
"\t--mount dir\tUse this mountpoint in conjunction with --setBoot\n"
"\t--file file\tSet firmware to boot from <file>\n"
"\t--setBoot\tSet firmware to boot from this volume\n"
"\t--verbose\tVerbose output\n"
"\n"
"Device Mode:\n"
"\t--device dev\tUse this block device in conjunction with --setBoot\n"
"\t--setBoot\tSet firmware to boot from this volume\n"
"\t--verbose\tVerbose output\n"
"\n"
"NetBoot Mode:\n"
"\t--netboot\tSet firmware to boot from the network\n"
"\t--server url\tUse BDSP to fetch boot parameters from <url>\n"
"\t--verbose\tVerbose output\n"
,
stderr);
exit(1);
}
/* Basically lifted from the man page */
void usage_short(void) {
fprintf(stderr, "Usage: %s [options]\n", getprogname());
fputs(
"bless --help\n"
"\n"
"bless --folder directory [--file file]\n"
"\t[--bootinfo [file]] [--bootefi [file]]\n"
"\t[--setBoot] [--openfolder directory]\n"
"\t[--create-snapshot] [--last-sealed-snapshot] [--verbose]\n"
"\n"
"bless --mount directory [--file file] [--setBoot] [--verbose]\n"
"\n"
"bless --device device [--setBoot] [--verbose]\n"
"\n"
"bless --netboot --server url [--verbose]\n"
"\n"
"bless --info [directory] [--getBoot] [--plist] [--verbose] [--version]\n"
,
stderr);
exit(1);
}