summaryrefslogtreecommitdiff
path: root/sys-apps/ipmitool/files
diff options
context:
space:
mode:
Diffstat (limited to 'sys-apps/ipmitool/files')
-rw-r--r--sys-apps/ipmitool/files/exchange-bmc-os-info.initd23
-rw-r--r--sys-apps/ipmitool/files/ipmievd.confd27
-rw-r--r--sys-apps/ipmitool/files/ipmievd.initd28
-rw-r--r--sys-apps/ipmitool/files/ipmitool-1.8.19-CVE-2011-4339.patch20
-rw-r--r--sys-apps/ipmitool/files/ipmitool-1.8.19-fix-buffer-overflow.patch21
-rw-r--r--sys-apps/ipmitool/files/ipmitool-1.8.19-manpage-longlines.patch55
-rw-r--r--sys-apps/ipmitool/files/ipmitool-1.8.19-missing-func-decl.patch32
-rw-r--r--sys-apps/ipmitool/files/ipmitool-1.8.19-nvidia-iana.patch23
-rw-r--r--sys-apps/ipmitool/files/log_bmc.initd25
9 files changed, 254 insertions, 0 deletions
diff --git a/sys-apps/ipmitool/files/exchange-bmc-os-info.initd b/sys-apps/ipmitool/files/exchange-bmc-os-info.initd
new file mode 100644
index 000000000000..9c63983f21f3
--- /dev/null
+++ b/sys-apps/ipmitool/files/exchange-bmc-os-info.initd
@@ -0,0 +1,23 @@
+#!/sbin/openrc-run
+# Copyright 2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+# /etc/init.d/exchange-bmc-os-info
+
+name="exchange-bmc-os-info"
+description="Exchange Information between BMC and OS"
+command=/usr/libexec/exchange-bmc-os-info
+command_args=""
+: "${DEVICENUM:=0}" # which BMC
+required_files=/dev/ipmi${DEVICENUM}
+
+depend() {
+ use hostname modules
+ keyword -docker -lxc -prefix -systemd-nspawn
+}
+
+start() {
+ "${command}" start
+}
+stop() {
+ "${command}" stop
+}
diff --git a/sys-apps/ipmitool/files/ipmievd.confd b/sys-apps/ipmitool/files/ipmievd.confd
new file mode 100644
index 000000000000..b860c23c7f89
--- /dev/null
+++ b/sys-apps/ipmitool/files/ipmievd.confd
@@ -0,0 +1,27 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+# /etc/conf.d/ipmievd
+
+# Interfaces:
+# open Linux OpenIPMI Interface
+# imb Intel IMB Interface
+# bmc IPMI v2.0 BMC interface
+# lan IPMI v1.5 LAN Interface
+# lanplus IPMI v2.0 RMCP+ LAN Interface
+
+INTERFACE="open"
+
+# Commands:
+# open Use OpenIPMI for asyncronous notification of events
+# sel Poll SEL for notification of events
+#
+# 'pidfile=...' will be appended!
+COMMAND="open daemon"
+
+# Options.
+
+OPTIONS=""
+
+# Device number:
+# Used to target a specific BMC on a multi-node, multi-BMC system via the open interface
+DEVICENUM=0
diff --git a/sys-apps/ipmitool/files/ipmievd.initd b/sys-apps/ipmitool/files/ipmievd.initd
new file mode 100644
index 000000000000..e8ef2c39d454
--- /dev/null
+++ b/sys-apps/ipmitool/files/ipmievd.initd
@@ -0,0 +1,28 @@
+#!/sbin/openrc-run
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+# /etc/init.d/ipmievd
+
+depend() {
+ use logger modules
+ keyword -docker -lxc -prefix -systemd-nspawn
+}
+
+# TODO: ipmievd has a mode where it could be used to monitor multiple BMCs via
+# DEVICENUM or remote systems, and it would be valid to run multiple instances.
+# That is not supported by this init script at this time.
+
+description="IPMI event daemon for sending events to syslog LOCAL4"
+
+: "${DEVICENUM:=0}"
+: "${INTERFACE:=open}"
+: "${COMMAND:=open daemon}"
+: "${OPTIONS:=}"
+
+daemon=ipmievd
+
+pidfile=/run/${daemon}.pid${DEVICENUM} # see manpage re suffix
+command=/usr/sbin/${daemon}
+cachefile=/run/${daemon}.${DEVICENUM}.sdr-cache
+command_args="-d ${DEVICENUM} -S ${cachefile} -I ${INTERFACE} ${OPTIONS} ${COMMAND} pidfile=${pidfile}"
+required_files=/dev/ipmi$DEVICENUM
diff --git a/sys-apps/ipmitool/files/ipmitool-1.8.19-CVE-2011-4339.patch b/sys-apps/ipmitool/files/ipmitool-1.8.19-CVE-2011-4339.patch
new file mode 100644
index 000000000000..4a25280662b5
--- /dev/null
+++ b/sys-apps/ipmitool/files/ipmitool-1.8.19-CVE-2011-4339.patch
@@ -0,0 +1,20 @@
+Description: CVE-2011-4339
+ insecure file permission when creating PID files
+ based on 112_fix_CVE-2011-4339
+Author: Jörg Frings-Fürst <debian@jff-webhosting.net>
+Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=651917
+Forwarded: https://sourceforge.net/p/ipmitool/patches/99/
+Last-Update: 2020-10-21
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+diff -Nuar --exclude '*.orig' ipmitool-50d8c36edf9657720e25445a435dabc44572cf5f.orig/lib/helper.c ipmitool-50d8c36edf9657720e25445a435dabc44572cf5f/lib/helper.c
+--- ipmitool-50d8c36edf9657720e25445a435dabc44572cf5f.orig/lib/helper.c 2020-08-07 00:53:06.000000000 -0700
++++ ipmitool-50d8c36edf9657720e25445a435dabc44572cf5f/lib/helper.c 2020-10-21 13:59:02.335206233 -0700
+@@ -917,7 +917,6 @@
+ lprintf(LOG_ERR, "chdir failed: %s (%d)", strerror(errno), errno);
+ exit(1);
+ }
+- umask(0);
+
+ for (fd=0; fd<64; fd++) {
+ if (fd != intf->fd)
diff --git a/sys-apps/ipmitool/files/ipmitool-1.8.19-fix-buffer-overflow.patch b/sys-apps/ipmitool/files/ipmitool-1.8.19-fix-buffer-overflow.patch
new file mode 100644
index 000000000000..ceeffde085a7
--- /dev/null
+++ b/sys-apps/ipmitool/files/ipmitool-1.8.19-fix-buffer-overflow.patch
@@ -0,0 +1,21 @@
+Description: fix buffer overflow
+ based on 101_fix_buf_overflow from Leo Iannacone <l3on@ubuntu.com>
+Author: Jörg Frings-Fürst <debian@jff-webhosting.net>
+Bug: TSOL buffer overflow
+Bug-ubuntu: https://bugs.launchpad.net/ubuntu/+source/ipmitool/+bug/633054
+Forwarded: https://sourceforge.net/p/ipmitool/patches/100/
+Last-Update: 2020-20-21
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+diff -Nuar --exclude '*.orig' ipmitool-50d8c36edf9657720e25445a435dabc44572cf5f.orig/lib/ipmi_tsol.c ipmitool-50d8c36edf9657720e25445a435dabc44572cf5f/lib/ipmi_tsol.c
+--- ipmitool-50d8c36edf9657720e25445a435dabc44572cf5f.orig/lib/ipmi_tsol.c 2020-08-07 00:53:06.000000000 -0700
++++ ipmitool-50d8c36edf9657720e25445a435dabc44572cf5f/lib/ipmi_tsol.c 2020-10-21 13:55:58.571536858 -0700
+@@ -374,7 +374,7 @@
+ char *recvip = NULL;
+ char in_buff[IPMI_BUF_SIZE];
+ char out_buff[IPMI_BUF_SIZE * 8];
+- char buff[IPMI_BUF_SIZE + 4];
++ char buff[IPMI_BUF_SIZE * 8 + 4];
+ int fd_socket, result, i;
+ int out_buff_fill, in_buff_fill;
+ int ip1, ip2, ip3, ip4;
diff --git a/sys-apps/ipmitool/files/ipmitool-1.8.19-manpage-longlines.patch b/sys-apps/ipmitool/files/ipmitool-1.8.19-manpage-longlines.patch
new file mode 100644
index 000000000000..6c0e00da3e15
--- /dev/null
+++ b/sys-apps/ipmitool/files/ipmitool-1.8.19-manpage-longlines.patch
@@ -0,0 +1,55 @@
+Description: long lines in man-page
+ prevent "can't break line" warnings
+Author: Jörg Frings-Fürst <debian@jff-webhosting.net>
+Forwarded: not-needed
+Last-Update: 2020-10-21
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+diff -Nuar --exclude '*.orig' ipmitool-50d8c36edf9657720e25445a435dabc44572cf5f.orig/doc/ipmitool.1.in ipmitool-50d8c36edf9657720e25445a435dabc44572cf5f/doc/ipmitool.1.in
+--- ipmitool-50d8c36edf9657720e25445a435dabc44572cf5f.orig/doc/ipmitool.1.in 2020-08-07 00:53:06.000000000 -0700
++++ ipmitool-50d8c36edf9657720e25445a435dabc44572cf5f/doc/ipmitool.1.in 2020-10-21 14:00:23.383643880 -0700
+@@ -1038,7 +1038,7 @@
+ AMC slot B2 topology:
+ Port 0 =====> On Carrier Device ID 0, Port 3
+ Port 2 =====> AMC slot B1, Port 2
+- *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
++ *-*-*-* *-*-* *-*-* *-*-* *-*-* *-*-* *-*-*
+ From Carrier file: carrierfru
+ On Carrier Device ID 0 topology:
+ Port 0 =====> AMC slot B1, Port 4
+@@ -1094,7 +1094,7 @@
+ \-Link Type: AMC.2 Ethernet
+ \-Link Type extension: 1000BASE-BX (SerDES Gigabit) Ethernet link
+ \-Link Group ID: 0 || Link Asym. Match: exact match
+- *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
++ *-*-*-* *-*-* *-*-* *-*-* *-*-* *-*-* *-*-*
+ AMC slot B1 port 1 ==> On-Carrier Device 0 port 12
+ Matching Result
+ - From On-Carrier Device ID 0
+@@ -1107,7 +1107,7 @@
+ \-Link Type: AMC.2 Ethernet
+ \-Link Type extension: 1000BASE-BX (SerDES Gigabit) Ethernet link
+ \-Link Group ID: 0 || Link Asym. Match: exact match
+- *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
++ *-*-*-* *-*-* *-*-* *-*-* *-*-* *-*-* *-*-*
+ On-Carrier Device vs AMC slot A2
+ AMC slot A2 port 0 ==> On-Carrier Device 0 port 3
+ Matching Result
+@@ -1121,7 +1121,7 @@
+ \-Link Type: AMC.2 Ethernet
+ \-Link Type extension: 1000BASE-BX (SerDES Gigabit) Ethernet link
+ \-Link Group ID: 0 || Link Asym. Match: exact match
+- *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
++ *-*-*-* *-*-* *-*-* *-*-* *-*-* *-*-* *-*-*
+ AMC slot B1 vs AMC slot A2
+ AMC slot A2 port 2 ==> AMC slot B1 port 2
+ Matching Result
+@@ -1135,7 +1135,7 @@
+ \-Link Type: AMC.3 Storage
+ \-Link Type extension: Serial Attached SCSI (SAS/SATA)
+ \-Link Group ID: 0 || Link Asym. Match: FC or SAS interface {exact match}
+- *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
++ *-*-*-* *-*-* *-*-* *-*-* *-*-* *-*-* *-*-*
+ .TP
+ \fIunmatch\fP <\fBxx=filename\fR> <\fBxx=filename\fR> \fB...\fr
+ .br
diff --git a/sys-apps/ipmitool/files/ipmitool-1.8.19-missing-func-decl.patch b/sys-apps/ipmitool/files/ipmitool-1.8.19-missing-func-decl.patch
new file mode 100644
index 000000000000..5057fcaf0525
--- /dev/null
+++ b/sys-apps/ipmitool/files/ipmitool-1.8.19-missing-func-decl.patch
@@ -0,0 +1,32 @@
+https://github.com/ipmitool/ipmitool/pull/360
+
+From a9e262480722f5affd237ee10d0bbc8c55617cb7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 2 Sep 2022 07:30:10 -0700
+Subject: [PATCH] ipmi_fru.c: Provide missing function declarations
+
+Fixes build with clang-15+
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/ipmi_fru.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/lib/ipmi_fru.c b/lib/ipmi_fru.c
+index 3d1d8a1a..5c5661cf 100644
+--- a/lib/ipmi_fru.c
++++ b/lib/ipmi_fru.c
+@@ -60,6 +60,13 @@ static const char *section_id[4] = {
+ "Board Section",
+ "Product Section"
+ };
++/* From lib/ipmi_hpmfwupg.c: */
++uint16_t
++ipmi_intf_get_max_request_data_size(struct ipmi_intf * intf);
++
++/* From src/plugins/ipmi_intf.c: */
++uint16_t
++ipmi_intf_get_max_response_data_size(struct ipmi_intf * intf);
+
+ static const char * combined_voltage_desc[] = {
+ "12 V",
diff --git a/sys-apps/ipmitool/files/ipmitool-1.8.19-nvidia-iana.patch b/sys-apps/ipmitool/files/ipmitool-1.8.19-nvidia-iana.patch
new file mode 100644
index 000000000000..31b1a42dcf59
--- /dev/null
+++ b/sys-apps/ipmitool/files/ipmitool-1.8.19-nvidia-iana.patch
@@ -0,0 +1,23 @@
+Description: Add IANA ID for NVIDIA hardware
+ Add the NVIDIA IANA ID to the hardcoded list used in ipmitool <= 1.8.18.
+ After upstream commit "9d41136 ID:491 - Fetch vendor IDs from IANA", ipmitool
+ generates a list of vendor IDs dynamically at build time, so we can drop this
+ patch in future releases.
+Author: dann frazier <dannf@debian.org>
+Origin: backport
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=903616
+Forwarded: not-needed
+Last-Update: 2020-10-21
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+diff -Nuar --exclude '*.orig' --exclude '*.rej' ipmitool-50d8c36edf9657720e25445a435dabc44572cf5f.orig/include/ipmitool/ipmi.h ipmitool-50d8c36edf9657720e25445a435dabc44572cf5f/include/ipmitool/ipmi.h
+--- ipmitool-50d8c36edf9657720e25445a435dabc44572cf5f.orig/include/ipmitool/ipmi.h 2020-08-07 00:53:06.000000000 -0700
++++ ipmitool-50d8c36edf9657720e25445a435dabc44572cf5f/include/ipmitool/ipmi.h 2020-10-21 14:04:11.675128602 -0700
+@@ -281,6 +281,7 @@
+ /* 4769 for [IBM Corporation] */
+ IPMI_OEM_IBM_4769 = 4769,
+ IPMI_OEM_MAGNUM = 5593,
++ IPMI_OEM_NVIDIA = 5703,
+ IPMI_OEM_TYAN = 6653,
+ IPMI_OEM_QUANTA = 7244,
+ IPMI_OEM_VIKING = 9237,
diff --git a/sys-apps/ipmitool/files/log_bmc.initd b/sys-apps/ipmitool/files/log_bmc.initd
new file mode 100644
index 000000000000..4064edf3b84d
--- /dev/null
+++ b/sys-apps/ipmitool/files/log_bmc.initd
@@ -0,0 +1,25 @@
+#!/sbin/openrc-run
+# Copyright 2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+name="log_bmc"
+description="Add SEL entries to indicate OS Boot status"
+command=/usr/libexec/log_bmc.sh
+command_args=""
+: "${DEVICENUM:=0}" # which BMC
+required_files=/dev/ipmi${DEVICENUM}
+
+depend() {
+ use modules
+ after ipmievd # to capture our own log event
+ keyword -docker -lxc -prefix -systemd-nspawn
+}
+
+start() {
+ # TODO: should this keep start so it only fires once per boot?
+ "${command}" os_boot
+}
+
+stop() {
+ "${command}" os_shutdown
+}