format: fix stdbool symbol name conflict
[unleashed.git] / usr / src / cmd / format / init_menus.c
blob3b7dcf0b0441687071760047ec5b0e9bb145c68b
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #pragma ident "%Z%%M% %I% %E% SMI"
29 * This file contains the declarations of menus for the program. To add
30 * a new command/menu, simply add it to the appropriate table and define
31 * the function that executes it.
33 #include <sys/isa_defs.h>
34 #include "global.h"
35 #include "menu.h"
36 #include "menu_partition.h"
37 #include "menu_command.h"
38 #include "menu_analyze.h"
39 #include "menu_defect.h"
40 #include "add_definition.h"
41 #include "menu_scsi.h"
42 #include "menu_developer.h"
43 #include "menu_cache.h"
45 #include "menu_fdisk.h"
49 * This declaration is for the command menu. It is the menu first
50 * encountered upon entering the program.
52 struct menu_item menu_command[] = {
53 { "disk - select a disk",
54 c_disk, truefxn },
56 { "type - select (define) a disk type",
57 c_type, truefxn },
59 { "partition - select (define) a partition table",
60 c_partition, truefxn },
62 { "current - describe the current disk",
63 c_current, truefxn },
65 { "format - format and analyze the disk",
66 c_format, truefxn },
68 { "fdisk - run the fdisk program",
69 c_fdisk, support_fdisk_on_sparc },
71 { "repair - repair a defective sector",
72 c_repair, truefxn },
74 { "show - translate a disk address",
75 c_show, not_scsi },
77 { "label - write label to the disk",
78 c_label, truefxn },
80 { "analyze - surface analysis",
81 c_analyze, truefxn },
83 { "defect - defect list management",
84 c_defect, truefxn },
86 { "backup - search for backup labels",
87 c_backup, truefxn },
89 { "verify - read and display labels",
90 c_verify, truefxn },
92 { "save - save new disk/partition definitions",
93 add_definition, not_efi },
95 { "inquiry - show vendor, product and revision",
96 c_inquiry, scsi },
98 { "scsi - independent SCSI mode selects",
99 c_scsi, scsi_expert },
101 { "cache - enable, disable or query SCSI disk cache",
102 c_cache, scsi_expert },
104 { "volname - set 8-character volume name",
105 c_volname, truefxn },
107 { "developer - dump developer things",
108 c_developer, developer },
110 { "!<cmd> - execute <cmd>, then return",
111 execute_shell, truefxn},
113 { NULL }
118 * This declaration is for the partition menu. It is used to create
119 * and maintain partition tables.
121 struct menu_item menu_partition[] = {
122 { "0 - change `0' partition",
123 p_apart, truefxn },
124 { "1 - change `1' partition",
125 p_bpart, truefxn },
126 { "2 - change `2' partition",
127 p_cpart, truefxn },
128 { "3 - change `3' partition",
129 p_dpart, truefxn },
130 { "4 - change `4' partition",
131 p_epart, truefxn },
132 { "5 - change `5' partition",
133 p_fpart, truefxn },
134 { "6 - change `6' partition",
135 p_gpart, truefxn },
136 { "7 - change `7' partition",
137 p_hpart, disp_expert_change_expert_efi },
138 { "8 - change '8' partition",
139 p_ipart, disp_all_change_expert_efi },
140 #if defined(i386)
141 { "9 - change `9' partition",
142 p_jpart, expert },
143 #endif
144 { "expand - expand label to use whole disk",
145 p_expand, disp_expand_efi },
146 { "select - select a predefined table",
147 p_select, truefxn },
148 { "modify - modify a predefined partition table",
149 p_modify, truefxn },
150 { "name - name the current table",
151 p_name, truefxn },
152 { "print - display the current table",
153 p_print, truefxn },
154 { "label - write partition map and label to the disk",
155 c_label, truefxn },
156 { "!<cmd> - execute <cmd>, then return",
157 execute_shell, truefxn},
159 { NULL }
165 * This declaration is for the analysis menu. It is used to set up
166 * and execute surface analysis of a disk.
168 struct menu_item menu_analyze[] = {
169 { "read - read only test (doesn't harm SunOS)",
170 a_read, truefxn },
171 { "refresh - read then write (doesn't harm data)",
172 a_refresh, truefxn },
173 { "test - pattern testing (doesn't harm data)",
174 a_test, truefxn },
175 { "write - write then read (corrupts data)",
176 a_write, truefxn },
177 { "compare - write, read, compare (corrupts data)",
178 a_compare, truefxn },
179 { "purge - write, read, write (corrupts data)",
180 a_purge, truefxn },
181 { "verify - write entire disk, then verify (corrupts data)",
182 a_verify, truefxn },
183 { "print - display data buffer",
184 a_print, truefxn },
185 { "setup - set analysis parameters",
186 a_setup, truefxn },
187 { "config - show analysis parameters",
188 a_config, truefxn },
189 { "!<cmd> - execute <cmd> , then return",
190 execute_shell, truefxn},
191 { NULL }
197 * This declaration is for the defect menu. It is used to manipulate
198 * the defect list for a disk.
200 struct menu_item menu_defect[] = {
201 { "restore - set working list = current list",
202 d_restore, not_embedded_scsi },
203 { "original - extract manufacturer's list from disk",
204 d_original, not_embedded_scsi },
205 { "extract - extract working list from disk",
206 d_extract, not_embedded_scsi },
207 { "primary - extract manufacturer's defect list",
208 d_primary, embedded_scsi },
209 { "grown - extract the grown defects list",
210 d_grown, embedded_scsi },
211 { "both - extract both primary and grown defects lists",
212 d_both, embedded_scsi },
213 { "add - add defects to working list",
214 d_add, not_embedded_scsi },
215 { "delete - delete a defect from working list",
216 d_delete, not_embedded_scsi },
217 { "print - display defect list",
218 d_print, embedded_scsi },
219 { "dump - dump defect list to file",
220 d_dump, embedded_scsi },
221 { "print - display working list",
222 d_print, not_embedded_scsi },
223 { "dump - dump working list to file",
224 d_dump, not_embedded_scsi },
225 { "load - load working list from file",
226 d_load, not_embedded_scsi },
227 { "commit - set current list = working list",
228 d_commit, not_embedded_scsi },
229 { "create - recreates maufacturer's defect list on disk",
230 d_create, not_embedded_scsi },
231 { "!<cmd> - execute <cmd>, then return",
232 execute_shell, truefxn},
234 { NULL }
238 * This declaration is for the developer menu.
240 struct menu_item menu_developer[] = {
241 { "dump_disk - dump disk entries",
242 dv_disk, truefxn },
243 { "dump_cont - dump controller entries",
244 dv_cont, truefxn },
245 { "dump_c_chain - dump controller chain entries",
246 dv_cont_chain, truefxn },
247 { "dev_params - dump device parameters",
248 dv_params, truefxn },
249 { "!<cmd> - execute <cmd>, then return",
250 execute_shell, truefxn},
251 { NULL }
255 * This declaration is for the cache menu.
257 struct menu_item menu_cache[] = {
258 { "write_cache - display or modify write cache settings",
259 ca_write_cache, scsi_expert },
260 { "read_cache - display or modify read cache settings",
261 ca_read_cache, scsi_expert },
262 { "!<cmd> - execute <cmd>, then return",
263 execute_shell, truefxn},
264 { NULL }
268 * This declaration is for the write_cache menu.
270 struct menu_item menu_write_cache[] = {
271 { "display - display current setting of write cache",
272 ca_write_display, scsi_expert },
273 { "enable - enable write cache",
274 ca_write_enable, scsi_expert },
275 { "disable - disable write cache",
276 ca_write_disable, scsi_expert },
277 { "!<cmd> - execute <cmd>, then return",
278 execute_shell, truefxn},
279 { NULL }
283 * This declaration is for the read_cache menu.
285 struct menu_item menu_read_cache[] = {
286 { "display - display current setting of read cache",
287 ca_read_display, scsi_expert },
288 { "enable - enable read cache",
289 ca_read_enable, scsi_expert },
290 { "disable - disable read cache",
291 ca_read_disable, scsi_expert },
292 { "!<cmd> - execute <cmd>, then return",
293 execute_shell, truefxn},
294 { NULL }