No empty .Rs/.Re
[netbsd-mini2440.git] / distrib / utils / sysinst / arch / mac68k / menus.md.pl
blobbb9944c3062ef34de2660364104045da0325fb1f
1 /* $NetBSD: menus.md.pl,v 1.8 2008/05/24 21:42:52 hauke Exp $ */
2 /* Based on english version: */
3 /* NetBSD: menus.md.en,v 1.13 2001/11/29 23:20:58 thorpej Exp */
5 /*
6 * Copyright 1997 Piermont Information Systems Inc.
7 * All rights reserved.
9 * Written by Philip A. Nelson for Piermont Information Systems Inc.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 * 3. All advertising materials mentioning features or use of this software
20 * must display the following acknowledgement:
21 * This product includes software developed for the NetBSD Project by
22 * Piermont Information Systems Inc.
23 * 4. The name of Piermont Information Systems Inc. may not be used to endorse
24 * or promote products derived from this software without specific prior
25 * written permission.
27 * THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``AS IS''
28 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 * ARE DISCLAIMED. IN NO EVENT SHALL PIERMONT INFORMATION SYSTEMS INC. BE
31 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
37 * THE POSSIBILITY OF SUCH DAMAGE.
41 /* Menu definitions for sysinst. mac68k version, machine dependent. */
43 menu fullpart, title "Wybierz";
44 option "Uzyj tylko czesci dysku", exit, action {usefull = 0;};
45 option "Uzyj calego dysku", exit, action {usefull = 1;};
47 menu nodiskmap, title "Wybierz opcje", y=16;
48 display action { msg_display (MSG_nodiskmap, diskdev); };
49 option "Przerwij instalacje", exit, action {
50 endwin(); exit(1);
52 option "Zainicjuj Mape partycji Dysku", exit, action {
53 int i;
55 msg_clear();
56 msg_display (MSG_okwritediskmap);
57 process_menu (MENU_okabort, NULL);
58 if (!yesno) {
59 endwin();
60 return 0;
62 map.size = NEW_MAP_SIZE;
63 map.in_use_cnt = new_map[0].pmMapBlkCnt;
64 map.blk = (struct apple_part_map_entry *)calloc(map.size,
65 sizeof(struct apple_part_map_entry));
66 for (i=0;i<map.size;i++)
67 memcpy (&map.blk[i], &new_map[i],
68 sizeof(struct apple_part_map_entry));
71 menu editparttable, title "Wybierz swoje partycje", exit, y=14;
72 display action { msg_display (MSG_editparttable);
73 sortmerge();
74 if (map.selected >= map.usable_cnt)
75 map.selected = 0;
76 disp_selected_part (map.selected);
78 option "Wybierz nastepna partycje", action {
79 map.selected += 1;
80 if (map.selected >= map.usable_cnt)
81 map.selected = 0;
83 option "Zmien wybrana partycje", sub menu chooseid;
84 option "Ustaw punkt montazu dla partycji", sub menu mount_point;
85 option "Podziel wybrana partycje", action {
86 int i, j, k, size, free_size;
87 char buf[40];
88 EBZB *bzb;
90 j = map.mblk[map.selected];
91 msg_display(MSG_split_part, map.blk[j].pmPartBlkCnt);
92 msg_prompt_add (MSG_scratch_size, NULL, buf, sizeof(buf));
93 size = atoi(buf);
94 if (size > 0 && size < map.blk[j].pmPartBlkCnt) {
95 k = map.in_use_cnt+1;
96 if (k <= map.size) {
97 memcpy (&map.blk[k], &map.blk[j],
98 sizeof(struct apple_part_map_entry));
99 free_size = map.blk[j].pmPartBlkCnt - size;
100 strcpy (map.blk[j].pmPartType, "Apple_Scratch");
101 map.blk[j].pmPartBlkCnt = size;
102 map.blk[j].pmDataCnt = size;
103 bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
104 bzb->magic = 0;
105 bzb->mount_point[0] = '\0';
106 strcpy (map.blk[k].pmPartType, "Apple_Free");
107 map.blk[k].pmPyPartStart += size;
108 if ((map.blk[k].pmPyPartStart + free_size) > dlsize)
109 map.blk[k].pmPartBlkCnt =
110 dlsize - map.blk[k].pmPyPartStart;
111 else
112 map.blk[k].pmPartBlkCnt = free_size;
113 map.blk[k].pmDataCnt = map.blk[k].pmPartBlkCnt;
114 bzb = (EBZB *)&map.blk[k].pmBootArgs[0];
115 bzb->magic = 0;
116 bzb->mount_point[0] = '\0';
117 map.in_use_cnt += 1; /* Count new part as usable */
118 sortmerge();
119 } else {
120 msg_display (MSG_diskfull);
121 process_menu (MENU_okabort, NULL);
122 if (!yesno) {
123 free (map.blk);
124 map.size = NEW_MAP_SIZE;
125 map.in_use_cnt = new_map[0].pmMapBlkCnt;
126 map.blk = (struct apple_part_map_entry *)calloc(map.size,
127 sizeof(struct apple_part_map_entry));
128 for (i=0;i<map.size;i++)
129 memcpy (&map.blk[i], &new_map[i],
130 sizeof(struct apple_part_map_entry));
131 map.blk[0].pmSigPad = 0; /* Don't rewrite Block0 */
134 } };
135 option "Napraw wybrana partycje", action {
136 int i = map.mblk[map.selected];
137 EBZB *bzb = (EBZB *)&map.blk[i].pmBootArgs[0];
138 msg_display(MSG_partdebug, diskdev, bzb->flags.part,
139 map.blk[i].pmPyPartStart,
140 map.blk[i].pmPartBlkCnt);
141 if ((map.blk[i].pmPyPartStart +
142 map.blk[i].pmPartBlkCnt) > dlsize) {
143 msg_display_add(MSG_parttable_fix_fixing,
144 diskdev, bzb->flags.part);
145 map.blk[i].pmPartBlkCnt =
146 dlsize - map.blk[i].pmPyPartStart;
147 map.blk[i].pmDataCnt =
148 map.blk[i].pmPartBlkCnt;
149 } else {
150 msg_display_add(MSG_parttable_fix_fine,
151 diskdev, bzb->flags.part);
153 process_menu(MENU_ok, NULL);
157 menu ok2, title "Przerwac?", y=17;
158 option "OK", exit, action { };
160 menu okabort, title "Co chcesz zrobic?";
161 option "OK", exit, action { yesno = 1; };
162 option "Przerwac instalacje", exit, action { yesno = 0; };
164 menu chooseid, title "Rodzaj partycji?";
165 option "NetBSD Root", exit, action {
166 int i, j;
167 EBZB *bzb;
169 j = map.mblk[map.selected];
170 reset_part_flags(&map.blk[j]);
171 bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
172 bzb->magic = APPLE_BZB_MAGIC;
173 strcpy (map.blk[j].pmPartName, "NetBSD Root");
174 strcpy (map.blk[j].pmPartType, "Apple_Unix_SVR2");
175 bzb->type = APPLE_BZB_TYPEFS;
176 bzb->flags.root = 1;
178 * Automatically determine root mount points. The first
179 * root-type filesystem is mounted on "/", all others
180 * will mount on "/altroot". If there are multiple
181 * occurances of "/altroot" they will be picked up on
182 * the sanity_scan in the next step of the installation.
184 for (i=0,map.root_cnt=0;i<map.usable_cnt;i++) {
185 j = map.mblk[i];
186 if (whichType(&map.blk[j]) == ROOT_PART) {
187 bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
188 if (bzb->type == APPLE_BZB_TYPEFS && bzb->flags.root) {
189 if (map.root_cnt++ == 0)
190 strcpy (bzb->mount_point, "/");
191 else
192 strcpy (bzb->mount_point, "/altroot");
195 } };
196 option "NetBSD SWAP", exit, action {
197 int j;
198 EBZB *bzb;
200 j = map.mblk[map.selected];
201 reset_part_flags(&map.blk[j]);
202 bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
203 bzb->magic = APPLE_BZB_MAGIC;
204 strcpy (map.blk[j].pmPartName, "NetBSD SWAP");
205 strcpy (map.blk[j].pmPartType, "Apple_Unix_SVR2");
206 bzb->type = APPLE_BZB_TYPESWAP; };
207 option "NetBSD Usr", exit, action {
208 int j;
209 EBZB *bzb;
211 j = map.mblk[map.selected];
212 reset_part_flags(&map.blk[j]);
213 bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
214 bzb->magic = APPLE_BZB_MAGIC;
215 strcpy (map.blk[j].pmPartName, "NetBSD Usr");
216 strcpy (map.blk[j].pmPartType, "Apple_Unix_SVR2");
217 bzb->type = APPLE_BZB_TYPEFS;
218 bzb->flags.usr = 1;
219 if (map.usr_cnt++ == 0)
220 strcpy (bzb->mount_point, "/usr");
222 option "NetBSD Root&Usr", exit, action {
223 int j;
224 EBZB *bzb;
226 j = map.mblk[map.selected];
227 reset_part_flags(&map.blk[j]);
228 bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
229 bzb->magic = APPLE_BZB_MAGIC;
230 strcpy (map.blk[j].pmPartName, "NetBSD Root & Usr");
231 strcpy (map.blk[j].pmPartType, "Apple_Unix_SVR2");
232 bzb->type = APPLE_BZB_TYPEFS;
233 bzb->flags.root = 1;
234 bzb->flags.usr = 1;
235 if (map.root_cnt++ == 0)
236 strcpy (bzb->mount_point, "/");
237 else {
238 if (map.usr_cnt++ == 0)
239 strcpy (bzb->mount_point, "/usr");
240 } };
241 option "MacOS HFS", exit, action {
242 int j;
243 EBZB *bzb;
245 j = map.mblk[map.selected];
246 reset_part_flags(&map.blk[j]);
247 bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
248 bzb->magic = 0;
249 bzb->mount_point[0] = '\0';
250 strcpy (map.blk[j].pmPartName, "untitled (HFS)");
251 strcpy (map.blk[j].pmPartType, "Apple_HFS"); };
252 option "Scratch", exit, action {
253 int j;
254 EBZB *bzb;
256 j = map.mblk[map.selected];
257 reset_part_flags(&map.blk[j]);
258 bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
259 bzb->magic = 0;
260 bzb->mount_point[0] = '\0';
261 strcpy (map.blk[j].pmPartName, "untitled (Scratch)");
262 strcpy (map.blk[j].pmPartType, "Apple_Scratch"); };
263 option "Free", exit, action {
264 int j;
265 EBZB *bzb;
267 j = map.mblk[map.selected];
268 reset_part_flags(&map.blk[j]);
269 bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
270 bzb->magic = 0;
271 bzb->mount_point[0] = '\0';
272 strcpy (map.blk[j].pmPartName, "untitled (Free)");
273 strcpy (map.blk[j].pmPartType, "Apple_Free"); };
275 menu mount_point, title "Punkt montazu?";
276 option "/usr", exit, action {
277 int j;
278 EBZB *bzb;
280 j = map.mblk[map.selected];
281 bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
282 strcpy (bzb->mount_point, "/usr"); };
283 option "/home", exit, action {
284 int j;
285 EBZB *bzb;
287 j = map.mblk[map.selected];
288 bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
289 strcpy (bzb->mount_point, "/home"); };
290 option "/var", exit, action {
291 int j;
292 EBZB *bzb;
294 j = map.mblk[map.selected];
295 bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
296 strcpy (bzb->mount_point, "/var"); };
297 option "/tmp", exit, action {
298 int j;
299 EBZB *bzb;
301 j = map.mblk[map.selected];
302 bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
303 strcpy (bzb->mount_point, "/tmp"); };
304 option "Zaden", exit, action {
305 int j;
306 EBZB *bzb;
308 j = map.mblk[map.selected];
309 bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
310 bzb->mount_point[0] = '\0'; };
311 option "inny", exit, action {
312 int j;
313 char buf[60];
314 EBZB *bzb;
316 msg_display (MSG_custom_mount_point);
317 msg_prompt_add (MSG_mountpoint, NULL, buf, sizeof(buf));
318 j = map.mblk[map.selected];
319 bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
320 if (buf[0] != '\0') {
321 bzb->mount_point[0] = '\0';
322 if (buf[0] != '/')
323 strcpy (bzb->mount_point, "/");
324 strcat(bzb->mount_point, buf);
325 } };
327 menu sanity, title "Wybierz opcje";
328 display action {msg_display (MSG_sanity_check);
329 report_errors(); };
330 option "Przerwij instalacje", exit, action {yesno = -1; };
331 option "Zignoruj ostrzezenia i kontynuuj", exit, action {yesno = 1;};
332 option "Ponownie wyedytuj mape partycji dysku", exit, action {yesno = 0; };
335 * This menu shouldn't be used in the mac68k port, but it needs to be
336 * defined because it's referenced from the toplevel code.