packaging: modules paths and names fixup
Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
This commit is contained in:
parent
13984c976a
commit
8938310b61
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright(c) 2020-2021 Intel Corporation
|
||||
# Copyright(c) 2020-2022 Intel Corporation
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
|
||||
@ -16,6 +16,7 @@ CAS_NAME="open-cas-linux"
|
||||
CAS_HOMEPAGE="https://open-cas.github.io"
|
||||
CAS_GIT="https://github.com/Open-CAS/open-cas-linux.git"
|
||||
CAS_LICENSE_NAME="BSD-3-Clause"
|
||||
CAS_MODULES_DIR="extra/block/opencas"
|
||||
SUPPORTED_FROM_VERSION="20.03"
|
||||
THIS=$(basename "$0")
|
||||
ARCH="$(uname -i)"
|
||||
@ -298,6 +299,7 @@ rpm_spec_prepare() {
|
||||
sed -i "s/<CAS_NAME>/$CAS_NAME/g" "$RPM_SPECS_DIR/$CAS_NAME.spec"
|
||||
sed -i "s/<CAS_VERSION>/$CAS_VERSION/g" "$RPM_SPECS_DIR/$CAS_NAME.spec"
|
||||
sed -i "s/<CAS_LICENSE_NAME>/$CAS_LICENSE_NAME/g" "$RPM_SPECS_DIR/$CAS_NAME.spec"
|
||||
sed -i "s|<CAS_MODULES_DIR>|$CAS_MODULES_DIR|g" "$RPM_SPECS_DIR/$CAS_NAME.spec"
|
||||
sed -i "s/<CAS_HOMEPAGE>/${CAS_HOMEPAGE//\//\\/}/g" "$RPM_SPECS_DIR/$CAS_NAME.spec"
|
||||
sed -i "s/<PACKAGE_MAINTAINER>/$PACKAGE_MAINTAINER/g" "$RPM_SPECS_DIR/$CAS_NAME.spec"
|
||||
if [ "$DEBUG" ]; then
|
||||
@ -341,6 +343,7 @@ deb_control_files_prepare() {
|
||||
sed -i "s/<CAS_NAME>/$CAS_NAME/g" "$file"
|
||||
sed -i "s/<CAS_VERSION>/$CAS_VERSION/g" "$file"
|
||||
sed -i "s/<CAS_LICENSE_NAME>/$CAS_LICENSE_NAME/g" "$file"
|
||||
sed -i "s|<CAS_MODULES_DIR>|$CAS_MODULES_DIR|g" "$file"
|
||||
sed -i "s/<CAS_HOMEPAGE>/${CAS_HOMEPAGE//\//\\/}/g" "$file"
|
||||
sed -i "s/<CAS_GIT>/${CAS_GIT//\//\\/}/g" "$file"
|
||||
sed -i "s/<PACKAGE_MAINTAINER>/$PACKAGE_MAINTAINER/g" "$file"
|
||||
|
@ -4,8 +4,8 @@ BUILT_MODULE_NAME[0]="cas_disk"
|
||||
BUILT_MODULE_NAME[1]="cas_cache"
|
||||
BUILT_MODULE_LOCATION[0]="modules/cas_disk/"
|
||||
BUILT_MODULE_LOCATION[1]="modules/cas_cache/"
|
||||
DEST_MODULE_LOCATION[0]="/extra/block/opencas"
|
||||
DEST_MODULE_LOCATION[1]="/extra/block/opencas"
|
||||
DEST_MODULE_LOCATION[0]="/<CAS_MODULES_DIR>"
|
||||
DEST_MODULE_LOCATION[1]="/<CAS_MODULES_DIR>"
|
||||
PRE_BUILD="./configure"
|
||||
MAKE[0]="make -j -C modules/ KERNEL_VERSION=$kernelver"
|
||||
AUTOINSTALL=yes
|
||||
|
@ -24,7 +24,7 @@ Group: System
|
||||
Vendor: Intel Corporation
|
||||
License: <CAS_LICENSE_NAME>
|
||||
URL: <CAS_HOMEPAGE>
|
||||
Source0: https://github.com/Open-CAS/open-cas-linux/releases/download/v%{version}/%{name}-%{version}.tar.gz
|
||||
Source0: https://github.com/Open-CAS/<CAS_NAME>/releases/download/v%{version}/%{name}-%{version}.tar.gz
|
||||
Packager: <PACKAGE_MAINTAINER>
|
||||
BuildRequires: coreutils, gawk, gcc, kernel-devel, kernel-headers, make
|
||||
Requires: <CAS_NAME>-modules-%{version}, python3, sed, python3-packaging, python3-PyYAML
|
||||
@ -88,7 +88,7 @@ depmod
|
||||
. /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
|
||||
if [[ "$file" =~ .*\.ko$ ]]; then
|
||||
# realpath to resolve any possible symlinks (needed for weak-modules)
|
||||
modules+=( $(realpath "$file") )
|
||||
fi
|
||||
@ -109,7 +109,7 @@ if [ $1 -eq 0 ]; then
|
||||
if [[ ! "$ID_LIKE" =~ suse|sles ]]; then
|
||||
# Search for all CAS modules to remove them from weak-modules
|
||||
# Use realpath to resolve any possible symlinks (needed for weak-modules)
|
||||
realpath $(find /lib/modules/*/extra/block/opencas/ -name "cas_*.ko") >/var/run/rpm-open-cas-linux-modules
|
||||
realpath $(find /lib/modules/%{kver}/<CAS_MODULES_DIR> -name "*.ko") >/var/run/rpm-<CAS_NAME>-modules
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -117,8 +117,8 @@ fi
|
||||
if [ $1 -eq 0 ]; then
|
||||
. /etc/os-release
|
||||
if [[ ! "$ID_LIKE" =~ suse|sles ]]; then
|
||||
modules=( $(cat /var/run/rpm-open-cas-linux-modules) )
|
||||
rm -f /var/run/rpm-open-cas-linux-modules
|
||||
modules=( $(cat /var/run/rpm-<CAS_NAME>-modules) )
|
||||
rm -f /var/run/rpm-<CAS_NAME>-modules
|
||||
printf "%s\n" "${modules[@]}" | weak-modules --no-initramfs --remove-modules
|
||||
fi
|
||||
depmod
|
||||
|
Loading…
Reference in New Issue
Block a user