Skip to content

Commit

Permalink
Remove hostid handling
Browse files Browse the repository at this point in the history
According to

openzfs/spl@acf0ade
openzfs/zfs#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
  • Loading branch information
demizer committed Jul 2, 2016
1 parent cdce0ea commit b58e399
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 31 deletions.
3 changes: 0 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -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"
Expand Down
1 change: 0 additions & 1 deletion conf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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="1e20071fa61a33874505dae0f2d71bb560f43e7faaea735cbde770ea10c133df"
zfs_initcpio_hook_hash="67a96169d36853d8f18ee5a2443ecfcd2461a20f9109f4b281bee3945d83518a"
Expand Down
7 changes: 2 additions & 5 deletions src/spl-utils/PKGBUILD.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -28,7 +26,6 @@ build() {
package() {
cd "${spl_workdir}"
make DESTDIR="\${pkgdir}" install
install -D -m644 "\${srcdir}"/spl-utils.hostid "\${pkgdir}"/etc/hostid
}
EOF

Expand Down
1 change: 0 additions & 1 deletion src/spl-utils/spl-utils.hostid

This file was deleted.

15 changes: 0 additions & 15 deletions src/spl/spl.install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

cat << EOF > ${spl_pkgbuild_path}/spl.install
post_install() {
check_hostid
run_depmod
}
Expand All @@ -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}
Expand Down
4 changes: 0 additions & 4 deletions src/zfs-utils/zfs-utils.initcpio.hook
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,6 @@ run_hook() {
;;
esac

if [ ! -f "/etc/hostid" ] ; then
warning "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
Expand Down
2 changes: 0 additions & 2 deletions src/zfs-utils/zfs-utils.initcpio.install
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ build() {
zstreamdump \
ztest \
splat \
hostid \
/lib/udev/vdev_id \
/lib/udev/zvol_id \
findmnt
Expand All @@ -47,7 +46,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() {
Expand Down

0 comments on commit b58e399

Please sign in to comment.