11.8Smartin/* $NetBSD: md.c,v 1.8 2022/12/09 17:02:14 martin Exp $ */ 21.1Sdholland 31.1Sdholland/* 41.1Sdholland * Copyright 1997 Piermont Information Systems Inc. 51.1Sdholland * All rights reserved. 61.1Sdholland * 71.1Sdholland * Based on code written by Philip A. Nelson for Piermont Information 81.1Sdholland * Systems Inc. 91.1Sdholland * 101.1Sdholland * Redistribution and use in source and binary forms, with or without 111.1Sdholland * modification, are permitted provided that the following conditions 121.1Sdholland * are met: 131.1Sdholland * 1. Redistributions of source code must retain the above copyright 141.1Sdholland * notice, this list of conditions and the following disclaimer. 151.1Sdholland * 2. Redistributions in binary form must reproduce the above copyright 161.1Sdholland * notice, this list of conditions and the following disclaimer in the 171.1Sdholland * documentation and/or other materials provided with the distribution. 181.1Sdholland * 3. The name of Piermont Information Systems Inc. may not be used to endorse 191.1Sdholland * or promote products derived from this software without specific prior 201.1Sdholland * written permission. 211.1Sdholland * 221.1Sdholland * THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``AS IS'' 231.1Sdholland * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 241.1Sdholland * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 251.1Sdholland * ARE DISCLAIMED. IN NO EVENT SHALL PIERMONT INFORMATION SYSTEMS INC. BE 261.1Sdholland * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 271.1Sdholland * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 281.1Sdholland * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 291.1Sdholland * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 301.1Sdholland * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 311.1Sdholland * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 321.1Sdholland * THE POSSIBILITY OF SUCH DAMAGE. 331.1Sdholland */ 341.1Sdholland 351.1Sdholland#include <err.h> 361.1Sdholland 371.1Sdholland#include "defs.h" 381.1Sdholland#include "md.h" 391.1Sdholland 401.1Sdhollandvoid 411.1Sdhollandmd_init(void) 421.1Sdholland{ 431.2Sjoerg warnx("sysinst has not been properly ported to this platform"); 441.1Sdholland} 451.1Sdholland 461.1Sdhollandvoid 471.1Sdhollandmd_init_set_status(int flags) 481.1Sdholland{ 491.1Sdholland (void)flags; 501.1Sdholland} 511.1Sdholland 521.3Smartinbool 531.4Smrgmd_get_info(struct install_partition_desc *desc) 541.1Sdholland{ 551.8Smartin set_default_sizemult(pm->diskdev, MEG, pm->sectorsize); 561.3Smartin return true; 571.1Sdholland} 581.1Sdholland 591.6Smartinint 601.4Smrgmd_make_bsd_partitions(struct install_partition_desc *desc) 611.4Smrg{ 621.4Smrg return make_bsd_partitions(desc); 631.4Smrg} 641.4Smrg 651.4Smrgbool 661.4Smrgmd_check_partitions(struct install_partition_desc *desc) 671.1Sdholland{ 681.4Smrg return true; 691.1Sdholland} 701.1Sdholland 711.4Smrgbool 721.4Smrgmd_pre_disklabel(struct install_partition_desc *install, 731.4Smrg struct disk_partitions *part) 741.1Sdholland{ 751.4Smrg return false; 761.1Sdholland} 771.1Sdholland 781.4Smrgbool 791.4Smrgmd_post_disklabel(struct install_partition_desc *install, 801.4Smrg struct disk_partitions *part) 811.1Sdholland{ 821.4Smrg return true; 831.1Sdholland} 841.1Sdholland 851.1Sdhollandint 861.5Smartinmd_pre_mount(struct install_partition_desc *install, size_t ndx) 871.1Sdholland{ 881.4Smrg return 0; 891.1Sdholland} 901.1Sdholland 911.1Sdhollandint 921.4Smrgmd_post_newfs(struct install_partition_desc *install) 931.1Sdholland{ 941.1Sdholland return 0; 951.1Sdholland} 961.1Sdholland 971.1Sdhollandint 981.7Smartinmd_post_extract(struct install_partition_desc *install, bool upgrade) 991.1Sdholland{ 1001.1Sdholland return 0; 1011.1Sdholland} 1021.1Sdholland 1031.1Sdhollandvoid 1041.4Smrgmd_cleanup_install(struct install_partition_desc *install) 1051.1Sdholland{ 1061.1Sdholland} 1071.1Sdholland 1081.1Sdhollandint 1091.4Smrgmd_pre_update(struct install_partition_desc *install) 1101.1Sdholland{ 1111.1Sdholland return 1; 1121.1Sdholland} 1131.1Sdholland 1141.1Sdhollandint 1151.4Smrgmd_update(struct install_partition_desc *install) 1161.1Sdholland{ 1171.1Sdholland return 1; 1181.1Sdholland} 1191.1Sdholland 1201.4Smrg#ifdef HAVE_GPT 1211.4Smrg/* 1221.4Smrg * New GPT partitions have been written, update bootloader or remember 1231.4Smrg * data untill needed in md_post_newfs 1241.4Smrg */ 1251.4Smrgbool 1261.4Smrgmd_gpt_post_write(struct disk_partitions *parts, part_id root_id, 1271.4Smrg bool root_is_new, part_id efi_id, bool efi_is_new) 1281.4Smrg{ 1291.4Smrg 1301.4Smrg return true; 1311.4Smrg} 1321.4Smrg#endif 1331.4Smrg 1341.4Smrgbool 1351.4Smrgmd_parts_use_wholedisk(struct disk_partitions *parts) 1361.1Sdholland{ 1371.4Smrg return parts_use_wholedisk(parts, 0, NULL); 1381.1Sdholland} 1391.4Smrg 140