Localversion changes to kerncache, and added a sleep statement so modprobe loop has...
authorEric Edgar <rocket@gentoo.org>
Thu, 16 Jun 2005 18:20:50 +0000 (18:20 +0000)
committerEric Edgar <rocket@gentoo.org>
Thu, 16 Jun 2005 18:20:50 +0000 (18:20 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@210 67a159dc-881f-0410-a524-ba9dfbe2cb84

gen_determineargs.sh
gen_initramfs.sh
gen_initrd.sh
gen_moddeps.sh
genkernel

index 2d79d54f9542e3f4210b02d1c43f159aa71910fd..826d4fc2664711a2a843a02a2d647eaa970c2caf 100644 (file)
@@ -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
 }
index 09525e24dfcf64673de5fcbacab4a232dc7fb922..77cc2cc446fd20124679379e28ea99986b7b40ea 100644 (file)
@@ -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..."
@@ -300,8 +300,8 @@ create_initramfs_modules() {
                print_info 2 "initramfs: >> Copying ${i}${MOD_EXT}..."
                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
index 458212e4fb9a46bc0a67126b7233180980e2327a..18ae9406b28afb1cecce7a61fe3d479f058e26f7 100644 (file)
@@ -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
index 51e4a572e4e6fa452ec07a514e5e4ca5e7f1f533..840b2ca67c57315cb765c505830c0590d5f6d58c 100644 (file)
@@ -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
index 72ebf4d8fed99310bd3cb04d0c7b64f8e7a5d535..ef7fc2a6c2abb444b56a70fde1001c5c86486e68 100755 (executable)
--- a/genkernel
+++ b/genkernel
@@ -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,15 +155,20 @@ 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