Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 136271 - kernel-2 eclass always applies GENPATCHES first before other patches
Summary: kernel-2 eclass always applies GENPATCHES first before other patches
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: High major
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-10 03:39 UTC by Peter Hyman
Modified: 2006-07-22 12:34 UTC (History)
1 user (show)

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


Attachments
kernel-2.genpatch.eclass.diff (kernel-2.genpatch.eclass.diff,1.48 KB, patch)
2006-06-10 05:02 UTC, Peter Hyman
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Hyman 2006-06-10 03:39:43 UTC
See bug #136109. When emerging ck12 sources, ck patches will not apply if genpatches are applied first. In order to force the ck patches to succeed, many of the genpatches have to be excluded, 10, 2400, 25, 26, 27. I have determined that if the order of patch application is reversed: i.e. apply ck patches first, THEN apply the genpatches (with 10 excluded), all but two patches would apply. I tried to override the patch order by editing UNIPATCH_LIST, but it seems the kernel-2 eclass always applies the genpatches first. This is an oversight.

There should be a fix to allow the user to specify the order of patch files, not just strict order within the genpatch files. Allow UNIPATCH_LIST to take precedence, so that if genpatches is listed second, or third, they will be applied in that sequence.

Since unipatch is called internally, nothing the user can do will affect the order: see
kernel-2_src_unpack() {
	universal_unpack
	debug-print "Doing unipatch"

	[[ -n ${UNIPATCH_LIST} || -n ${UNIPATCH_LIST_DEFAULT} || -n ${UNIPATCH_LIST_GENPATCHES} ]] && \
		unipatch "${UNIPATCH_LIST_DEFAULT} ${UNIPATCH_LIST_GENPATCHES} ${UNIPATCH_LIST}"

So, if the user modifies UNIPATCH_LIST, it will still always come after genpatches. This is where the bug comes from.

A workaround, which will require some testing, would be to either A: have another flag variable to allow the user to control the order (default would be current method), or B: instruct the user to modify UNIPATCH_LIST_DEFAULT (which I think is a crappy idea), or C: allow ebuild to skip genpatches altogether.

However, if you are going to support -ck sources or other sources with their own patch sets, AND use genpatches, this change is important and required.
Comment 1 Peter Hyman 2006-06-10 04:08:25 UTC
The following was tested and appears to work.

	if [[ -n ${UNIPATCH_LIST} || -n ${UNIPATCH_LIST_DEFAULT} || -n 	${UNIPATCH_LIST_GENPATCHES} ]] ; then
		if [ -z ${UNIPATCH_GENPATCHES_LAST} ] ; then
			# normal behavior
			unipatch "${UNIPATCH_LIST_DEFAULT} ${UNIPATCH_LIST_GENPATCHES} ${UNIPATCH_LIST}"
		else
			# reverse order, genpatches last
			unipatch "${UNIPATCH_LIST_DEFAULT} ${UNIPATCH_LIST} ${UNIPATCH_LIST_GENPATCHES}"
		fi
	fi

Here's a partial output
 * Excluding Patch #2400 ...                                              [ ok ]
 * Applying patch-2.6.16-ck12.patch (-p0+) ...                            [ ok ]
 * Applying 1700_sparc-obp64-naming.patch (-p0+) ...                      [ ok ]
 * Applying 1705_sparc-U1-hme-lockup.patch (-p0+) ...                     [ ok ]
 * Applying 1710_sparc-sparsemem.patch (-p0+) ...   

Note, how the ck patch is applied first. In order to make this work, the new variable UNIPATCH_GENPATCHES_LAST must be set. If not set, normal behavior results.

This will allow for more patches to be applied to enhanced kernel patch sets.
Comment 2 Peter Hyman 2006-06-10 05:02:33 UTC
Created attachment 88833 [details, diff]
kernel-2.genpatch.eclass.diff

just the part to change order of patch application. Need to look at prepatched and strict order to make sure this is even necessary. the goal here is to have genpatches apply after a patchset for a given kernel.
Comment 3 Peter Hyman 2006-06-10 05:31:48 UTC
this _MAY_ not be the problem I thought it was. The ck-sources had K_PREPATCHED and UNIPATCH_STRICTORDER set. dsd pointed out that the uml sources, which also have patches do not exhibit this problem. Removing these two variables from the ck-sources allows the ck patchset to be applied followed by the gentoo ones. Unfortunately, this is a result of having an incorrect ebuild for a long time. I just assumed the variables were set for a reason, not realizing they caused the problem this patch tried to fix.

I'll leave it up to the kernel team to review and or close this bug. Seems like a non issue now.
Comment 4 Peter Hyman 2006-07-22 12:34:46 UTC
upstream inaction.