Skip to content

Commit ccfc92c

Browse files
authored
Change ZBM hostid handling defaults
* Enable set_hostid and import_policy=hostid by default, update documentation to reflect that
1 parent 635d140 commit ccfc92c

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

90zfsbootmenu/zfsbootmenu-parse-commandline.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,16 @@ if [ -n "${import_policy}" ]; then
6767
info "ZFSBootMenu: setting import_policy to strict"
6868
;;
6969
*)
70-
info "ZFSBootMenu: unknown import policy ${import_policy}, defaulting to strict"
71-
import_policy="strict"
70+
info "ZFSBootMenu: unknown import policy ${import_policy}, defaulting to hostid"
71+
import_policy="hostid"
7272
;;
7373
esac
7474
elif getargbool 0 zbm.force_import -d force_import ; then
7575
import_policy="force"
7676
info "ZFSBootMenu: setting import_policy to force"
7777
else
78-
info "ZFSBootMenu: defaulting import_policy to strict"
79-
import_policy="strict"
78+
info "ZFSBootMenu: defaulting import_policy to hostid"
79+
import_policy="hostid"
8080
fi
8181

8282
# zbm.timeout= overrides timeout=
@@ -160,7 +160,7 @@ fi
160160
if [ "${BYTE_ORDER}" = "be" ]; then
161161
zbm_set_hostid=0
162162
info "ZFSBootMenu: big endian detected, disabling automatic replacement of spl_hostid"
163-
elif getargbool 0 zbm.set_hostid ; then
163+
elif getargbool 1 zbm.set_hostid ; then
164164
zbm_set_hostid=1
165165
info "ZFSBootMenu: enabling automatic replacement of spl_hostid"
166166
else

pod/zfsbootmenu.7.pod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ This option controls how the pool import process should take place.
3838

3939
=item B<zbm.import_policy=hostid>
4040

41-
Set this option to allow run-time reconfiguration of the SPL hostid. If a pool is preferred via B<zbm.prefer> and the pool can not be imported with a preconfigured hostid, the system will attempt to adopt the hostid of the system that last imported the pool. If a preferred pool is not set and no pools can be imported using a preconfigured hostid, the system will adopt the hostid of the first otherwise-importable pool. After adopting a detected hostid, ZFSBootMenu will subsequently attempt to import as many pools as possible. This option is forbidden on big-endian systems.
41+
Set this option to allow run-time reconfiguration of the SPL hostid. If a pool is preferred via B<zbm.prefer> and the pool can not be imported with a preconfigured hostid, the system will attempt to adopt the hostid of the system that last imported the pool. If a preferred pool is not set and no pools can be imported using a preconfigured hostid, the system will adopt the hostid of the first otherwise-importable pool. After adopting a detected hostid, ZFSBootMenu will subsequently attempt to import as many pools as possible. This option is forbidden on big-endian systems. This is the default import policy.
4242

4343
=item B<zbm.import_policy=strict>
4444

45-
Set this option to only import pools that match the SPL hostid configured in ZFSBootMenu. If none can be imported, an emergency shell will be invoked. The I<strict> policy is consistent with the behavior of earlier versions of ZFSBootMenu and is the default import policy.
45+
Set this option to only import pools that match the SPL hostid configured in ZFSBootMenu. If none can be imported, an emergency shell will be invoked. The I<strict> policy is consistent with the behavior of earlier versions of ZFSBootMenu.
4646

4747
=item B<zbm.import_policy=force>
4848

@@ -52,7 +52,7 @@ Set this option to attempt to force pool imports. When set, this invokes I<zpool
5252

5353
=item B<zbm.set_hostid>
5454

55-
On little-endian systems, setting this option will cause ZFSBootMenu to set the I<spl.spl_hostid> command-line parameter for the selected boot environment to the hostid used to import its pool. The SPL kernel module will use this value as the hostid of the booted environment regardless of the contents of I</etc/hostid>. As a special case, if the hostid to be set is zero, ZFSBootMenu will instead set I<spl_hostid=00000000>, which should be used by dracut-based initramfs images to write an all-zero I</etc/hostid> in the initramfs prior to importing the boot pool.
55+
On little-endian systems, setting this option will cause ZFSBootMenu to set the I<spl.spl_hostid> command-line parameter for the selected boot environment to the hostid used to import its pool. The SPL kernel module will use this value as the hostid of the booted environment regardless of the contents of I</etc/hostid>. As a special case, if the hostid to be set is zero, ZFSBootMenu will instead set I<spl_hostid=00000000>, which should be used by dracut-based initramfs images to write an all-zero I</etc/hostid> in the initramfs prior to importing the boot pool. This option is on by default.
5656

5757
This option has no effect on big-endian systems.
5858

0 commit comments

Comments
 (0)