summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root@cletus>2021-03-04 17:31:46 -0500
committerroot <root@cletus>2021-03-04 17:38:24 -0500
commitf80a62832bb5f296a730b238677b9b20ace7b993 (patch)
treeae4928516bb2b3ec79ad0c1c020c97cebde3d4cd
parentbd3df256b1d754dd0c032d86d709e29c7df46914 (diff)
improvementsHEADmaster
-rw-r--r--Makefile2
-rw-r--r--hpssacli-2.40-13.0_amd64.sh31
2 files changed, 22 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index 3e848b7..713813b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
1.PHONY: fix 1.PHONY: fix
2sudo = $(shell [ $$(id -u) = 0 ] || echo sudo) 2sudo = $(shell [ $$(id -u) = 0 ] || echo sudo)
3fix: 3fix:
4 $(sudo) sh hpssacli-2.40-13.0_amd64.sh 4 $(sudo) sh -x hpssacli-2.40-13.0_amd64.sh
diff --git a/hpssacli-2.40-13.0_amd64.sh b/hpssacli-2.40-13.0_amd64.sh
index 9255684..e736e79 100644
--- a/hpssacli-2.40-13.0_amd64.sh
+++ b/hpssacli-2.40-13.0_amd64.sh
@@ -1,22 +1,33 @@
1#!/bin/sh 1#!/bin/sh
2# Thanks to rmp5s on unraid.net for the solution. 2[ "$(id -u)" = 0 ] || exec sudo -- $0 "$@"
3# Thanks to Daggr for confirming the solution.
4# https://forums.unraid.net/topic/82007-solved-unraid-with-hp-p420i-raid-card-in-hp-proliant-dl380p-g8/
5 3
6#deb=hpssacli-2.40-13.0_amd64.deb 4deb=hpssacli-2.40-13.0_amd64.deb
7deb=${0%.sh}.deb 5deb=${0%.sh}.deb
8url=https://downloads.linux.hpe.com/SDR/repo/mcp/pool/non-free/$deb 6url=https://downloads.linux.hpe.com/SDR/repo/mcp/pool/non-free/$deb
9set -ex
10 7
11if ! dpkg-query -W hpssacli 8install_deb_url()
12then 9{
13 [ -e "$deb" ] || wget "$url" || curl -O "$url" 10 local url="$1" deb pkg
14 dpkg -i "$deb" 11 deb=${url##*/}
15fi 12 pkg=${deb%%-*}
13
14 if ! status=$(dpkg-query -W -f '${Status}' "$pkg") || ! [ "$status" = 'install ok installed' ]
15 then
16 [ -e "$deb" ] || wget -c "$url" || curl -O "$url"
17 dpkg -i "$deb"
18 fi
19}
16 20
21set -e
22install_deb_url "$url"
17PATH=/opt/hp/hpssacli/bld:$PATH 23PATH=/opt/hp/hpssacli/bld:$PATH
18 24
19hpssacli controller slot=0 show | 25hpssacli controller slot=0 show |
20 grep 'HBA Mode Enabled: True' || 26 grep 'HBA Mode Enabled: True' ||
21 hpssacli controller slot=0 modify hbamode=on 27 hpssacli controller slot=0 modify hbamode=on
22hpssacli rescan 28hpssacli rescan
29
30# Thanks to rmp5s on unraid.net for the solution & link.
31# Thanks to Daggr for confirming the solution.
32#
33# https://forums.unraid.net/topic/82007-solved-unraid-with-hp-p420i-raid-card-in-hp-proliant-dl380p-g8/