886e4c966e
With the merge of spl and zfs the extra level of directories is not needed anymore. Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
20 lines
738 B
Bash
20 lines
738 B
Bash
#!/bin/sh
|
|
set -e
|
|
# The hostname and hostid of the last system to access a ZFS pool are stored in
|
|
# the ZFS pool itself. A pool is foreign if, during `zpool import`, the
|
|
# current hostname and hostid are different than the stored values thereof.
|
|
#
|
|
# The only way of having a stable hostid is to define it in /etc/hostid.
|
|
# This postinst helper will check if we already have the hostid stabilized by
|
|
# checking the existence of the file /etc/hostid to be 4 bytes at least.
|
|
# If this file don't already exists on our system or has less than 4 bytes, then
|
|
# a new (random) value is generated with zgenhostid (8) and stored in
|
|
# /etc/hostid
|
|
|
|
if [ ! -f /etc/hostid ] || [ "$(stat -c %s /etc/hostid)" -lt 4 ] ; then
|
|
zgenhostid
|
|
fi
|
|
|
|
#DEBHELPER#
|
|
|