[Fedora-packaging] file-conflicts on updates problem

Thorsten Leemhuis fedora at leemhuis.info
Fri Aug 18 17:13:19 UTC 2006


Hi all!

I was looking at the current kmod situation a bit again and tested some
stuff and it seems I'm to dump to reproduce the "file-conflicts on
updates problem" -- a problem that I saw myself some weeks ago once IIRC
and that was multiple times brought into the current discussions by Axel.

Seems I'm doing something wrong here. Can somebody tell me that that is?
I uploaded two srpms for testing to
http://www.leemhuis.info/files/fedorarpms/MISC.fdr/kmod/
for people to reproduce the problem locally. That's not a real kmod, but
it uses the kmod-scheme and a "kernel module" for testing which is
created by

> dd if=/dev/urandom bs=1k count=500 > $RPM_BUILD_ROOT/lib/modules/%{kverrel}${kvariant}/extra/%{kmod_name}/foo.ko

Look closer yourself below to understand my confusion. Note, all the yum
calls are on FC5 with latest updates, but without the kmod plugin:

Prepare the test rpms:
> [thl at notebook ~]$ rpmbuild -ba rpmbuild/SPECS/foo-kmod-common.spec
> [thl at notebook ~]$ rpmbuild -ba rpmbuild/SPECS/foo-kmod.spec --define 'kversion 2.6.17-1.2157_FC5' --define 'kvariants ""' --define 'thisrelease 1' --target i686
> [thl at notebook ~]$ rpmbuild -ba rpmbuild/SPECS/foo-kmod.spec --define 'kversion 2.6.17-1.2174_FC5' --define 'kvariants ""' --define 'thisrelease 1' --target i686
> [thl at notebook ~]$ rpmbuild -ba rpmbuild/SPECS/foo-kmod.spec --define 'kversion 2.6.17-1.2174_FC5' --define 'kvariants ""' --define 'thisrelease 2' --target i686
[...]

Put them in a testrepo:

> [thl at notebook ~]$ mkdir -p ~/tmp/testrepo
> [thl at notebook ~]$ cp rpmbuild/RPMS/noarch/foo-kmod-common-1.1-1.noarch.rpm rpmbuild/RPMS/i686/kmod-foo-1.1-1.2.6.17_1.2157_FC5.i686.rpm ~/tmp/testrepo/
> [thl at notebook ~]$ createrepo ~/tmp/testrepo 
> 2/2 - kmod-foo-1.1-1.2.6.17_1.2157_FC5.i686.rpm
> Saving Primary metadata
> Saving file lists metadata
> Saving other metadata

Install the first one with yum:

> [thl at notebook ~]$ sudo yum --enablerepo=testrepo install kmod-foo
> Loading "installonlyn" plugin
> Setting up Install Process
> Setting up repositories
[...]
> Parsing package install arguments
> Resolving Dependencies
> --> Populating transaction set with selected packages. Please wait.
> ---> Package kmod-foo.i686 0:1.1-1.2.6.17_1.2157_FC5 set to be installed
> --> Running transaction check
> --> Processing Dependency: foo-kmod-common >= 1.1 for package: kmod-foo
> --> Restarting Dependency Resolution with new changes.
> --> Populating transaction set with selected packages. Please wait.
> ---> Package foo-kmod-common.noarch 0:1.1-1 set to be updated
> --> Running transaction check
> 
> Dependencies Resolved
> 
> =============================================================================
>  Package                 Arch       Version          Repository        Size
> =============================================================================
> Installing:
>  kmod-foo                i686       1.1-1.2.6.17_1.2157_FC5  testrepo          504 k
> Installing for dependencies:
>  foo-kmod-common         noarch     1.1-1            testrepo          2.2 k
> 
> Transaction Summary
> =============================================================================
> Install      2 Package(s)
> Update       0 Package(s)
> Remove       0 Package(s)
> Total download size: 506 k
> Is this ok [y/N]: y
> Downloading Packages:
> Running Transaction Test
> Finished Transaction Test
> Transaction Test Succeeded
> Running Transaction
>   Installing: foo-kmod-common              ######################### [1/2]
>   Installing: kmod-foo                     ######################### [2/2]
> WARNING: Module /lib/modules/2.6.17-1.2157_FC5/extra/foo/foo.ko is not an elf object
> 
> Installed: kmod-foo.i686 0:1.1-1.2.6.17_1.2157_FC5
> Dependency Installed: foo-kmod-common.noarch 0:1.1-1
> Complete!
> [thl at notebook ~]$

Copy the second one in the repo and update:

> [thl at notebook ~]$ cp rpmbuild/RPMS/i686/kmod-foo-1.1-1.2.6.17_1.2174_FC5.i686.rpm ~/tmp/testrepo/ 
> [thl at notebook ~]$ createrepo ~/tmp/testrepo/
> 3/3 - kmod-foo-1.1-1.2.6.17_1.2174_FC5.i686.rpm
> Saving Primary metadata
> Saving file lists metadata
> Saving other metadata
> [thl at notebook ~]$ sudo rm -rf /var/cache/yum/testrepo/
> [thl at notebook ~]$ sudo yum --enablerepo=testrepo update
> Loading "installonlyn" plugin
> Setting up Update Process
> Setting up repositories
> macromedia                                                           [1/7]
> livna                                                                [2/7]
> testrepo                                                             [3/7]
> testrepo                  100% |=========================|  951 B    00:00
> updates-testing                                                      [4/7]
> core                                                                 [5/7]
> updates                                                              [6/7]
> extras                                                               [7/7]
> Reading repository metadata in from local files
> primary.xml.gz            100% |=========================| 1.0 kB    00:00
> testrepo  : ################################################## 3/3
> Added 3 new packages, deleted 0 old in 0.05 seconds
> Resolving Dependencies
> --> Populating transaction set with selected packages. Please wait.
> ---> Downloading header for kmod-foo to pack into transaction set.
> kmod-foo-1.1-1.2.6.17_1.2 100% |=========================| 2.4 kB    00:00
> ---> Package kmod-foo.i686 0:1.1-1.2.6.17_1.2174_FC5 set to be installed
> --> Running transaction check
> 
> Dependencies Resolved
> 
> =============================================================================
>  Package                 Arch       Version          Repository        Size
> =============================================================================
> Installing:
>  kmod-foo                i686       1.1-1.2.6.17_1.2174_FC5  testrepo          504 k
> 
> Transaction Summary
> =============================================================================
> Install      1 Package(s)
> Update       0 Package(s)
> Remove       0 Package(s)
> Total download size: 504 k
> Is this ok [y/N]: y
> Downloading Packages:
> Running Transaction Test
> Finished Transaction Test
> Transaction Test Succeeded
> Running Transaction
>   Installing: kmod-foo                     ######################### [1/1]
> WARNING: Module /lib/modules/2.6.17-1.2174_FC5/extra/foo/foo.ko is not an elf object
> 
> Installed: kmod-foo.i686 0:1.1-1.2.6.17_1.2174_FC5
> Complete!
> [thl at notebook ~]$

Works as expected so far. But now:

> [thl at notebook ~]$ cp rpmbuild/RPMS/i686/kmod-foo-1.1-2.2.6.17_1.2174_FC5.i686.rpm tmp/testrepo/
> [thl at notebook ~]$ sudo rm -rf /var/cache/yum/testrepo/
> [thl at notebook ~]$ createrepo ~/tmp/testrepo/
> 4/4 - kmod-foo-1.1-2.2.6.17_1.2174_FC5.i686.rpm
> Saving Primary metadata
> Saving file lists metadata
> Saving other metadata
> [thl at notebook ~]$ sudo yum --enablerepo=testrepo update
> Loading "installonlyn" plugin
> Setting up Update Process
> Setting up repositories
> macromedia                                                           [1/7]
> livna                                                                [2/7]
> testrepo                                                             [3/7]
> testrepo                  100% |=========================|  951 B    00:00
> updates-testing                                                      [4/7]
> core                                                                 [5/7]
> updates                                                              [6/7]
> extras                                                               [7/7]
> Reading repository metadata in from local files
> primary.xml.gz            100% |=========================| 1.1 kB    00:00
> testrepo  : ################################################## 4/4
> Added 4 new packages, deleted 0 old in 0.10 seconds
> Resolving Dependencies
> --> Populating transaction set with selected packages. Please wait.
> ---> Downloading header for kmod-foo to pack into transaction set.
> kmod-foo-1.1-2.2.6.17_1.2 100% |=========================| 2.4 kB    00:00
> ---> Package kmod-foo.i686 0:1.1-2.2.6.17_1.2174_FC5 set to be installed
> --> Running transaction check
> --> Populating transaction set with selected packages. Please wait.
> ---> Package kmod-foo.i686 0:1.1-1.2.6.17_1.2157_FC5 set to be erased
> --> Running transaction check
> 
> Dependencies Resolved
> 
> =============================================================================
>  Package                 Arch       Version          Repository        Size
> =============================================================================
> Installing:
>  kmod-foo                i686       1.1-2.2.6.17_1.2174_FC5  testrepo          504 k
> Removing:
>  kmod-foo                i686       1.1-1.2.6.17_1.2157_FC5  installed         500 k
> 
> Transaction Summary
> =============================================================================
> Install      1 Package(s)
> Update       0 Package(s)
> Remove       1 Package(s)
> Total download size: 504 k
> Is this ok [y/N]: y
> Downloading Packages:
> Running Transaction Test
> Finished Transaction Test
> Transaction Test Succeeded
> Running Transaction
>   Removing  : kmod-foo                     ######################### [1/2]
>   Installing: kmod-foo                     ######################### [2/2]
> WARNING: Module /lib/modules/2.6.17-1.2174_FC5/extra/foo/foo.ko is not an elf object
> 
> Removed: kmod-foo.i686 0:1.1-1.2.6.17_1.2157_FC5
> Installed: kmod-foo.i686 0:1.1-2.2.6.17_1.2174_FC5
> Complete!
> [thl at notebook ~]$ 

Okay, why did that work? I don't know for real. Let's check some details:

> [thl at notebook ~]$ rpm -qa kmod-foo
> kmod-foo-1.1-2.2.6.17_1.2174_FC5
> kmod-foo-1.1-1.2.6.17_1.2174_FC5
> [thl at notebook ~]$ rpm -V kmod-foo-1.1-1.2.6.17_1.2174_FC5
> ..5....T    /lib/modules/2.6.17-1.2174_FC5/extra/foo/foo.ko
> [thl at notebook ~]$ rpm -V kmod-foo-1.1-2.2.6.17_1.2174_FC5
> [thl at notebook ~]$

Well, I'd call that "interesting". Seem the "file-conflicts on updates
problem" doesn't exist.

But while testing it I noticed something else. You probably noticed that
in above transaction kmod-foo.i686 0:1.1-1.2.6.17_1.2157_FC5 got removed
-- it seems that's not a rpm/yum feature. It's the installonly-plugin
that does this. Let's get back to the state we were before:

> [thl at notebook ~]$ sudo rpm -ivh /home/thl/tmp/testrepo/kmod-foo-1.1-1.2.6.17_1.2157_FC5.i686.rpm  --oldpackage
> Preparing...                ########################################### [100%]
>    1:kmod-foo               ########################################### [100%]
> WARNING: Module /lib/modules/2.6.17-1.2157_FC5/extra/foo/foo.ko is not an elf object
> [thl at notebook ~]$ sudo rpm -e kmod-foo-1.1-1.2.6.17_1.2174_FC5 kmod-foo-1.1-2.2.6.17_1.2174_FC5
> [thl at notebook ~]$ sudo rpm -ivh /home/thl/tmp/testrepo/kmod-foo-1.1-1.2.6.17_1.2174_FC5.i686.rpm
> Preparing...                ########################################### [100%]
>    1:kmod-foo               ########################################### [100%]
> WARNING: Module /lib/modules/2.6.17-1.2174_FC5/extra/foo/foo.ko is not an elf object
> [thl at notebook ~]$

Now disable the plugin:

> [thl at notebook ~]$ sudo yum --noplugins --enablerepo=testrepo update
> Setting up Update Process
> Setting up repositories
> macromedia                                                           [1/7]
> livna                                                                [2/7]
> testrepo                                                             [3/7]
> updates-testing                                                      [4/7]
> core                                                                 [5/7]
> updates                                                              [6/7]
> extras                                                               [7/7]
> Reading repository metadata in from local files
> Resolving Dependencies
> --> Populating transaction set with selected packages. Please wait.
> ---> Downloading header for kmod-foo to pack into transaction set.
> kmod-foo-1.1-2.2.6.17_1.2 100% |=========================| 2.4 kB    00:00
> ---> Package kmod-foo.i686 0:1.1-2.2.6.17_1.2174_FC5 set to be installed
> --> Running transaction check
> 
> Dependencies Resolved
> 
> =============================================================================
>  Package                 Arch       Version          Repository        Size
> =============================================================================
> Installing:
>  kmod-foo                i686       1.1-2.2.6.17_1.2174_FC5  testrepo          504 k
> 
> Transaction Summary
> =============================================================================
> Install      1 Package(s)
> Update       0 Package(s)
> Remove       0 Package(s)
> Total download size: 504 k
> Is this ok [y/N]: y
> Downloading Packages:
> Running Transaction Test
> Finished Transaction Test
> Transaction Test Succeeded
> Running Transaction
>   Installing: kmod-foo                     ######################### [1/1]
> WARNING: Module /lib/modules/2.6.17-1.2174_FC5/extra/foo/foo.ko is not an elf object
> 
> Installed: kmod-foo.i686 0:1.1-2.2.6.17_1.2174_FC5
> Complete!
> [thl at notebook ~]$

Disabling the installonly-plungin in
/etc/yum/pluginconf.d/installonlyn.conf has the same effect. So the "old
modules get removed on updates" problem in reality is a bug AFAICS.

Or I'm probably doing something really wrong here -- but what?

CU
thl





More information about the packaging mailing list