Home | History | Annotate | Line # | Download | only in mac68k
menus.md.de revision 1.4.16.1
      1  1.4.16.1    martin /*	$NetBSD: menus.md.de,v 1.4.16.1 2020/04/13 08:06:03 martin Exp $	*/
      2       1.1  dholland 
      3       1.1  dholland /*
      4       1.1  dholland  * Copyright 1997 Piermont Information Systems Inc.
      5       1.1  dholland  * All rights reserved.
      6       1.1  dholland  *
      7       1.1  dholland  * Written by Philip A. Nelson for Piermont Information Systems Inc.
      8       1.1  dholland  *
      9       1.1  dholland  * Redistribution and use in source and binary forms, with or without
     10       1.1  dholland  * modification, are permitted provided that the following conditions
     11       1.1  dholland  * are met:
     12       1.1  dholland  * 1. Redistributions of source code must retain the above copyright
     13       1.1  dholland  *    notice, this list of conditions and the following disclaimer.
     14       1.1  dholland  * 2. Redistributions in binary form must reproduce the above copyright
     15       1.1  dholland  *    notice, this list of conditions and the following disclaimer in the
     16       1.1  dholland  *    documentation and/or other materials provided with the distribution.
     17       1.1  dholland  * 3. The name of Piermont Information Systems Inc. may not be used to endorse
     18       1.1  dholland  *    or promote products derived from this software without specific prior
     19       1.1  dholland  *    written permission.
     20       1.1  dholland  *
     21       1.1  dholland  * THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``AS IS''
     22       1.1  dholland  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23       1.1  dholland  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24       1.1  dholland  * ARE DISCLAIMED. IN NO EVENT SHALL PIERMONT INFORMATION SYSTEMS INC. BE
     25       1.1  dholland  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     26       1.1  dholland  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     27       1.1  dholland  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     28       1.1  dholland  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     29       1.1  dholland  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     30       1.1  dholland  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     31       1.1  dholland  * THE POSSIBILITY OF SUCH DAMAGE.
     32       1.1  dholland  *
     33       1.1  dholland  */
     34       1.1  dholland 
     35       1.1  dholland /* Menu definitions for sysinst. mac68k version, machine dependent. */
     36       1.1  dholland 
     37       1.1  dholland menu fullpart, title  "Bitte whlen Sie";
     38       1.1  dholland 	option "Nur einen Teil der Festplatte nutzen",      exit, action  {usefull = 0;};
     39       1.1  dholland 	option "Die ganze Festplatte fr NetBSD verwenden", exit, action  {usefull = 1;};
     40       1.1  dholland 
     41       1.1  dholland menu nodiskmap, title "Bitte whlen Sie", y=16;
     42  1.4.16.1    martin 	display action { msg_fmt_display (MSG_nodiskmap, "%s", pm->diskdev); };
     43       1.1  dholland 	option "Installation abbrechen", exit, action {
     44       1.1  dholland 		endwin();  exit(1);
     45       1.1  dholland 	};
     46       1.1  dholland 	option "Initialisiere Festplatten Partition bersicht", exit, action {
     47       1.4    martin 		int i, rv;
     48       1.1  dholland 
     49       1.1  dholland 		msg_clear();
     50       1.1  dholland 		msg_display (MSG_okwritediskmap);
     51       1.4    martin 		process_menu (MENU_okabort, &rv);
     52       1.4    martin 		if (!rv) {
     53       1.1  dholland 		    endwin();
     54       1.1  dholland 		    return 0;
     55       1.1  dholland 		}
     56       1.1  dholland 		map.size = NEW_MAP_SIZE;
     57       1.1  dholland 		map.in_use_cnt = new_map[0].pmMapBlkCnt;
     58       1.1  dholland 		map.blk = (struct apple_part_map_entry *)calloc(map.size,
     59       1.1  dholland 			sizeof(struct apple_part_map_entry));
     60       1.1  dholland 		for (i=0;i<map.size;i++)
     61       1.1  dholland 		    memcpy (&map.blk[i], &new_map[i],
     62       1.1  dholland 			 sizeof(struct apple_part_map_entry));
     63       1.1  dholland 	};
     64       1.1  dholland 
     65       1.1  dholland menu editparttable, title  "Whlen Sie eine Partition", exit, y=14;
     66  1.4.16.1    martin 	display action  { msg_display (MSG_mac68k_editparttable);
     67       1.1  dholland 			  sortmerge();
     68       1.1  dholland 			  if (map.selected >= map.usable_cnt)
     69       1.1  dholland 				map.selected = 0;
     70       1.1  dholland 			  disp_selected_part (map.selected);
     71       1.1  dholland 			};
     72       1.1  dholland 	option "Nchste Partition auswhlen",  action {
     73       1.1  dholland 		map.selected += 1;
     74       1.1  dholland 		if (map.selected >= map.usable_cnt)
     75       1.1  dholland 			map.selected = 0;
     76       1.1  dholland 		};
     77       1.1  dholland 	option "Ausgewhlte Partition bearbeiten", sub menu chooseid;
     78       1.1  dholland 	option "Mount Point festlegen", sub menu mount_point;
     79       1.1  dholland 	option "Gewhlte Partition unterteilen", action {
     80       1.4    martin 		int i, j, k, size, free_size, rv;
     81       1.1  dholland 		char buf[40];
     82       1.1  dholland 		EBZB *bzb;
     83       1.1  dholland 
     84       1.1  dholland 		j = map.mblk[map.selected];
     85  1.4.16.1    martin 		msg_fmt_display(MSG_split_part, "%s", map.blk[j].pmPartBlkCnt);
     86       1.1  dholland 		msg_prompt_add (MSG_scratch_size, NULL, buf, sizeof(buf));
     87       1.1  dholland 		size = atoi(buf);
     88       1.1  dholland 		if (size > 0 && size < map.blk[j].pmPartBlkCnt) {
     89       1.1  dholland 		    k = map.in_use_cnt+1;
     90       1.1  dholland 		    if (k <= map.size) {
     91       1.1  dholland 			memcpy (&map.blk[k], &map.blk[j],
     92       1.1  dholland 			    sizeof(struct apple_part_map_entry));
     93       1.1  dholland 			free_size = map.blk[j].pmPartBlkCnt - size;
     94       1.1  dholland 			strcpy (map.blk[j].pmPartType, "Apple_Scratch");
     95       1.1  dholland 			map.blk[j].pmPartBlkCnt = size;
     96       1.1  dholland 			map.blk[j].pmDataCnt = size;
     97       1.1  dholland 			bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
     98       1.1  dholland 			bzb->magic = 0;
     99       1.1  dholland 			bzb->mount_point[0] = '\0';
    100       1.1  dholland 			strcpy (map.blk[k].pmPartType, "Apple_Free");
    101       1.1  dholland 			map.blk[k].pmPyPartStart += size;
    102       1.2    martin 			if ((map.blk[k].pmPyPartStart + free_size) > pm->dlsize)
    103       1.1  dholland 			    map.blk[k].pmPartBlkCnt =
    104       1.2    martin 				pm->dlsize - map.blk[k].pmPyPartStart;
    105       1.1  dholland 			else
    106       1.1  dholland 			    map.blk[k].pmPartBlkCnt = free_size;
    107       1.1  dholland 			map.blk[k].pmDataCnt = map.blk[k].pmPartBlkCnt;
    108       1.1  dholland 			bzb = (EBZB *)&map.blk[k].pmBootArgs[0];
    109       1.1  dholland 			bzb->magic = 0;
    110       1.1  dholland 			bzb->mount_point[0] = '\0';
    111       1.1  dholland 			map.in_use_cnt += 1;	/* Count new part as usable */
    112       1.1  dholland 			sortmerge();
    113       1.1  dholland 		    } else {
    114       1.1  dholland 			msg_display (MSG_diskfull);
    115       1.4    martin 			process_menu (MENU_okabort, &rv);
    116       1.4    martin 			if (!rv) {
    117       1.1  dholland 			    free (map.blk);
    118       1.1  dholland 			    map.size = NEW_MAP_SIZE;
    119       1.1  dholland 			    map.in_use_cnt = new_map[0].pmMapBlkCnt;
    120       1.1  dholland 			    map.blk = (struct apple_part_map_entry *)calloc(map.size,
    121       1.1  dholland 				sizeof(struct apple_part_map_entry));
    122       1.1  dholland 			    for (i=0;i<map.size;i++)
    123       1.1  dholland 				memcpy (&map.blk[i], &new_map[i],
    124       1.1  dholland 				    sizeof(struct apple_part_map_entry));
    125       1.1  dholland 			    map.blk[0].pmSigPad = 0; /* Don't rewrite Block0 */
    126       1.1  dholland 			}
    127       1.1  dholland 		    }
    128       1.1  dholland 		} };
    129       1.1  dholland 	option "Partition korrigieren", action {
    130       1.1  dholland 		int i = map.mblk[map.selected];
    131       1.1  dholland 		EBZB *bzb = (EBZB *)&map.blk[i].pmBootArgs[0];
    132  1.4.16.1    martin 		msg_fmt_display(MSG_partdebug, "%s%c%d%d",
    133  1.4.16.1    martin 		    pm->diskdev, bzb->flags.part, map.blk[i].pmPyPartStart,
    134  1.4.16.1    martin 		    map.blk[i].pmPartBlkCnt);
    135       1.1  dholland 		if ((map.blk[i].pmPyPartStart +
    136       1.2    martin 		    map.blk[i].pmPartBlkCnt) > pm->dlsize) {
    137  1.4.16.1    martin 			msg_fmt_display_add(MSG_parttable_fix_fixing,
    138  1.4.16.1    martin 			    "%s%c", pm->diskdev, bzb->flags.part);
    139       1.1  dholland 			map.blk[i].pmPartBlkCnt =
    140       1.2    martin 			    pm->dlsize - map.blk[i].pmPyPartStart;
    141       1.1  dholland 			map.blk[i].pmDataCnt =
    142       1.1  dholland 			    map.blk[i].pmPartBlkCnt;
    143       1.1  dholland 		} else {
    144  1.4.16.1    martin 		    msg_fmt_display_add(MSG_parttable_fix_fine, "%s%c",
    145       1.2    martin 			pm->diskdev, bzb->flags.part);
    146       1.1  dholland 		}
    147       1.1  dholland 		process_menu(MENU_ok, NULL);
    148       1.1  dholland 		};
    149       1.1  dholland 
    150       1.1  dholland 
    151       1.1  dholland menu ok2, title "Abbrechen?", y=17;
    152       1.1  dholland        option "OK", exit, action { };
    153       1.1  dholland 
    154       1.1  dholland menu okabort, title "Was mchten Sie?", y=17;
    155       1.3    martin 	option "Fortfahren", exit, action { *((int*)arg) = 1; };
    156       1.3    martin 	option "Installation abbrechen", exit, action { *((int*)arg) = 0; };
    157       1.1  dholland 
    158       1.1  dholland menu chooseid, title  "Partitionstyp?";
    159       1.1  dholland 	option "NetBSD Root", exit, action {
    160       1.1  dholland 		int i, j;
    161       1.1  dholland 		EBZB *bzb;
    162       1.1  dholland 
    163       1.1  dholland 		j = map.mblk[map.selected];
    164       1.1  dholland 		reset_part_flags(&map.blk[j]);
    165       1.1  dholland 		bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
    166       1.1  dholland 		bzb->magic = APPLE_BZB_MAGIC;
    167       1.1  dholland 		strcpy (map.blk[j].pmPartName, "NetBSD Root");
    168       1.1  dholland 		strcpy (map.blk[j].pmPartType, "Apple_Unix_SVR2");
    169       1.1  dholland 		bzb->type = APPLE_BZB_TYPEFS;
    170       1.1  dholland 		bzb->flags.root = 1;
    171       1.1  dholland 		/*
    172       1.1  dholland 		 * Automatically determine root mount points.  The first
    173       1.1  dholland 		 *  root-type filesystem is mounted on "/", all others
    174       1.1  dholland 		 *  will mount on "/altroot".  If there are multiple
    175       1.1  dholland 		 *  occurances of "/altroot" they will be picked up on
    176       1.1  dholland 		 *  the sanity_scan in the next step of the installation.
    177       1.1  dholland 		 */
    178       1.1  dholland 		for (i=0,map.root_cnt=0;i<map.usable_cnt;i++) {
    179       1.1  dholland 		    j = map.mblk[i];
    180       1.1  dholland 		    if (whichType(&map.blk[j]) == ROOT_PART) {
    181       1.1  dholland 			bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
    182       1.1  dholland 			if (bzb->type == APPLE_BZB_TYPEFS && bzb->flags.root) {
    183       1.1  dholland 			   if (map.root_cnt++ == 0)
    184       1.1  dholland 				strcpy (bzb->mount_point, "/");
    185       1.1  dholland 			   else
    186       1.1  dholland 				strcpy (bzb->mount_point, "/altroot");
    187       1.1  dholland 			}
    188       1.1  dholland 		    }
    189       1.1  dholland 		} };
    190       1.1  dholland 	option "NetBSD SWAP", exit, action {
    191       1.1  dholland 		int j;
    192       1.1  dholland 		EBZB *bzb;
    193       1.1  dholland 
    194       1.1  dholland 		j = map.mblk[map.selected];
    195       1.1  dholland 		reset_part_flags(&map.blk[j]);
    196       1.1  dholland 		bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
    197       1.1  dholland 		bzb->magic = APPLE_BZB_MAGIC;
    198       1.1  dholland 		strcpy (map.blk[j].pmPartName, "NetBSD SWAP");
    199       1.1  dholland 		strcpy (map.blk[j].pmPartType, "Apple_Unix_SVR2");
    200       1.1  dholland 		bzb->type = APPLE_BZB_TYPESWAP; };
    201       1.1  dholland 	option "NetBSD Usr", exit, action {
    202       1.1  dholland 		int j;
    203       1.1  dholland 		EBZB *bzb;
    204       1.1  dholland 
    205       1.1  dholland 		j = map.mblk[map.selected];
    206       1.1  dholland 		reset_part_flags(&map.blk[j]);
    207       1.1  dholland 		bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
    208       1.1  dholland 		bzb->magic = APPLE_BZB_MAGIC;
    209       1.1  dholland 		strcpy (map.blk[j].pmPartName, "NetBSD Usr");
    210       1.1  dholland 		strcpy (map.blk[j].pmPartType, "Apple_Unix_SVR2");
    211       1.1  dholland 		bzb->type = APPLE_BZB_TYPEFS;
    212       1.1  dholland 		bzb->flags.usr = 1;
    213       1.1  dholland 		if (map.usr_cnt++ == 0)
    214       1.1  dholland 		    strcpy (bzb->mount_point, "/usr");
    215       1.1  dholland 		};
    216       1.1  dholland 	option "NetBSD Root&Usr", exit, action {
    217       1.1  dholland 		int j;
    218       1.1  dholland 		EBZB *bzb;
    219       1.1  dholland 
    220       1.1  dholland 		j = map.mblk[map.selected];
    221       1.1  dholland 		reset_part_flags(&map.blk[j]);
    222       1.1  dholland 		bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
    223       1.1  dholland 		bzb->magic = APPLE_BZB_MAGIC;
    224       1.1  dholland 		strcpy (map.blk[j].pmPartName, "NetBSD Root & Usr");
    225       1.1  dholland 		strcpy (map.blk[j].pmPartType, "Apple_Unix_SVR2");
    226       1.1  dholland 		bzb->type = APPLE_BZB_TYPEFS;
    227       1.1  dholland 		bzb->flags.root = 1;
    228       1.1  dholland 		bzb->flags.usr = 1;
    229       1.1  dholland 		if (map.root_cnt++ == 0)
    230       1.1  dholland 		    strcpy (bzb->mount_point, "/");
    231       1.1  dholland 		else {
    232       1.1  dholland 		    if (map.usr_cnt++ == 0)
    233       1.1  dholland 			strcpy (bzb->mount_point, "/usr");
    234       1.1  dholland 		} };
    235       1.1  dholland 	option "MacOS HFS", exit, action {
    236       1.1  dholland 		int j;
    237       1.1  dholland 		EBZB *bzb;
    238       1.1  dholland 
    239       1.1  dholland 		j = map.mblk[map.selected];
    240       1.1  dholland 		reset_part_flags(&map.blk[j]);
    241       1.1  dholland 		bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
    242       1.1  dholland 		bzb->magic = 0;
    243       1.1  dholland 		bzb->mount_point[0] = '\0';
    244       1.1  dholland 		strcpy (map.blk[j].pmPartName, "unbetitelt (HFS)");
    245       1.1  dholland 		strcpy (map.blk[j].pmPartType, "Apple_HFS"); };
    246       1.1  dholland 	option "Scratch", exit, action {
    247       1.1  dholland 		int j;
    248       1.1  dholland 		EBZB *bzb;
    249       1.1  dholland 
    250       1.1  dholland 		j = map.mblk[map.selected];
    251       1.1  dholland 		reset_part_flags(&map.blk[j]);
    252       1.1  dholland 		bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
    253       1.1  dholland 		bzb->magic = 0;
    254       1.1  dholland 		bzb->mount_point[0] = '\0';
    255       1.1  dholland 		strcpy (map.blk[j].pmPartName, "unbetitelt (Scratch)");
    256       1.1  dholland 		strcpy (map.blk[j].pmPartType, "Apple_Scratch"); };
    257       1.1  dholland 	option "Frei", exit, action {
    258       1.1  dholland 		int j;
    259       1.1  dholland 		EBZB *bzb;
    260       1.1  dholland 
    261       1.1  dholland 		j = map.mblk[map.selected];
    262       1.1  dholland 		reset_part_flags(&map.blk[j]);
    263       1.1  dholland 		bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
    264       1.1  dholland 		bzb->magic = 0;
    265       1.1  dholland 		bzb->mount_point[0] = '\0';
    266       1.1  dholland 		strcpy (map.blk[j].pmPartName, "unbetitelt (frei)");
    267       1.1  dholland 		strcpy (map.blk[j].pmPartType, "Apple_Free"); };
    268       1.1  dholland 
    269       1.1  dholland menu mount_point, title  "Mount Point?";
    270       1.1  dholland 	option "/usr", exit, action {
    271       1.1  dholland 		int j;
    272       1.1  dholland 		EBZB *bzb;
    273       1.1  dholland 
    274       1.1  dholland 		j = map.mblk[map.selected];
    275       1.1  dholland 		bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
    276       1.1  dholland 		strcpy (bzb->mount_point, "/usr"); };
    277       1.1  dholland 	option "/home", exit, action {
    278       1.1  dholland 		int j;
    279       1.1  dholland 		EBZB *bzb;
    280       1.1  dholland 
    281       1.1  dholland 		j = map.mblk[map.selected];
    282       1.1  dholland 		bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
    283       1.1  dholland 		strcpy (bzb->mount_point, "/home"); };
    284       1.1  dholland 	option "/var", exit, action {
    285       1.1  dholland 		int j;
    286       1.1  dholland 		EBZB *bzb;
    287       1.1  dholland 
    288       1.1  dholland 		j = map.mblk[map.selected];
    289       1.1  dholland 		bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
    290       1.1  dholland 		strcpy (bzb->mount_point, "/var"); };
    291       1.1  dholland 	option "/tmp", exit, action {
    292       1.1  dholland 		int j;
    293       1.1  dholland 		EBZB *bzb;
    294       1.1  dholland 
    295       1.1  dholland 		j = map.mblk[map.selected];
    296       1.1  dholland 		bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
    297       1.1  dholland 		strcpy (bzb->mount_point, "/tmp"); };
    298       1.1  dholland 	option "Keiner", exit, action {
    299       1.1  dholland 		int j;
    300       1.1  dholland 		EBZB *bzb;
    301       1.1  dholland 
    302       1.1  dholland 		j = map.mblk[map.selected];
    303       1.1  dholland 		bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
    304       1.1  dholland 		bzb->mount_point[0] = '\0'; };
    305       1.1  dholland 	option "Sonstige", exit, action {
    306       1.1  dholland 		int j;
    307       1.1  dholland 		char buf[60];
    308       1.1  dholland 		EBZB *bzb;
    309       1.1  dholland 
    310       1.1  dholland 		msg_display (MSG_custom_mount_point);
    311       1.1  dholland 		msg_prompt_add (MSG_mountpoint, NULL, buf, sizeof(buf));
    312       1.1  dholland 		j = map.mblk[map.selected];
    313       1.1  dholland 		bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
    314       1.1  dholland 		if (buf[0] != '\0') {
    315       1.1  dholland 		    bzb->mount_point[0] = '\0';
    316       1.1  dholland 		    if (buf[0] != '/')
    317       1.1  dholland 			strcpy (bzb->mount_point, "/");
    318       1.1  dholland 		    strcat(bzb->mount_point, buf);
    319       1.1  dholland 		} };
    320       1.1  dholland 
    321       1.1  dholland menu sanity, title "Bitte whlen Sie";
    322       1.1  dholland 	display action {msg_display (MSG_sanity_check);
    323       1.1  dholland 		report_errors(); };
    324       1.3    martin 	option "Installation abbrechen", exit, action { *((int*)arg) = -1; };
    325       1.3    martin 	option "Warnungen ignorieren und fortfahren", exit, action { *((int*)arg) = 1;};
    326       1.3    martin 	option "Festplatten Partitions bersicht erneut ndern", exit, action { *((int*)arg) = 0; };
    327       1.1  dholland 
    328       1.1  dholland /*
    329       1.1  dholland  * This menu shouldn't be used in the mac68k port, but it needs to be
    330       1.1  dholland  *  defined because it's referenced from the toplevel code.
    331       1.1  dholland  */
    332