/*
* 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 "Select your choice";
option "Use only part of the disk", exit, action {usefull = 0;};
option "Use the entire disk", exit, action {usefull = 1;};
menu nodiskmap, title "Choose an option", y=16;
display action { msg_fmt_display (MSG_nodiskmap, "%s", pm->diskdev); };
option "Abort install", exit, action {
endwin(); exit(1);
};
option "Initialize Disk partition Map", exit, action {
int i, rv;
menu editparttable, title "Choose your 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 "Select next partition", action {
map.selected += 1;
if (map.selected >= map.usable_cnt)
map.selected = 0;
};
option "Change selected partition", sub menu chooseid;
option "Set mount point for partition", sub menu mount_point;
option "Split selected partition", action {
int i, j, k, size, free_size, rv;
char buf[40];
EBZB *bzb;
menu ok2, title "Abort?", y=17;
option "OK", exit, action { };
menu okabort, title "What do you want to do?", y=17;
option "Continue", exit, action { *((int*)arg) = 1; };
option "Abort install", exit, action { *((int*)arg) = 0; };
menu chooseid, title "Partition Type?";
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 ((char *)map.blk[j].pmPartName, "NetBSD Root");
strcpy ((char *)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 ((char *)bzb->mount_point, "/");
else
strcpy ((char *)bzb->mount_point, "/altroot");
}
}
} };
option "NetBSD SWAP", exit, action {
int j;
EBZB *bzb;