get_KV() {
if [ "${CMD_NO_KERNEL_SOURCES}" = '1' -a -e "${CMD_KERNCACHE}" ]
then
- #[ -d ${TEMP} ] && gen_die "temporary directory already exists! Exiting."
- #(umask 077 && mkdir ${TEMP}) || {
- # gen_die "Could not create temporary directory! Exiting."
- #}
/bin/tar -xj -C ${TEMP} -f ${CMD_KERNCACHE} kerncache.config
if [ -e ${TEMP}/kerncache.config ]
then
fi
else
- #rm -r ${TEMP}
gen_die "Could not find kerncache.config in the kernel cache! Exiting."
fi
- #rm -r ${TEMP}
else
# Configure the kernel
gen_kerncache_extract_kernel()
{
- #[ -d ${TEMP} ] && gen_die "temporary directory already exists! Exiting."
- #(umask 077 && mkdir ${TEMP}) || {
- # gen_die "Could not create temporary directory! Exiting."
- #}
/bin/tar -f ${KERNCACHE} -C ${TEMP} -xj
cp "${TEMP}/kernel-${ARCH}-${KV}" "/boot/kernel-${KNAME}-${ARCH}-${KV}" || gen_die 'Could not copy the kernel binary to /boot!'
if [ "${KERNEL_BINARY_2}" != '' ]
BUILD_KERNEL=0
# Can make this more secure ....
- #[ -d ${TEMP} ] && gen_die "temporary directory already exists! Exiting."
- #(umask 077 && mkdir ${TEMP}) || {
- # gen_die "Could not create temporary directory! Exiting."
- #}
/bin/tar -xj -f ${KERNCACHE} -C ${TEMP}
if [ -e ${TEMP}/config-${ARCH}-${KV} -a -e ${TEMP}/kernel-${ARCH}-${KV} ]
print_info 1 'Valid kernel cache found; no sources will be used'
KERNCACHE_IS_VALID=1
fi
- #/bin/rm -r ${TEMP}
else
if [ -e "${KERNCACHE}" ]
then
- #[ -d ${TEMP} ] && gen_die "temporary directory already exists! Exiting."
- #(umask 077 && mkdir ${TEMP}) || {
- # gen_die "Could not create temporary directory! Exiting."
- #
- #}
-
/bin/tar -xj -f ${KERNCACHE} -C ${TEMP}
if [ -e ${TEMP}/config-${ARCH}-${KV} -a -e /${KERNEL_DIR}/.config ]
then
KERNCACHE_IS_VALID=1
fi
fi
- #/bin/rm -r ${TEMP}
fi
fi
export KERNCACHE_IS_VALID