diff mbox

[ovs-dev,1/2] rhel: Prioritize our vport-foo modules in depmod.

Message ID 20160729000938.816-1-joe@ovn.org
State Accepted
Headers show

Commit Message

Joe Stringer July 29, 2016, 12:09 a.m. UTC
We've done the same for openvswitch.ko previously, but we really should
be doing this for vport modules as well; otherwise, depmod may try to
pair upstream vport modules with the out-of-tree openvswitch module
(leading to depmod warnings on package install, and failure to load the
module at runtime).

VMware-BZ: #1700293
Signed-off-by: Joe Stringer <joe@ovn.org>
---
 rhel/openvswitch-kmod-rhel6.spec.in | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

Comments

Pravin Shelar July 29, 2016, 6:38 p.m. UTC | #1
On Thu, Jul 28, 2016 at 5:09 PM, Joe Stringer <joe@ovn.org> wrote:
> We've done the same for openvswitch.ko previously, but we really should
> be doing this for vport modules as well; otherwise, depmod may try to
> pair upstream vport modules with the out-of-tree openvswitch module
> (leading to depmod warnings on package install, and failure to load the
> module at runtime).
>
> VMware-BZ: #1700293
> Signed-off-by: Joe Stringer <joe@ovn.org>

Looks good except one comment below.

Acked-by: Pravin B Shelar <pshelar@ovn.org>


> ---
>  rhel/openvswitch-kmod-rhel6.spec.in | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/rhel/openvswitch-kmod-rhel6.spec.in b/rhel/openvswitch-kmod-rhel6.spec.in
> index 5d46838a9ed5..82a3312b100f 100644
> --- a/rhel/openvswitch-kmod-rhel6.spec.in
> +++ b/rhel/openvswitch-kmod-rhel6.spec.in
> @@ -43,10 +43,6 @@ Open vSwitch Linux kernel module.
>  %prep
>
>  %setup -n %{oname}-%{version}
> -cat > %{oname}.conf << EOF
> -override %{oname} * extra/%{oname}
> -override %{oname} * weak-updates/%{oname}
> -EOF
>
>  %build
>  for flavor in %flavors_to_build; do
> @@ -66,7 +62,17 @@ for flavor in %flavors_to_build ; do
>           find $INSTALL_MOD_PATH/lib/modules -iname 'modules.*' -exec rm {} \;
>  done
>  install -d %{buildroot}%{_sysconfdir}/depmod.d/
> +for module in %{buildroot}/lib/modules/%{kernel_version}/$INSTALL_MOD_DIR/*.ko;
> +do
> +    modname="$(basename ${module})"
> +    echo "override ${modname%.ko} * extra/${oname}" >> %{oname}.conf
> +    echo "override ${modname%.ko} * weak-updates/${oname}" >> %{oname}.conf
> +done
>  install -m 644 %{oname}.conf %{buildroot}%{_sysconfdir}/depmod.d/
>
> +%files
> +%defattr(644,root,root)
> +/etc/depmod.d/openvswitch.conf
> +

is there a reason for not using "oname" variable, like it is used above?
Flavio Leitner July 29, 2016, 6:46 p.m. UTC | #2
On Thu, Jul 28, 2016 at 05:09:37PM -0700, Joe Stringer wrote:
> We've done the same for openvswitch.ko previously, but we really should
> be doing this for vport modules as well; otherwise, depmod may try to
> pair upstream vport modules with the out-of-tree openvswitch module
> (leading to depmod warnings on package install, and failure to load the
> module at runtime).
> 
> VMware-BZ: #1700293
> Signed-off-by: Joe Stringer <joe@ovn.org>
> ---

LGTM
Acked-by: Flavio Leitner <fbl@sysclose.org>
Joe Stringer July 29, 2016, 6:47 p.m. UTC | #3
On 29 July 2016 at 11:38, pravin shelar <pshelar@ovn.org> wrote:
> On Thu, Jul 28, 2016 at 5:09 PM, Joe Stringer <joe@ovn.org> wrote:
>> We've done the same for openvswitch.ko previously, but we really should
>> be doing this for vport modules as well; otherwise, depmod may try to
>> pair upstream vport modules with the out-of-tree openvswitch module
>> (leading to depmod warnings on package install, and failure to load the
>> module at runtime).
>>
>> VMware-BZ: #1700293
>> Signed-off-by: Joe Stringer <joe@ovn.org>
>
> Looks good except one comment below.
>
> Acked-by: Pravin B Shelar <pshelar@ovn.org>

Thanks.

>> ---
>>  rhel/openvswitch-kmod-rhel6.spec.in | 14 ++++++++++----
>>  1 file changed, 10 insertions(+), 4 deletions(-)
>>
>> diff --git a/rhel/openvswitch-kmod-rhel6.spec.in b/rhel/openvswitch-kmod-rhel6.spec.in
>> index 5d46838a9ed5..82a3312b100f 100644
>> --- a/rhel/openvswitch-kmod-rhel6.spec.in
>> +++ b/rhel/openvswitch-kmod-rhel6.spec.in
>> @@ -43,10 +43,6 @@ Open vSwitch Linux kernel module.
>>  %prep
>>
>>  %setup -n %{oname}-%{version}
>> -cat > %{oname}.conf << EOF
>> -override %{oname} * extra/%{oname}
>> -override %{oname} * weak-updates/%{oname}
>> -EOF
>>
>>  %build
>>  for flavor in %flavors_to_build; do
>> @@ -66,7 +62,17 @@ for flavor in %flavors_to_build ; do
>>           find $INSTALL_MOD_PATH/lib/modules -iname 'modules.*' -exec rm {} \;
>>  done
>>  install -d %{buildroot}%{_sysconfdir}/depmod.d/
>> +for module in %{buildroot}/lib/modules/%{kernel_version}/$INSTALL_MOD_DIR/*.ko;
>> +do
>> +    modname="$(basename ${module})"
>> +    echo "override ${modname%.ko} * extra/${oname}" >> %{oname}.conf
>> +    echo "override ${modname%.ko} * weak-updates/${oname}" >> %{oname}.conf
>> +done
>>  install -m 644 %{oname}.conf %{buildroot}%{_sysconfdir}/depmod.d/
>>
>> +%files
>> +%defattr(644,root,root)
>> +/etc/depmod.d/openvswitch.conf
>> +
>
> is there a reason for not using "oname" variable, like it is used above?

No particular reason. I can update this.
Joe Stringer July 29, 2016, 8:15 p.m. UTC | #4
Thanks for the reviews all, I pushed this to master.

On 29 July 2016 at 11:46, Flavio Leitner <fbl@sysclose.org> wrote:
> On Thu, Jul 28, 2016 at 05:09:37PM -0700, Joe Stringer wrote:
>> We've done the same for openvswitch.ko previously, but we really should
>> be doing this for vport modules as well; otherwise, depmod may try to
>> pair upstream vport modules with the out-of-tree openvswitch module
>> (leading to depmod warnings on package install, and failure to load the
>> module at runtime).
>>
>> VMware-BZ: #1700293
>> Signed-off-by: Joe Stringer <joe@ovn.org>
>> ---
>
> LGTM
> Acked-by: Flavio Leitner <fbl@sysclose.org>
>
>
diff mbox

Patch

diff --git a/rhel/openvswitch-kmod-rhel6.spec.in b/rhel/openvswitch-kmod-rhel6.spec.in
index 5d46838a9ed5..82a3312b100f 100644
--- a/rhel/openvswitch-kmod-rhel6.spec.in
+++ b/rhel/openvswitch-kmod-rhel6.spec.in
@@ -43,10 +43,6 @@  Open vSwitch Linux kernel module.
 %prep
 
 %setup -n %{oname}-%{version}
-cat > %{oname}.conf << EOF
-override %{oname} * extra/%{oname}
-override %{oname} * weak-updates/%{oname}
-EOF
 
 %build
 for flavor in %flavors_to_build; do
@@ -66,7 +62,17 @@  for flavor in %flavors_to_build ; do
          find $INSTALL_MOD_PATH/lib/modules -iname 'modules.*' -exec rm {} \;
 done
 install -d %{buildroot}%{_sysconfdir}/depmod.d/
+for module in %{buildroot}/lib/modules/%{kernel_version}/$INSTALL_MOD_DIR/*.ko;
+do
+    modname="$(basename ${module})"
+    echo "override ${modname%.ko} * extra/${oname}" >> %{oname}.conf
+    echo "override ${modname%.ko} * weak-updates/${oname}" >> %{oname}.conf
+done
 install -m 644 %{oname}.conf %{buildroot}%{_sysconfdir}/depmod.d/
 
+%files
+%defattr(644,root,root)
+/etc/depmod.d/openvswitch.conf
+
 %clean
 rm -rf $RPM_BUILD_ROOT