From 1b96832bf7e60a849119975adcb5fa7959e05e3e Mon Sep 17 00:00:00 2001 From: demmm Date: Sun, 16 Oct 2022 12:22:45 +0200 Subject: [PATCH] [zfs] adding hostid using ZFS in combination with dracut exposed a bug on system updates hostid from the Live session does not match hostid installed, thus zpool id no longer matches id created by dracut in the kernel img to work around this, the zfs module now uses zgenhostid to create a hostid --- src/modules/zfs/ZfsJob.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/modules/zfs/ZfsJob.cpp b/src/modules/zfs/ZfsJob.cpp index 921645f0a..c840da846 100644 --- a/src/modules/zfs/ZfsJob.cpp +++ b/src/modules/zfs/ZfsJob.cpp @@ -241,6 +241,13 @@ ZfsJob::exec() } } + // Generate the zfs hostid file + auto i = system->runCommand( { "zgenhostid" }, std::chrono::seconds( 3 ) ); + if ( i.getExitCode() != 0 ) + { + cWarning() << "Failed to create /etc/hostid"; + } + // Create the zpool ZfsResult zfsResult; if ( encrypt )