diff options
author | Omar Vega Ramos <ovruni@gnu.org.pe> | 2016-05-02 13:00:53 -0500 |
---|---|---|
committer | Omar Vega Ramos <ovruni@gnu.org.pe> | 2016-05-02 13:00:53 -0500 |
commit | 607f0124ed64cfeff9976dffb0650702b54a298d (patch) | |
tree | 98313d29a1735dbfe676a7e67590538243655ebd /pcr/spl-dkms/spl.install | |
parent | 8464403d50322dd104ae099d1d5af3753edf2d5c (diff) |
Removing spl-utils-git. Use spl-utils instead
Diffstat (limited to 'pcr/spl-dkms/spl.install')
-rw-r--r-- | pcr/spl-dkms/spl.install | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/pcr/spl-dkms/spl.install b/pcr/spl-dkms/spl.install new file mode 100644 index 000000000..1438151a8 --- /dev/null +++ b/pcr/spl-dkms/spl.install @@ -0,0 +1,16 @@ +post_install() { + check_hostid +} + +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 +} |