From 60b4250550a9280d480e13e8e8ba66822ae6e63d Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Thu, 7 Oct 2021 23:30:45 +0100 Subject: [PATCH] sample: remove sample spec/conf files With all other spec/rpm support gone, remove these out-of-date files. Signed-off-by: Emil Velikov --- dkms.8 | 60 --------------------- sample-suse-10-mkkmp.spec | 52 ------------------- sample-suse-9-mkkmp.spec | 106 -------------------------------------- sample.conf | 18 ------- sample.spec | 105 ------------------------------------- 5 files changed, 341 deletions(-) delete mode 100644 sample-suse-10-mkkmp.spec delete mode 100644 sample-suse-9-mkkmp.spec delete mode 100644 sample.conf delete mode 100644 sample.spec diff --git a/dkms.8 b/dkms.8 index 4150c72e..2ac6f985 100644 --- a/dkms.8 +++ b/dkms.8 @@ -984,66 +984,6 @@ in the final kernel you remove your DKMS module from. This is an imperfect syst fact that there is only one modules.conf file for every kernel on your system even though various kernels use different modules. In a perfect world, there would be one modules.conf file for every kernel (just like System.map). -.SH CREATING RPMS WHICH UTILIZE DKMS -See the -.I sample.spec -file packaged with -.B DKMS -as an example for what your RPM spec file might look like. -Creating RPMs which utilize -.B dkms -is a fairly straight\-forward process. The RPM need only to install the source into -.I /usr/src/\-/ -and then employ -.B dkms -itself to do all the work of installation. As such, the RPM should first untar the source into -this directory. From here, within the RPM -.I .spec -file, a -.B dkms add -should be called (remember to use the \-\-rpm_safe_upgrade flag during the add) followed by a -.B dkms build -followed by a -.B dkms install. -Your -.I dkms.conf -file should be placed within the -.I /usr/src/\-/ -directory. - -Under the removal parts of the -.I .spec -file, all that needs to be called is a: dkms remove \-m \-v \-\-all \-\-rpm_safe_upgrade. -Use of the -.B \-\-rpm_safe_upgrade -flag is imperative for making sure DKMS and RPM play nicely together in all scenarios of using -the \-Uvh flag with RPM to upgrade dkms enabled packages. It will only function if used during -both the add -.B and -remove actions within the same RPM spec file. Its use makes sure that when upgrading between different -releases of an RPM for the same , DKMS does not do anything dumb (eg. it ensures -a smooth upgrade from megaraid\-2.09-5.noarch.rpm to megaraid\-2.09\-6.noarch.rpm). - -It should be noted that a binary RPM which contains source is not a traditional practice. -However, given the benefits of -.B dkms -it hopefully will become so. As the RPM created which utilizes -.B dkms -is not architecture specific, -.B BuildArch: noarch -should be specified in the -.I .spec -file to indicate that the package can work regardless of the system architecture. Also -note that DKMS RPM upgrades (\-U option) will automatically work because of the structure -of the -.B dkms -tree. - -Lastly, as a matter of convention, you should name your RPM: -\-\-dkms.noarch.rpm. The word -.B dkms -as part of the rpm\-version signifies that the RPM -works within the DKMS framework. .SH AUTHOR Gary Lerhaupt .SH WEBPAGE diff --git a/sample-suse-10-mkkmp.spec b/sample-suse-10-mkkmp.spec deleted file mode 100644 index 086c4695..00000000 --- a/sample-suse-10-mkkmp.spec +++ /dev/null @@ -1,52 +0,0 @@ -# norootforbuild - -Name: novell-example -BuildRequires: kernel-source kernel-syms -License: GPL -Group: System/Kernel -Summary: Example Kernel Module Package -Version: 1.1 -Release: 0 -Source0: %name-%version.tar.bz2 -BuildRoot: %{_tmppath}/%{name}-%{version}-build - -%suse_kernel_module_package kdump um - -%description -This is an example Kernel Module Package. - -%package KMP -Summary: Example Kernel Module -Group: System/Kernel - -%description KMP -This is one of the sub-packages for a specific kernel. All the -sub-packages will share the same summary, group, and description. - -%prep -%setup -set -- * -mkdir source -mv "$@" source/ -mkdir obj - -%build -export EXTRA_CFLAGS='-DVERSION=\"%version\"' -for flavor in %flavors_to_build; do - rm -rf obj/$flavor - cp -r source obj/$flavor - make -C /usr/src/linux-obj/%_target_cpu/$flavor modules \ - M=$PWD/obj/$flavor -done - -%install -export INSTALL_MOD_PATH=$RPM_BUILD_ROOT -export INSTALL_MOD_DIR=updates -for flavor in %flavors_to_build; do - make -C /usr/src/linux-obj/%_target_cpu/$flavor modules_install \ - M=$PWD/obj/$flavor -done - -%changelog -* Sat Jan 28 2006 - agruen@suse.de -- Initial package. diff --git a/sample-suse-9-mkkmp.spec b/sample-suse-9-mkkmp.spec deleted file mode 100644 index bdb42d84..00000000 --- a/sample-suse-9-mkkmp.spec +++ /dev/null @@ -1,106 +0,0 @@ -#neededforbuild kernel-source kernel-syms - -# Change either of these definitions to define flavor. If flavor is -# non-nil, this defines a single-flavor driver package, otherwise -# this driver package will be multi-flavor. (Note that commenting out -# one of these definitions will not work due to some very strange -# RPM behavior!) -%define flavor %{nil} -%define XXflavor default - -%define driver_version 1.1 -%define kver %(rpm -q --qf '%{VERSION}-%{RELEASE}' kernel-source) -%define arch %(echo %_target_cpu | sed -e 's/i.86/i386/') - -Name: novell-kmp -License: GPL -Group: System/Kernel -Autoreqprov: on -Summary: An example module package -%if "%flavor" == "" -Version: %(echo %driver_version-%kver | tr - _) -Requires: kernel = %kver -%else -Version: %(echo %driver_version-%kver-%flavor | tr - _) -Requires: kernel-%flavor = %kver -%endif -Release: 0 -Source0: novell-kmp-%driver_version.tar.bz2 -Source1: depmod.sh -Source2: mkinitrd.sh -BuildRoot: %{_tmppath}/%{name}-%{version}-build - -%description -Driver test - -%prep -# Make sure to include a %setup statement in the %prep section: -# without, the ``%post -f ...'' and ``%postun -f ...'' statements -# will silently fail and produce empty scripts. -%setup -n novell-kmp-%driver_version -mkdir source -mv * source/ || : -mkdir obj - -%build -export EXTRA_CFLAGS='-DVERSION=\"%driver_version\"' -%if "%flavor" == "" -flavors=$(ls /usr/src/linux-obj/%arch) -%else -flavors=%flavor -%endif -for flavor in $flavors; do - if [ $flavor = um ]; then - # User Mode Linux is an exception for many external kernel modules; - # we may choose to skip it here. - continue - fi - rm -rf obj-$flavor - cp -r source obj/$flavor - make -C /usr/src/linux-obj/%arch/$flavor modules M=$PWD/obj/$flavor -done - -%install -export INSTALL_MOD_PATH=$RPM_BUILD_ROOT -export INSTALL_MOD_DIR=updates -for flavor in $(ls obj/); do - make -C /usr/src/linux-obj/%arch/$flavor modules_install \ - M=$PWD/obj/$flavor -done - -set -- $(ls $RPM_BUILD_ROOT/lib/modules) -KERNELRELEASES=$* - -set -- $(find $RPM_BUILD_ROOT/lib/modules -type f -name '*.ko' \ - | sed -e 's:.*/::' -e 's:\.ko$::' | sort -u) -MODULES=$* - -( cat <<-EOF - # IMPORTANT: Do not change the KERNELRELEASES definition; it will be - # replaced during driver reuse! - KERNELRELEASES="$KERNELRELEASES" - MODULES="$MODULES" - EOF - cat %_sourcedir/depmod.sh - cat %_sourcedir/mkinitrd.sh -) > post_postun.sh - -mkdir -p $RPM_BUILD_ROOT/var/lib/YaST2/download -# Insert your download location here: -echo "ftp://ftp.suse.com/pub/suse;SUSE/Novell" \ - > $RPM_BUILD_ROOT/var/lib/YaST2/download/%name - -%post -f post_postun.sh - -%postun -f post_postun.sh - -%files -%defattr(-, root, root) -/lib/modules/* -%dir /var/lib/YaST2 -%dir /var/lib/YaST2/download -%config(noreplace) /var/lib/YaST2/download/%name - -%changelog -* Thu Dec 01 2005 - agruen@suse.de -- Initial package. diff --git a/sample.conf b/sample.conf deleted file mode 100644 index 4174b71f..00000000 --- a/sample.conf +++ /dev/null @@ -1,18 +0,0 @@ -PACKAGE_VERSION="2.10.1" - -# Items below here should not have to change with each driver version -PACKAGE_NAME="megaraid2" -MAKE[0]="make -C ${kernel_source_dir} SUBDIRS=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build modules" -CLEAN="make -C ${kernel_source_dir} SUBDIRS=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build clean" - -BUILT_MODULE_NAME[0]="megaraid2" -DEST_MODULE_LOCATION[0]="/kernel/drivers/scsi/" -MODULES_CONF_ALIAS_TYPE[0]="scsi_hostadapter" -MODULES_CONF_OBSOLETES[0]="megaraid,megaraid_2002" - -REMAKE_INITRD="yes" - -PATCH[0]="rhel21.patch" -PATCH_MATCH[0]="2\.4\.9\-e\." -PATCH[1]="rhel3.patch" -PATCH_MATCH[1]="2\.4\.21\-.*\.EL" diff --git a/sample.spec b/sample.spec deleted file mode 100644 index 3abdf077..00000000 --- a/sample.spec +++ /dev/null @@ -1,105 +0,0 @@ -%define module megaraid2 -%define version 2.10.1 - -Summary: megaraid2 dkms package -Name: %{module} -Version: %{version} -Release: 2dkms -Vendor: LSI -License: GPL -Packager: Ganesh Viswanathan -Group: System Environment/Base -BuildArch: noarch -Requires: dkms >= 1.00 -Requires: bash -# There is no Source# line for dkms.conf since it has been placed -# into the source tarball of SOURCE0 -Source0: %{module}-%{version}-src.tar.gz -Source1: %{module}-%{version}-kernel2.4.9-e.3-all.tgz -Source2: %{module}-%{version}-kernel2.4.20-16.9-all.tgz -Source3: %{module}-%{version}-kernel2.4.20-9-all.tgz -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root/ - -%description -This package contains LSI's megaraid2 module wrapped for -the DKMS framework. - -%prep -rm -rf %{module}-%{version} -mkdir %{module}-%{version} -cd %{module}-%{version} -tar xvzf $RPM_SOURCE_DIR/%{module}-%{version}-src.tar.gz - -%install -if [ "$RPM_BUILD_ROOT" != "/" ]; then - rm -rf $RPM_BUILD_ROOT -fi -mkdir -p $RPM_BUILD_ROOT/usr/src/%{module}-%{version}/ -mkdir -p $RPM_BUILD_ROOT/usr/src/%{module}-%{version}/patches -mkdir -p $RPM_BUILD_ROOT/usr/src/%{module}-%{version}/redhat_driver_disk -cp -rf %{module}-%{version}/* $RPM_BUILD_ROOT/usr/src/%{module}-%{version} -install -m 644 $RPM_SOURCE_DIR/%{module}-%{version}-kernel2.4.9-e.3-all.tgz $RPM_BUILD_ROOT/usr/src/%{module}-%{version} -install -m 644 $RPM_SOURCE_DIR/%{module}-%{version}-kernel2.4.20-9-all.tgz $RPM_BUILD_ROOT/usr/src/%{module}-%{version} -install -m 644 $RPM_SOURCE_DIR/%{module}-%{version}-kernel2.4.20-16.9-all.tgz $RPM_BUILD_ROOT/usr/src/%{module}-%{version} - -%clean -if [ "$RPM_BUILD_ROOT" != "/" ]; then - rm -rf $RPM_BUILD_ROOT -fi - -%files -%defattr(-,root,root) -/usr/src/%{module}-%{version}/ - -%pre - -%post -dkms add -m %{module} -v %{version} --rpm_safe_upgrade - -# Load tarballs as necessary -loaded_tarballs="" -for kernel_name in 2.4.9-e.3; do - if [ `uname -r | grep -c "$kernel_name"` -gt 0 ] && [ `uname -m | grep -c "i*86"` -gt 0 ]; then - echo -e "" - echo -e "Loading/Installing pre-built modules for $kernel_name." - dkms ldtarball --archive=/usr/src/%{module}-%{version}/%{module}-%{version}-kernel${kernel_name}-all.tgz >/dev/null - dkms install -m %{module} -v %{version} -k ${kernel_name} >/dev/null 2>&1 - dkms install -m %{module} -v %{version} -k ${kernel_name}smp >/dev/null 2>&1 - dkms install -m %{module} -v %{version} -k ${kernel_name}enterprise >/dev/null 2>&1 - loaded_tarballs="true" - fi -done -for kernel_name in 2.4.20-9 2.4.20-16.9; do - if [ `uname -r | grep -c "$kernel_name"` -gt 0 ] && [ `uname -m | grep -c "i*86"` -gt 0 ]; then - echo -e "" - echo -e "Loading/Installing pre-built modules for $kernel_name." - dkms ldtarball --archive=/usr/src/%{module}-%{version}/%{module}-%{version}-kernel${kernel_name}-all.tgz >/dev/null - dkms install -m %{module} -v %{version} -k ${kernel_name} >/dev/null 2>&1 - dkms install -m %{module} -v %{version} -k ${kernel_name}smp >/dev/null 2>&1 - dkms install -m %{module} -v %{version} -k ${kernel_name}bigmem >/dev/null 2>&1 - loaded_tarballs="true" - fi -done - -# If we haven't loaded a tarball, then try building it for the current kernel -if [ -z "$loaded_tarballs" ]; then - if [ `uname -r | grep -c "BOOT"` -eq 0 ] && [ -e /lib/modules/`uname -r`/build/include ]; then - dkms build -m %{module} -v %{version} - dkms install -m %{module} -v %{version} - elif [ `uname -r | grep -c "BOOT"` -gt 0 ]; then - echo -e "" - echo -e "Module build for the currently running kernel was skipped since you" - echo -e "are running a BOOT variant of the kernel." - else - echo -e "" - echo -e "Module build for the currently running kernel was skipped since the" - echo -e "kernel headers for this kernel do not seem to be installed." - fi -fi -exit 0 - -%preun -echo -e -echo -e "Uninstall of megaraid2 module (version %{version}) beginning:" -dkms remove -m %{module} -v %{version} --all --rpm_safe_upgrade -exit 0