diff options
author | Nathan Whitehorn <nwhitehorn@FreeBSD.org> | 2014-09-13 18:24:54 +0000 |
---|---|---|
committer | Nathan Whitehorn <nwhitehorn@FreeBSD.org> | 2014-09-13 18:24:54 +0000 |
commit | 6e15678a470671d454dba52e195c4167b8d63c06 (patch) | |
tree | dfbb0fcea3e591646b2414002270f7c9ea83dec5 /usr.sbin/bsdinstall/partedit/partedit_x86.c | |
parent | 299153b5708a57614195515cf2ba08ff68031779 (diff) |
Add ZFS support to the bsdinstall partition editor and sade.
Submitted by: Kurt Lidl (original version)
MFC after: 6 weeks
Notes
Notes:
svn path=/head/; revision=271539
Diffstat (limited to 'usr.sbin/bsdinstall/partedit/partedit_x86.c')
-rw-r--r-- | usr.sbin/bsdinstall/partedit/partedit_x86.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/usr.sbin/bsdinstall/partedit/partedit_x86.c b/usr.sbin/bsdinstall/partedit/partedit_x86.c index b458475fe6c6..bd98ac55cf39 100644 --- a/usr.sbin/bsdinstall/partedit/partedit_x86.c +++ b/usr.sbin/bsdinstall/partedit/partedit_x86.c @@ -58,6 +58,21 @@ is_scheme_bootable(const char *part_type) { return (0); } +int +is_fs_bootable(const char *part_type, const char *fs) { + size_t platlen = sizeof(platform); + if (strlen(platform) == 0) + sysctlbyname(platform_sysctl, platform, &platlen, NULL, -1); + + if (strcmp(fs, "freebsd-ufs") == 0) + return (1); + + if (strcmp(fs, "freebsd-zfs") == 0 && strcmp(platform, "BIOS") == 0) + return (1); + + return (0); +} + size_t bootpart_size(const char *scheme) { size_t platlen = sizeof(platform); @@ -107,7 +122,7 @@ bootcode_path(const char *part_type) { } const char * -partcode_path(const char *part_type) { +partcode_path(const char *part_type, const char *fs_type) { size_t platlen = sizeof(platform); if (strlen(platform) == 0) sysctlbyname(platform_sysctl, platform, &platlen, NULL, -1); @@ -115,6 +130,8 @@ partcode_path(const char *part_type) { if (strcmp(part_type, "GPT") == 0) { if (strcmp(platform, "UEFI") == 0) return ("/boot/boot1.efifat"); + else if (strcmp(fs_type, "zfs") == 0) + return ("/boot/gptzfsboot"); else return ("/boot/gptboot"); } |