diff options
author | Richard Yao <ryao@gentoo.org> | 2014-03-15 15:05:00 -0400 |
---|---|---|
committer | Richard Yao <ryao@gentoo.org> | 2014-03-15 20:23:12 -0400 |
commit | 4be2a63948607ae984314e5b214c7743247f4a40 (patch) | |
tree | 2d37f3c64383fda4b7994cab9bf8dd688cae8cf8 | |
parent | Bump version to 3.4.48 (diff) | |
download | genkernel-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-x | gen_initramfs.sh | 2 |
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}" \ |