Skip to content

Commit 9b348b4

Browse files
committed
zfsbootmenu-core: disable spl_hostid warnings
The default behavior of hostid matching is useful to have on in binary releases. However, it generates a warning message that isn't really relevant for users of that build. It's expected that the spl_hostid value in ZFSBootMenu.EFI won't match the local pool hostid - advising these users to manually set `spl_hostid` on the ZBM KCL runs counter to how we recommend ZBM should be used.
1 parent bd1319f commit 9b348b4

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed

dracut/module-setup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ install() {
125125

126126
# vdev_id.conf and hostid files are host-specific
127127
# and do not belong in public release images
128-
if [ -z "${release_build}" ]; then
128+
if [ -z "${zfsbootmenu_release_build}" ]; then
129129
if [ -e /etc/zfs/vdev_id.conf ]; then
130130
inst /etc/zfs/vdev_id.conf
131131
type mark_hostonly >/dev/null 2>&1 && mark_hostonly /etc/zfs/vdev_id.conf
@@ -172,7 +172,7 @@ install() {
172172

173173
# Force rd.hostonly=0 in the KCL for releases, this will purge itself after 99base/init.sh runs
174174
# shellcheck disable=SC2154
175-
if [ -n "${release_build}" ]; then
175+
if [ -n "${zfsbootmenu_release_build}" ]; then
176176
echo "rd.hostonly=0" > "${initdir}/etc/cmdline.d/hostonly.conf"
177177
fi
178178

etc/zfsbootmenu/release.conf.d/common.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ omit_dracutmodules+=" qemu "
1414
omit_dracutmodules+=" nvdimm fs-lib rootfs-block dm dmraid crypt "
1515

1616
embedded_kcl="rd.hostonly=0"
17-
release_build=1
17+
zfsbootmenu_release_build=1

zfsbootmenu/install-helpers.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,15 @@ create_zbm_conf() {
100100
has_column=1
101101
fi
102102

103+
case "${zfsbootmenu_release_build,,}" in
104+
yes|y|on|1)
105+
zfsbootmenu_release_build=1
106+
;;
107+
*)
108+
zfsbootmenu_release_build=
109+
;;
110+
esac
111+
103112
# Normalize ZBM_BUILDSTYLE, if set
104113
case "${ZBM_BUILDSTYLE,,}" in
105114
mkinitcpio) ZBM_BUILDSTYLE="mkinitcpio" ;;
@@ -113,12 +122,14 @@ create_zbm_conf() {
113122
readonly _ETC_ZFSBOOTMENU_CONF=1
114123
EOF
115124

125+
# shellcheck disable=SC2154
116126
cat >> "${BUILDROOT}/etc/zfsbootmenu.conf" <<-EOF
117127
export HAS_REFRESH="${has_refresh}"
118128
export HAS_DISABLED="${has_disabled}"
119129
export HAS_BORDER="${has_border}"
120130
export HAS_COLUMN="${has_column}"
121131
export ZBM_BUILDSTYLE="${ZBM_BUILDSTYLE}"
132+
export ZBM_RELEASE_BUILD="${zfsbootmenu_release_build}"
122133
EOF
123134
}
124135

zfsbootmenu/lib/zfsbootmenu-core.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,10 @@ match_hostid() {
184184
if read_write='' import_pool "${pool}"; then
185185
zdebug "successfully imported ${pool}"
186186

187-
zwarn "imported ${pool} with assumed hostid ${hostid}"
188-
zwarn "set spl_hostid=${hostid} on ZBM KCL or regenerate with corrected /etc/hostid"
187+
if [ -z "${ZBM_RELEASE_BUILD}" ]; then
188+
zwarn "imported ${pool} with assumed hostid ${hostid}"
189+
zwarn "set spl_hostid=${hostid} on ZBM KCL or regenerate with corrected /etc/hostid"
190+
fi
189191

190192
echo "${pool};${hostid}"
191193
return 0

0 commit comments

Comments
 (0)