Bug 1299019 - /bin/kernel-install incorrectly copies files
/bin/kernel-install incorrectly copies files
Status: CLOSED EOL
Product: Fedora
Classification: Fedora
Component: systemd (Show other bugs)
24
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: systemd-maint
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-01-15 12:28 EST by Dennis Gilmore
Modified: 2017-08-08 08:39 EDT (History)
13 users (show)

See Also:
Fixed In Version: systemd-228-10.gite35a787.fc24
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-08-08 08:39:50 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Output from dnf reinstall (3.37 KB, text/plain)
2016-09-18 07:50 EDT, Joonas Sarajärvi
no flags Details

  None (edit)
Description Dennis Gilmore 2016-01-15 12:28:05 EST
Description of problem:

if [[ -x /sbin/new-kernel-pkg ]]; then
    KERNEL_DIR="${KERNEL_IMAGE%/*}"
    if [[ "${KERNEL_DIR}" != "/boot" ]]; then
        for i in \
            "$KERNEL_IMAGE" \
            "$KERNEL_DIR"/System.map \
            "$KERNEL_DIR"/config \
            "$KERNEL_DIR"/zImage.stub \
            "$KERNEL_DIR"/dtb \
            ; do
            [[ -e "$i" ]] || continue
            cp -a "$i" "/boot/${i##*/}-${KERNEL_VERSION}"
            command -v restorecon &>/dev/null && \
                restorecon "/boot/${i##*/}-${KERNEL_VERSION}"
        done


when installing or removing a kernel the files are copied. 
"$KERNEL_DIR"/dtb however is a directory. On removal the dtb/ directory is copied into /boot/dtb-<kernelversion>/ resulting in /boot/dtb-<kernelversion>/dtb/ being left with all the dtb files inside of it. 

the copy should only be done on a install and not on a remove. if doing the copy for all actions is really wanted it needs to be more careful about what it is copying where.
 
Version-Release number of selected component (if applicable):


How reproducible:
always

Steps to Reproduce:
1.install and remove a new kernel
2.
3.

Actual results:


Expected results:


Additional info:
Comment 1 Michal Schmidt 2016-01-15 12:30:59 EST
(In reply to Dennis Gilmore from comment #0)
> the copy should only be done on a install and not on a remove.

I agree.
Also I think we should make sure "kernel-install add ..." is idempotent and does not result in /boot/dtb-<kernelversion>/dtb/ being created either.
Comment 3 Harald Hoyer 2016-02-11 05:00:42 EST
systemd-228-10.gite35a787.fc24
Comment 4 Dennis Gilmore 2016-02-16 14:07:27 EST
The fix broke installing altogether

the dtb files are not coppied at all and the fdtdir is coppied without being updated so grubby is not being told correctly what to do.
Comment 5 Jan Kurik 2016-02-24 09:17:27 EST
This bug appears to have been reported against 'rawhide' during the Fedora 24 development cycle.
Changing version to '24'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora24#Rawhide_Rebase
Comment 6 Patrick Uiterwijk 2016-03-23 18:09:30 EDT
This bug is fixed in systemd-229-9.fc25
Comment 7 Joonas Sarajärvi 2016-09-18 07:50 EDT
Created attachment 1202183 [details]
Output from dnf reinstall

systemd-222-16.fc23.armv7hl seems to ship a partial fix to this bug. The fix has been reverted for other branches but not for F23. For F25 it has been also later been reapplied with some changes.

Current F23 state seems broken to me.

I tried cherry-picking commits 70cb855cd7c7c60b641da60a9db8d41e6f33ec66 and 253663e57d2458ac9e988bb59b304ab05c860538 from the f25 branch. These bring the F23 version of kernel-install-grubby.patch into sync with what is shipped in F25. With these changes, kernel installation works as I would expect and I get dtb files for the latest kernel placed under /boot.
Comment 8 Fedora End Of Life 2017-07-25 15:47:05 EDT
This message is a reminder that Fedora 24 is nearing its end of life.
Approximately 2 (two) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 24. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '24'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 24 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
Comment 9 Fedora End Of Life 2017-08-08 08:39:50 EDT
Fedora 24 changed to end-of-life (EOL) status on 2017-08-08. Fedora 24 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.