mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-25 16:00:19 +00:00
This script is used in the non-dkms scst package. The purpose of package is to determine kernel location at compile-time, as opposed to the package installation time. However, calling `uname -r` in package installation time violates that idea because it would get some random kernel that was running on the machine. This problem is particularly seen in containers, because in those `uname` shows the kernel running on the host, rather than the one running inside container. Fix this by determining the kernel location in `preinst` script at compile time as well.
48 lines
1.1 KiB
Bash
48 lines
1.1 KiB
Bash
#!/bin/sh
|
|
# preinst script for scst
|
|
#
|
|
# see: dh_installdeb(1)
|
|
|
|
set -e
|
|
|
|
# summary of how this script can be called:
|
|
# * <new-preinst> `install'
|
|
# * <new-preinst> `install' <old-version>
|
|
# * <new-preinst> `upgrade' <old-version>
|
|
# * <old-preinst> `abort-upgrade' <new-version>
|
|
# for details, see https://www.debian.org/doc/debian-policy/ or
|
|
# the debian-policy package
|
|
|
|
|
|
case "$1" in
|
|
install)
|
|
# Remove any existing ib_srpt.ko kernel modules
|
|
find "/lib/modules/%{KVER}" -name ib_srpt.ko -exec rm {} \;
|
|
# Remove files installed by "make install"
|
|
rm -f /usr/local/man/man5/iscsi-scstd.conf.5
|
|
rm -f /usr/local/man/man8/iscsi-scst-adm.8
|
|
rm -f /usr/local/man/man8/iscsi-scstd.8
|
|
rm -f /usr/local/sbin/iscsi-scst-adm
|
|
rm -f /usr/local/sbin/iscsi-scstd
|
|
rm -rf /usr/local/include/scst
|
|
;;
|
|
|
|
upgrade)
|
|
;;
|
|
|
|
abort-upgrade)
|
|
;;
|
|
|
|
*)
|
|
echo "preinst called with unknown argument \`$1'" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
# dh_installdeb will replace this with shell code automatically
|
|
# generated by other debhelper scripts.
|
|
|
|
#DEBHELPER#
|
|
|
|
exit 0
|