Localversion changes to kerncache, and added a sleep statement so modprobe loop has a chance to work

git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@210 67a159dc-881f-0410-a524-ba9dfbe2cb84
cleanup-cruft
Eric Edgar 20 years ago
parent 733f779330
commit 8ec05b8cbf

@ -14,7 +14,9 @@ get_KV() {
PAT=`grep ^PATCHLEVEL\ \= ${tmp}/kerncache.config | awk '{ print $3 };'`
SUB=`grep ^SUBLEVEL\ \= ${tmp}/kerncache.config | awk '{ print $3 };'`
EXV=`grep ^EXTRAVERSION\ \= ${tmp}/kerncache.config | sed -e "s/EXTRAVERSION =//" -e "s/ //g"`
KV=${VER}.${PAT}.${SUB}${EXV}
LOV=`grep ^CONFIG_LOCALVERSION\= ${tmp}/kerncache.config | sed -e "s/CONFIG_LOCALVERSION=\"\(.*\)\"/\1/"`
KV=${VER}.${PAT}.${SUB}${EXV}${LOV}
else
rm -r ${tmp}
gen_die "Could not find kerncache.config in the kernel cache! Exiting."
@ -22,11 +24,23 @@ get_KV() {
rm -r ${tmp}
else
#configure the kernel
#if BUILD_KERNEL=0 then assume --no-clean, menuconfig is cleared,
VER=`grep ^VERSION\ \= ${KERNEL_DIR}/Makefile | awk '{ print $3 };'`
PAT=`grep ^PATCHLEVEL\ \= ${KERNEL_DIR}/Makefile | awk '{ print $3 };'`
SUB=`grep ^SUBLEVEL\ \= ${KERNEL_DIR}/Makefile | awk '{ print $3 };'`
EXV=`grep ^EXTRAVERSION\ \= ${KERNEL_DIR}/Makefile | sed -e "s/EXTRAVERSION =//" -e "s/ //g"`
KV=${VER}.${PAT}.${SUB}${EXV}
cd ${KERNEL_DIR}
compile_generic prepare0 kernel > /dev/null 2>&1
cd - > /dev/null 2>&1
if [ -f ${KERNEL_DIR}/include/linux/version.h ]
then
UTS_RELEASE=`grep UTS_RELEASE ${KERNEL_DIR}/include/linux/version.h | sed -e 's/#define UTS_RELEASE "\(.*\)"/\1/'`
LOV=`echo ${UTS_RELEASE}|sed -e "s/${VER}.${PAT}.${SUB}${EXV}//"`
KV=${VER}.${PAT}.${SUB}${EXV}${LOV}
else
KV=${VER}.${PAT}.${SUB}${EXV}
fi
fi
}
@ -72,8 +86,6 @@ determine_real_args() {
KNAME="genkernel"
fi
get_KV
if [ "${CMD_KERNEL_MAKE}" != '' ]
then
KERNEL_MAKE="${CMD_KERNEL_MAKE}"
@ -331,4 +343,6 @@ determine_real_args() {
else
DMRAID=0
fi
#get_KV has to be last
get_KV
}

@ -290,7 +290,7 @@ create_initramfs_modules() {
mkdir -p "${TEMP}/initramfs-modules-${KV}-temp/lib/modules/${KV}"
for i in `gen_dep_list`
do
mymod=`find ./lib/modules/${KV} -name "${i}${MOD_EXT}" | head -n 1`
mymod=`find ./lib/modules/${KV} -name "${i}${MOD_EXT}" 2>/dev/null| head -n 1 `
if [ -z "${mymod}" ]
then
print_warning 2 "Warning :: ${i}${MOD_EXT} not found; skipping..."
@ -301,7 +301,7 @@ create_initramfs_modules() {
cp -ax --parents "${mymod}" "${TEMP}/initramfs-modules-${KV}-temp"
done
cp -ax --parents ./lib/modules/${KV}/modules* ${TEMP}/initramfs-modules-${KV}-temp
cp -ax --parents ./lib/modules/${KV}/modules* ${TEMP}/initramfs-modules-${KV}-temp 2>/dev/null
mkdir -p "${TEMP}/initramfs-modules-${KV}-temp/etc/modules"
for group_modules in ${!MODULES_*}; do

@ -217,7 +217,7 @@ create_initrd_modules() {
for i in `gen_dep_list`
do
mymod=`find ./lib/modules/${KV} -name "${i}${MOD_EXT}" | head -n 1`
mymod=`find ./lib/modules/${KV} -name "${i}${MOD_EXT}" 2>/dev/null| head -n 1`
if [ -z "${mymod}" ]
then
print_warning 2 "Warning :: ${i}${MOD_EXT} not found; skipping..."
@ -227,7 +227,7 @@ create_initrd_modules() {
cp -ax --parents "${mymod}" "${TEMP}/initrd-temp"
done
cp -ax --parents ./lib/modules/${KV}/modules* ${TEMP}/initrd-temp
cp -ax --parents ./lib/modules/${KV}/modules* ${TEMP}/initrd-temp 2>/dev/null
mkdir -p "${TEMP}/initrd-temp/etc/modules"
for group_modules in ${!MODULES_*}; do

@ -8,7 +8,10 @@ modules_dep_list()
else
KEXT=".o"
fi
cat ${INSTALL_MOD_PATH}/lib/modules/${KV}/modules.dep | grep ${1}${KEXT}\: | cut -d\: -f2
if [ -f ${INSTALL_MOD_PATH}/lib/modules/${KV}/modules.dep ]
then
cat ${INSTALL_MOD_PATH}/lib/modules/${KV}/modules.dep | grep ${1}${KEXT}\: | cut -d\: -f2
fi
}
# Pass module deps list

@ -80,9 +80,10 @@ then
if ! has_loop
then
modprobe loop 2>/dev/null
sleep 3
if ! has_loop
then
print_error 1 'Your kernel does not appear to have loop device support.'
print_error 1 'The build-host kernel does not appear to have loop device support.'
print_error 1 'Please load loop support before running genkernel!'
gen_die 'Load loop support!'
else
@ -154,16 +155,21 @@ then
echo
fi
KERNCACHE_IS_VALID=0
if [ "${KERNCACHE}" != "" ]
then
gen_kerncache_is_valid
fi
if [ ${BUILD_KERNEL} -eq 1 -a "${KERNCACHE_IS_VALID}" == "0" ]
then
# Configure kernel
config_kernel
# KV may have changed due to the configuration
get_KV
# Make deps
compile_dep

Loading…
Cancel
Save