changes for livecd stuff

git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@30 67a159dc-881f-0410-a524-ba9dfbe2cb84
cleanup-cruft
Brad House 21 years ago
parent a882d7efe2
commit ef448e9d6a

@ -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=<outfile> Output file for debug info"
@ -39,6 +43,11 @@ usage() {
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 ""
}
@ -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

@ -117,4 +117,9 @@ determine_real_args() {
fi
fi
if [ "${CMD_MINKERNPACKAGE}" != "" ]
then
MINKERNPACKAGE="${CMD_MINKERNPACKAGE}"
fi
}

@ -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"
}

@ -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"

Loading…
Cancel
Save