diff --git a/gen_cmdline.sh b/gen_cmdline.sh
index 9d4bdf4..f8d2854 100755
--- a/gen_cmdline.sh
+++ b/gen_cmdline.sh
@@ -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=
Location of the kernel sources"
echo " --kernel-config= 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"
diff --git a/gen_determineargs.sh b/gen_determineargs.sh
index 5beff0d..f4db5ad 100644
--- a/gen_determineargs.sh
+++ b/gen_determineargs.sh
@@ -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}"
diff --git a/genkernel b/genkernel
index 5b67f11..e4f5dfe 100755
--- 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