Skip to content

Commit

Permalink
Workaround rpm utils bug on RHEL4 which can truncate the buffer output
Browse files Browse the repository at this point in the history
from kmodtool and make the README a little clearer.
  • Loading branch information
Quentin Barnes committed Sep 24, 2013
1 parent d92eb9d commit dc91997
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
10 changes: 7 additions & 3 deletions linux/README
Expand Up @@ -48,9 +48,13 @@ or for a RHEL5-like system, add:
ExtensionsDir_native = extensions-1.3
KmodDir_native = kmod-xt-older

If you're building for a specific kvariant, you can specify it. The
macro is architecture specific, so for example, for Xen i686:
KVARIANTS_native.i686 = xen
If you're building just for some kvariants, you can specify them.
The macro is architecture specific, so for example, on RHEL4/i686
building just for largesmp and Xen:
KVARIANTS_native.i686 = largesmp xenU
or only just for Xen on RHEL5/x86_64:
KVARIANTS_native.x86_64 = xen


For systems not using yum and rpm, porting will be more complex. If
you make changes to port to other systems that can be folded back
Expand Down
10 changes: 1 addition & 9 deletions linux/iptables-daddr.spec
Expand Up @@ -136,14 +136,7 @@ Source3: kmodtool

# hint: this can he overridden with "--define kvariants foo bar" on the
# rpmbuild command line, e.g. --define 'kvariants "" smp'
%if 0%{?rhel_version} != 406
%{!?kvariants: %define kvariants %{?upvar} %{?smpvar} %{?xenvar} %{?kdumpvar} %{?paevar}}
%else
# Split the output into two chunks on RHEL4 due to bug in its rpm utils
# not able to handle all the output from a single expand below.
%{!?kvariants1: %define kvariants1 %{?upvar} %{?smpvar}}
%{!?kvariants2: %define kvariants2 %{?xenvar} %{?kdumpvar} %{?paevar}}
%endif

# Use kmodtool to generate individual kmod subpackages directives.
%if 0%{?rhel_version} >= 406 && 0%{?rhel_version} <= 505
Expand All @@ -156,8 +149,7 @@ Source3: kmodtool
%if 0%{?rhel_version} != 406
%{expand:%(%{kmodtool} %{kmodtemplate} %{kmod_name} %{kverrel} %{kvariants} 2>/dev/null | sed -e 's@^\(%%preun \)\(.*\)$@%%pre \2\n%{prekmodrm}\n\n\1\2\n%{preunkmodrm}\n@g')}
%else
%{expand:%(%{kmodtool} %{kmodtemplate} %{kmod_name} %{kverrel} %{kvariants1} 2>/dev/null | sed -e 's@^\(%%preun \)\(.*\)$@%%pre \2\n%{prekmodrm}\n\1\2\n%{preunkmodrm}@g')}
%{expand:%(%{kmodtool} %{kmodtemplate} %{kmod_name} %{kverrel} %{kvariants2} 2>/dev/null | sed -e 's@^\(%%preun \)\(.*\)$@%%pre \2\n%{prekmodrm}\n\1\2\n%{preunkmodrm}@g')}
%{expand:%(for kvariant in %{kvariants};do %{kmodtool} %{kmodtemplate} %{kmod_name} %{kverrel} "$kvariant" 2>/dev/null;done | sed -e 's@^\(%%preun \)\(.*\)$@%%pre \2\n%{prekmodrm}\n\1\2\n%{preunkmodrm}@g')}
%endif


Expand Down

0 comments on commit dc91997

Please sign in to comment.