From d571b3fb51d6922613381dabfddea4269b4b5b33 Mon Sep 17 00:00:00 2001 From: Jesus Alvarez Date: Sun, 29 May 2016 02:08:34 -0700 Subject: [PATCH] Remove hostid handling According to https://github.com/zfsonlinux/spl/commit/acf0ade362cb8b26d67770114ee6fa17816e6b65 https://github.com/zfsonlinux/zfs/issues/2794 the hostid handling is not needed anymore. If /etc/hostid does not exist, then spl treats it as 0 and continues operation. Closes #60 Closes #31 --- build.sh | 3 --- conf.sh | 1 - src/spl-utils/PKGBUILD.sh | 7 ++----- src/spl-utils/spl-utils.hostid | 1 - src/spl/spl.install.sh | 15 --------------- src/zfs-utils/zfs-utils.initcpio.hook | 4 ---- src/zfs-utils/zfs-utils.initcpio.install | 2 -- 7 files changed, 2 insertions(+), 31 deletions(-) delete mode 100644 src/spl-utils/spl-utils.hostid diff --git a/build.sh b/build.sh index 9383eb8..d261da6 100755 --- a/build.sh +++ b/build.sh @@ -181,7 +181,6 @@ generate_package_files() { debug "spl_workdir: ${spl_workdir}" debug "spl_src_target: ${spl_src_target}" debug "spl_src_hash: ${spl_src_hash}" - debug "spl_hostid_hash: ${spl_hostid_hash}" debug "zfs_bash_completion_hash: ${zfs_bash_completion_hash}" debug "zfs_initcpio_install_hash: ${zfs_initcpio_install_hash}" debug "zfs_initcpio_hook_hash: ${zfs_initcpio_hook_hash}" @@ -195,8 +194,6 @@ generate_package_files() { # Finally, generate the update packages ... msg2 "Creating spl-utils PKGBUILD" run_cmd_no_output "source ${script_dir}/src/spl-utils/PKGBUILD.sh" - msg2 "Copying spl-utils.hostid" - run_cmd_no_output "cp ${script_dir}/src/spl-utils/spl-utils.hostid ${spl_utils_pkgbuild_path}/spl-utils.hostid" msg2 "Creating spl PKGBUILD" run_cmd_no_output "source ${script_dir}/src/spl/PKGBUILD.sh" diff --git a/conf.sh b/conf.sh index d8221b5..787eca1 100644 --- a/conf.sh +++ b/conf.sh @@ -4,7 +4,6 @@ zol_version="0.6.5.7" # The ZOL source hashes are from zfsonlinux.org zfs_src_hash="4a9e271bb9a6af8d564e4d5800e4fff36224f1697b923a7253659bdda80dc590" spl_src_hash="dc8690e407183eeb7a6af0e7692d6e0a1cd323d51dd1aa492522c421b1924ea0" -spl_hostid_hash="ad95131bc0b799c0b1af477fb14fcf26a6a9f76079e48bf090acb7e8367bfd0e" zfs_bash_completion_hash="b60214f70ffffb62ffe489cbfabd2e069d14ed2a391fac0e36f914238394b540" zfs_initcpio_install_hash="8190b69853d9670c6aaf1d14c674598a14c58f8ec359e249a1c3010c0b39d074" zfs_initcpio_hook_hash="67a96169d36853d8f18ee5a2443ecfcd2461a20f9109f4b281bee3945d83518a" diff --git a/src/spl-utils/PKGBUILD.sh b/src/spl-utils/PKGBUILD.sh index c027ad6..a3af0f3 100755 --- a/src/spl-utils/PKGBUILD.sh +++ b/src/spl-utils/PKGBUILD.sh @@ -8,10 +8,8 @@ pkgrel=${spl_pkgrel} pkgdesc="Solaris Porting Layer kernel module support files." arch=("x86_64") url="http://zfsonlinux.org/" -source=("${spl_src_target}" - "spl-utils.hostid") -sha256sums=("${spl_src_hash}" - "${spl_hostid_hash}") +source=("${spl_src_target}") +sha256sums=("${spl_src_hash}") groups=("${archzfs_package_group}") license=("GPL") provides=("spl-utils") @@ -28,7 +26,6 @@ build() { package() { cd "${spl_workdir}" make DESTDIR="\${pkgdir}" install - install -D -m644 "\${srcdir}"/spl-utils.hostid "\${pkgdir}"/etc/hostid } EOF diff --git a/src/spl-utils/spl-utils.hostid b/src/spl-utils/spl-utils.hostid deleted file mode 100644 index 7bde864..0000000 --- a/src/spl-utils/spl-utils.hostid +++ /dev/null @@ -1 +0,0 @@ -ÿÿÿÿ \ No newline at end of file diff --git a/src/spl/spl.install.sh b/src/spl/spl.install.sh index 26d693f..e87fff6 100755 --- a/src/spl/spl.install.sh +++ b/src/spl/spl.install.sh @@ -2,7 +2,6 @@ cat << EOF > ${spl_pkgbuild_path}/spl.install post_install() { - check_hostid run_depmod } @@ -11,23 +10,9 @@ post_remove() { } post_upgrade() { - check_hostid run_depmod } -check_hostid() { - # Check /etc/hostid to see if it set to the sentinel value, see - # https://wiki.archlinux.org/index.php/ZFS for more information. - HOSTID=\$(hostid) - if [ "0x\${HOSTID}" == "0xffffffff" ]; then - # Generate a new hostid - : >/etc/hostid - HOSTID=\$(hostid) - # hostid is 4 byte little endian - printf \$(echo -n \$HOSTID | sed 's/\(..\)\(..\)\(..\)\(..\)/\\x\4\\x\3\\x\2\\x\1/') >/etc/hostid - fi -} - run_depmod() { echo ">>> Updating SPL module dependencies" depmod -a ${kernel_mod_path} diff --git a/src/zfs-utils/zfs-utils.initcpio.hook b/src/zfs-utils/zfs-utils.initcpio.hook index 4eee1c7..98ab909 100644 --- a/src/zfs-utils/zfs-utils.initcpio.hook +++ b/src/zfs-utils/zfs-utils.initcpio.hook @@ -103,10 +103,6 @@ run_hook() { ;; esac - if [ ! -f "/etc/hostid" ] ; then - echo "ZFS: No hostid found on kernel command line or /etc/hostid. ZFS pools may not import correctly." - fi - # Allow up to n seconds for zfs device to show up for i in {1..${ZFS_WAIT}}; do [ -c "/dev/zfs" ] && break diff --git a/src/zfs-utils/zfs-utils.initcpio.install b/src/zfs-utils/zfs-utils.initcpio.install index 43a8e01..3574a17 100644 --- a/src/zfs-utils/zfs-utils.initcpio.install +++ b/src/zfs-utils/zfs-utils.initcpio.install @@ -27,7 +27,6 @@ build() { zstreamdump \ ztest \ splat \ - hostid \ /lib/udev/vdev_id \ /lib/udev/zvol_id \ findmnt @@ -48,7 +47,6 @@ build() { [[ -f /etc/zfs/zpool.cache ]] && add_file "/etc/zfs/zpool.cache" [[ -f /etc/modprobe.d/zfs.conf ]] && add_file "/etc/modprobe.d/zfs.conf" - [[ -f /etc/hostid ]] && add_file "/etc/hostid" } help() {