From 4be2a63948607ae984314e5b214c7743247f4a40 Mon Sep 17 00:00:00 2001 From: Richard Yao Date: Sat, 15 Mar 2014 15:05:00 -0400 Subject: Record hostid into initramfs ZFS pool import on non-exported pools is only permitted when the hostid of the system matches the host id of the last pool to import it. Store the hostid of the system to ensure that it matches at boot. Signed-off-by: Richard Yao --- gen_initramfs.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gen_initramfs.sh b/gen_initramfs.sh index 40318a23..26bcdf6b 100755 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -99,6 +99,8 @@ append_base_layout() { date -u '+%Y%m%d-%H%M%S' > ${TEMP}/initramfs-base-temp/etc/build_date echo "Genkernel $GK_V" > ${TEMP}/initramfs-base-temp/etc/build_id + printf "$(hostid | sed 's/\([0-9A-F]\{2\}\)/\\x\1/gI')" > ${TEMP}/initramfs-base-temp/etc/hostid + cd "${TEMP}/initramfs-base-temp/" log_future_cpio_content find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" \ -- cgit v1.2.3-65-gdbad