summarylogtreecommitdiffstats
path: root/mdadm.install
diff options
context:
space:
mode:
authorChris Severance2015-08-03 22:52:15 -0400
committerChris Severance2015-08-03 22:52:15 -0400
commita482519685ccf6bfd671f87ec5a198d0e85a7c0f (patch)
tree673225bf42db6c4c8184124695efc69f6ef6a64e /mdadm.install
downloadaur-a482519685ccf6bfd671f87ec5a198d0e85a7c0f.tar.gz
Initial Import
Diffstat (limited to 'mdadm.install')
-rw-r--r--mdadm.install25
1 files changed, 25 insertions, 0 deletions
diff --git a/mdadm.install b/mdadm.install
new file mode 100644
index 000000000000..1a5d0eb6b447
--- /dev/null
+++ b/mdadm.install
@@ -0,0 +1,25 @@
+# arg 1: the new package version
+# arg 2: the old package version
+
+post_upgrade() {
+ if [ "$(vercmp "$2" '2.6.8-2')" -lt 0 -a "$(grep 'raid_partitions' '/etc/mkinitcpio.conf')" ]; then
+ echo "Attention mdadm update:"
+ echo "raid_partitions hook has been replaced by the more powerfull mdadm hook."
+ echo "Please update your /etc/mkinitcpio.conf accordingly."
+ fi
+ if [ -s '/etc/mkinitcpio.conf' ] && grep -q '^\s*HOOKS=".*\smdadm\s.*$' '/etc/mkinitcpio.conf'; then
+ echo "Attention mdadm update:"
+ echo "mdadm is deprecated for mdadm_udev"
+ echo "Please update your /etc/mkinitcpio.conf accordingly."
+ fi
+ if ! mdadm -D --scan >/dev/null; then
+ cat '/proc/mdstat'
+ tput 'rev'
+ echo 'One or more arrays may be damaged. Please repair soon.'
+ tput 'sgr0'
+ fi
+}
+
+post_install() {
+ post_upgrade
+}