Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 87242 | Differences between
and this patch

Collapse All | Expand All

(-)linux-info.eclass (-12 / +40 lines)
Lines 123-130 local ERROR workingdir basefname basedna Link Here
123
		unset ARCH
123
		unset ARCH
124
124
125
		cd "${basedname}"
125
		cd "${basedname}"
126
		echo -e "e:\\n\\t@echo \$(${1})\\ninclude ${basefname}" | \
126
		if [ -n "${3}" ]
127
			make M="${S}" ${BUILD_FIXES} -s -f - 2>/dev/null
127
		then
128
			echo -e "e:\\n\\t@echo \$(${1})\\ninclude ${basefname}" | \
129
				make M="${S}" O="${3}" ${BUILD_FIXES} -s -f - 2>/dev/null
130
		else
131
			echo -e "e:\\n\\t@echo \$(${1})\\ninclude ${basefname}" | \
132
				make M="${S}" ${BUILD_FIXES} -s -f - 2>/dev/null
133
		fi
128
		cd "${workingdir}"
134
		cd "${workingdir}"
129
135
130
		ARCH=${myARCH}
136
		ARCH=${myARCH}
Lines 250-255 get_version() { Link Here
250
	[ -h "${KERNEL_DIR}" ] && KV_DIR="$(readlink -f ${KERNEL_DIR})"
256
	[ -h "${KERNEL_DIR}" ] && KV_DIR="$(readlink -f ${KERNEL_DIR})"
251
	[ -d "${KERNEL_DIR}" ] && KV_DIR="${KERNEL_DIR}"
257
	[ -d "${KERNEL_DIR}" ] && KV_DIR="${KERNEL_DIR}"
252
258
259
	if [ -n "${KBUILD_OUTPUT}" ]
260
	then
261
		if [ ! -s "${KBUILD_OUTPUT}/Makefile" ]
262
		then
263
			qeerror "Could not find a Makefile in the kernel build directory."
264
			qeerror "Please ensure that ${KBUILD_OUTPUT} points to an initialized"
265
			qeerror "kernel output directory."
266
			return 1
267
		fi
268
		local make_args="$(getfilevar MAKEARGS ${KBUILD_OUTPUT}/Makefile)"
269
		if [ -z "${make_args}" ]; then
270
			OUTPUT_DIR="$(getfilevar KERNELOUTPUT ${KBUILD_OUTPUT}/Makefile)"
271
			KV_DIR="$(getfilevar KERNELSRC ${KBUILD_OUTPUT}/Makefile)"
272
		else
273
			qeinfo "This KBUILD_OUTPUT makefile looks like 2.6.25 or more recent format"
274
			OUTPUT_DIR=$(echo ${make_args} | sed -r -e 's:^.*O=([^ ]*)/\.( .*)?$:\1:')
275
			KV_DIR=$(echo ${make_args} | sed -r -e 's:^.*-C ([^ ]*)/? .*$:\1:')
276
		fi
277
	elif [ -f "${KV_DIR}/Makefile" -a -n "$(getfilevar KERNELSRC ${KV_DIR}/Makefile)" ]
278
	then
279
		# We probably found KBUILD_OUTPUT instead of KERNEL_DIR ...
280
		OUTPUT_DIR="$(getfilevar KERNELOUTPUT ${KV_DIR}/Makefile)"
281
		KV_DIR="$(getfilevar KERNELSRC ${KV_DIR}/Makefile)"
282
		qeinfo "Found kernel output directory instead of source directory:"
283
		qeinfo "    ${KV_DIR}"
284
	fi
285
	unset KBUILD_OUTPUT
286
253
	if [ -z "${KV_DIR}" ]
287
	if [ -z "${KV_DIR}" ]
254
	then
288
	then
255
		qeerror "Unable to find kernel sources at ${KERNEL_DIR}"
289
		qeerror "Unable to find kernel sources at ${KERNEL_DIR}"
Lines 274-285 get_version() { Link Here
274
		return 1
308
		return 1
275
	fi
309
	fi
276
310
277
	# OK so now we know our sources directory, but they might be using
278
	# KBUILD_OUTPUT, and we need this for .config and localversions-*
279
	# so we better find it eh?
280
	# do we pass KBUILD_OUTPUT on the CLI?
281
	OUTPUT_DIR="${OUTPUT_DIR:-${KBUILD_OUTPUT}}"
282
283
	# And if we didn't pass it, we can take a nosey in the Makefile
311
	# And if we didn't pass it, we can take a nosey in the Makefile
284
	kbuild_output="$(getfilevar KBUILD_OUTPUT ${KV_DIR}/Makefile)"
312
	kbuild_output="$(getfilevar KBUILD_OUTPUT ${KV_DIR}/Makefile)"
285
	OUTPUT_DIR="${OUTPUT_DIR:-${kbuild_output}}"
313
	OUTPUT_DIR="${OUTPUT_DIR:-${kbuild_output}}"
Lines 287-296 get_version() { Link Here
287
	# And contrary to existing functions I feel we shouldn't trust the
315
	# And contrary to existing functions I feel we shouldn't trust the
288
	# directory name to find version information as this seems insane.
316
	# directory name to find version information as this seems insane.
289
	# so we parse ${KV_DIR}/Makefile
317
	# so we parse ${KV_DIR}/Makefile
290
	KV_MAJOR="$(getfilevar VERSION ${KV_DIR}/Makefile)"
318
	KV_MAJOR="$(getfilevar VERSION ${KV_DIR}/Makefile ${OUTPUT_DIR})"
291
	KV_MINOR="$(getfilevar PATCHLEVEL ${KV_DIR}/Makefile)"
319
	KV_MINOR="$(getfilevar PATCHLEVEL ${KV_DIR}/Makefile ${OUTPUT_DIR})"
292
	KV_PATCH="$(getfilevar SUBLEVEL ${KV_DIR}/Makefile)"
320
	KV_PATCH="$(getfilevar SUBLEVEL ${KV_DIR}/Makefile ${OUTPUT_DIR})"
293
	KV_EXTRA="$(getfilevar EXTRAVERSION ${KV_DIR}/Makefile)"
321
	KV_EXTRA="$(getfilevar EXTRAVERSION ${KV_DIR}/Makefile ${OUTPUT_DIR})"
294
322
295
	if [ -z "${KV_MAJOR}" -o -z "${KV_MINOR}" -o -z "${KV_PATCH}" ]
323
	if [ -z "${KV_MAJOR}" -o -z "${KV_MINOR}" -o -z "${KV_PATCH}" ]
296
	then
324
	then

Return to bug 87242