aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Yao <ryao@gentoo.org>2014-03-15 15:05:00 -0400
committerRichard Yao <ryao@gentoo.org>2014-03-15 20:23:12 -0400
commit4be2a63948607ae984314e5b214c7743247f4a40 (patch)
tree2d37f3c64383fda4b7994cab9bf8dd688cae8cf8
parentBump version to 3.4.48 (diff)
downloadgenkernel-4be2a63948607ae984314e5b214c7743247f4a40.tar.gz
genkernel-4be2a63948607ae984314e5b214c7743247f4a40.tar.bz2
genkernel-4be2a63948607ae984314e5b214c7743247f4a40.zip
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@gentoo.org>
-rwxr-xr-xgen_initramfs.sh2
1 files changed, 2 insertions, 0 deletions
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}" \