1 1.7 andvar /* $NetBSD: menus.md.en,v 1.7 2021/07/24 21:31:39 andvar 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 "Select your choice"; 38 1.1 dholland option "Use only part of the disk", exit, action {usefull = 0;}; 39 1.1 dholland option "Use the entire disk", exit, action {usefull = 1;}; 40 1.1 dholland 41 1.1 dholland menu nodiskmap, title "Choose an option", y=16; 42 1.6 christos display action { msg_fmt_display (MSG_nodiskmap, "%s", pm->diskdev); }; 43 1.1 dholland option "Abort install", exit, action { 44 1.1 dholland endwin(); exit(1); 45 1.1 dholland }; 46 1.1 dholland option "Initialize Disk partition Map", 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 "Choose your partition", exit, y=14; 66 1.5 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 "Select next partition", 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 "Change selected partition", sub menu chooseid; 78 1.1 dholland option "Set mount point for partition", sub menu mount_point; 79 1.1 dholland option "Split selected partition", 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.6 christos msg_fmt_display(MSG_split_part, "%d", 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 < (int)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 ((char *)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 ((char *)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 "Fix selected partition", 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.6 christos msg_fmt_display(MSG_partdebug, "%s%c%d%d", 133 1.6 christos pm->diskdev, bzb->flags.part, map.blk[i].pmPyPartStart, 134 1.6 christos 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.6 christos msg_fmt_display_add(MSG_parttable_fix_fixing, 138 1.6 christos "%s%c%d%d", 139 1.6 christos pm->diskdev, bzb->flags.part); 140 1.1 dholland map.blk[i].pmPartBlkCnt = 141 1.2 martin pm->dlsize - map.blk[i].pmPyPartStart; 142 1.1 dholland map.blk[i].pmDataCnt = 143 1.1 dholland map.blk[i].pmPartBlkCnt; 144 1.1 dholland } else { 145 1.6 christos msg_fmt_display_add(MSG_parttable_fix_fine, "%s%c", 146 1.2 martin pm->diskdev, bzb->flags.part); 147 1.1 dholland } 148 1.1 dholland process_menu(MENU_ok, NULL); 149 1.1 dholland }; 150 1.1 dholland 151 1.1 dholland 152 1.1 dholland menu ok2, title "Abort?", y=17; 153 1.1 dholland option "OK", exit, action { }; 154 1.1 dholland 155 1.1 dholland menu okabort, title "What do you want to do?", y=17; 156 1.3 martin option "Continue", exit, action { *((int*)arg) = 1; }; 157 1.3 martin option "Abort install", exit, action { *((int*)arg) = 0; }; 158 1.1 dholland 159 1.1 dholland menu chooseid, title "Partition Type?"; 160 1.1 dholland option "NetBSD Root", exit, action { 161 1.1 dholland int i, j; 162 1.1 dholland EBZB *bzb; 163 1.1 dholland 164 1.1 dholland j = map.mblk[map.selected]; 165 1.1 dholland reset_part_flags(&map.blk[j]); 166 1.1 dholland bzb = (EBZB *)&map.blk[j].pmBootArgs[0]; 167 1.1 dholland bzb->magic = APPLE_BZB_MAGIC; 168 1.1 dholland strcpy ((char *)map.blk[j].pmPartName, "NetBSD Root"); 169 1.1 dholland strcpy ((char *)map.blk[j].pmPartType, "Apple_Unix_SVR2"); 170 1.1 dholland bzb->type = APPLE_BZB_TYPEFS; 171 1.1 dholland bzb->flags.root = 1; 172 1.1 dholland /* 173 1.1 dholland * Automatically determine root mount points. The first 174 1.1 dholland * root-type filesystem is mounted on "/", all others 175 1.1 dholland * will mount on "/altroot". If there are multiple 176 1.7 andvar * occurrences of "/altroot" they will be picked up on 177 1.1 dholland * the sanity_scan in the next step of the installation. 178 1.1 dholland */ 179 1.1 dholland for (i=0,map.root_cnt=0;i<map.usable_cnt;i++) { 180 1.1 dholland j = map.mblk[i]; 181 1.1 dholland if (whichType(&map.blk[j]) == ROOT_PART) { 182 1.1 dholland bzb = (EBZB *)&map.blk[j].pmBootArgs[0]; 183 1.1 dholland if (bzb->type == APPLE_BZB_TYPEFS && bzb->flags.root) { 184 1.1 dholland if (map.root_cnt++ == 0) 185 1.1 dholland strcpy ((char *)bzb->mount_point, "/"); 186 1.1 dholland else 187 1.1 dholland strcpy ((char *)bzb->mount_point, "/altroot"); 188 1.1 dholland } 189 1.1 dholland } 190 1.1 dholland } }; 191 1.1 dholland option "NetBSD SWAP", exit, action { 192 1.1 dholland int j; 193 1.1 dholland EBZB *bzb; 194 1.1 dholland 195 1.1 dholland j = map.mblk[map.selected]; 196 1.1 dholland reset_part_flags(&map.blk[j]); 197 1.1 dholland bzb = (EBZB *)&map.blk[j].pmBootArgs[0]; 198 1.1 dholland bzb->magic = APPLE_BZB_MAGIC; 199 1.1 dholland strcpy ((char *)map.blk[j].pmPartName, "NetBSD SWAP"); 200 1.1 dholland strcpy ((char *)map.blk[j].pmPartType, "Apple_Unix_SVR2"); 201 1.1 dholland bzb->type = APPLE_BZB_TYPESWAP; }; 202 1.1 dholland option "NetBSD Usr", exit, action { 203 1.1 dholland int j; 204 1.1 dholland EBZB *bzb; 205 1.1 dholland 206 1.1 dholland j = map.mblk[map.selected]; 207 1.1 dholland reset_part_flags(&map.blk[j]); 208 1.1 dholland bzb = (EBZB *)&map.blk[j].pmBootArgs[0]; 209 1.1 dholland bzb->magic = APPLE_BZB_MAGIC; 210 1.1 dholland strcpy ((char *)map.blk[j].pmPartName, "NetBSD Usr"); 211 1.1 dholland strcpy ((char *)map.blk[j].pmPartType, "Apple_Unix_SVR2"); 212 1.1 dholland bzb->type = APPLE_BZB_TYPEFS; 213 1.1 dholland bzb->flags.usr = 1; 214 1.1 dholland if (map.usr_cnt++ == 0) 215 1.1 dholland strcpy ((char *)bzb->mount_point, "/usr"); 216 1.1 dholland }; 217 1.1 dholland option "NetBSD Root&Usr", exit, action { 218 1.1 dholland int j; 219 1.1 dholland EBZB *bzb; 220 1.1 dholland 221 1.1 dholland j = map.mblk[map.selected]; 222 1.1 dholland reset_part_flags(&map.blk[j]); 223 1.1 dholland bzb = (EBZB *)&map.blk[j].pmBootArgs[0]; 224 1.1 dholland bzb->magic = APPLE_BZB_MAGIC; 225 1.1 dholland strcpy ((char *)map.blk[j].pmPartName, "NetBSD Root & Usr"); 226 1.1 dholland strcpy ((char *)map.blk[j].pmPartType, "Apple_Unix_SVR2"); 227 1.1 dholland bzb->type = APPLE_BZB_TYPEFS; 228 1.1 dholland bzb->flags.root = 1; 229 1.1 dholland bzb->flags.usr = 1; 230 1.1 dholland if (map.root_cnt++ == 0) 231 1.1 dholland strcpy ((char *)bzb->mount_point, "/"); 232 1.1 dholland else { 233 1.1 dholland if (map.usr_cnt++ == 0) 234 1.1 dholland strcpy ((char *)bzb->mount_point, "/usr"); 235 1.1 dholland } }; 236 1.1 dholland option "MacOS HFS", exit, action { 237 1.1 dholland int j; 238 1.1 dholland EBZB *bzb; 239 1.1 dholland 240 1.1 dholland j = map.mblk[map.selected]; 241 1.1 dholland reset_part_flags(&map.blk[j]); 242 1.1 dholland bzb = (EBZB *)&map.blk[j].pmBootArgs[0]; 243 1.1 dholland bzb->magic = 0; 244 1.1 dholland bzb->mount_point[0] = '\0'; 245 1.1 dholland strcpy ((char *)map.blk[j].pmPartName, "untitled (HFS)"); 246 1.1 dholland strcpy ((char *)map.blk[j].pmPartType, "Apple_HFS"); }; 247 1.1 dholland option "Scratch", exit, action { 248 1.1 dholland int j; 249 1.1 dholland EBZB *bzb; 250 1.1 dholland 251 1.1 dholland j = map.mblk[map.selected]; 252 1.1 dholland reset_part_flags(&map.blk[j]); 253 1.1 dholland bzb = (EBZB *)&map.blk[j].pmBootArgs[0]; 254 1.1 dholland bzb->magic = 0; 255 1.1 dholland bzb->mount_point[0] = '\0'; 256 1.1 dholland strcpy ((char *)map.blk[j].pmPartName, "untitled (Scratch)"); 257 1.1 dholland strcpy ((char *)map.blk[j].pmPartType, "Apple_Scratch"); }; 258 1.1 dholland option "Free", exit, action { 259 1.1 dholland int j; 260 1.1 dholland EBZB *bzb; 261 1.1 dholland 262 1.1 dholland j = map.mblk[map.selected]; 263 1.1 dholland reset_part_flags(&map.blk[j]); 264 1.1 dholland bzb = (EBZB *)&map.blk[j].pmBootArgs[0]; 265 1.1 dholland bzb->magic = 0; 266 1.1 dholland bzb->mount_point[0] = '\0'; 267 1.1 dholland strcpy ((char *)map.blk[j].pmPartName, "untitled (Free)"); 268 1.1 dholland strcpy ((char *)map.blk[j].pmPartType, "Apple_Free"); }; 269 1.1 dholland 270 1.1 dholland menu mount_point, title "Mount Point?"; 271 1.1 dholland option "/usr", exit, action { 272 1.1 dholland int j; 273 1.1 dholland EBZB *bzb; 274 1.1 dholland 275 1.1 dholland j = map.mblk[map.selected]; 276 1.1 dholland bzb = (EBZB *)&map.blk[j].pmBootArgs[0]; 277 1.1 dholland strcpy ((char *)bzb->mount_point, "/usr"); }; 278 1.1 dholland option "/home", exit, action { 279 1.1 dholland int j; 280 1.1 dholland EBZB *bzb; 281 1.1 dholland 282 1.1 dholland j = map.mblk[map.selected]; 283 1.1 dholland bzb = (EBZB *)&map.blk[j].pmBootArgs[0]; 284 1.1 dholland strcpy ((char *)bzb->mount_point, "/home"); }; 285 1.1 dholland option "/var", exit, action { 286 1.1 dholland int j; 287 1.1 dholland EBZB *bzb; 288 1.1 dholland 289 1.1 dholland j = map.mblk[map.selected]; 290 1.1 dholland bzb = (EBZB *)&map.blk[j].pmBootArgs[0]; 291 1.1 dholland strcpy ((char *)bzb->mount_point, "/var"); }; 292 1.1 dholland option "/tmp", exit, action { 293 1.1 dholland int j; 294 1.1 dholland EBZB *bzb; 295 1.1 dholland 296 1.1 dholland j = map.mblk[map.selected]; 297 1.1 dholland bzb = (EBZB *)&map.blk[j].pmBootArgs[0]; 298 1.1 dholland strcpy ((char *)bzb->mount_point, "/tmp"); }; 299 1.1 dholland option "None", exit, action { 300 1.1 dholland int j; 301 1.1 dholland EBZB *bzb; 302 1.1 dholland 303 1.1 dholland j = map.mblk[map.selected]; 304 1.1 dholland bzb = (EBZB *)&map.blk[j].pmBootArgs[0]; 305 1.1 dholland bzb->mount_point[0] = '\0'; }; 306 1.1 dholland option "other", exit, action { 307 1.1 dholland int j; 308 1.1 dholland char buf[60]; 309 1.1 dholland EBZB *bzb; 310 1.1 dholland 311 1.1 dholland msg_display (MSG_custom_mount_point); 312 1.1 dholland msg_prompt_add (MSG_mountpoint, NULL, buf, sizeof(buf)); 313 1.1 dholland j = map.mblk[map.selected]; 314 1.1 dholland bzb = (EBZB *)&map.blk[j].pmBootArgs[0]; 315 1.1 dholland if (buf[0] != '\0') { 316 1.1 dholland bzb->mount_point[0] = '\0'; 317 1.1 dholland if (buf[0] != '/') 318 1.1 dholland strcpy ((char *)bzb->mount_point, "/"); 319 1.1 dholland strcat((char *)bzb->mount_point, buf); 320 1.1 dholland } }; 321 1.1 dholland 322 1.1 dholland menu sanity, title "Choose an option"; 323 1.1 dholland display action {msg_display (MSG_sanity_check); 324 1.1 dholland report_errors(); }; 325 1.3 martin option "Abort installation", exit, action { *((int*)arg) = -1; }; 326 1.3 martin option "Ignore warnings and continue", exit, action { *((int*)arg) = 1;}; 327 1.3 martin option "Re-edit Disk Partition Map", exit, action { *((int*)arg) = 0; }; 328 1.1 dholland 329 1.1 dholland /* 330 1.1 dholland * This menu shouldn't be used in the mac68k port, but it needs to be 331 1.1 dholland * defined because it's referenced from the toplevel code. 332 1.1 dholland */ 333