nextboot: fix nextboot -k on ZFS

zfsbootcfg(1) expects pool name to operate on, not currently mounted
filesystem name.

Fixes:	fd6d47375a
This commit is contained in:
Gleb Smirnoff 2024-02-19 19:51:22 -08:00
parent 3aefe67596
commit 0c3ade2cf1

View file

@ -130,6 +130,11 @@ write_nextboot(const char *fn, const char *env, bool force)
}
if (zfs) {
char *slash;
if ((slash = strchr(sfs.f_mntfromname, '/')) == NULL)
E("Can't find ZFS pool name in %s", sfs.f_mntfromname);
*slash = '\0';
zfsbootcfg(sfs.f_mntfromname, force);
}