spdk/debian/postinst
2025-06-24 19:24:24 +08:00

22 lines
460 B
Bash

#!/bin/sh
set -e
#DEBHELPER#
case "$1" in
configure)
if [ ! -f "/etc/default/grub.d/spdk.cfg" ]; then
arch=$(uname -m)
if [ "$arch" = "x86_64" ];then
iommu="intel_iommu=on iommu=pt amd_iommu=on"
fi
echo "GRUB_CMDLINE_LINUX=\"hugepagesz=2M hugepages=2048 $iommu\"" >/etc/default/grub.d/spdk.cfg
update-grub
fi
systemctl enable pxvirt-spdk.service pxvirt-spdk-load.service
;;
esac
exit 0