rpm -U odd behavior

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I've got an rpm under development that, while installing, converts a
kernel module .o file to .ko if the rpm is being installed on a 2.6
kernel.  The .ko file is then copied to /lib/modules/`uname -r`/misc.  
These steps are done by the post scriptlet (along with a few other things
like running depmod).  This technique allows me to have a single rpm that
supports many linux varients running either 2.4 or 2.6 kernels.

Since the post scriptlet copies the .ko to /lib/modules/`uname -r`/misc I
must also rm the /lib/modules/`uname -r`/misc/myfile.ko in the postun 
scriptlet to that when this rpm is uninstalled it fully removes all files 
related to the package.

I am relatively new to rpm development.  Today I started investigating the
-U (upgrade) feature of rpm in relation to the above package.  I created
an rpm for the product of version 1.44 and another rpm for version 1.45.  
I installed (rpm -i) version 1.44.  I then used rpm -U to upgrade to
version 1.45.  This upgrade process completed without complaint.  
However, the result of the upgrade was a broken installation.  I
discovered that the /lib/modules/`uname -r`/misc/myfile.ko was missing
after the upgrade.

So, I added set -x and echo commands to uniquely identify the %pre, %post,
%preun and %postun sections for both the version 1.44 and 1.45 spec files
and re-built the rpm packages.  I then removed the failed upgrade and
repeated the above install of version 1.44 followed by an upgrade to 1.45.

During the upgrade process the echo commands revealed that the %pre and
%post scriptlets for version 1.45 ran first followed by the %preun and
%postun scriptlets for version 1.44!  This, to me, is completely
backwards.  The %post scriptlet of 1.45 copied the created myfile.ko to
/lib/modules/`uname -r`/misc just fine and after that the upgrade process
ran the version 1.44 %postun scriptlet which removed the just installed
/lib/modules/`uname -r`/misc/myfile.ko breaking the installation/upgrade
of version 1.45.

Why is this happening?

-- 
Thanks,

Mark Sincerbox
Adax, Inc.
1-510-548-7047 x129

_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux