xref: /netbsd/usr.sbin/sysinst/arch/dummy/md.c (revision 5960e8ba)
1*5960e8baSmartin /*	$NetBSD: md.c,v 1.8 2022/12/09 17:02:14 martin Exp $	*/
268680a16Sdholland 
368680a16Sdholland /*
468680a16Sdholland  * Copyright 1997 Piermont Information Systems Inc.
568680a16Sdholland  * All rights reserved.
668680a16Sdholland  *
768680a16Sdholland  * Based on code written by Philip A. Nelson for Piermont Information
868680a16Sdholland  * Systems Inc.
968680a16Sdholland  *
1068680a16Sdholland  * Redistribution and use in source and binary forms, with or without
1168680a16Sdholland  * modification, are permitted provided that the following conditions
1268680a16Sdholland  * are met:
1368680a16Sdholland  * 1. Redistributions of source code must retain the above copyright
1468680a16Sdholland  *    notice, this list of conditions and the following disclaimer.
1568680a16Sdholland  * 2. Redistributions in binary form must reproduce the above copyright
1668680a16Sdholland  *    notice, this list of conditions and the following disclaimer in the
1768680a16Sdholland  *    documentation and/or other materials provided with the distribution.
1868680a16Sdholland  * 3. The name of Piermont Information Systems Inc. may not be used to endorse
1968680a16Sdholland  *    or promote products derived from this software without specific prior
2068680a16Sdholland  *    written permission.
2168680a16Sdholland  *
2268680a16Sdholland  * THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``AS IS''
2368680a16Sdholland  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2468680a16Sdholland  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2568680a16Sdholland  * ARE DISCLAIMED. IN NO EVENT SHALL PIERMONT INFORMATION SYSTEMS INC. BE
2668680a16Sdholland  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2768680a16Sdholland  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2868680a16Sdholland  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2968680a16Sdholland  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
3068680a16Sdholland  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
3168680a16Sdholland  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
3268680a16Sdholland  * THE POSSIBILITY OF SUCH DAMAGE.
3368680a16Sdholland  */
3468680a16Sdholland 
3568680a16Sdholland #include <err.h>
3668680a16Sdholland 
3768680a16Sdholland #include "defs.h"
3868680a16Sdholland #include "md.h"
3968680a16Sdholland 
4068680a16Sdholland void
md_init(void)4168680a16Sdholland md_init(void)
4268680a16Sdholland {
43d5b457fdSjoerg 	warnx("sysinst has not been properly ported to this platform");
4468680a16Sdholland }
4568680a16Sdholland 
4668680a16Sdholland void
md_init_set_status(int flags)4768680a16Sdholland md_init_set_status(int flags)
4868680a16Sdholland {
4968680a16Sdholland 	(void)flags;
5068680a16Sdholland }
5168680a16Sdholland 
52dcc57e24Smartin bool
md_get_info(struct install_partition_desc * desc)53f8160a09Smrg md_get_info(struct install_partition_desc *desc)
54f8160a09Smrg {
55*5960e8baSmartin 	set_default_sizemult(pm->diskdev, MEG, pm->sectorsize);
56f8160a09Smrg 	return true;
57f8160a09Smrg }
58f8160a09Smrg 
5980bf2417Smartin int
md_make_bsd_partitions(struct install_partition_desc * desc)60f8160a09Smrg md_make_bsd_partitions(struct install_partition_desc *desc)
61f8160a09Smrg {
62f8160a09Smrg 	return make_bsd_partitions(desc);
63f8160a09Smrg }
64f8160a09Smrg 
65f8160a09Smrg bool
md_check_partitions(struct install_partition_desc * desc)66f8160a09Smrg md_check_partitions(struct install_partition_desc *desc)
67f8160a09Smrg {
68f8160a09Smrg 	return true;
69f8160a09Smrg }
70f8160a09Smrg 
71f8160a09Smrg bool
md_pre_disklabel(struct install_partition_desc * install,struct disk_partitions * part)72f8160a09Smrg md_pre_disklabel(struct install_partition_desc *install,
73f8160a09Smrg     struct disk_partitions *part)
74f8160a09Smrg {
75f8160a09Smrg 	return false;
76f8160a09Smrg }
77f8160a09Smrg 
78f8160a09Smrg bool
md_post_disklabel(struct install_partition_desc * install,struct disk_partitions * part)79f8160a09Smrg md_post_disklabel(struct install_partition_desc *install,
80f8160a09Smrg     struct disk_partitions *part)
8168680a16Sdholland {
82dcc57e24Smartin 	return true;
8368680a16Sdholland }
8468680a16Sdholland 
8568680a16Sdholland int
md_pre_mount(struct install_partition_desc * install,size_t ndx)86d5a9dfe9Smartin md_pre_mount(struct install_partition_desc *install, size_t ndx)
8768680a16Sdholland {
8868680a16Sdholland 	return 0;
8968680a16Sdholland }
9068680a16Sdholland 
9168680a16Sdholland int
md_post_newfs(struct install_partition_desc * install)92f8160a09Smrg md_post_newfs(struct install_partition_desc *install)
9368680a16Sdholland {
9468680a16Sdholland 	return 0;
9568680a16Sdholland }
9668680a16Sdholland 
9768680a16Sdholland int
md_post_extract(struct install_partition_desc * install,bool upgrade)98b8b586ecSmartin md_post_extract(struct install_partition_desc *install, bool upgrade)
9968680a16Sdholland {
10068680a16Sdholland 	return 0;
10168680a16Sdholland }
10268680a16Sdholland 
10368680a16Sdholland void
md_cleanup_install(struct install_partition_desc * install)104f8160a09Smrg md_cleanup_install(struct install_partition_desc *install)
10568680a16Sdholland {
10668680a16Sdholland }
10768680a16Sdholland 
10868680a16Sdholland int
md_pre_update(struct install_partition_desc * install)109f8160a09Smrg md_pre_update(struct install_partition_desc *install)
11068680a16Sdholland {
11168680a16Sdholland 	return 1;
11268680a16Sdholland }
11368680a16Sdholland 
11468680a16Sdholland int
md_update(struct install_partition_desc * install)115f8160a09Smrg md_update(struct install_partition_desc *install)
11668680a16Sdholland {
11768680a16Sdholland 	return 1;
11868680a16Sdholland }
11968680a16Sdholland 
120f8160a09Smrg #ifdef HAVE_GPT
121f8160a09Smrg /*
122f8160a09Smrg  * New GPT partitions have been written, update bootloader or remember
123f8160a09Smrg  * data untill needed in md_post_newfs
124f8160a09Smrg  */
125f8160a09Smrg bool
md_gpt_post_write(struct disk_partitions * parts,part_id root_id,bool root_is_new,part_id efi_id,bool efi_is_new)126f8160a09Smrg md_gpt_post_write(struct disk_partitions *parts, part_id root_id,
127f8160a09Smrg     bool root_is_new, part_id efi_id, bool efi_is_new)
12868680a16Sdholland {
129f8160a09Smrg 
130f8160a09Smrg 	return true;
13168680a16Sdholland }
132f8160a09Smrg #endif
133f8160a09Smrg 
134f8160a09Smrg bool
md_parts_use_wholedisk(struct disk_partitions * parts)135f8160a09Smrg md_parts_use_wholedisk(struct disk_partitions *parts)
136f8160a09Smrg {
137f8160a09Smrg 	return parts_use_wholedisk(parts, 0, NULL);
138f8160a09Smrg }
139f8160a09Smrg 
140