#!/bin/bash
usage()
{
	cat <<EOF
Usage: $0 [options]

Options:
    -s       Show package name and version number.
    -n       Show numerical version number only.
    -l       List installed packages details (Default option).
EOF
}
if [ "X$1" == "X-s" ]; then echo OFED-internal-26.01-1.0.0.0.612:; exit 0; fi
if [ "X$1" == "X-n" ]; then echo 26.01-1.0.0.0.612; exit 0; fi
if [ "X$1" != "X-l" ] && [ "X$1" != "X" ]; then usage; exit 1; fi

cat << EOF
OFED-internal-26.01-1.0.0.0.612:

clusterkit:
/sw/release/mlnx_ofed/IBHPC/OFED-internal-26.01-1.0.0/SRPMS/clusterkit-1.15.475-1.20260211.db5c406.2601100.src.rpm

dpcp:
https://doca-repo-prod.nvidia.com/public-nsb/repo/doca/prime/generic-rpm/x86_64/dpcp/1.1.59-1/dpcp-1.1.59-1.src.rpm
ibarr:
https://doca-repo-prod.nvidia.com/public-nsb/repo/doca/prime/generic-rpm/x86_64/ibarr/2601.0.0-1/ibarr-2601.0.0-1.src.rpm
ibdump:
https://doca-repo-prod.nvidia.com/public-nsb/repo/doca/prime/generic-rpm/x86_64/ibdump/6.0.0-2/ibdump-6.0.0-2.src.rpm
ibsim:
https://doca-repo-prod.nvidia.com/public-nsb/repo/doca/prime/generic-rpm/x86_64/ibsim/0.12.1-4/ibsim-0.12.1-4.src.rpm
ibutils2:
https://doca-repo-prod.nvidia.com/public-nsb/repo/doca/prime/generic-rpm/x86_64/ibutils2/2.1.1-0.22400.MLNX202601152019.ge04c0b67f/ibutils2-2.1.1-0.22400.MLNX202601152019.ge04c0b67f.src.rpm
iser:
https://git-nbu.nvidia.com/r/a/mlnx_ofed/mlnx-ofa_kernel-4.0.git mlnx_ofed_26_01
commit ecf69d4cc73086ffd7d361092c5ef06cfcd96c8b

isert:
https://git-nbu.nvidia.com/r/a/mlnx_ofed/mlnx-ofa_kernel-4.0.git mlnx_ofed_26_01
commit ecf69d4cc73086ffd7d361092c5ef06cfcd96c8b

kernel-mft:
mlnx_ofed_mft/kernel-mft-4.35.0-159.src.rpm

libvma:
https://doca-repo-prod.nvidia.com/public-nsb/repo/doca/prime/generic-rpm/x86_64/libvma/9.8.84-1/libvma-9.8.84-1.src.rpm
libxlio:
/sw/release/mlnx_ofed/IBHPC/OFED-internal-26.01-1.0.0/SRPMS/libxlio-3.61.2-1.src.rpm

mlnx-ethtool:
https://doca-repo-prod.nvidia.com/public-nsb/repo/doca/prime/generic-rpm/x86_64/mlnx-ethtool/2601.0.2-1/mlnx-ethtool-2601.0.2-1.src.rpm
mlnx-iproute2:
https://doca-repo-prod.nvidia.com/public-nsb/repo/doca/prime/generic-rpm/x86_64/mlnx-iproute2/2601.0.6-1/mlnx-iproute2-2601.0.6-1.src.rpm
mlnx-nfsrdma:
https://git-nbu.nvidia.com/r/a/mlnx_ofed/mlnx-ofa_kernel-4.0.git mlnx_ofed_26_01
commit ecf69d4cc73086ffd7d361092c5ef06cfcd96c8b

mlnx-nvme:
https://git-nbu.nvidia.com/r/a/mlnx_ofed/mlnx-ofa_kernel-4.0.git mlnx_ofed_26_01
commit ecf69d4cc73086ffd7d361092c5ef06cfcd96c8b

mlnx-ofa_kernel:
https://git-nbu.nvidia.com/r/a/mlnx_ofed/mlnx-ofa_kernel-4.0.git mlnx_ofed_26_01
commit ecf69d4cc73086ffd7d361092c5ef06cfcd96c8b

mlnx-tools:
https://doca-repo-prod.nvidia.com/public-nsb/repo/doca/prime/generic-rpm/x86_64/mlnx-tools/2601.0.2-1/mlnx-tools-2601.0.2-1.src.rpm
mlx-steering-dump:
https://doca-repo-prod.nvidia.com/public-nsb/repo/doca/prime/generic-rpm/x86_64/mlx-steering-dump/1.0.0-1/mlx-steering-dump-1.0.0-1.src.rpm
multiperf:
https://git-nbu.nvidia.com/r/a/Performance/multiperf rdma-core-support
commit d3fad92dc6984e43cc5377ba0a3126808432ce2d

ofed-docs:
https://git-nbu.nvidia.com/r/a/mlnx_ofed/ofed-docs.git mlnx_ofed-4.0
commit 3d1b0afb7bc190ae5f362223043f76b2b45971cc

openmpi:
/sw/release/mlnx_ofed/IBHPC/OFED-internal-26.01-1.0.0/SRPMS/openmpi-4.1.9a1-1.20260211.81d402c97a.2601100.src.rpm

opensm:
/sw/release/mlnx_ofed/IBHPC/OFED-internal-26.01-1.0.0/SRPMS/opensm-5.26.1-202601271032.8c07ef43.2601100.src.rpm

openvswitch:
/sw/release/mlnx_ofed/IBHPC/OFED-internal-26.01-1.0.0/SRPMS/openvswitch-3.3.0040-1.2601100.src.rpm

perftest:
https://doca-repo-prod.nvidia.com/public-nsb/repo/doca/prime/generic-rpm/x86_64/perftest/26.01.5-1/perftest-26.01.5-1.src.rpm
rdma-core:
https://doca-repo-prod.nvidia.com/public-nsb/repo/doca/prime/generic-rpm/x86_64/rdma-core/2601.0.7-1/rdma-core-2601.0.7-1.src.rpm
rshim:
/sw/release/mlnx_ofed/IBHPC/OFED-internal-26.01-1.0.0/SRPMS/rshim-2.6.6-0.g0ff6d20.src.rpm

sockperf:
https://doca-repo-prod.nvidia.com/public-nsb/repo/doca/prime/generic-rpm/x86_64/sockperf/3.1-1/sockperf-3.1-1.src.rpm
srp:
https://git-nbu.nvidia.com/r/a/mlnx_ofed/mlnx-ofa_kernel-4.0.git mlnx_ofed_26_01
commit ecf69d4cc73086ffd7d361092c5ef06cfcd96c8b

ucx:
/sw/release/mlnx_ofed/IBHPC/OFED-internal-26.01-1.0.0/SRPMS/ucx-1.20.0-1.20260211.d9a4f352d.2601100.src.rpm

virtiofs:
https://git-nbu.nvidia.com/r/a/mlnx_ofed/mlnx-ofa_kernel-4.0.git mlnx_ofed_26_01
commit ecf69d4cc73086ffd7d361092c5ef06cfcd96c8b

xpmem:
https://doca-repo-prod.nvidia.com/public-nsb/repo/doca/prime/generic-rpm/x86_64/xpmem/2601.0.9-1/dkms/xpmem-2601.0.9-1.src.rpm
EOF

echo
echo Installed Packages:
echo -------------------

pkglist1=
pkglist2=

if [ -x /usr/bin/dpkg ]; then
    pkglist1=$(dpkg --list | grep -E "#DEB_PACKAGES_LIST#")
fi

if (which rpm >/dev/null 2>&1); then
    pkglist2=$(rpm -qa --queryformat "[%{NAME}]
" | grep -E "kernel-ib|clusterkit|dpcp|ibarr|ibdump|ibsim|ibutils2|^iser|kmod-iser|iser.*kmp|^isert|kmod-isert|isert.*kmp|kernel-mft|libvma|libxlio|mlnx-ethtool|mlnx-iproute2|mlnx-nfsrdma|mlnx-nvme|mlnx-ofa_kernel|mlnx-tools|mlx-steering-dump|multiperf|ofed-docs|openmpi|opensm|openvswitch|perftest|rdma-core|ibacm|libibcm|libibumad|libibverbs|librdmacm|srp_daemon|infiniband-diags|python3-pyverbs|rshim|sockperf|^srp$|kmod-srp|srp.*kmp|ucx|^virtiofs$|kmod-virtiofs|virtiofs.*kmp|xpmem|neohost-backend|neohost-sdk")
fi

echo -e "$pkglist1"
echo -e "$pkglist2"
