From 603f3d6e1aa4f260d242b7533b2d9252a4ed6de2 Mon Sep 17 00:00:00 2001
From: Kevin Stolp <kevinstolp@gmail.com>
Date: Fri, 13 Jan 2023 17:36:43 -0800
Subject: [PATCH] Restore hostid handling

This was originally performed in commit f18efa1.
---
 .SRCINFO             | 6 +++---
 PKGBUILD             | 6 +++---
 zfs.initcpio.install | 1 +
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/.SRCINFO b/.SRCINFO
index d96fc77..841f0d9 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
 pkgbase = zfs-utils
 	pkgdesc = Userspace utilities for the Zettabyte File System.
 	pkgver = 2.1.7
-	pkgrel = 2
+	pkgrel = 3
 	url = https://zfsonlinux.org/
 	arch = i686
 	arch = x86_64
@@ -18,11 +18,11 @@ pkgbase = zfs-utils
 	validpgpkeys = C33DF142657ED1F7C328A2960AB9E991C6AF658B
 	sha256sums = 6462e63e185de6ff10c64ffa6ed773201a082f9dd13e603d7e8136fcb4aca71b
 	sha256sums = SKIP
-	sha256sums = d19476c6a599ebe3415680b908412c8f19315246637b3a61e811e2e0961aea78
+	sha256sums = 2f09c742287f4738c7c09a9669f8055cd63d3b9474cd1f6d9447152d11a1b913
 	sha256sums = 15b5acea44225b4364ec6472a08d3d48666d241fe84c142e1171cd3b78a5584f
 	b2sums = 9c85c3eb72f3bb39bc4fd44aaa80338ca197a4e8183436fee73cd56705abfdaecfaf1b6fbe8dd508ccce707c8259c7ab6e1733b60b17757f0a7ff92d4e52bbad
 	b2sums = SKIP
-	b2sums = f7c78e5a0ce887e89e5cdc52515381d647a51586cb05c52a900e1307520f6f0fa828f8f5fd5a30823b233dcd79f0496375b21d044103e1d765e20f728c2d0fee
+	b2sums = cb774227f157573f960bdb345e5b014c043a573c987d37a1db027b852d77a5eda1ee699612e1d8f4a2770897624889f1a3808116a171cc4c796a95e3caa43012
 	b2sums = 779c864611249c3f21d1864508d60cfe5e0f5541d74fb3093c6bdfa56be2c76f386ac1690d363beaee491c5132f5f6dbc01553aa408cda579ebca74b0e0fd1d0
 
 pkgname = zfs-utils
diff --git a/PKGBUILD b/PKGBUILD
index 01f31ee..f6da530 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@
 
 pkgname=zfs-utils
 pkgver=2.1.7
-pkgrel=2
+pkgrel=3
 pkgdesc="Userspace utilities for the Zettabyte File System."
 arch=("i686" "x86_64" "aarch64")
 url="https://zfsonlinux.org/"
@@ -15,11 +15,11 @@ source=("https://github.com/zfsonlinux/zfs/releases/download/zfs-${pkgver}/zfs-$
         "zfs.initcpio.hook")
 sha256sums=('6462e63e185de6ff10c64ffa6ed773201a082f9dd13e603d7e8136fcb4aca71b'
             'SKIP'
-            'd19476c6a599ebe3415680b908412c8f19315246637b3a61e811e2e0961aea78'
+            '2f09c742287f4738c7c09a9669f8055cd63d3b9474cd1f6d9447152d11a1b913'
             '15b5acea44225b4364ec6472a08d3d48666d241fe84c142e1171cd3b78a5584f')
 b2sums=('9c85c3eb72f3bb39bc4fd44aaa80338ca197a4e8183436fee73cd56705abfdaecfaf1b6fbe8dd508ccce707c8259c7ab6e1733b60b17757f0a7ff92d4e52bbad'
         'SKIP'
-        'f7c78e5a0ce887e89e5cdc52515381d647a51586cb05c52a900e1307520f6f0fa828f8f5fd5a30823b233dcd79f0496375b21d044103e1d765e20f728c2d0fee'
+        'cb774227f157573f960bdb345e5b014c043a573c987d37a1db027b852d77a5eda1ee699612e1d8f4a2770897624889f1a3808116a171cc4c796a95e3caa43012'
         '779c864611249c3f21d1864508d60cfe5e0f5541d74fb3093c6bdfa56be2c76f386ac1690d363beaee491c5132f5f6dbc01553aa408cda579ebca74b0e0fd1d0')
 validpgpkeys=('4F3BA9AB6D1F8D683DC2DFB56AD860EED4598027'  # Tony Hutter (GPG key for signing ZFS releases) <hutter2@llnl.gov>
               'C33DF142657ED1F7C328A2960AB9E991C6AF658B') # Brian Behlendorf <behlendorf1@llnl.gov>
diff --git a/zfs.initcpio.install b/zfs.initcpio.install
index fd3387f..27e11f5 100644
--- a/zfs.initcpio.install
+++ b/zfs.initcpio.install
@@ -41,6 +41,7 @@ build() {
 
     [[ -f /etc/zfs/zpool.cache ]] && cp "/etc/zfs/zpool.cache" "${BUILDROOT}/etc/zfs/zpool.cache.org"
     [[ -f /etc/modprobe.d/zfs.conf ]] && add_file "/etc/modprobe.d/zfs.conf"
+    [[ -f /etc/hostid ]] && add_file "/etc/hostid"
     [[ -f /etc/fstab ]] && add_file "/etc/fstab"
 }