From: Brad House Date: Tue, 23 Dec 2003 03:51:28 +0000 (+0000) Subject: changes for livecd stuff X-Git-Tag: v3.4.10.902~722 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ef448e9d6a99d117eb11518279decb835f9f0a75;p=genkernel.git changes for livecd stuff git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@30 67a159dc-881f-0410-a524-ba9dfbe2cb84 --- diff --git a/gen_cmdline.sh b/gen_cmdline.sh index 19ef7fb..ef18dc9 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -1,9 +1,13 @@ #!/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= Output file for debug info" @@ -39,6 +43,11 @@ usage() { echo " --max-kernel-size= Maximum kernel size" echo " --max-initrd-size= Maximum initrd size" echo " --max-kernel-and-initrd-size= Maximum combined initrd + kernel size" + echo " Output Settings" + echo " --minkernpackage= 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 "" } @@ -177,6 +186,19 @@ parse_cmdline() { 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 diff --git a/gen_determineargs.sh b/gen_determineargs.sh index aded8d8..e26b55e 100644 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -117,4 +117,9 @@ determine_real_args() { fi fi + if [ "${CMD_MINKERNPACKAGE}" != "" ] + then + MINKERNPACKAGE="${CMD_MINKERNPACKAGE}" + fi + } diff --git a/gen_package.sh b/gen_package.sh new file mode 100644 index 0000000..666d32c --- /dev/null +++ b/gen_package.sh @@ -0,0 +1,13 @@ +#!/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" +} diff --git a/genkernel.sh b/genkernel.sh index 5dc9967..775bdb8 100755 --- a/genkernel.sh +++ b/genkernel.sh @@ -19,10 +19,21 @@ source ${GK_BIN}/gen_compile.sh || gen_die "could not read ${GK_BIN}/gen_compile 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} @@ -37,6 +48,7 @@ source ${GK_SHARE}/${ARCH}/modules_load || gen_die "could not read ${GK_SHARE}/$ determine_real_args print_info 1 "ARCH: ${ARCH}" +print_info 1 "KERNEL VER: ${KV}" # Configure kernel config_kernel @@ -72,4 +84,9 @@ compile_devfsd # Create initrd create_initrd +if [ "${MINKERNPACKAGE}" != "" ] +then + gen_minkernpackage +fi + print_info 1 "DONE"