Permalink
Browse files

deleted: bbswitch.conf

	modified:   bbswitch.spec
	modified:   kmodtool-bbswitch-el6.sh
  • Loading branch information...
1 parent a9b2dc4 commit eb92de6226ac8490331cce80f5b4f90679cd027a @amyagi amyagi committed Feb 29, 2012
Showing with 89 additions and 89 deletions.
  1. +0 −1 bbswitch/el6/bbswitch.conf
  2. +5 −4 bbswitch/el6/bbswitch.spec
  3. +84 −84 bbswitch/el6/kmodtool-bbswitch-el6.sh
View
1 bbswitch/el6/bbswitch.conf
@@ -1 +0,0 @@
-options bbswitch load_state=0 unload_state=1
View
9 bbswitch/el6/bbswitch.spec
@@ -17,7 +17,6 @@ ExclusiveArch: i686 x86_64
# Sources.
Source0: %{kmod_name}-%{version}.tar.gz
-Source1: bbswitch.conf
Source5: GPL-v2.0.txt
Source10: kmodtool-%{kmod_name}-el6.sh
@@ -46,9 +45,9 @@ if that was the case before suspending. Hibernation should work, but it not test
%prep
%setup -q -n %{kmod_name}-%{version}
-%{__cp} -a %{SOURCE1} .
%{__cp} -a %{SOURCE5} .
echo "override %{kmod_name} * weak-updates/%{kmod_name}" > kmod-%{kmod_name}.conf
+echo "options %{kmod_name} load_state=0 unload_state=1" > %{kmod_name}.conf
%build
KSRC=%{_usrsrc}/kernels/%{kversion}
@@ -61,10 +60,12 @@ KSRC=%{_usrsrc}/kernels/%{kversion}
%{__make} -C "${KSRC}" modules_install M=$PWD
%{__install} -d %{buildroot}%{_sysconfdir}/depmod.d/
%{__install} kmod-%{kmod_name}.conf %{buildroot}%{_sysconfdir}/depmod.d/
+%{__install} -d %{buildroot}%{_sysconfdir}/modprobe.d/
+%{__install} %{kmod_name}.conf %{buildroot}/%{_sysconfdir}/modprobe.d/
%{__install} -d %{buildroot}%{_defaultdocdir}/kmod-%{kmod_name}-%{version}/
%{__install} GPL-v2.0.txt %{buildroot}%{_defaultdocdir}/kmod-%{kmod_name}-%{version}/
-%{__install} -d %{buildroot}%{_sysconfdir}/modprobe.d/
-%{__install} bbswitch.conf %{buildroot}/%{_sysconfdir}/modprobe.d/
+%{__install} NEWS %{buildroot}%{_defaultdocdir}/kmod-%{kmod_name}-%{version}/
+%{__install} README.md %{buildroot}%{_defaultdocdir}/kmod-%{kmod_name}-%{version}/README
# Set the module(s) to be executable, so that they will be stripped when packaged.
find %{buildroot} -type f -name \*.ko -exec %{__chmod} u+x \{\} \;
# Remove the unrequired files.
View
168 bbswitch/el6/kmodtool-bbswitch-el6.sh 100644 → 100755
@@ -1,14 +1,14 @@
#!/bin/bash
# kmodtool - Helper script for building kernel module RPMs
-# An original version appeared in Fedora. This version is
-# generally called only by the %kernel_module_package RPM macro
-# during the process of building Driver Update Packages (which
-# are also known as "kmods" in the Fedora community).
+# An original version appeared in Fedora. This version is
+# generally called only by the %kernel_module_package RPM macro
+# during the process of building Driver Update Packages (which
+# are also known as "kmods" in the Fedora community).
#
# Copyright (c) 2003-2010 Ville Skyttä <ville.skytta@iki.fi>,
-# Thorsten Leemhuis <fedora@leemhuis.info>
-# Jon Masters <jcm@redhat.com>
+# Thorsten Leemhuis <fedora@leemhuis.info>
+# Jon Masters <jcm@redhat.com>
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,13 +31,13 @@
# Changelog:
#
-# 2010/07/28 - Add fixes for filelists in line with LF standard
-# - Remove now defunct "framepointer" kernel variant
-# - Change version to "rhel6-rh2" as a consequence.
+# 2010/07/28 - Add fixes for filelists in line with LF standard
+# - Remove now defunct "framepointer" kernel variant
+# - Change version to "rhel6-rh2" as a consequence.
#
-# 2010/01/10 - Simplified for RHEL6. We are working on upstream
-# moving to a newer format and in any case do not
-# need to retain support for really old systems.
+# 2010/01/10 - Simplified for RHEL6. We are working on upstream
+# moving to a newer format and in any case do not
+# need to retain support for really old systems.
shopt -s extglob
@@ -76,28 +76,28 @@ print_variant ()
}
get_filelist() {
-local IFS=$'\n'
-filelist=($(cat))
-
-if [ ${#filelist[@]} -gt 0 ];
-then
-for ((n = 0; n < ${#filelist[@]}; n++));
-do
-line="${filelist[n]}"
-line=$(echo "$line" \
-| sed -e "s/%verrel/$verrel/g" \
-| sed -e "s/%variant/$variant/g" \
-| sed -e "s/%dashvariant/$dashvariant/g" \
-| sed -e "s/%dotvariant/$dotvariant/g" \
-| sed -e "s/\.%1/$dotvariant/g" \
-| sed -e "s/\-%1/$dotvariant/g" \
-| sed -e "s/%2/$verrel/g")
-echo "$line"
-done
-else
-echo "%defattr(644,root,root,755)"
-echo "/lib/modules/${verrel}${dotvariant}"
-fi
+ local IFS=$'\n'
+ filelist=($(cat))
+
+ if [ ${#filelist[@]} -gt 0 ];
+ then
+ for ((n = 0; n < ${#filelist[@]}; n++));
+ do
+ line="${filelist[n]}"
+ line=$(echo "$line" \
+ | sed -e "s/%verrel/$verrel/g" \
+ | sed -e "s/%variant/$variant/g" \
+ | sed -e "s/%dashvariant/$dashvariant/g" \
+ | sed -e "s/%dotvariant/$dotvariant/g" \
+ | sed -e "s/\.%1/$dotvariant/g" \
+ | sed -e "s/\-%1/$dotvariant/g" \
+ | sed -e "s/%2/$verrel/g")
+ echo "$line"
+ done
+ else
+ echo "%defattr(644,root,root,755)"
+ echo "/lib/modules/${verrel}${dotvariant}"
+ fi
}
get_rpmtemplate ()
@@ -106,126 +106,126 @@ get_rpmtemplate ()
local dashvariant="${variant:+-${variant}}"
local dotvariant="${variant:+.${variant}}"
- echo "%package -n kmod-${kmod_name}${dashvariant}"
+ echo "%package -n kmod-${kmod_name}${dashvariant}"
if [ -z "$kmod_provides_summary" ]; then
-echo "Summary: ${kmod_name} kernel module(s)"
+ echo "Summary: ${kmod_name} kernel module(s)"
fi
-if [ -z "$kmod_provides_group" ]; then
-echo "Group: System Environment/Kernel"
+ if [ -z "$kmod_provides_group" ]; then
+ echo "Group: System Environment/Kernel"
fi
-if [ ! -z "$kmod_version" ]; then
-echo "Version: %{kmod_version}"
+ if [ ! -z "$kmod_version" ]; then
+ echo "Version: %{kmod_version}"
fi
-if [ ! -z "$kmod_release" ]; then
-echo "Release: %{kmod_release}"
+ if [ ! -z "$kmod_release" ]; then
+ echo "Release: %{kmod_release}"
fi
# Turn off the internal dep generator so we will use the kmod scripts.
echo "%global _use_internal_dependency_generator 0"
cat <<EOF
-Provides: kabi-modules = ${verrel}${dotvariant}
-Provides: ${kmod_name}-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
-Requires(post): /sbin/depmod
+Provides: kabi-modules = ${verrel}${dotvariant}
+Provides: ${kmod_name}-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
+Requires(post): /sbin/depmod
Requires(postun): /sbin/depmod
EOF
if [ "yes" != "$nobuildreqs" ]
then
-echo "BuildRequires: kernel${dashvariant}-devel"
+ echo "BuildRequires: kernel${dashvariant}-devel"
fi
-if [ "" != "$override_preamble" ]
+ if [ "" != "$override_preamble" ]
then
-cat "$override_preamble"
+ cat "$override_preamble"
fi
cat <<EOF
-%description -n kmod-${kmod_name}${dashvariant}
+%description -n kmod-${kmod_name}${dashvariant}
This package provides the ${kmod_name} kernel module(s) built
for the Linux kernel using the %{_target_cpu} family of processors.
EOF
##############################################################################
-## The following are not part of this script directly, they are scripts ##
+## The following are not part of this script directly, they are scripts ##
## that will be executed by RPM during various stages of package processing ##
##############################################################################
cat <<EOF
-%post -n kmod-${kmod_name}${dashvariant}
+%post -n kmod-${kmod_name}${dashvariant}
echo "Working. This may take some time ..."
if [ -e "/boot/System.map-${verrel}${dotvariant}" ]; then
-/sbin/depmod -aeF "/boot/System.map-${verrel}${dotvariant}" "${verrel}${dotvariant}" > /dev/null || :
+ /sbin/depmod -aeF "/boot/System.map-${verrel}${dotvariant}" "${verrel}${dotvariant}" > /dev/null || :
fi
modules=( \$(find /lib/modules/${verrel}${dotvariant}/extra/${kmod_name} | grep '\.ko$') )
if [ -x "/sbin/weak-modules" ]; then
-printf '%s\n' "\${modules[@]}" | /sbin/weak-modules --add-modules
+ printf '%s\n' "\${modules[@]}" | /sbin/weak-modules --add-modules
fi
echo "Done."
EOF
cat <<EOF
-%preun -n kmod-${kmod_name}${dashvariant}
+%preun -n kmod-${kmod_name}${dashvariant}
rpm -ql kmod-${kmod_name}${dashvariant}-%{version}-%{release}.$(arch) | grep '\.ko$' > /var/run/rpm-kmod-${kmod_name}${dashvariant}-modules
EOF
cat <<EOF
-%postun -n kmod-${kmod_name}${dashvariant}
+%postun -n kmod-${kmod_name}${dashvariant}
echo "Working. This may take some time ..."
if [ -e "/boot/System.map-${verrel}${dotvariant}" ]; then
-/sbin/depmod -aeF "/boot/System.map-${verrel}${dotvariant}" "${verrel}${dotvariant}" > /dev/null || :
+ /sbin/depmod -aeF "/boot/System.map-${verrel}${dotvariant}" "${verrel}${dotvariant}" > /dev/null || :
fi
modules=( \$(cat /var/run/rpm-kmod-${kmod_name}${dashvariant}-modules) )
rm /var/run/rpm-kmod-${kmod_name}${dashvariant}-modules
if [ -x "/sbin/weak-modules" ]; then
-printf '%s\n' "\${modules[@]}" | /sbin/weak-modules --remove-modules
+ printf '%s\n' "\${modules[@]}" | /sbin/weak-modules --remove-modules
fi
echo "Done."
EOF
-echo "%files -n kmod-${kmod_name}${dashvariant}"
+echo "%files -n kmod-${kmod_name}${dashvariant}"
if [ "" == "$override_filelist" ];
then
-echo "%defattr(644,root,root,755)"
+ echo "%defattr(644,root,root,755)"
echo "/lib/modules/${verrel}${dotvariant}/"
echo "%config /etc/depmod.d/kmod-${kmod_name}.conf"
+ echo "%config /etc/modprobe.d/${kmod_name}.conf"
echo "%doc /usr/share/doc/kmod-${kmod_name}-%{version}/"
- echo "%attr (644, root, root) /etc/modprobe.d/bbswitch.conf"
else
-cat "$override_filelist" | get_filelist
+ cat "$override_filelist" | get_filelist
fi
}
print_rpmtemplate ()
{
kmod_name="${1}"
shift
-kver="${1}"
+ kver="${1}"
get_verrel "${1}"
shift
-if [ -z "${kmod_name}" ] ; then
-echo "Please provide the kmodule-name as first parameter." >&2
+ if [ -z "${kmod_name}" ] ; then
+ echo "Please provide the kmodule-name as first parameter." >&2
exit 2
elif [ -z "${kver}" ] ; then
-echo "Please provide the kver as second parameter." >&2
+ echo "Please provide the kver as second parameter." >&2
exit 2
elif [ -z "${verrel}" ] ; then
-echo "Couldn't find out the verrel." >&2
+ echo "Couldn't find out the verrel." >&2
exit 2
fi
-for variant in "$@" ; do
-if [ "default" == "$variant" ];
+ for variant in "$@" ; do
+ if [ "default" == "$variant" ];
then
-get_rpmtemplate ""
+ get_rpmtemplate ""
else
-get_rpmtemplate "${variant}"
+ get_rpmtemplate "${variant}"
fi
-done
+ done
}
usage ()
@@ -234,34 +234,34 @@ usage ()
You called: ${invocation}
Usage: ${myprog} <command> <option>+
-Commands:
-verrel <uname>
-- Get "base" version-release.
-variant <uname>
-- Get variant from uname.
-rpmtemplate <mainpgkname> <uname> <variants>
-- Return a template for use in a source RPM
-version
-- Output version number and exit.
+ Commands:
+ verrel <uname>
+ - Get "base" version-release.
+ variant <uname>
+ - Get variant from uname.
+ rpmtemplate <mainpgkname> <uname> <variants>
+ - Return a template for use in a source RPM
+ version
+ - Output version number and exit.
EOF
}
invocation="$(basename ${0}) $@"
while [ "${1}" ] ; do
-case "${1}" in
+ case "${1}" in
verrel)
shift
-print_verrel $@
+ print_verrel $@
exit $?
;;
variant)
shift
-print_variant $@
+ print_variant $@
exit $?
;;
rpmtemplate)
shift
-print_rpmtemplate "$@"
+ print_rpmtemplate "$@"
exit $?
;;
version)

0 comments on commit eb92de6

Please sign in to comment.