From acac896cc65183d6bf20c1b843967ecebbedd079 Mon Sep 17 00:00:00 2001 From: Alexandru Antone Date: Wed, 27 Nov 2019 16:05:53 +0200 Subject: [PATCH] Add hw_type for Ampere Falcon server Signed-off-by: Alexandru Antone Change-Id: Iacc648267aa9663e9dcf9750b5a23f5eb1e07d64 --- hw-detector.spec | 4 ++-- src/hw_detector/hw_ipmi_lib.py | 1 + src/hw_detector/hw_types/hw_ampere.py | 30 ++++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 src/hw_detector/hw_types/hw_ampere.py diff --git a/hw-detector.spec b/hw-detector.spec index 268292e..2613522 100644 --- a/hw-detector.spec +++ b/hw-detector.spec @@ -14,7 +14,7 @@ Name: hw-detector Version: %{_version} -Release: 2%{?dist} +Release: 3%{?dist} Summary: Hardware detector Group: Nokia License: %{_platform_licence} @@ -22,7 +22,7 @@ Source0: %{name}-%{version}.tar.gz BuildArch: noarch Vendor: %{_platform_vendor} -Requires: python +Requires: python BuildRequires: python BuildRequires: python-setuptools diff --git a/src/hw_detector/hw_ipmi_lib.py b/src/hw_detector/hw_ipmi_lib.py index ec7eca3..8d076fc 100755 --- a/src/hw_detector/hw_ipmi_lib.py +++ b/src/hw_detector/hw_ipmi_lib.py @@ -31,6 +31,7 @@ def _load_ipmi_drivers(): subprocess.call('modprobe ipmi_msghandler', stderr=devnull, shell=True) subprocess.call('modprobe ipmi_devintf', stderr=devnull, shell=True) subprocess.call('modprobe ipmi_si', stderr=devnull, shell=True) + subprocess.call('modprobe ipmi_ssif', stderr=devnull, shell=True) def get_local_ipmi_info(): _load_ipmi_drivers() diff --git a/src/hw_detector/hw_types/hw_ampere.py b/src/hw_detector/hw_types/hw_ampere.py new file mode 100644 index 0000000..bd045b9 --- /dev/null +++ b/src/hw_detector/hw_types/hw_ampere.py @@ -0,0 +1,30 @@ +# Copyright 2019 Nokia +# Copyright 2019 ENEA + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from hw_detector.hw_type import HWType + +class HWFALCON(HWType): + def __init__(self): + super(HWFALCON, self).__init__() + self.matches = {'Board Product' : 'FALCON'} + self.hwtype = 'AMPERE' + self.vendor_name = 'AMPERE' + self.productfamily = 'FALCON' + self.disk_map = {'os': '/dev/sda', + 'osd' : ['/dev/sdb', + '/dev/sdc', + '/dev/sdd' + ] + } -- 2.16.6