#!/usr/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-0.2.9:; exit 0; fi
if [ "X$1" == "X-n" ]; then echo 26.01-0.2.9; exit 0; fi
if [ "X$1" != "X-l" ] && [ "X$1" != "X" ]; then usage; exit 1; fi

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

clusterkit:
/sw/release/mlnx_ofed/IBHPC/OFED-internal-25.10-1.2.2/SRPMS/clusterkit-1.15.472-1.20251022.023d2d0.2510122.src.rpm

dpcp:
https://doca-repo-prod.nvidia.com/public-nsb/repo/doca/prime/generic-rpm/x86_64/dpcp/1.1.54-1/dpcp-1.1.54-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.202512161720.gdc8b16556/ibutils2-2.1.1-0.22400.202512161720.gdc8b16556.src.rpm
iser:
https://git-nbu.nvidia.com/r/a/mlnx_ofed/mlnx-ofa_kernel-4.0.git mlnx_ofed_26_01
commit 6439d83ae5638585b0b3fd65581e88af9e74fd93

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

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

libvma:
https://doca-repo-prod.nvidia.com/public-nsb/repo/doca/prime/generic-rpm/x86_64/libvma/9.8.81-1/libvma-9.8.81-1.src.rpm
libxlio:
/sw/release/sw_acceleration/xlio/libxlio-3.61.0-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.2-1/mlnx-iproute2-2601.0.2-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 6439d83ae5638585b0b3fd65581e88af9e74fd93

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

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

mlnx-tools:
https://doca-repo-prod.nvidia.com/public-nsb/repo/doca/prime/generic-rpm/x86_64/mlnx-tools/2601.0.0-1/mlnx-tools-2601.0.0-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-0.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-25.10-1.2.2/SRPMS/openmpi-4.1.9a1-1.20251022.ad48c462ff.2510122.src.rpm

opensm:
mlnx_ofed_opensm/opensm-5.25.0-202512161720.19e617f8.tar.gz

openvswitch:
https://git-nbu.nvidia.com/r/a/sdn/ovs.git 3.3_head
commit 522132eeeb07134b2291ccc0c871aba745ad42ae

perftest:
https://doca-repo-prod.nvidia.com/public-nsb/repo/doca/prime/generic-rpm/x86_64/perftest/25.10.0-0.134.g8aff167.1/perftest-25.10.0-0.134.g8aff167.1.src.rpm
rdma-core:
https://doca-repo-prod.nvidia.com/public-nsb/repo/doca/prime/generic-rpm/x86_64/rdma-core/2601.0.1-1/rdma-core-2601.0.1-1.src.rpm
rshim:
/sw_mc_soc_release/packages//rshim-2.5.7-0.g0339e66.src.rpm

sharp:
mlnx_ofed_sharp/sharp-3.14.0-202512161720.e6f4daf2.tar.gz

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 6439d83ae5638585b0b3fd65581e88af9e74fd93

ucx:
/sw/release/mlnx_ofed/IBHPC/OFED-internal-25.10-1.2.2/SRPMS/ucx-1.20.0-1.20251022.03898fede.2510122.src.rpm

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

xpmem:
https://doca-repo-prod.nvidia.com/public-nsb/repo/doca/prime/generic-rpm/x86_64/xpmem/2510.0.16-1/xpmem-2510.0.16-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|sharp|sockperf|^srp$|kmod-srp|srp.*kmp|ucx|^virtiofs$|kmod-virtiofs|virtiofs.*kmp|xpmem|neohost-backend|neohost-sdk")
fi

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