From: Fabio Erculiani Date: Wed, 20 Jul 2011 15:54:56 +0000 (+0200) Subject: Make possible to compile XEN based kernels providing --kernel-target= and --kernel... X-Git-Tag: v3.4.18~7 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=dfca908b6fc9ce21c714b12bdc96d8049af70f8d;p=genkernel.git Make possible to compile XEN based kernels providing --kernel-target= and --kernel-binary= switches --- diff --git a/defaults/config.sh b/defaults/config.sh index 7f339ea..6d26757 100755 --- a/defaults/config.sh +++ b/defaults/config.sh @@ -3,8 +3,10 @@ # Arch-specific options that normally shouldn't be changed. # KERNEL_MAKE_DIRECTIVE="bzImage" +KERNEL_MAKE_DIRECTIVE_OVERRIDE="--INVALID--" KERNEL_MAKE_DIRECTIVE_2="" KERNEL_BINARY="arch/i386/boot/bzImage" +KERNEL_BINARY_OVERRIDE="" COMPRESS_INITRD=yes diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index 2d7f775..fc00834 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -189,6 +189,12 @@ LOW-LEVEL COMPILATION OPTIONS *--kernel-make*=:: GNU Make to use for the kernel compilation. +*--kernel-target*=:: + Override default make target (bzImage) + +*--kernel-binary*=:: + Override default kernel binary path (arch/foo/boot/bar) + *--utils-cc*=:: Compiler to use for utilities. diff --git a/gen_cmdline.sh b/gen_cmdline.sh index f7eb707..b3e451d 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -57,6 +57,9 @@ longusage() { echo " --kernel-ld= Linker to use for kernel" echo " --kernel-cross-compile= CROSS_COMPILE kernel variable" echo " --kernel-make= GNU Make to use for kernel" + echo " --kernel-target= Override default make target (bzImage)" + echo " --kernel-binary= Override default kernel binary path (arch/foo/boot/bar)" + echo " --utils-cc= Compiler to use for utilities" echo " --utils-as= Assembler to use for utils" echo " --utils-ld= Linker to use for utils" @@ -166,6 +169,14 @@ parse_cmdline() { CMD_KERNEL_MAKE=`parse_opt "$*"` print_info 2 "CMD_KERNEL_MAKE: ${CMD_KERNEL_MAKE}" ;; + --kernel-target=*) + KERNEL_MAKE_DIRECTIVE_OVERRIDE=`parse_opt "$*"` + print_info 2 "KERNEL_MAKE_DIRECTIVE_OVERRIDE: ${KERNEL_MAKE_DIRECTIVE_OVERRIDE}" + ;; + --kernel-binary=*) + KERNEL_BINARY_OVERRIDE=`parse_opt "$*"` + print_info 2 "KERNEL_BINARY_OVERRIDE: ${KERNEL_BINARY_OVERRIDE}" + ;; --kernel-cross-compile=*) CMD_KERNEL_CROSS_COMPILE=`parse_opt "$*"` CMD_KERNEL_CROSS_COMPILE=$(echo ${CMD_KERNEL_CROSS_COMPILE}|sed -e 's/.*[^-]$/&-/g') diff --git a/gen_compile.sh b/gen_compile.sh index 3a815e8..9fc35af 100755 --- a/gen_compile.sh +++ b/gen_compile.sh @@ -296,8 +296,12 @@ compile_kernel() { [ "${KERNEL_MAKE}" = '' ] && gen_die "KERNEL_MAKE undefined - I don't know how to compile a kernel for this arch!" cd ${KERNEL_DIR} - print_info 1 " >> Compiling ${KV} ${KERNEL_MAKE_DIRECTIVE/_install/ [ install ]/}..." - compile_generic "${KERNEL_MAKE_DIRECTIVE}" kernel + local kernel_make_directive="${KERNEL_MAKE_DIRECTIVE}" + if [ "${KERNEL_MAKE_DIRECTIVE_OVERRIDE}" != "--INVALID--" ]; then + kernel_make_directive="${KERNEL_MAKE_DIRECTIVE_OVERRIDE}" + fi + print_info 1 " >> Compiling ${KV} ${kernel_make_directive/_install/ [ install ]/}..." + compile_generic "${kernel_make_directive}" kernel if [ "${KERNEL_MAKE_DIRECTIVE_2}" != '' ] then print_info 1 " >> Starting supplimental compile of ${KV}: ${KERNEL_MAKE_DIRECTIVE_2}..." @@ -313,7 +317,7 @@ compile_kernel() { print_info 1 " >> Not installing firmware as it's included in the kernel already (CONFIG_FIRMWARE_IN_KERNEL=y)..." fi - local tmp_kernel_binary=$(find_kernel_binary ${KERNEL_BINARY}) + local tmp_kernel_binary=$(find_kernel_binary ${KERNEL_BINARY_OVERRIDE:-${KERNEL_BINARY}}) local tmp_kernel_binary2=$(find_kernel_binary ${KERNEL_BINARY_2}) if [ -z "${tmp_kernel_binary}" ] then