On Thu, Jul 13, 2017 at 10:20 AM, Aaron Conole <[email protected]> wrote:

> Hi Leif,
>

Ohai!


>
> Leif Madsen <[email protected]> writes:
>
> > Update the kernel module spec file to better reflect how I'm
> > locally building the kmod RPM in mock and pushing it to COPR.
> >
> > These changes also better align with RPM linting and uses the
> > preferred macros for referring to the build root.
> >
> > Adds in some Requires and BuildRequires lines that define the
> > RPM dependencies needed to build this RPM.
> >
> > Signed-off-by: Leif Madsen <[email protected]>
> > ---
>
> So, I guess this spec file is used by COPR based distribution.  I don't
> recall that we even use it in Fedora.
>

It's built in COPR (
https://copr.fedorainfracloud.org/coprs/leifmadsen/ovs-master/) but only
built for EPEL (CentOS) due to the old kernel there. It's primarily for
testing, and wouldn't be necessary in Fedora (since the OVS kernel bits are
already upstreamed in the kernel itself).


> > +mkdir -p %{buildroot}/etc/depmod.d
> > +for module in %{buildroot}/lib/modules/%{kernel}.%{_arch}/extra/*.ko
> >  do
> >      modname="$(basename ${module})"
> >      echo "override ${modname%.ko} * extra" >> \
> > -        $RPM_BUILD_ROOT/etc/depmod.d/kmod-openvswitch.conf
> > +        %{buildroot}/etc/depmod.d/kmod-openvswitch.conf
> >      echo "override ${modname%.ko} * weak-updates" >> \
> > -        $RPM_BUILD_ROOT/etc/depmod.d/kmod-openvswitch.conf
> > +        %{buildroot}/etc/depmod.d/kmod-openvswitch.conf
> >  done
> >
> >  %clean
> > -rm -rf $RPM_BUILD_ROOT
> > +rm -rf %{buildroot}
> >
> >  %post
> >  # Ensure that modprobe will find our modules.
> > -depmod %{kernel}
> > +depmod %{kernel}.%{_arch}
>
> Given this ^^^
>
> >  %files
> >  %defattr(0644,root,root)
> >  /lib/modules/%{kernel}/extra/*.ko
> > +/lib/modules/%{kernel}/modules.*
> >  /etc/depmod.d/kmod-openvswitch.conf
> > -%exclude /lib/modules/%{kernel}/modules.*
>
> Why include the modules.* files here.  Won't that break existing
> modules?
>

Great question. Unfortunately this is a bit of a black art to me, and I've
mostly gone on documentation from other spec files and examples. I had been
including this in my own local builds, but I don't have any actual CI
testing around the installation and usage of the RPMs being built. They are
mostly there for others to test. If this is indeed the incorrect thing to
be doing, I can revert this, and adjust in my own builds. My goal is to
start consuming the kmod spec file like I do for the application RPM (I use
the OVS spec file in the master branch with some minor `sed` magic to add
the version, but otherwise, depend on the spec file included in the OVS
repo itself.)


>
> That brings up a different question, actually.  Should this also have
> a postun which reruns depmod to clear out the dependency information in
> /lib/modules/%{kernel}/modules.*?
>
>
Great question, and unfortunately I don't know. Maybe someone better with
kernel module stuff could comment so that I could adjust the patch to make
it friendlier?

Thanks!
Leif.


-- 
Leif Madsen | Partner Engineer - NFV & CI
NFV Partner Engineering
Red Hat
GPG: (D670F846) BEE0 336E 5406 42BA 6194 6831 B38A 291E D670 F846
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to