Add support to genkernel to build a monolithic kernel by skipping module building...
authorJoshua Kinard <kumba@gentoo.org>
Sun, 15 Jan 2006 22:53:55 +0000 (22:53 +0000)
committerJoshua Kinard <kumba@gentoo.org>
Sun, 15 Jan 2006 22:53:55 +0000 (22:53 +0000)
--static is passed on the gk commandline.

git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@355 67a159dc-881f-0410-a524-ba9dfbe2cb84

gen_cmdline.sh
gen_determineargs.sh
genkernel

index 9d4bdf46d0a784ccc4748c8f2ee5f41450ea2b9a..f8d2854932c12a0d1a5affd4d077782ac62278c6 100755 (executable)
@@ -41,6 +41,7 @@ longusage() {
   echo "       --no-devfs              Disable devfs support"
   echo "       --callback=<...>        Run the specified arguments after the"
   echo "                               kernel and modules have been compiled"
+  echo "       --static                Build a static (monolithic kernel)."
   echo "  Kernel settings"
   echo "       --kerneldir=<dir>       Location of the kernel sources"
   echo "       --kernel-config=<file>  Kernel configuration file to use for compilation"
@@ -354,6 +355,10 @@ parse_cmdline() {
                      CMD_CALLBACK=`parse_opt "$*"`
                      print_info 2 "CMD_CALLBACK: $CMD_CALLBACK/$*"
              ;;
+             --static)
+                     CMD_STATIC=1
+                     print_info 2 "CMD_STATIC: $CMD_STATIC"
+             ;;
              --tempdir=*)
                      TEMP=`parse_opt "$*"`
                      print_info 2 "TEMP: $TEMP"
index 5beff0db5e6deec24c6e2ed2024e486488108c21..f4db5adf1e3282935901cf260ca35da400b89044 100644 (file)
@@ -298,6 +298,18 @@ determine_real_args() {
                MOUNTBOOT=0
        fi
 
+       if [ "${CMD_STATIC}" != '' ]
+       then
+               BUILD_STATIC=${CMD_STATIC}
+       fi
+
+       if isTrue ${BUILD_STATIC}
+       then
+               BUILD_STATIC=1
+       else
+               BUILD_STATIC=0
+       fi
+
        if [ "${CMD_SAVE_CONFIG}" != '' ]
        then
                SAVE_CONFIG="${CMD_SAVE_CONFIG}"
index 5b67f11352a6ded24569cd0be85e21b666127fe3..e4f5dfe9004db79adde1a02d5fde0d317a38713f 100755 (executable)
--- a/genkernel
+++ b/genkernel
@@ -217,7 +217,7 @@ then
        [ "${GENERATE_Z_IMAGE}" = '' -a "${MIPS_EMBEDDED_IMAGE}" = '' ] && compile_kernel
 
        # Compile modules
-       if [ ${BUILD_MODULES} -eq 1 ]
+       if [ ${BUILD_MODULES} -eq 1 -a ${BUILD_STATIC} -eq 0 ]
        then
                compile_modules
        fi
@@ -247,7 +247,7 @@ fi
 
 if [ "${KERNCACHE}" != "" -a "${KERNCACHE_IS_VALID}" != "0" ] 
 then
-       gen_kerncache_extract_modules
+       [ ${BUILD_STATIC} -eq 0 ] && gen_kerncache_extract_modules
        gen_kerncache_extract_config
 fi
 
@@ -293,9 +293,9 @@ then
                if [ "${KERN_24}" != '1' ]
                then
                        # Compile module-init-tools
-                       compile_module_init_tools
+                       [ ${BUILD_STATIC} -eq 0 ] && compile_module_init_tools
                else
-                       compile_modutils
+                       [ ${BUILD_STATIC} -eq 0 ] && compile_modutils
                fi
        fi