Remove hostid handling

According to

acf0ade362
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
extramodules
Jesus Alvarez 9 years ago
parent 7cffa689d6
commit d571b3fb51
  1. 3
      build.sh
  2. 1
      conf.sh
  3. 7
      src/spl-utils/PKGBUILD.sh
  4. 1
      src/spl-utils/spl-utils.hostid
  5. 15
      src/spl/spl.install.sh
  6. 4
      src/zfs-utils/zfs-utils.initcpio.hook
  7. 2
      src/zfs-utils/zfs-utils.initcpio.install

@ -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"

@ -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"

@ -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

@ -1 +0,0 @@
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>

@ -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}

@ -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

@ -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() {

Loading…
Cancel
Save