On SLES run depmod for every kernel version for which the modules installed
Signed-off-by: Jan Musial <jan.musial@intel.com>
This commit is contained in:
parent
1064cecbb9
commit
1bc3b66535
@ -86,15 +86,21 @@ fi
|
|||||||
%post modules_%{kver_filename}
|
%post modules_%{kver_filename}
|
||||||
depmod
|
depmod
|
||||||
. /etc/os-release
|
. /etc/os-release
|
||||||
|
# Determine the exact location of installed modules to add them to weak-modules
|
||||||
|
for file in $(rpm -ql $(rpm -qa | grep <CAS_NAME>-modules)); do
|
||||||
|
if [[ "$file" =~ cas_.*\.ko$ ]]; then
|
||||||
|
# realpath to resolve any possible symlinks (needed for weak-modules)
|
||||||
|
modules+=( $(realpath "$file") )
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
if [[ ! "$ID_LIKE" =~ suse|sles ]]; then
|
if [[ ! "$ID_LIKE" =~ suse|sles ]]; then
|
||||||
# Determine the exact location of installed modules to add them to weak-modules
|
|
||||||
for file in $(rpm -ql $(rpm -qa | grep <CAS_NAME>-modules)); do
|
|
||||||
if [[ "$file" =~ cas_.*\.ko$ ]]; then
|
|
||||||
# realpath to resolve any possible symlinks (needed for weak-modules)
|
|
||||||
modules+=( $(realpath "$file") )
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
printf "%s\n" "${modules[@]}" | weak-modules --no-initramfs --add-modules
|
printf "%s\n" "${modules[@]}" | weak-modules --no-initramfs --add-modules
|
||||||
|
else
|
||||||
|
for version in $(echo "${modules[@]}" | tr " " "\n" | cut -d"/" -f4 | sort | uniq); do
|
||||||
|
# run depmod for all kernel versions for which the modules installed
|
||||||
|
depmod $version
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
%preun modules_%{kver_filename}
|
%preun modules_%{kver_filename}
|
||||||
|
Loading…
Reference in New Issue
Block a user