#!/bin/bash
usage() {
- echo "GenKernel ${GK_V} Options"
+ echo "GenKernel ${GK_V} [options] command"
+ echo "Available Commands: "
+ echo " all Build all steps"
+ echo " kernel Build only kernel and modules (not done yet)"
+ echo " initrd Build only initrd (not done yet)"
+ echo ""
echo "Available Options: "
-
echo " Debug settings"
echo " --debuglevel=<0-5> Debug Verbosity Level"
echo " --debugfile=<outfile> Output file for debug info"
echo " --max-kernel-size=<k> Maximum kernel size"
echo " --max-initrd-size=<k> Maximum initrd size"
echo " --max-kernel-and-initrd-size=<k> Maximum combined initrd + kernel size"
+ echo " Output Settings"
+ echo " --minkernpackage=<tbz2> File to output a .tar.bz2'd kernel and initrd to."
+ echo " These will be renamed to simply 'kernel' and 'initrd'"
+ echo " inside the package without any path information."
+ echo " No modules outside of the initrd will be included"
echo ""
}
CMD_MAX_KERNEL_AND_INITRD_SIZE=`parse_opt "${x}"`
print_info 2 "MAX_KERNEL_AND_INITRD_SIZE: $CMD_MAX_KERNEL_AND_INITRD_SIZE"
;;
+ --minkernpackage*)
+ CMD_MINKERNPACKAGE=`parse_opt "${x}"`
+ print_info 2 "MINKERNPACKAGE: $CMD_MINKERNPACKAGE"
+ ;;
+ all)
+ BUILD_ALL=1
+ ;;
+ initrd)
+ BUILD_INITRD=1
+ ;;
+ kernel)
+ BUILD_KERNEL=1
+ ;;
--help)
usage
exit 1
--- /dev/null
+#!/bin/bash
+
+gen_minkernpackage()
+{
+ print_info 1 "Creating minkernpackage"
+ rm -rf "${TEMP}/minkernpackage" > /dev/null 2>&1
+ mkdir "${TEMP}/minkernpackage" || gen_die "Could not make directory for minkernpackage"
+ cd "${KERNEL_DIR}"
+ cp "${KERNEL_BINARY}" "${TEMP}/minkernpackage/kernel" || gen_die "Could not copy kernel for minkernpackage"
+ cp "/boot/initrd-${KV}" "${TEMP}/minkernpackage/initrd" || gen_die "Could not copy initrd for minkernpackage"
+ cd "${TEMP}/minkernpackage"
+ tar -jcpf ${MINKERNPACKAGE} * || gen_die "Could not tar up minkernpackage"
+}
source ${GK_BIN}/gen_configkernel.sh || gen_die "could not read ${GK_BIN}/gen_configkernel.sh"
source ${GK_BIN}/gen_initrd.sh || gen_die "could not read ${GK_BIN}/gen_initrd.sh"
source ${GK_BIN}/gen_moddeps.sh || gen_die "could not read ${GK_BIN}/gen_moddeps.sh"
+source ${GK_BIN}/gen_package.sh || gen_die "could not read ${GK_BIN}/gen_package.sh"
+
+BUILD_ALL=0
+BUILD_KERNEL=0
+BUILD_INITRD=0
# Parse all command line options, and load into memory
parse_cmdline $*
+if [ "${BUILD_ALL}" -eq 0 -a "${BUILD_KERNEL}" -eq 0 -a "${BUILD_INITRD}" -eq 0 ]
+then
+ usage
+ exit 1
+fi
+
print_info 1 "GenKernel v${GK_V}" 1 0
# Set ${ARCH}
determine_real_args
print_info 1 "ARCH: ${ARCH}"
+print_info 1 "KERNEL VER: ${KV}"
# Configure kernel
config_kernel
# Create initrd
create_initrd
+if [ "${MINKERNPACKAGE}" != "" ]
+then
+ gen_minkernpackage
+fi
+
print_info 1 "DONE"