Fix corner cases on OUTPUTDIR.

If you give the kernel O= with the same dir as the source, it will
complain about an unclean tree.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
cleanup-cruft
Robin H. Johnson 12 years ago
parent 457cc95b07
commit 7fdf3fc01a

@ -25,7 +25,7 @@ compile_kernel_args() {
then then
ARGS="${ARGS} ARCH=\"${KERNEL_ARCH}\"" ARGS="${ARGS} ARCH=\"${KERNEL_ARCH}\""
fi fi
if [ -n "${KERNEL_OUTPUTDIR}" ] if [ -n "${KERNEL_OUTPUTDIR}" -a "${KERNEL_OUTPUTDIR}" != "${KERNEL_DIR}" ]
then then
ARGS="${ARGS} O=\"${KERNEL_OUTPUTDIR}\"" ARGS="${ARGS} O=\"${KERNEL_OUTPUTDIR}\""
fi fi

@ -20,7 +20,7 @@ gen_minkernpackage() {
then then
gen_die "Cannot locate kernel binary" gen_die "Cannot locate kernel binary"
fi fi
cd "${KERNEL_DIR}" cd "${KERNEL_OUTPUTDIR}"
cp "${tmp_kernel_binary}" "${TEMP}/minkernpackage/kernel-${KV}" || gen_die 'Could not the copy kernel for the min kernel package!' cp "${tmp_kernel_binary}" "${TEMP}/minkernpackage/kernel-${KV}" || gen_die 'Could not the copy kernel for the min kernel package!'
cp ".config" "${TEMP}/minkernpackage/config-${ARCH}-${KV}" || gen_die 'Could not the copy kernel config for the min kernel package!' cp ".config" "${TEMP}/minkernpackage/config-${ARCH}-${KV}" || gen_die 'Could not the copy kernel config for the min kernel package!'
if isTrue "${GENZIMAGE}" if isTrue "${GENZIMAGE}"
@ -38,7 +38,7 @@ gen_minkernpackage() {
then then
/bin/tar -xj -C ${TEMP}/minkernpackage -f ${KERNCACHE} System.map-${ARCH}-${KV} /bin/tar -xj -C ${TEMP}/minkernpackage -f ${KERNCACHE} System.map-${ARCH}-${KV}
else else
cp "${KERNEL_DIR}/System.map" "${TEMP}/minkernpackage/System.map-${ARCH}-${KV}" || gen_die 'Could not copy System.map for the kernel package!'; cp "${KERNEL_OUTPUTDIR}/System.map" "${TEMP}/minkernpackage/System.map-${ARCH}-${KV}" || gen_die 'Could not copy System.map for the kernel package!';
fi fi
cd "${TEMP}/minkernpackage" cd "${TEMP}/minkernpackage"
@ -75,9 +75,9 @@ gen_kerncache()
gen_die "Cannot locate kernel binary" gen_die "Cannot locate kernel binary"
fi fi
cd "${KERNEL_DIR}" cd "${KERNEL_OUTPUTDIR}"
cp "${tmp_kernel_binary}" "${TEMP}/kerncache/kernel-${ARCH}-${KV}" || gen_die 'Could not the copy kernel for the kernel package!' cp "${tmp_kernel_binary}" "${TEMP}/kerncache/kernel-${ARCH}-${KV}" || gen_die 'Could not the copy kernel for the kernel package!'
cp "${KERNEL_DIR}/.config" "${TEMP}/kerncache/config-${ARCH}-${KV}" cp "${KERNEL_OUTPUTDIR}/.config" "${TEMP}/kerncache/config-${ARCH}-${KV}"
if [[ "$(file --brief --mime-type "${KERNEL_CONFIG}")" == application/x-gzip ]]; then if [[ "$(file --brief --mime-type "${KERNEL_CONFIG}")" == application/x-gzip ]]; then
# Support --kernel-config=/proc/config.gz, mainly # Support --kernel-config=/proc/config.gz, mainly
@ -85,7 +85,7 @@ gen_kerncache()
else else
cp "${KERNEL_CONFIG}" "${TEMP}/kerncache/config-${ARCH}-${KV}.orig" cp "${KERNEL_CONFIG}" "${TEMP}/kerncache/config-${ARCH}-${KV}.orig"
fi fi
cp "${KERNEL_DIR}/System.map" "${TEMP}/kerncache/System.map-${ARCH}-${KV}" cp "${KERNEL_OUTPUTDIR}/System.map" "${TEMP}/kerncache/System.map-${ARCH}-${KV}"
if isTrue "${GENZIMAGE}" if isTrue "${GENZIMAGE}"
then then
cp "${tmp_kernel_binary2}" "${TEMP}/kerncache/kernelz-${ARCH}-${KV}" || gen_die "Could not copy the kernelz for the kernel package" cp "${tmp_kernel_binary2}" "${TEMP}/kerncache/kernelz-${ARCH}-${KV}" || gen_die "Could not copy the kernelz for the kernel package"
@ -170,7 +170,7 @@ gen_kerncache_is_valid()
else else
if [ -e "${KERNCACHE}" ] if [ -e "${KERNCACHE}" ]
then then
KERNEL_CONFIG="/${KERNEL_DIR}/.config" KERNEL_CONFIG="/${KERNEL_OUTPUTDIR}/.config"
if [ "${CMD_KERNEL_CONFIG}" != '' ] if [ "${CMD_KERNEL_CONFIG}" != '' ]
then then
KERNEL_CONFIG="${CMD_KERNEL_CONFIG}" KERNEL_CONFIG="${CMD_KERNEL_CONFIG}"

Loading…
Cancel
Save