| Summary: | Suggestion: `make mrproper` when unmerging kernel source ebuilds | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | Peter Gordon (RETIRED) <codergeek42> |
| Component: | [OLD] Core system | Assignee: | Gentoo Kernel Bug Wranglers and Kernel Maintainers <kernel> |
| Status: | RESOLVED FIXED | ||
| Severity: | enhancement | CC: | johnm, vanquirius |
| Priority: | High | Keywords: | Inclusion |
| Version: | unspecified | ||
| Hardware: | x86 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
| Attachments: | kernel-eclass-make-mrproper-before-unmerge.patch | ||
|
Description
Peter Gordon (RETIRED)
2005-06-19 01:55:54 UTC
Created attachment 61476 [details, diff]
kernel-eclass-make-mrproper-before-unmerge.patch
Adds an exported pkg_prerm function to the kernel-2 eclass to run `make
mrproper` in the given kernel source tree directory before unmerging.
I Cant see any problem with doing this.
I have updated the eclass here, locally. The prerm function I would prefer to
use is:
kernel-2_pkg_prerm() {
local KV_DIR=${ROOT}/usr/src/linux-${KV_FULL}
if [[ ${ETYPE} == sources ]]; then
# if we have a config for it then we should act on it.
if [[ -f ${KV_DIR}/.config ]]; then
cp ${KV_DIR}/.config ${KV_DIR}.config
gzip ${KV_DIR}.config
fi
# have kbuild clean up for us.
env -u ARCH make -C ${KV_DIR} mrproper
fi
}
any objections?
make mrproper does not always work (try running it twice) and we should do our usual voodoo for ARCH for cross-compilers John,
Thanks for fixing up the pkg_prerm. That's much nicer. :-)
Daniel, I just tried running it twice (after running `make allnoconfig && make`
on a gentoo-sources 2.6.11-r11 kernel tree that I've been using to test things,
and it failed with an error saying that "/include/linux/version.h" couldn't be
found. I've modified John's function to test for that first before running `make
mrproper`:
---snip---
kernel-2_pkg_prerm() {
local KV_DIR=${ROOT}/usr/src/linux-${KV_FULL}
if [[ ${ETYPE} == sources ]]; then
# if we have a config for it then we should act on it.
if [[ -f ${KV_DIR}/.config ]]; then
cp ${KV_DIR}/.config ${KV_DIR}.config
gzip ${KV_DIR}.config
fi
# have kbuild clean up for us.
[[ -f ${KV_DIR}/include/linux/version.h ]] && env -u ARCH make -C ${KV_DIR}
mrproper
fi
}
---/snip---
Thanks for the input. What do you mean by "usual voodoo for ARCH for
cross-compilers"? Could we simply set what ARCH to use for kbuild based on the
current GCC profile?
Look at how tc-arch-kernel is used elsewhere in the eclass This should probably be done with an USE flag, to prevent .config files and other files to be wiped out without the users's consent. Im not sure how much the cross-compile stuff has effect here (ie: why I never
used it) although to take into account the previous comments please check:
kernel-2_pkg_prerm() {
local KV_DIR=${ROOT}/usr/src/linux-${KV_FULL}
if [[ ${ETYPE} == sources ]]; then
# if we have a config for it then we should act on it.
if [[ -f ${KV_DIR}/.config ]]; then
gzip -c ${KV_DIR}/.config > ${KV_DIR}.config
fi
# have kbuild clean up for us.
if [[ -f ${KV_DIR}/include/linux/version.h ]]; then
ARCH=$(tc-arch-kernel)
make -C ${KV_DIR} mrproper
fi
fi
}
which should solve everyones requirements hopefully.
Marcelo, I'm not sure if that would matter, since every kernel is SLOT'ed
${KV_FULL} anyways they would have to explicitly remove it. I asssume if they do
so, then they want it gone, completely.
However, the .config is backed up for courtesy if it exists.
any other comments?
Heh. I was just going to post a similar function. Thanks, John. That Works nicely, here. :-) comitted to CVS. Shweet. Thanks very much. :D |