summaryrefslogtreecommitdiff
path: root/pcr/spl-git/spl.install
diff options
context:
space:
mode:
authorOmar Vega Ramos <ovruni@gnu.org.pe>2015-08-28 15:51:37 -0500
committerOmar Vega Ramos <ovruni@gnu.org.pe>2015-08-28 15:51:37 -0500
commitaaca16fbbad2fbac706ffc7ccaabe92224b13ff7 (patch)
treefbb4f7b7b442744665faedf0361725cfb0749ec4 /pcr/spl-git/spl.install
parent47e71cd82ddf3f28a7c20d613feec39a642a5893 (diff)
spl-git: add new package to [pcr]
Diffstat (limited to 'pcr/spl-git/spl.install')
-rw-r--r--pcr/spl-git/spl.install37
1 files changed, 37 insertions, 0 deletions
diff --git a/pcr/spl-git/spl.install b/pcr/spl-git/spl.install
new file mode 100644
index 000000000..e316e7542
--- /dev/null
+++ b/pcr/spl-git/spl.install
@@ -0,0 +1,37 @@
+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="4.1.6-gnu-1"
+ _kernel_version_x64_full="4.1.6-gnu-1"
+
+ [[ $CARCH == "i686" ]] && _kernel_version_full=${_kernel_version_x32_full} || _kernel_version_full=${_kernel_version_x64_full}
+
+ depmod ${_kernel_version_full}
+}