View previous topic :: View next topic |
Author |
Message |
mathfeel l33t
Joined: 03 Aug 2004 Posts: 700
|
Posted: Sat May 21, 2011 11:35 pm Post subject: gentoo-sources and depclean |
|
|
Is it possible to get emerge --depclean to, besides keeping only the latest version of gentoo-sources, but also the current running version, by perhaps checking with uname -r or something? This way, when I DO upgrade the kernel and the newer version is up and running, running depclean will then clean the older version.
Thanks. _________________ -----------------------------------------------------------
"In heaven all the interesting people are missing"
-- Friedrich Nietzsche |
|
Back to top |
|
|
platojones Veteran
Joined: 23 Oct 2002 Posts: 1602 Location: Just over the horizon
|
Posted: Sat May 21, 2011 11:45 pm Post subject: |
|
|
depclean doesn't actually remove the kernel sources. They are still left there, in tact. It just removes them from the list of installed packages. |
|
Back to top |
|
|
krinn Watchman
Joined: 02 May 2003 Posts: 7470
|
Posted: Sat May 21, 2011 11:46 pm Post subject: |
|
|
emerge the specific package version, this way emerge add it to world and it will be protect from depclean
edit: -> better cmdline: emerge --noreplace =gentoo-sources-versiontoprotect |
|
Back to top |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21637
|
Posted: Sun May 22, 2011 12:55 am Post subject: |
|
|
platojones wrote: | depclean doesn't actually remove the kernel sources. They are still left there, in tact. It just removes them from the list of installed packages. | On what do you base this comment? The behavior you suggest directly contradicts the point of unmerging package files. |
|
Back to top |
|
|
platojones Veteran
Joined: 23 Oct 2002 Posts: 1602 Location: Just over the horizon
|
Posted: Sun May 22, 2011 1:03 am Post subject: |
|
|
Hu wrote: | platojones wrote: | depclean doesn't actually remove the kernel sources. They are still left there, in tact. It just removes them from the list of installed packages. | On what do you base this comment? The behavior you suggest directly contradicts the point of unmerging package files. |
I base that comment on years of experience and there are several (old) threads here about it. I've been depcleaning/unmerging them for years and the sources have never been actually removed. I have to do it manually (rm -rf) if I actually want to get rid of the sources. Kernel sources are handled differently...at least they always have been on my system. Maybe my system is different. |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21637
|
Posted: Sun May 22, 2011 2:53 am Post subject: |
|
|
You might have your sources protected from unmerge by CONFIG_PROTECT. Alternatively, you might be completely mistaken. Many people choose to build their kernel in-tree, which pollutes /usr/src/linux-version with uncontrolled files. Portage will only remove controlled files and empty directories. If you pollute your kernel source tree, then emerge --depclean will not remove the directory structure. |
|
Back to top |
|
|
platojones Veteran
Joined: 23 Oct 2002 Posts: 1602 Location: Just over the horizon
|
Posted: Sun May 22, 2011 2:58 am Post subject: |
|
|
Hu wrote: | You might have your sources protected from unmerge by CONFIG_PROTECT. Alternatively, you might be completely mistaken. Many people choose to build their kernel in-tree, which pollutes /usr/src/linux-version with uncontrolled files. Portage will only remove controlled files and empty directories. If you pollute your kernel source tree, then emerge --depclean will not remove the directory structure. |
Actually, I don't have my sources protected by CONFIG_PROTECT.
And yes, I do build my sources 'in-tree'. How do you build them? Copy them somewhere else then build them? I wasn't aware anybody did this and I can't imagine why they would...and then, even if you did and avoided 'polluting your sources with uncontrolled files'...depclean still wouldn't touch those copies either.
I'm sorry, nothing you just wrote makes any sense to me. |
|
Back to top |
|
|
Etal Veteran
Joined: 15 Jul 2005 Posts: 1931
|
Posted: Sun May 22, 2011 3:30 am Post subject: |
|
|
Code: | # ls linux-2.6.39-rc7/
arch CREDITS drivers include Kbuild lib mm Module.symvers REPORTING-BUGS security tools vmlinux
block crypto firmware init Kconfig MAINTAINERS modules.builtin net samples sound usr vmlinux.o
COPYING Documentation fs ipc kernel Makefile modules.order README scripts System.map virt
# emerge -aqC vanilla-sources-2.6.39_rc7
sys-kernel/vanilla-sources: 2.6.39_rc7 none 2.6.39
All selected packages: sys-kernel/vanilla-sources-2.6.39_rc7
Would you like to unmerge these packages? [Yes/No] y
>>> Waiting 5 seconds before starting...
>>> (Control-C to abort)...
>>> Unmerging in: 5 4 3 2 1
>>> Unmerging sys-kernel/vanilla-sources-2.6.39_rc7...
# ls linux-2.6.39-rc7/
arch crypto firmware include ipc lib modules.builtin Module.symvers scripts sound usr vmlinux
block drivers fs init kernel mm modules.order net security System.map virt vmlinux.o |
I get the same behavior as Hu describes - anything that gets installed by portage gets uninstalled by it. _________________ “And even in authoritarian countries, information networks are helping people discover new facts and making governments more accountable.”– Hillary Clinton, Jan. 21, 2010 |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21637
|
Posted: Sun May 22, 2011 3:45 am Post subject: |
|
|
I use the out-of-tree build support via $KBUILD_OUTPUT, which I have described and advocated many times on these forums. It allows me to build multiple kernels with different configurations, all from a single source tree with no extra copies created anywhere. |
|
Back to top |
|
|
platojones Veteran
Joined: 23 Oct 2002 Posts: 1602 Location: Just over the horizon
|
Posted: Sun May 22, 2011 3:48 am Post subject: |
|
|
Apologies to all...it removes some of the tree, but leaves some files in place.
Jaglover, Hu, Etal...I'm wrong. I thought the tree was in tact all these years.
Sorry for the confusion I caused. |
|
Back to top |
|
|
mathfeel l33t
Joined: 03 Aug 2004 Posts: 700
|
Posted: Sun May 22, 2011 4:01 am Post subject: |
|
|
platojones wrote: | Apologies to all...it removes some of the tree, but leaves some files in place.
Jaglover, Hu, Etal...I'm wrong. I thought the tree was in tact all these years.
Sorry for the confusion I caused. |
It behaves like this: if you have run make under the tree, it produces a lot of new files (object file etc), which are not unmerged. If you want them gone by unmerge, you do:
which restore the tree to post-merge states. Then emerge -C gentoo-sources:{version} would remove the tree completely.
krinn wrote: | emerge the specific package version, this way emerge add it to world and it will be protect from depclean
edit: -> better cmdline: emerge --noreplace =gentoo-sources-versiontoprotect |
It is of course possible to run emerge --noreplace gentoo-sources:{desired version} to keep depclean from removing it. But one would have to remember to do this every time compiling a new kernel to keep it explicitly in @world. And when a newer kernel comes along that one wants to use, one would have to emerge -C gentoo-sources:{old marked version} also explicitly, remembering which versions in @world that one do not wants.
I think the behavior should be (to suit my own taste, not speaking for anyone else here):
- If {any version} is explicitly in @world, then it should be unmerged explicitly. As it is now.
- If {old version} is emerge implicit via update and is currently in used, depclean shouldn't unmerge it.
- If an implicit {old version} is not in use, depclean should then clean it.
I think kernel sources is pretty unique in the sense that one often need to keep the tree of the in-use version even when a newer version is emerged because some packages check it and would failed if the tree is unmerged. _________________ -----------------------------------------------------------
"In heaven all the interesting people are missing"
-- Friedrich Nietzsche |
|
Back to top |
|
|
|