# Copyright 1999-2009 Gentoo Foundation; 2008-2009 Various authors (see AUTHORS)
# Distributed under the GPL v2
+ 20 Feb 2009; Andrew Gaffney <agaffney@gentoo.org> arch/sparc64/config.sh,
+ gen_compile.sh, gen_funcs.sh, gen_package.sh:
+ Add support for multiple possible kernel binary paths for gentoo bug
+ #255085
+
04 Feb 2009; Andrew Gaffney <agaffney@gentoo.org> defaults/linuxrc:
Comment out the exec line for console=*, since it seems to blow up when
the param isn't a true device node, such as ttyS0,115200n8
#
KERNEL_MAKE_DIRECTIVE="vmlinux"
KERNEL_MAKE_DIRECTIVE_2="image"
-KERNEL_BINARY="arch/sparc64/boot/image"
+KERNEL_BINARY="arch/sparc64/boot/image arch/sparc/boot/image"
COMPRESS_INITRD=yes
USECOLOR="no"
print_info 1 " >> Starting supplimental compile of ${KV}: ${KERNEL_MAKE_DIRECTIVE_2}..."
compile_generic "${KERNEL_MAKE_DIRECTIVE_2}" kernel
fi
+
+ local tmp_kernel_binary=$(find_kernel_binary ${KERNEL_BINARY})
+ local tmp_kernel_binary2=$(find_kernel_binary ${KERNEL_BINARY_2})
+ if [ -z "${tmp_kernel_binary}" ]
+ then
+ gen_die "Cannot locate kernel binary"
+ fi
+
if ! isTrue "${CMD_NOINSTALL}"
then
copy_image_with_preserve "kernel" \
- "${KERNEL_BINARY}" \
+ "${tmp_kernel_binary}" \
"kernel-${KNAME}-${ARCH}-${KV}"
copy_image_with_preserve "System.map" \
if isTrue "${GENZIMAGE}"
then
copy_image_with_preserve "kernelz" \
- "${KERNEL_BINARY_2}" \
+ "${tmp_kernel_binary2}" \
"kernelz-${KV}"
fi
else
- cp "${KERNEL_BINARY}" "${TMPDIR}/kernel-${KNAME}-${ARCH}-${KV}" ||
+ cp "${tmp_kernel_binary}" "${TMPDIR}/kernel-${KNAME}-${ARCH}-${KV}" ||
gen_die "Could not copy the kernel binary to ${TMPDIR}!"
cp "System.map" "${TMPDIR}/System.map-${KNAME}-${ARCH}-${KV}" ||
gen_die "Could not copy System.map to ${TMPDIR}!"
if isTrue "${GENZIMAGE}"
then
- cp "${KERNEL_BINARY_2}" "${TMPDIR}/kernelz-${KV}" ||
+ cp "${tmp_kernel_binary2}" "${TMPDIR}/kernelz-${KV}" ||
gen_die "Could not copy the kernelz binary to ${TMPDIR}!"
fi
fi
fi
done
}
+
+find_kernel_binary() {
+ local kernel_binary=$*
+ local curdir=$(pwd)
+
+ cd "${KERNEL_DIR}"
+ for i in ${kernel_binary}
+ do
+ if [ -e "${i}" ]
+ then
+ tmp_kernel_binary=$i
+ break
+ fi
+ done
+# if [ -z "${tmp_kernel_binary}" ]
+# then
+# gen_die "Cannot locate kernel binary!"
+# fi
+ cd "${curdir}"
+ echo "${tmp_kernel_binary}"
+}
/bin/tar -xj -C ${TEMP}/minkernpackage -f ${KERNCACHE} kernelz-${ARCH}-${KV}
fi
else
+ local tmp_kernel_binary=$(find_kernel_binary ${KERNEL_BINARY})
+ local tmp_kernel_binary2=$(find_kernel_binary ${KERNEL_BINARY_2})
+ if [ -z "${tmp_kernel_binary}" ]
+ then
+ gen_die "Cannot locate kernel binary"
+ fi
cd "${KERNEL_DIR}"
- cp "${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!'
if isTrue "${GENZIMAGE}"
then
- cp "${KERNEL_BINARY_2}" "${TEMP}/minkernpackage/kernelz-${KV}" || gen_die "Could not copy the kernelz for the min kernel package"
+ cp "${tmp_kernel_binary2}" "${TEMP}/minkernpackage/kernelz-${KV}" || gen_die "Could not copy the kernelz for the min kernel package"
fi
fi
print_info 1 'Creating kernel cache'
rm -rf "${TEMP}/kerncache" > /dev/null 2>&1
mkdir "${TEMP}/kerncache" || gen_die 'Could not make a directory for the kernel cache!'
+
+ local tmp_kernel_binary=$(find_kernel_binary ${KERNEL_BINARY})
+ local tmp_kernel_binary2=$(find_kernel_binary ${KERNEL_BINARY_2})
+ if [ -z "${tmp_kernel_binary}" ]
+ then
+ gen_die "Cannot locate kernel binary"
+ fi
+
cd "${KERNEL_DIR}"
- cp "${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_CONFIG}" "${TEMP}/kerncache/config-${ARCH}-${KV}.orig"
cp "${KERNEL_DIR}/System.map" "${TEMP}/kerncache/System.map-${ARCH}-${KV}"
if isTrue "${GENZIMAGE}"
- then
- cp "${KERNEL_BINARY_2}" "${TEMP}/kerncache/kernelz-${ARCH}-${KV}" || gen_die "Could not copy the kernelz for the kernel package"
- fi
+ then
+ cp "${tmp_kernel_binary2}" "${TEMP}/kerncache/kernelz-${ARCH}-${KV}" || gen_die "Could not copy the kernelz for the kernel package"
+ fi
echo "VERSION = ${VER}" > "${TEMP}/kerncache/kerncache.config"
echo "PATCHLEVEL = ${PAT}" >> "${TEMP}/kerncache/kerncache.config"