mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 19:57:43 +03:00
FreeBSD boot code reminder after zpool upgrade
There used to be a warning after upgrading a zpool in FreeBSD, so users won't forget to update the boot loader that pool is booted from. This change brings this warning back, but only if the bootfs property is set on the pool, which should be sufficient for the vast majority of FreeBSD installations. People running something custom are most likely aware of what to do after an upgrade in their specific environment. Functionality is implemented in an OS specific helper function. Reviewed-by: John Kennedy <john.kennedy@delphix.com> Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Co-authored-by: Michael Gmelin <grembo@FreeBSD.org> Signed-off-by: Michael Gmelin <grembo@FreeBSD.org> Closes #12099 Closes #12104
This commit is contained in:
+12
-10
@@ -8837,7 +8837,7 @@ upgrade_cb(zpool_handle_t *zhp, void *arg)
|
||||
upgrade_cbdata_t *cbp = arg;
|
||||
nvlist_t *config;
|
||||
uint64_t version;
|
||||
boolean_t printnl = B_FALSE;
|
||||
boolean_t modified_pool = B_FALSE;
|
||||
int ret;
|
||||
|
||||
config = zpool_get_config(zhp, NULL);
|
||||
@@ -8851,7 +8851,7 @@ upgrade_cb(zpool_handle_t *zhp, void *arg)
|
||||
ret = upgrade_version(zhp, cbp->cb_version);
|
||||
if (ret != 0)
|
||||
return (ret);
|
||||
printnl = B_TRUE;
|
||||
modified_pool = B_TRUE;
|
||||
|
||||
/*
|
||||
* If they did "zpool upgrade -a", then we could
|
||||
@@ -8871,12 +8871,13 @@ upgrade_cb(zpool_handle_t *zhp, void *arg)
|
||||
|
||||
if (count > 0) {
|
||||
cbp->cb_first = B_FALSE;
|
||||
printnl = B_TRUE;
|
||||
modified_pool = B_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (printnl) {
|
||||
(void) printf(gettext("\n"));
|
||||
if (modified_pool) {
|
||||
(void) printf("\n");
|
||||
(void) after_zpool_upgrade(zhp);
|
||||
}
|
||||
|
||||
return (0);
|
||||
@@ -8989,7 +8990,7 @@ upgrade_list_disabled_cb(zpool_handle_t *zhp, void *arg)
|
||||
static int
|
||||
upgrade_one(zpool_handle_t *zhp, void *data)
|
||||
{
|
||||
boolean_t printnl = B_FALSE;
|
||||
boolean_t modified_pool = B_FALSE;
|
||||
upgrade_cbdata_t *cbp = data;
|
||||
uint64_t cur_version;
|
||||
int ret;
|
||||
@@ -9017,7 +9018,7 @@ upgrade_one(zpool_handle_t *zhp, void *data)
|
||||
}
|
||||
|
||||
if (cur_version != cbp->cb_version) {
|
||||
printnl = B_TRUE;
|
||||
modified_pool = B_TRUE;
|
||||
ret = upgrade_version(zhp, cbp->cb_version);
|
||||
if (ret != 0)
|
||||
return (ret);
|
||||
@@ -9030,7 +9031,7 @@ upgrade_one(zpool_handle_t *zhp, void *data)
|
||||
return (ret);
|
||||
|
||||
if (count != 0) {
|
||||
printnl = B_TRUE;
|
||||
modified_pool = B_TRUE;
|
||||
} else if (cur_version == SPA_VERSION) {
|
||||
(void) printf(gettext("Pool '%s' already has all "
|
||||
"supported and requested features enabled.\n"),
|
||||
@@ -9038,8 +9039,9 @@ upgrade_one(zpool_handle_t *zhp, void *data)
|
||||
}
|
||||
}
|
||||
|
||||
if (printnl) {
|
||||
(void) printf(gettext("\n"));
|
||||
if (modified_pool) {
|
||||
(void) printf("\n");
|
||||
(void) after_zpool_upgrade(zhp);
|
||||
}
|
||||
|
||||
return (0);
|
||||
|
||||
Reference in New Issue
Block a user