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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
|
/* $NetBSD: menus.md.de,v 1.7 2021/07/24 21:31:39 andvar Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
* All rights reserved.
*
* Written by Philip A. Nelson for Piermont Information Systems Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of Piermont Information Systems Inc. may not be used to endorse
* or promote products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL PIERMONT INFORMATION SYSTEMS INC. BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/* Menu definitions for sysinst. mac68k version, machine dependent. */
menu fullpart, title "Bitte wählen Sie";
option "Nur einen Teil der Festplatte nutzen", exit, action {usefull = 0;};
option "Die ganze Festplatte für NetBSD verwenden", exit, action {usefull = 1;};
menu nodiskmap, title "Bitte wählen Sie", y=16;
display action { msg_fmt_display (MSG_nodiskmap, "%s", pm->diskdev); };
option "Installation abbrechen", exit, action {
endwin(); exit(1);
};
option "Initialisiere Festplatten Partition Übersicht", exit, action {
int i, rv;
msg_clear();
msg_display (MSG_okwritediskmap);
process_menu (MENU_okabort, &rv);
if (!rv) {
endwin();
return 0;
}
map.size = NEW_MAP_SIZE;
map.in_use_cnt = new_map[0].pmMapBlkCnt;
map.blk = (struct apple_part_map_entry *)calloc(map.size,
sizeof(struct apple_part_map_entry));
for (i=0;i<map.size;i++)
memcpy (&map.blk[i], &new_map[i],
sizeof(struct apple_part_map_entry));
};
menu editparttable, title "Wählen Sie eine Partition", exit, y=14;
display action { msg_display (MSG_mac68k_editparttable);
sortmerge();
if (map.selected >= map.usable_cnt)
map.selected = 0;
disp_selected_part (map.selected);
};
option "Nächste Partition auswählen", action {
map.selected += 1;
if (map.selected >= map.usable_cnt)
map.selected = 0;
};
option "Ausgewählte Partition bearbeiten", sub menu chooseid;
option "Mount Point festlegen", sub menu mount_point;
option "Gewählte Partition unterteilen", action {
int i, j, k, size, free_size, rv;
char buf[40];
EBZB *bzb;
j = map.mblk[map.selected];
msg_fmt_display(MSG_split_part, "%s", map.blk[j].pmPartBlkCnt);
msg_prompt_add (MSG_scratch_size, NULL, buf, sizeof(buf));
size = atoi(buf);
if (size > 0 && size < map.blk[j].pmPartBlkCnt) {
k = map.in_use_cnt+1;
if (k <= map.size) {
memcpy (&map.blk[k], &map.blk[j],
sizeof(struct apple_part_map_entry));
free_size = map.blk[j].pmPartBlkCnt - size;
strcpy (map.blk[j].pmPartType, "Apple_Scratch");
map.blk[j].pmPartBlkCnt = size;
map.blk[j].pmDataCnt = size;
bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
bzb->magic = 0;
bzb->mount_point[0] = '\0';
strcpy (map.blk[k].pmPartType, "Apple_Free");
map.blk[k].pmPyPartStart += size;
if ((map.blk[k].pmPyPartStart + free_size) > pm->dlsize)
map.blk[k].pmPartBlkCnt =
pm->dlsize - map.blk[k].pmPyPartStart;
else
map.blk[k].pmPartBlkCnt = free_size;
map.blk[k].pmDataCnt = map.blk[k].pmPartBlkCnt;
bzb = (EBZB *)&map.blk[k].pmBootArgs[0];
bzb->magic = 0;
bzb->mount_point[0] = '\0';
map.in_use_cnt += 1; /* Count new part as usable */
sortmerge();
} else {
msg_display (MSG_diskfull);
process_menu (MENU_okabort, &rv);
if (!rv) {
free (map.blk);
map.size = NEW_MAP_SIZE;
map.in_use_cnt = new_map[0].pmMapBlkCnt;
map.blk = (struct apple_part_map_entry *)calloc(map.size,
sizeof(struct apple_part_map_entry));
for (i=0;i<map.size;i++)
memcpy (&map.blk[i], &new_map[i],
sizeof(struct apple_part_map_entry));
map.blk[0].pmSigPad = 0; /* Don't rewrite Block0 */
}
}
} };
option "Partition korrigieren", action {
int i = map.mblk[map.selected];
EBZB *bzb = (EBZB *)&map.blk[i].pmBootArgs[0];
msg_fmt_display(MSG_partdebug, "%s%c%d%d",
pm->diskdev, bzb->flags.part, map.blk[i].pmPyPartStart,
map.blk[i].pmPartBlkCnt);
if ((map.blk[i].pmPyPartStart +
map.blk[i].pmPartBlkCnt) > pm->dlsize) {
msg_fmt_display_add(MSG_parttable_fix_fixing,
"%s%c", pm->diskdev, bzb->flags.part);
map.blk[i].pmPartBlkCnt =
pm->dlsize - map.blk[i].pmPyPartStart;
map.blk[i].pmDataCnt =
map.blk[i].pmPartBlkCnt;
} else {
msg_fmt_display_add(MSG_parttable_fix_fine, "%s%c",
pm->diskdev, bzb->flags.part);
}
process_menu(MENU_ok, NULL);
};
menu ok2, title "Abbrechen?", y=17;
option "OK", exit, action { };
menu okabort, title "Was möchten Sie?", y=17;
option "Fortfahren", exit, action { *((int*)arg) = 1; };
option "Installation abbrechen", exit, action { *((int*)arg) = 0; };
menu chooseid, title "Partitionstyp?";
option "NetBSD Root", exit, action {
int i, j;
EBZB *bzb;
j = map.mblk[map.selected];
reset_part_flags(&map.blk[j]);
bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
bzb->magic = APPLE_BZB_MAGIC;
strcpy (map.blk[j].pmPartName, "NetBSD Root");
strcpy (map.blk[j].pmPartType, "Apple_Unix_SVR2");
bzb->type = APPLE_BZB_TYPEFS;
bzb->flags.root = 1;
/*
* Automatically determine root mount points. The first
* root-type filesystem is mounted on "/", all others
* will mount on "/altroot". If there are multiple
* occurrences of "/altroot" they will be picked up on
* the sanity_scan in the next step of the installation.
*/
for (i=0,map.root_cnt=0;i<map.usable_cnt;i++) {
j = map.mblk[i];
if (whichType(&map.blk[j]) == ROOT_PART) {
bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
if (bzb->type == APPLE_BZB_TYPEFS && bzb->flags.root) {
if (map.root_cnt++ == 0)
strcpy (bzb->mount_point, "/");
else
strcpy (bzb->mount_point, "/altroot");
}
}
} };
option "NetBSD SWAP", exit, action {
int j;
EBZB *bzb;
j = map.mblk[map.selected];
reset_part_flags(&map.blk[j]);
bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
bzb->magic = APPLE_BZB_MAGIC;
strcpy (map.blk[j].pmPartName, "NetBSD SWAP");
strcpy (map.blk[j].pmPartType, "Apple_Unix_SVR2");
bzb->type = APPLE_BZB_TYPESWAP; };
option "NetBSD Usr", exit, action {
int j;
EBZB *bzb;
j = map.mblk[map.selected];
reset_part_flags(&map.blk[j]);
bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
bzb->magic = APPLE_BZB_MAGIC;
strcpy (map.blk[j].pmPartName, "NetBSD Usr");
strcpy (map.blk[j].pmPartType, "Apple_Unix_SVR2");
bzb->type = APPLE_BZB_TYPEFS;
bzb->flags.usr = 1;
if (map.usr_cnt++ == 0)
strcpy (bzb->mount_point, "/usr");
};
option "NetBSD Root&Usr", exit, action {
int j;
EBZB *bzb;
j = map.mblk[map.selected];
reset_part_flags(&map.blk[j]);
bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
bzb->magic = APPLE_BZB_MAGIC;
strcpy (map.blk[j].pmPartName, "NetBSD Root & Usr");
strcpy (map.blk[j].pmPartType, "Apple_Unix_SVR2");
bzb->type = APPLE_BZB_TYPEFS;
bzb->flags.root = 1;
bzb->flags.usr = 1;
if (map.root_cnt++ == 0)
strcpy (bzb->mount_point, "/");
else {
if (map.usr_cnt++ == 0)
strcpy (bzb->mount_point, "/usr");
} };
option "MacOS HFS", exit, action {
int j;
EBZB *bzb;
j = map.mblk[map.selected];
reset_part_flags(&map.blk[j]);
bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
bzb->magic = 0;
bzb->mount_point[0] = '\0';
strcpy (map.blk[j].pmPartName, "unbetitelt (HFS)");
strcpy (map.blk[j].pmPartType, "Apple_HFS"); };
option "Scratch", exit, action {
int j;
EBZB *bzb;
j = map.mblk[map.selected];
reset_part_flags(&map.blk[j]);
bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
bzb->magic = 0;
bzb->mount_point[0] = '\0';
strcpy (map.blk[j].pmPartName, "unbetitelt (Scratch)");
strcpy (map.blk[j].pmPartType, "Apple_Scratch"); };
option "Frei", exit, action {
int j;
EBZB *bzb;
j = map.mblk[map.selected];
reset_part_flags(&map.blk[j]);
bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
bzb->magic = 0;
bzb->mount_point[0] = '\0';
strcpy (map.blk[j].pmPartName, "unbetitelt (frei)");
strcpy (map.blk[j].pmPartType, "Apple_Free"); };
menu mount_point, title "Mount Point?";
option "/usr", exit, action {
int j;
EBZB *bzb;
j = map.mblk[map.selected];
bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
strcpy (bzb->mount_point, "/usr"); };
option "/home", exit, action {
int j;
EBZB *bzb;
j = map.mblk[map.selected];
bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
strcpy (bzb->mount_point, "/home"); };
option "/var", exit, action {
int j;
EBZB *bzb;
j = map.mblk[map.selected];
bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
strcpy (bzb->mount_point, "/var"); };
option "/tmp", exit, action {
int j;
EBZB *bzb;
j = map.mblk[map.selected];
bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
strcpy (bzb->mount_point, "/tmp"); };
option "Keiner", exit, action {
int j;
EBZB *bzb;
j = map.mblk[map.selected];
bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
bzb->mount_point[0] = '\0'; };
option "Sonstige", exit, action {
int j;
char buf[60];
EBZB *bzb;
msg_display (MSG_custom_mount_point);
msg_prompt_add (MSG_mountpoint, NULL, buf, sizeof(buf));
j = map.mblk[map.selected];
bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
if (buf[0] != '\0') {
bzb->mount_point[0] = '\0';
if (buf[0] != '/')
strcpy (bzb->mount_point, "/");
strcat(bzb->mount_point, buf);
} };
menu sanity, title "Bitte wählen Sie";
display action {msg_display (MSG_sanity_check);
report_errors(); };
option "Installation abbrechen", exit, action { *((int*)arg) = -1; };
option "Warnungen ignorieren und fortfahren", exit, action { *((int*)arg) = 1;};
option "Festplatten Partitions Übersicht erneut ändern", exit, action { *((int*)arg) = 0; };
/*
* This menu shouldn't be used in the mac68k port, but it needs to be
* defined because it's referenced from the toplevel code.
*/
|