diff options
author | root <root@cletus> | 2021-03-04 17:31:46 -0500 |
---|---|---|
committer | root <root@cletus> | 2021-03-04 17:38:24 -0500 |
commit | f80a62832bb5f296a730b238677b9b20ace7b993 (patch) | |
tree | ae4928516bb2b3ec79ad0c1c020c97cebde3d4cd | |
parent | bd3df256b1d754dd0c032d86d709e29c7df46914 (diff) |
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | hpssacli-2.40-13.0_amd64.sh | 31 |
2 files changed, 22 insertions, 11 deletions
@@ -1,4 +1,4 @@ | |||
1 | .PHONY: fix | 1 | .PHONY: fix |
2 | sudo = $(shell [ $$(id -u) = 0 ] || echo sudo) | 2 | sudo = $(shell [ $$(id -u) = 0 ] || echo sudo) |
3 | fix: | 3 | fix: |
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 | 4 | deb=hpssacli-2.40-13.0_amd64.deb |
7 | deb=${0%.sh}.deb | 5 | deb=${0%.sh}.deb |
8 | url=https://downloads.linux.hpe.com/SDR/repo/mcp/pool/non-free/$deb | 6 | url=https://downloads.linux.hpe.com/SDR/repo/mcp/pool/non-free/$deb |
9 | set -ex | ||
10 | 7 | ||
11 | if ! dpkg-query -W hpssacli | 8 | install_deb_url() |
12 | then | 9 | { |
13 | [ -e "$deb" ] || wget "$url" || curl -O "$url" | 10 | local url="$1" deb pkg |
14 | dpkg -i "$deb" | 11 | deb=${url##*/} |
15 | fi | 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 | ||
21 | set -e | ||
22 | install_deb_url "$url" | ||
17 | PATH=/opt/hp/hpssacli/bld:$PATH | 23 | PATH=/opt/hp/hpssacli/bld:$PATH |
18 | 24 | ||
19 | hpssacli controller slot=0 show | | 25 | hpssacli 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 |
22 | hpssacli rescan | 28 | hpssacli 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/ | ||