commit: 4be2a63948607ae984314e5b214c7743247f4a40
Author: Richard Yao <ryao <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 15 19:05:00 2014 +0000
Commit: Richard Yao <ryao <AT> gentoo <DOT> org>
CommitDate: Sun Mar 16 00:23:12 2014 +0000
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=4be2a639
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 <ryao <AT> gentoo.org>
---
gen_initramfs.sh | 2 ++
1 file changed, 2 insertions(+)
diff --git a/gen_initramfs.sh b/gen_initramfs.sh
index 40318a2..26bcdf6 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}" \