Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 581522 - kernel-2.eclass: warn about obsolete files in /lib/modules after removing the kernel
Summary: kernel-2.eclass: warn about obsolete files in /lib/modules after removing th...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-29 11:08 UTC by Pacho Ramos
Modified: 2016-12-29 00:14 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pacho Ramos gentoo-dev 2016-04-29 11:08:57 UTC
We currently has this message:
kernel-2_pkg_postrm() {
        # This warning only makes sense for kernel sources.
        [[ ${ETYPE} == headers ]] && return 0

        # If there isn't anything left behind, then don't complain.
        [[ -e ${ROOT}usr/src/linux-${KV_FULL} ]] || return 0
        echo
        ewarn "Note: Even though you have successfully unmerged "
        ewarn "your kernel package, directories in kernel source location: "
        ewarn "${ROOT}usr/src/linux-${KV_FULL}"
        ewarn "with modified files will remain behind. By design, package managers"
        ewarn "will not remove these modified files and the directories they reside in."
        echo
}

But most people run kernels with modules and, hence, they will also have many files left behind there when removing the kernel. Maybe the warning could be extended as a hint for admins to also clean that dir

Thanks
Comment 1 Pacho Ramos gentoo-dev 2016-04-29 11:19:25 UTC
Well... and /boot also ;)
Comment 2 Anthony Basile gentoo-dev 2016-04-29 16:11:23 UTC
(In reply to Pacho Ramos from comment #1)
> Well... and /boot also ;)

The files left behind in /boot and /lib/modules are of a totally different category than those left behind in /usr/src/linux-${KV_FULL}.  The former are the installed  vmlinuz image and modules for booting.  The later are the object files generated when building.  The message is support to alert people to the latter files which are left in /usr/src/linux-${KV_FULL} even after the gentoo-sources of hardened-sources for that ${KV_FULL} are removed.  It is not obvious that those files are left behind in /usr/src/linux-${KV_FULL} when everything else is removed on unmerging.

So, the message is fine as is. I'll let mgpagano chime in.  Maybe we want to clarify the message?  I don't know.  I don't know in what context this became and issue so I'm not sure how to address it.
Comment 3 Mike Pagano gentoo-dev 2016-05-03 19:02:52 UTC
I'm OK with clarifying it.   Are user's confused why these files still exist after an unmerge?  I've never had complaints over the last 8 years, myself but I'm just one sample source.
Comment 4 Pacho Ramos gentoo-dev 2016-05-03 20:23:56 UTC
Other option would be to point to this:
https://wiki.gentoo.org/wiki/Kernel/Removal

But I don't know if that page is "official" :/
Comment 5 Mike Pagano gentoo-dev 2016-12-27 21:38:27 UTC
(In reply to Pacho Ramos from comment #4)
> Other option would be to point to this:
> https://wiki.gentoo.org/wiki/Kernel/Removal
> 
> But I don't know if that page is "official" :/

I like this idea the best. I'll include a link to this in a patch and submit to gentoo-dev.
Comment 6 Mike Pagano gentoo-dev 2016-12-29 00:14:39 UTC
commit 56f159b0f4eb644f3a7109e66c81d0280e9cf6fd
Author: Mike Pagano <mpagano@gentoo.org>
Date:   Wed Dec 28 19:11:22 2016 -0500

kernel-2.eclass: Point user to addtional kernel removal instructions. See bug #581522.