mirror of https://github.com/archzfs/archzfs
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
926 B
37 lines
926 B
post_install() {
|
|
check_hostid
|
|
run_depmod
|
|
}
|
|
|
|
post_remove() {
|
|
run_depmod
|
|
}
|
|
|
|
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 module dependencies. Please wait ..."
|
|
|
|
_kernel_version_x32_full="3.10.45-1"
|
|
_kernel_version_x64_full="3.10.45-1"
|
|
|
|
[[ $CARCH == "i686" ]] && _kernel_version_full=${_kernel_version_x32_full} || _kernel_version_full=${_kernel_version_x64_full}
|
|
|
|
depmod ${_kernel_version_full}-lts
|
|
}
|
|
|