Bug 137829 (IT_53176)
Summary: | rpm -F on kernel-smp removes kernel packages | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 3 | Reporter: | Johnray Fuller <jrfuller> | ||||||||
Component: | rpm | Assignee: | Paul Nasrat <nobody+pnasrat> | ||||||||
Status: | CLOSED ERRATA | QA Contact: | Mike McLean <mikem> | ||||||||
Severity: | medium | Docs Contact: | |||||||||
Priority: | medium | ||||||||||
Version: | 3.0 | CC: | nobody+pnasrat, tao | ||||||||
Target Milestone: | --- | ||||||||||
Target Release: | --- | ||||||||||
Hardware: | All | ||||||||||
OS: | Linux | ||||||||||
Whiteboard: | |||||||||||
Fixed In Version: | RHBA-2005-744 | Doc Type: | Bug Fix | ||||||||
Doc Text: | Story Points: | --- | |||||||||
Clone Of: | Environment: | ||||||||||
Last Closed: | 2005-10-05 17:20:45 UTC | Type: | --- | ||||||||
Regression: | --- | Mount Type: | --- | ||||||||
Documentation: | --- | CRM: | |||||||||
Verified Versions: | Category: | --- | |||||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||||
Embargoed: | |||||||||||
Bug Depends On: | 163282 | ||||||||||
Bug Blocks: | 156320, 156322 | ||||||||||
Attachments: |
|
Description
Johnray Fuller
2004-11-01 21:09:07 UTC
Appended is a freshen.sh script that appears to solve the problem. Created attachment 106381 [details]
Replace --freshen with popt exec that upgrades by pkg name
This is basically the way that --freshen was implemented in rpm-3.0.4
and earlier.
Is there a chance of "return of the RHEL 2.1 behavior" for -F? If not, why? Thanks, J Created attachment 106756 [details]
Updated freshen script allows (passing of root= flag)
This version of the freshen script enables the passing of the root= flag in RPM
as required by the customer's installation scripts.
I have the follwoing feedback about the freshen script: "The pn-freshen script works, but before it is included into a future rpm package, please observe the following loop (lines 47 to 69) for fn in $*; do # If not a file, just pass to upgrade. [ ! -f $fn ] && Uargs="$Uargs $fn" && continue # For all occurences of identically named packages installed ... N="`$rpmq -qp --qf '%{NAME}' $fn`" NVR="`$rpmq $rootopt -qa $N`" # ... special case kernel packages case $N in kernel*) # ... if none installed, just pass the filename to -U #[ "$NVR" = "" ] && Uargs="$Uargs $fn" && continue [ "$NVR" = "" ] && continue # ... else erase the old package(s) before installing the new package. eargs="$eargs $NVR" iargs="$iargs $fn" ;; *) Uargs="$Uargs $fn";; esac done The query of the package %{NAME} and matching it against the installed database by doing: NVR="`$rpmq $rootopt -qa $N`" causes an open, lookup, and close for every package, not just for kernel packages. This will slow down our upgrade process as the distribution gets older and more packages have been updated. This needs to be sped up." Here is some additional feedback: "1> I suspect it could be mainly alleviated by moving the assignment of $NVR inside of the "case $N" statement's "kernel*)" condition since it doesn't need to be assigned unless $N ~= /^kernel/. (see above) 2> The script should also probably not check for "kernel*" but be refined to a list of provides so that "kernel-utils", "kernel-headers", etc. don't get caught in this un-necessary extra work. Perhaps the cases should be "kernel" "kernel-smp" "kernel-hugemem", or should just include logic to ensure that both "kernel" and "kernel-<something>" are provided." J Feedback from customer: Back to the original complaint: The script provided does the following incorrectly: 1) If someone tries to install the same version, the rpmi will fail, but the rpme will be run anyway. an && needed to be added between the commands to fix this. This means that if a system has more than one kernel, it can be removed unintentionally. I.e. if kernel and kernel-smp is installed, if rpm -F <same_kernel_version>.rpm is run, then since the kernel-smp has the same provides as kernel, kernel will be removed. 2) If it is used with the -F option, it will install non-kernel packages indiscriminantly. 3) If it is used with -U and a kernel package that is not installed already, it will not install the kernel. 4) It will fail on packages like kernel-utils that have dependancies if they are not satisfied because they match kernel*. 5) It is slow. The rpm database should only be checked for packages that match kernel, kernel-smp, or kernel-enterprise. This speeds it up tremendously. We have fixes in place here for all of these problems. Please confirm that whoever is folding this into the main rpm distribution knows about these and can make sure that the same issues will not be present in any released versions of RPM. -Peter One other important issue witht he freshen.sh that is currently implemented. Upon successful completion, it can return 1 to $? instead of 0. Removing the last line of the script seems to resolve this, but I am not sure if that is the best way. Here is the line that was removed: [ "$Uargs" != "" ] && $dbg $rpmi -U $opts $Uargs The shell variable is used to determine successful completion of the RPM commands, so it is important $? be 0 upon successful completion. J Created attachment 110799 [details]
updated freshen script.
Attaching a version of the script that addresses the above concerns. Can this version replace the previou version and be included as an addon? Patch seems to be in RHEL3U5, putting this into modified state. An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2005-602.html An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2005-744.html |