1 /* $NetBSD: menus.md.en,v 1.22 2010/01/02 17:15:07 dsl Exp $ */
4 * Copyright 1997 Piermont Information Systems Inc.
7 * Written by Philip A. Nelson for Piermont Information Systems Inc.
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed for the NetBSD Project by
20 * Piermont Information Systems Inc.
21 * 4. The name of Piermont Information Systems Inc. may not be used to endorse
22 * or promote products derived from this software without specific prior
25 * THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``AS IS''
26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL PIERMONT INFORMATION SYSTEMS INC. BE
29 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
35 * THE POSSIBILITY OF SUCH DAMAGE.
39 /* Menu definitions for sysinst. mac68k version, machine dependent. */
41 menu fullpart, title "Select your choice";
42 option "Use only part of the disk", exit, action {usefull = 0;};
43 option "Use the entire disk", exit, action {usefull = 1;};
45 menu nodiskmap, title "Choose an option", y=16;
46 display action { msg_display (MSG_nodiskmap, diskdev); };
47 option "Abort install", exit, action {
50 option "Initialize Disk partition Map", exit, action {
54 msg_display (MSG_okwritediskmap);
55 process_menu (MENU_okabort, NULL);
60 map.size = NEW_MAP_SIZE;
61 map.in_use_cnt = new_map[0].pmMapBlkCnt;
62 map.blk = (struct apple_part_map_entry *)calloc(map.size,
63 sizeof(struct apple_part_map_entry));
64 for (i=0;i<map.size;i++)
65 memcpy (&map.blk[i], &new_map[i],
66 sizeof(struct apple_part_map_entry));
69 menu editparttable, title "Choose your partition", exit, y=14;
70 display action { msg_display (MSG_editparttable);
72 if (map.selected >= map.usable_cnt)
74 disp_selected_part (map.selected);
76 option "Select next partition", action {
78 if (map.selected >= map.usable_cnt)
81 option "Change selected partition", sub menu chooseid;
82 option "Set mount point for partition", sub menu mount_point;
83 option "Split selected partition", action {
84 int i, j, k, size, free_size;
88 j = map.mblk[map.selected];
89 msg_display(MSG_split_part, map.blk[j].pmPartBlkCnt);
90 msg_prompt_add (MSG_scratch_size, NULL, buf, sizeof(buf));
92 if (size > 0 && size < (int)map.blk[j].pmPartBlkCnt) {
95 memcpy (&map.blk[k], &map.blk[j],
96 sizeof(struct apple_part_map_entry));
97 free_size = map.blk[j].pmPartBlkCnt - size;
98 strcpy ((char *)map.blk[j].pmPartType, "Apple_Scratch");
99 map.blk[j].pmPartBlkCnt = size;
100 map.blk[j].pmDataCnt = size;
101 bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
103 bzb->mount_point[0] = '\0';
104 strcpy ((char *)map.blk[k].pmPartType, "Apple_Free");
105 map.blk[k].pmPyPartStart += size;
106 if ((map.blk[k].pmPyPartStart + free_size) > dlsize)
107 map.blk[k].pmPartBlkCnt =
108 dlsize - map.blk[k].pmPyPartStart;
110 map.blk[k].pmPartBlkCnt = free_size;
111 map.blk[k].pmDataCnt = map.blk[k].pmPartBlkCnt;
112 bzb = (EBZB *)&map.blk[k].pmBootArgs[0];
114 bzb->mount_point[0] = '\0';
115 map.in_use_cnt += 1; /* Count new part as usable */
118 msg_display (MSG_diskfull);
119 process_menu (MENU_okabort, NULL);
122 map.size = NEW_MAP_SIZE;
123 map.in_use_cnt = new_map[0].pmMapBlkCnt;
124 map.blk = (struct apple_part_map_entry *)calloc(map.size,
125 sizeof(struct apple_part_map_entry));
126 for (i=0;i<map.size;i++)
127 memcpy (&map.blk[i], &new_map[i],
128 sizeof(struct apple_part_map_entry));
129 map.blk[0].pmSigPad = 0; /* Don't rewrite Block0 */
133 option "Fix selected partition", action {
134 int i = map.mblk[map.selected];
135 EBZB *bzb = (EBZB *)&map.blk[i].pmBootArgs[0];
136 msg_display(MSG_partdebug, diskdev, bzb->flags.part,
137 map.blk[i].pmPyPartStart,
138 map.blk[i].pmPartBlkCnt);
139 if ((map.blk[i].pmPyPartStart +
140 map.blk[i].pmPartBlkCnt) > dlsize) {
141 msg_display_add(MSG_parttable_fix_fixing,
142 diskdev, bzb->flags.part);
143 map.blk[i].pmPartBlkCnt =
144 dlsize - map.blk[i].pmPyPartStart;
145 map.blk[i].pmDataCnt =
146 map.blk[i].pmPartBlkCnt;
148 msg_display_add(MSG_parttable_fix_fine,
149 diskdev, bzb->flags.part);
151 process_menu(MENU_ok, NULL);
155 menu ok2, title "Abort?", y=17;
156 option "OK", exit, action { };
158 menu okabort, title "What do you want to do?", y=17;
159 option "Continue", exit, action { yesno = 1; };
160 option "Abort install", exit, action { yesno = 0; };
162 menu chooseid, title "Partition Type?";
163 option "NetBSD Root", exit, action {
167 j = map.mblk[map.selected];
168 reset_part_flags(&map.blk[j]);
169 bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
170 bzb->magic = APPLE_BZB_MAGIC;
171 strcpy ((char *)map.blk[j].pmPartName, "NetBSD Root");
172 strcpy ((char *)map.blk[j].pmPartType, "Apple_Unix_SVR2");
173 bzb->type = APPLE_BZB_TYPEFS;
176 * Automatically determine root mount points. The first
177 * root-type filesystem is mounted on "/", all others
178 * will mount on "/altroot". If there are multiple
179 * occurances of "/altroot" they will be picked up on
180 * the sanity_scan in the next step of the installation.
182 for (i=0,map.root_cnt=0;i<map.usable_cnt;i++) {
184 if (whichType(&map.blk[j]) == ROOT_PART) {
185 bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
186 if (bzb->type == APPLE_BZB_TYPEFS && bzb->flags.root) {
187 if (map.root_cnt++ == 0)
188 strcpy ((char *)bzb->mount_point, "/");
190 strcpy ((char *)bzb->mount_point, "/altroot");
194 option "NetBSD SWAP", exit, action {
198 j = map.mblk[map.selected];
199 reset_part_flags(&map.blk[j]);
200 bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
201 bzb->magic = APPLE_BZB_MAGIC;
202 strcpy ((char *)map.blk[j].pmPartName, "NetBSD SWAP");
203 strcpy ((char *)map.blk[j].pmPartType, "Apple_Unix_SVR2");
204 bzb->type = APPLE_BZB_TYPESWAP; };
205 option "NetBSD Usr", exit, action {
209 j = map.mblk[map.selected];
210 reset_part_flags(&map.blk[j]);
211 bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
212 bzb->magic = APPLE_BZB_MAGIC;
213 strcpy ((char *)map.blk[j].pmPartName, "NetBSD Usr");
214 strcpy ((char *)map.blk[j].pmPartType, "Apple_Unix_SVR2");
215 bzb->type = APPLE_BZB_TYPEFS;
217 if (map.usr_cnt++ == 0)
218 strcpy ((char *)bzb->mount_point, "/usr");
220 option "NetBSD Root&Usr", exit, action {
224 j = map.mblk[map.selected];
225 reset_part_flags(&map.blk[j]);
226 bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
227 bzb->magic = APPLE_BZB_MAGIC;
228 strcpy ((char *)map.blk[j].pmPartName, "NetBSD Root & Usr");
229 strcpy ((char *)map.blk[j].pmPartType, "Apple_Unix_SVR2");
230 bzb->type = APPLE_BZB_TYPEFS;
233 if (map.root_cnt++ == 0)
234 strcpy ((char *)bzb->mount_point, "/");
236 if (map.usr_cnt++ == 0)
237 strcpy ((char *)bzb->mount_point, "/usr");
239 option "MacOS HFS", exit, action {
243 j = map.mblk[map.selected];
244 reset_part_flags(&map.blk[j]);
245 bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
247 bzb->mount_point[0] = '\0';
248 strcpy ((char *)map.blk[j].pmPartName, "untitled (HFS)");
249 strcpy ((char *)map.blk[j].pmPartType, "Apple_HFS"); };
250 option "Scratch", exit, action {
254 j = map.mblk[map.selected];
255 reset_part_flags(&map.blk[j]);
256 bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
258 bzb->mount_point[0] = '\0';
259 strcpy ((char *)map.blk[j].pmPartName, "untitled (Scratch)");
260 strcpy ((char *)map.blk[j].pmPartType, "Apple_Scratch"); };
261 option "Free", exit, action {
265 j = map.mblk[map.selected];
266 reset_part_flags(&map.blk[j]);
267 bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
269 bzb->mount_point[0] = '\0';
270 strcpy ((char *)map.blk[j].pmPartName, "untitled (Free)");
271 strcpy ((char *)map.blk[j].pmPartType, "Apple_Free"); };
273 menu mount_point, title "Mount Point?";
274 option "/usr", exit, action {
278 j = map.mblk[map.selected];
279 bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
280 strcpy ((char *)bzb->mount_point, "/usr"); };
281 option "/home", exit, action {
285 j = map.mblk[map.selected];
286 bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
287 strcpy ((char *)bzb->mount_point, "/home"); };
288 option "/var", exit, action {
292 j = map.mblk[map.selected];
293 bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
294 strcpy ((char *)bzb->mount_point, "/var"); };
295 option "/tmp", exit, action {
299 j = map.mblk[map.selected];
300 bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
301 strcpy ((char *)bzb->mount_point, "/tmp"); };
302 option "None", exit, action {
306 j = map.mblk[map.selected];
307 bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
308 bzb->mount_point[0] = '\0'; };
309 option "other", exit, action {
314 msg_display (MSG_custom_mount_point);
315 msg_prompt_add (MSG_mountpoint, NULL, buf, sizeof(buf));
316 j = map.mblk[map.selected];
317 bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
318 if (buf[0] != '\0') {
319 bzb->mount_point[0] = '\0';
321 strcpy ((char *)bzb->mount_point, "/");
322 strcat((char *)bzb->mount_point, buf);
325 menu sanity, title "Choose an option";
326 display action {msg_display (MSG_sanity_check);
328 option "Abort installation", exit, action {yesno = -1; };
329 option "Ignore warnings and continue", exit, action {yesno = 1;};
330 option "Re-edit Disk Partition Map", exit, action {yesno = 0; };
333 * This menu shouldn't be used in the mac68k port, but it needs to be
334 * defined because it's referenced from the toplevel code.