1218799Snwhitehorn/*-
2218799Snwhitehorn * Copyright (c) 2011 Nathan Whitehorn
3218799Snwhitehorn * All rights reserved.
4218799Snwhitehorn *
5218799Snwhitehorn * Redistribution and use in source and binary forms, with or without
6218799Snwhitehorn * modification, are permitted provided that the following conditions
7218799Snwhitehorn * are met:
8218799Snwhitehorn * 1. Redistributions of source code must retain the above copyright
9218799Snwhitehorn *    notice, this list of conditions and the following disclaimer.
10218799Snwhitehorn * 2. Redistributions in binary form must reproduce the above copyright
11218799Snwhitehorn *    notice, this list of conditions and the following disclaimer in the
12218799Snwhitehorn *    documentation and/or other materials provided with the distribution.
13218799Snwhitehorn *
14218799Snwhitehorn * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15218799Snwhitehorn * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16218799Snwhitehorn * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17218799Snwhitehorn * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18218799Snwhitehorn * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19218799Snwhitehorn * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20218799Snwhitehorn * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21218799Snwhitehorn * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22218799Snwhitehorn * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23218799Snwhitehorn * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24218799Snwhitehorn * SUCH DAMAGE.
25218799Snwhitehorn *
26218799Snwhitehorn * $FreeBSD: releng/10.3/usr.sbin/bsdinstall/partedit/partedit_sparc64.c 273831 2014-10-29 16:48:18Z nwhitehorn $
27218799Snwhitehorn */
28218799Snwhitehorn
29218799Snwhitehorn#include <string.h>
30218799Snwhitehorn
31218799Snwhitehorn#include "partedit.h"
32218799Snwhitehorn
33218799Snwhitehornconst char *
34218799Snwhitehorndefault_scheme(void) {
35218799Snwhitehorn	return ("VTOC8");
36218799Snwhitehorn}
37218799Snwhitehorn
38218799Snwhitehornint
39218799Snwhitehornis_scheme_bootable(const char *part_type) {
40218799Snwhitehorn	if (strcmp(part_type, "VTOC8") == 0)
41218799Snwhitehorn		return (1);
42218799Snwhitehorn	return (0);
43218799Snwhitehorn}
44218799Snwhitehorn
45273831Snwhitehornint
46273831Snwhitehornis_fs_bootable(const char *part_type, const char *fs)
47273831Snwhitehorn{
48273831Snwhitehorn	if (strcmp(fs, "freebsd-ufs") == 0 || strcmp(fs, "freebsd-zfs") == 0)
49273831Snwhitehorn		return (1);
50273831Snwhitehorn	return (0);
51273831Snwhitehorn}
52273831Snwhitehorn
53273831Snwhitehorn
54218799Snwhitehornsize_t
55218799Snwhitehornbootpart_size(const char *part_type) {
56218799Snwhitehorn	/* No standalone boot partition */
57218799Snwhitehorn
58218799Snwhitehorn	return (0);
59218799Snwhitehorn}
60218799Snwhitehorn
61218799Snwhitehornconst char *
62271636Semastebootpart_type(const char *scheme) {
63271636Semaste	return ("freebsd-boot");
64271636Semaste}
65271636Semaste
66271636Semasteconst char *
67218799Snwhitehornbootcode_path(const char *part_type) {
68218799Snwhitehorn	return (NULL);
69218799Snwhitehorn}
70273831Snwhitehorn
71218799Snwhitehornconst char *
72273831Snwhitehornpartcode_path(const char *part_type, const char *fs_type) {
73273831Snwhitehorn	if (strcmp(part_type, "VTOC8") == 0) {
74273831Snwhitehorn		if (strcmp(fs_type, "ufs") == 0) {
75273831Snwhitehorn			return ("/boot/boot1");
76273831Snwhitehorn		} else if (strcmp(fs_type, "zfs") == 0) {
77273831Snwhitehorn			return ("/boot/zfsboot");
78273831Snwhitehorn		}
79273831Snwhitehorn	}
80218799Snwhitehorn	return (NULL);
81218799Snwhitehorn}
82218799Snwhitehorn
83