dreport: Remove IBM and OpenPower plugin dump scripts
IBM and OpenPower plugins are being moved to openpower-debug-collector
repository. So these scripts can be removed from here.
Recipe changes to remove installation of these scripts from this
repository.https://gerrit.openbmc.org/c/openbmc/openbmc/+/71687/
Tested:
Verified that scripts are getting installed correctly from
openpower-debug-collector instead of this repo.
Change-Id: Ie9b2bbfc6ec94aa27f49d635be40ec41ecf95763
Signed-off-by: Gopichand Paturi <gopichandpaturi@gmail.com>
diff --git a/tools/dreport.d/ibm.d/gendumpheader b/tools/dreport.d/ibm.d/gendumpheader
deleted file mode 100755
index cc49177..0000000
--- a/tools/dreport.d/ibm.d/gendumpheader
+++ /dev/null
@@ -1,226 +0,0 @@
-#!/bin/bash
-#
-#Header for BMC DUMP
-#This script will create header file only for IBM systems.
-#This script will generate generic IBM dump header format.
-#
-#Note: The dump header will be imposed on the dump file i.e
-#<obmdump file>.tar.xz only on IBM specific systems, user needs to
-#separate out the header before extracting the dump.
-#
-
-#Constants
-declare -rx INVENTORY_MANAGER='xyz.openbmc_project.Inventory.Manager'
-declare -rx INVENTORY_PATH='/xyz/openbmc_project/inventory/system'
-declare -rx INVENTORY_ASSET_INT='xyz.openbmc_project.Inventory.Decorator.Asset'
-declare -rx DUMP_HEADER_ENTRY_SIZE='516'
-declare -rx INVENTORY_BMC_BOARD='/xyz/openbmc_project/inventory/system/chassis/motherboard'
-declare -rx SIZE_4='4'
-declare -rx SIZE_8='8'
-declare -rx SIZE_12='12'
-declare -rx SIZE_32='32'
-
-#Variables
-declare -x FILE="/tmp/dumpheader_$EPOCHTIME"
-declare -x dumpSize=$(ls -al $name_dir.tar.xz | awk '{print $5}')
-declare -x modelNo=$(busctl get-property $INVENTORY_MANAGER $INVENTORY_PATH \
- $INVENTORY_ASSET_INT Model | cut -d " " -f 2 | sed "s/^\(\"\)\(.*\)\1\$/\2/g")
-
-declare -x serialNo=$(busctl get-property $INVENTORY_MANAGER $INVENTORY_PATH \
- $INVENTORY_ASSET_INT SerialNumber | cut -d " " -f 2 | sed "s/^\(\"\)\(.*\)\1\$/\2/g")
-
-declare -x dDay=$(date -d @$EPOCHTIME +'%Y%m%d%H%M%S')
-
-declare -x bmcSerialNo=$(busctl call $INVENTORY_MANAGER $INVENTORY_BMC_BOARD \
- org.freedesktop.DBus.Properties Get ss $INVENTORY_ASSET_INT \
- SerialNumber | cut -d " " -f 3 | sed "s/^\(\"\)\(.*\)\1\$/\2/g")
-
-#Function to add NULL
-function add_null() {
- local a=$1
- printf '%*s' $a | tr ' ' "\0" >> $FILE
-}
-
-#Function to is to convert the EPOCHTIME collected
-#from dreport into hex values and write the same in
-#header.
-function dump_time() {
- x=${#dDay}
- msize=`expr $x / 2`
- msize=`expr $SIZE_8 - $msize`
- for ((i=0;i<$x;i+=2));
- do
- printf \\x${dDay:$i:2} >> $FILE
- done
- add_null $msize
-}
-
-#Function to fetch the size of the dump
-function dump_size() {
- #Adding 516 bytes as the total dump size is dump tar size
- #plus the dump header entry in this case
- #dump_header and dump_entry
- sizeDump=`expr $dumpSize + $DUMP_HEADER_ENTRY_SIZE`
- printf -v hex "%x" $sizeDump
- x=${#hex}
- if [ $(($x % 2)) -eq 1 ]; then
- hex=0$hex
- x=${#hex}
- fi
- msize=`expr $x / 2`
- msize=`expr $SIZE_8 - $msize`
- add_null $msize
- for ((i=0;i<$x;i+=2));
- do
- printf \\x${hex:$i:2} >> $FILE
- done
-}
-
-#Function to set dump id to 8 bytes format
-function get_dump_id() {
- x=${#dump_id}
- nulltoadd=`expr $SIZE_8 - $x`
- printf '%*s' $nulltoadd | tr ' ' "0" >> $FILE
- printf $dump_id >> $FILE
-}
-
-#Function to get the bmc serial number
-function getbmc_serial() {
- x=${#bmcSerialNo}
- nulltoadd=`expr $SIZE_12 - $x`
- printf $bmcSerialNo >> $FILE
- printf '%*s' $nulltoadd | tr ' ' "0" >> $FILE
-}
-
-#Function to add virtual file directory entry, consists of below entries
-####################FORMAT################
-#Name Size(bytes) Value
-#Entry Header 8 FILE
-#Entry Size 2 0x0040
-#Reserved 10 NULL
-#Entry Type 2 0x0001
-#File Name Prefix 2 0x000F
-#Dump File Type 7 BMCDUMP
-#Separator 1 .
-#System Serial No 7 System serial number fetched from system
-#Dump Identifier 8 Dump Identifier value fetched from dump
-#Separator 1 .
-#Time stamp 14 Form should be yyyymmddhhmmss
-#Null Terminator 1 0x00
-function dump_file_entry() {
- printf "FILE " >> $FILE
- add_null 1
- printf '\x40' >> $FILE #Virtual file directory entry size
- add_null 11
- printf '\x01' >> $FILE
- add_null 1
- printf '\x0F' >> $FILE
- printf "BMPDUMP.%s." "$serialNo" >> $FILE
- get_dump_id
- printf "." >> $FILE
- printf $dDay >> $FILE #UTC time stamp
- add_null 1
-}
-
-#Function section directory entry, consists of below entries
-####################FORMAT################
-#Name Size(bytes) Value
-#Entry Header 8 SECTION
-#Entry Size 2 0x0030
-#Section Priority 2 0x0000
-#Reserved 4 NULL
-#Entry Flags 4 0x00000001
-#Entry Types 2 0x0002
-#Reserved 2 NULL
-#Dump Size 8 Dump size in hex + dump header
-#Optional Section 16 BMCDUMP
-function dump_section_entry() {
- printf "SECTION " >> $FILE
- add_null 1
- printf '\x30' >> $FILE #Section entry size
- add_null 9
- printf '\x01' >> $FILE
- add_null 1
- printf '\x02' >> $FILE
- add_null 2
- dump_size #Dump size
- printf "BMCDUMP" >> $FILE
- add_null 9
-}
-
-#Function to add dump header, consists of below entries
-####################FORMAT################
-#Name Size(bytes) Value
-#Dump type 8 BMC DUMP
-#Dump Request time 8 Dump request time stamp (in BCD)
-#Dump Identifier 4 Dump identifer fetched from dump
-#Dump version 2 0x0210
-#Dump header 2 0x200
-#Total dump size 8 Dump size + dump header
-#Panel function 32 System model, feature, type and IPL mode
-#System Name 32 System Name (in ASCII)
-#Serial number 7 System serial number
-#Reserved 1 NULL
-#PLID 4 Comes from errorlog
-#File Header Size 2 0x70
-#Dump SRC Size 2 Dump SRC Size. Currently NULL
-#DUMP SRC 320 DUMP SRC. Currently NULL
-#Dump Req Type 4 Dump requester user interface type.
-#Dump Req ID 32 Dump requester user interface ID
-#Dump Req user ID 32 Dump requester user ID.
-#
-#TODO: Github issue #2639, to populate the unpopulated elements.
-#Note: Unpopulated elements are listed below are set as NULL
-#PLID
-#SRC size
-#SRC dump
-#Dump requestor type
-#Dump Req ID
-#Dump Req user ID
-function dump_header() {
- printf "BMC DUMP" >> $FILE
- dump_time
- add_null 4 #Dump Identifier
- printf '\x02' >> $FILE #Dump version 0x0210
- printf '\x10' >> $FILE
- printf '\x02' >> $FILE #Dump header size 0x0200
- add_null 1
- dump_size #dump size
- printf $modelNo >> $FILE
- add_null 24
- printf "Server-%s-SN-%s" "$modelNo" "$serialNo" >> $FILE
- add_null 7
- printf $serialNo >> $FILE
- add_null 1
- add_null 4 #PLID
- printf '\x70' >> $FILE #File header size
- add_null 2 # SRC size
- add_null 320 # SRC dump
- getbmc_serial
- add_null 68 # Dump requester details
-}
-
-#Function to add Dump entry, consists of below entries
-####################FORMAT################
-#Name Size(bytes) Value
-#Dump Entry Version 1 0x01
-#BMC Dump Valid 1 0x01
-#No of Dump Entry 2 Number of Dump Entry
-#
-function dump_entry() {
- printf '\x01' >> $FILE #Dump entry version
- printf '\x01' >> $FILE #Dump valid
- add_null 1
- printf '\x10' >> $FILE #Dump entry
-}
-
-#main function
-function gen_header_package() {
- dump_file_entry
- dump_section_entry
- dump_header
- dump_entry
-}
-
-#Run gen_header_package
-gen_header_package
diff --git a/tools/dreport.d/ibm.d/plugins.d/badpel b/tools/dreport.d/ibm.d/plugins.d/badpel
deleted file mode 100644
index a1de332..0000000
--- a/tools/dreport.d/ibm.d/plugins.d/badpel
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env bash
-#
-# config: 2 20
-# @brief: Save the 'badPEL' file
-#
-
-. $DREPORT_INCLUDE/functions
-
-desc="Bad PEL file"
-file_name="/var/lib/phosphor-logging/extensions/pels/badPEL"
-
-if [ -e "$file_name" ]; then
- add_copy_file "$file_name" "$desc"
-fi
diff --git a/tools/dreport.d/ibm.d/plugins.d/pels b/tools/dreport.d/ibm.d/plugins.d/pels
deleted file mode 100644
index fd531f1..0000000
--- a/tools/dreport.d/ibm.d/plugins.d/pels
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/bash
-#
-# config: 23 20
-#
-# 23 = User dump(2), elog dump(3)
-# 20 = priority
-
-# @brief: Collect the PEL files
-
-# shellcheck disable=SC1091
-. "$DREPORT_INCLUDE"/functions
-
-dir="/var/lib/phosphor-logging/extensions/pels/logs"
-desc="PEL Files"
-if [ -d $dir ]; then
- add_copy_file "$dir" "$desc"
-fi
diff --git a/tools/dreport.d/ibm.d/plugins.d/vpd_data b/tools/dreport.d/ibm.d/plugins.d/vpd_data
deleted file mode 100644
index f146e47..0000000
--- a/tools/dreport.d/ibm.d/plugins.d/vpd_data
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/usr/bin/env bash
-#
-# config: 2 50
-# @brief: Collect VPD persistent data
-#
-
-. $DREPORT_INCLUDE/functions
-
-file_name="/var/lib/vpd"
-desc="VPD persistent data"
-
-if [ -d "$file_name" ]; then
- add_copy_file "$file_name" "$desc"
-else
- log_info "No $desc data"
-fi
-
-desc="Bad VPD"
-dir_name="/tmp/bad-vpd"
-
-if [ -f $dir_name ]; then
- add_copy_file "$dir_name" "$desc"
-else
- log_info "No $desc data"
-fi
diff --git a/tools/dreport.d/openpower.d/plugins.d/cfam b/tools/dreport.d/openpower.d/plugins.d/cfam
deleted file mode 100644
index b34de6b..0000000
--- a/tools/dreport.d/openpower.d/plugins.d/cfam
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/usr/bin/env bash
-#
-# config: 234 10
-# @brief: Add CFAM details to dump.
-#
-
-# shellcheck disable=SC1091
-. "$DREPORT_INCLUDE"/functions
-
-source /etc/profile.d/power-target.sh
-
-file_name="cfam.log"
-if [ -e "/usr/bin/edbg" ]; then
- desc="cfam 283c"
- command="/usr/bin/edbg getcfam pu 283c -pall"
- add_cmd_output "$command" "$file_name" "$desc"
-
- desc="cfam 1007"
- command="/usr/bin/edbg getcfam pu 1007 -pall"
- add_cmd_output "$command" "$file_name" "$desc"
-
- desc="cfam 2809"
- command="/usr/bin/edbg getcfam pu 2809 -pall"
- add_cmd_output "$command" "$file_name" "$desc"
-fi
diff --git a/tools/dreport.d/openpower.d/plugins.d/dumpfilelist b/tools/dreport.d/openpower.d/plugins.d/dumpfilelist
deleted file mode 100644
index 805a93e..0000000
--- a/tools/dreport.d/openpower.d/plugins.d/dumpfilelist
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/usr/bin/env bash
-#
-# config: 2 30
-# @brief: Get the dump and core file information
-#
-
-# shellcheck disable=SC1091
-. "$DREPORT_INCLUDE"/functions
-
-#core files
-file_name="dumplist.log"
-desc="Dumps"
-command="busctl call --verbose --no-pager \
- xyz.openbmc_project.Dump.Manager \
- /xyz/openbmc_project/dump \
- org.freedesktop.DBus.ObjectManager \
- GetManagedObjects"
-if ! add_cmd_output "$command" "$file_name" "$desc";
-then
- #bmc dumps
- dir="/var/lib/phosphor-debug-collector/dumps/"
- desc="BMC dumps"
- if [ -d "$dir" ] && [ -n "$(ls -A $dir/)" ]; then
- add_cmd_output "echo $'[$desc]'" "$file_name" "$desc"
- add_cmd_output "ls -AX $dir/*/*" "$file_name" "$desc"
- else
- log_info "$desc directory is empty"
- fi
-
- #hardware dumps
- dir="/var/lib/phosphor-debug-collector/hardwaredump/"
- desc="Hardware dumps"
- if [ -d "$dir" ] && [ -n "$(ls -A $dir/)" ]; then
- add_cmd_output "echo $'\n[$desc]'" "$file_name" "$desc"
- add_cmd_output "ls -AX $dir/*/*" "$file_name" "$desc"
- else
- log_info "$desc directory is empty"
- fi
-
-
- #hostboot dumps
- dir="/var/lib/phosphor-debug-collector/hostbootdump/"
- desc="Hostboot dumps"
- if [ -d "$dir" ] && [ -n "$(ls -A $dir/)" ]; then
- add_cmd_output "echo $'\n[$desc]'" "$file_name" "$desc"
- add_cmd_output "ls -AX $dir/*/*" "$file_name" "$desc"
- else
- log_info "$desc directory is empty"
- fi
-
-
- #sbe dumps
- dir="/var/lib/phosphor-debug-collector/sbedump/"
- desc="SBE dumps"
- if [ -d "$dir" ] && [ -n "$(ls -A $dir/)" ]; then
- add_cmd_output "echo $'\n[$desc]'" "$file_name" "$desc"
- add_cmd_output "ls -AX $dir/*/*" "$file_name" "$desc"
- else
- log_info "$desc directory is empty"
- fi
-fi
-
-#capture core file list
-dir="/var/lib/systemd/coredump/"
-desc="core files"
-if [ -d "$dir" ] && [ -n "$(ls -A $dir/)" ] && [ -n "$(ls -A $dir/core*)" ]; then
- add_cmd_output "echo $'[$desc]'" "$file_name" "$desc"
- add_cmd_output "ls -AX $dir/core*" "$file_name" "$desc"
-else
- log_info "$desc directory is empty"
-fi
-
diff --git a/tools/dreport.d/openpower.d/plugins.d/guardlist b/tools/dreport.d/openpower.d/plugins.d/guardlist
deleted file mode 100644
index 919a9d1..0000000
--- a/tools/dreport.d/openpower.d/plugins.d/guardlist
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/bash
-#
-# config: 234 40
-# @brief: Collect GUARD record information.
-#
-
-# shellcheck disable=SC1091
-. "$DREPORT_INCLUDE"/functions
-
-desc="GUARD Records"
-source /etc/profile.d/power-target.sh
-
-guard_part_file="/var/lib/phosphor-software-manager/hostfw/running/GUARD"
-
-# Check file is present and not empty.
-if [ -e "$guard_part_file" ]; then
- add_copy_file "$guard_part_file" "$desc"
-fi
-
-# collect guarded list
-guard_log_file=guard.log
-if [ -e "/usr/bin/guard" ]; then
- desc="Guard list"
- add_cmd_output "echo $'[$desc]'" "$guard_log_file" "$desc"
- add_cmd_output "/usr/bin/guard -l" "$guard_log_file" "$desc"
-
- desc="Guard resolved records"
- add_cmd_output "echo $'\n[$desc]'" "$guard_log_file" "$desc"
- add_cmd_output "/usr/bin/guard -a" "$guard_log_file" "$desc"
-
- desc="Guard ephemeral records"
- add_cmd_output "echo $'\n[$desc]'" "$guard_log_file" "$desc"
- add_cmd_output "/usr/bin/guard -e" "$guard_log_file" "$desc"
-fi
diff --git a/tools/dreport.d/openpower.d/plugins.d/obmcconsole1 b/tools/dreport.d/openpower.d/plugins.d/obmcconsole1
deleted file mode 100644
index c6e7781..0000000
--- a/tools/dreport.d/openpower.d/plugins.d/obmcconsole1
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/usr/bin/env bash
-#
-# config: 2 25
-# @brief: Collect OBMC console1 log.
-#
-
-. $DREPORT_INCLUDE/functions
-
-desc="OBMC console1 log"
-file_name="/var/log/obmc-console1.log"
-if [ -e $file_name ]; then
- add_copy_file "$file_name" "$desc"
-fi
diff --git a/tools/dreport.d/openpower.d/plugins.d/occ b/tools/dreport.d/openpower.d/plugins.d/occ
deleted file mode 100644
index 3e9c805..0000000
--- a/tools/dreport.d/openpower.d/plugins.d/occ
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/usr/bin/env bash
-#
-# config: 234 10
-# @brief: Get the occ information.
-#
-
-# shellcheck disable=SC1091
-. "$DREPORT_INCLUDE"/functions
-
-#fetch occ control data
-file_name="occ.log"
-
-desc="occ control"
-command="busctl call --verbose --no-pager \
- org.open_power.OCC.Control \
- /org/open_power/control \
- org.freedesktop.DBus.ObjectManager \
- GetManagedObjects"
-
-add_cmd_output "$command" "$file_name" "$desc"
-
-#fetch occ control host data
-desc="occ conrol host"
-command="busctl call --verbose --no-pager \
- org.open_power.OCC.Control \
- /xyz/openbmc_project/control \
- org.freedesktop.DBus.ObjectManager \
- GetManagedObjects"
-add_cmd_output "$command" "$file_name" "$desc"
-
-#fetch occ sensors data
-desc="occ sensor"
-command="busctl call --verbose --no-pager \
- org.open_power.OCC.Control \
- /xyz/openbmc_project/sensors \
- org.freedesktop.DBus.ObjectManager \
- GetManagedObjects"
-add_cmd_output "$command" "$file_name" "$desc"
-
-occ_dir="/var/lib/openpower-occ-control"
-if [ -d "$occ_dir" ]; then
- add_copy_file "$occ_dir" "$desc"
-fi
diff --git a/tools/dreport.d/openpower.d/plugins.d/phal_devtree b/tools/dreport.d/openpower.d/plugins.d/phal_devtree
deleted file mode 100644
index bf768ee..0000000
--- a/tools/dreport.d/openpower.d/plugins.d/phal_devtree
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/env bash
-#
-# config: 234 25
-# @brief: Collect PHAL devtree debug data
-#
-
-# shellcheck disable=SC1091
-. "$DREPORT_INCLUDE"/functions
-
-# shellcheck source=./power-target.sh
-source /etc/profile.d/power-target.sh
-
-#export attributes list to attribute_list.txt
-attributes="/usr/bin/attributes"
-file_name="PHAL_devtree.txt"
-attr_cmd="$attributes export"
-desc="Attribute list"
-if [ -x $attributes ]; then
- add_cmd_output "$attr_cmd" "$file_name" "$desc"
-fi
-#copy PHAL device tree file to dump
-file_name="$PDBG_DTB"
-desc="Device tree file"
-if [ -e "$file_name" ]; then
- add_copy_file "$file_name" "$desc"
-fi
-
-#copy PHAL export device tree to dump
-file_name="/var/lib/phal/exportdevtree"
-desc="Exported device tree file"
-if [ -e "$file_name" ]; then
- add_copy_file "$file_name" "$desc"
-fi
-
-#copy attribues info db to dump
-file_name="$PDATA_INFODB"
-desc="Attribute info db"
-if [ -e "$file_name" ]; then
- add_copy_file "$file_name" "$desc"
-fi