summaryrefslogtreecommitdiffstats
path: root/cddl/usr.sbin
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2018-03-22 23:54:14 +0000
committermav <mav@FreeBSD.org>2018-03-22 23:54:14 +0000
commit99b95157db09016a55bc5ee65f3aebd952373bf8 (patch)
tree05a0eae8bdbb861189c08de14bafdb55856e1c2e /cddl/usr.sbin
parent4dfbe8b3ac42df8d0b6664fd64b5abd36a56d1a2 (diff)
downloadFreeBSD-src-99b95157db09016a55bc5ee65f3aebd952373bf8.zip
FreeBSD-src-99b95157db09016a55bc5ee65f3aebd952373bf8.tar.gz
MFC r329681: MFV r318941: 7446 zpool create should support efi system partition
illumos/illumos-gate@7855d95b30fd903e3918bad5a29b777e765db821 https://github.com/illumos/illumos-gate/commit/7855d95b30fd903e3918bad5a29b777e765db821 https://www.illumos.org/issues/7446 Since we support whole-disk configuration for boot pool, we also will need whole disk support with UEFI boot and for this, zpool create should create efi- system partition. I have borrowed the idea from oracle solaris, and introducing zpool create - B switch to provide an way to specify that boot partition should be created. However, there is still an question, how big should the system partition be. For time being, I have set default size 256MB (thats minimum size for FAT32 with 4k blocks). To support custom size, the set on creation "bootsize" property is created and so the custom size can be set as: zpool create B - o bootsize=34MB rpool c0t0d0 After pool is created, the "bootsize" property is read only. When -B switch is not used, the bootsize defaults to 0 and is shown in zpool get output with value ''. Older zfs/zpool implementations are ignoring this property. https://www.illumos.org/rb/r/219/ Reviewed by: Andrew Stormont <andyjstormont@gmail.com> Reviewed by: Yuri Pankov <yuri.pankov@gmail.com> Approved by: Dan McDonald <danmcd@kebe.com> Author: Toomas Soome <tsoome@me.com> This commit makes no sense for FreeBSD, that is why I blocked the option, but it should be good to stay closer to upstream.
Diffstat (limited to 'cddl/usr.sbin')
-rw-r--r--cddl/usr.sbin/zfsd/case_file.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/cddl/usr.sbin/zfsd/case_file.cc b/cddl/usr.sbin/zfsd/case_file.cc
index c14009b..19c4abe 100644
--- a/cddl/usr.sbin/zfsd/case_file.cc
+++ b/cddl/usr.sbin/zfsd/case_file.cc
@@ -239,6 +239,8 @@ CaseFile::ReEvaluate(const string &devPath, const string &physPath, Vdev *vdev)
{
ZpoolList zpl(ZpoolList::ZpoolByGUID, &m_poolGUID);
zpool_handle_t *pool(zpl.empty() ? NULL : zpl.front());
+ zpool_boot_label_t boot_type;
+ uint64_t boot_size;
if (pool == NULL || !RefreshVdevState()) {
/*
@@ -331,7 +333,13 @@ CaseFile::ReEvaluate(const string &devPath, const string &physPath, Vdev *vdev)
}
/* Write a label on the newly inserted disk. */
- if (zpool_label_disk(g_zfsHandle, pool, devPath.c_str()) != 0) {
+ if (zpool_is_bootable(pool))
+ boot_type = ZPOOL_COPY_BOOT_LABEL;
+ else
+ boot_type = ZPOOL_NO_BOOT_LABEL;
+ boot_size = zpool_get_prop_int(pool, ZPOOL_PROP_BOOTSIZE, NULL);
+ if (zpool_label_disk(g_zfsHandle, pool, devPath.c_str(),
+ boot_type, boot_size, NULL) != 0) {
syslog(LOG_ERR,
"Replace vdev(%s/%s) by physical path (label): %s: %s\n",
zpool_get_name(pool), VdevGUIDString().c_str(),
OpenPOWER on IntegriCloud