From e96618e06a496ff219bfb68f60746cbc2604c595 Mon Sep 17 00:00:00 2001 From: Eric Edgar Date: Thu, 24 Feb 2005 17:59:39 +0000 Subject: [PATCH] Add support for maxkernpackage creates a tarball containing: kernel initrd contents of /lib/modules kernel config git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@173 67a159dc-881f-0410-a524-ba9dfbe2cb84 --- gen_cmdline.sh | 6 ++++++ gen_determineargs.sh | 5 +++++ gen_package.sh | 18 +++++++++++++++++- genkernel | 1 + genkernel.8 | 3 +++ 5 files changed, 32 insertions(+), 1 deletion(-) diff --git a/gen_cmdline.sh b/gen_cmdline.sh index b6562b3..3266ca1 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -77,6 +77,8 @@ longusage() { echo " --minkernpackage= File to output a .tar.bz2'd kernel and initrd:" echo " No modules outside of the initrd will be" echo " included..." + echo " --maxkernpackage= File to output a .tar.bz2'd kernel,initrd," + echo " contents of /lib/modules/ and the kernel config" } usage() { @@ -335,6 +337,10 @@ parse_cmdline() { CMD_MINKERNPACKAGE=`parse_opt "$*"` print_info 2 "MINKERNPACKAGE: $CMD_MINKERNPACKAGE" ;; + --maxkernpackage=*) + CMD_MAXKERNPACKAGE=`parse_opt "$*"` + print_info 2 "MAXKERNPACKAGE: $CMD_MAXKERNPACKAGE" + ;; --linuxrc=*) CMD_LINUXRC=`parse_opt "$*"` print_info 2 "CMD_LINUXRC: $CMD_LINUXRC" diff --git a/gen_determineargs.sh b/gen_determineargs.sh index 6ea48ad..3678f77 100644 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -163,6 +163,11 @@ determine_real_args() { MINKERNPACKAGE="${CMD_MINKERNPACKAGE}" fi + if [ "${CMD_MAXKERNPACKAGE}" != '' ] + then + MAXKERNPACKAGE="${CMD_MAXKERNPACKAGE}" + fi + if [ "${CMD_NOINITRDMODULES}" != '' ] then NOINITRDMODULES="${CMD_NOINITRDMODULES}" diff --git a/gen_package.sh b/gen_package.sh index b0eb238..c62ccc2 100644 --- a/gen_package.sh +++ b/gen_package.sh @@ -2,7 +2,7 @@ gen_minkernpackage() { - print_info 1 'Creating kernel package' + print_info 1 'Creating minimal kernel package' rm -rf "${TEMP}/minkernpackage" > /dev/null 2>&1 mkdir "${TEMP}/minkernpackage" || gen_die 'Could not make a directory for the kernel package!' cd "${KERNEL_DIR}" @@ -12,3 +12,19 @@ gen_minkernpackage() tar -jcpf ${MINKERNPACKAGE} * || gen_die 'Could not compress the kernel package!' cd "${TEMP}" && rm -rf "${TEMP}/minkernpackage" > /dev/null 2>&1 } + +gen_maxkernpackage() +{ + print_info 1 'Creating maximum kernel package' + rm -rf "${TEMP}/maxkernpackage" > /dev/null 2>&1 + mkdir "${TEMP}/maxkernpackage" || gen_die 'Could not make a directory for the kernel package!' + cd "${KERNEL_DIR}" + cp "${KERNEL_BINARY}" "${TEMP}/maxkernpackage/kernel-${KV}" || gen_die 'Could not the copy kernel for the kernel package!' + [ "${BUILD_INITRD}" -ne 0 ] && { cp "${TEMP}/initrd-${KV}" "${TEMP}/maxkernpackage/initrd-${KV}" || gen_die 'Could not copy the initrd for the kernel package!'; } + cp "${KERNEL_DIR}/.config" "${TEMP}/maxkernpackage/kernel-config-${ARCH}-${KV}" + mkdir -p "${TEMP}/maxkernpackage/lib/modules/" + cp -r "/lib/modules/${KV}" "${TEMP}/maxkernpackage/lib/modules/" + cd "${TEMP}/maxkernpackage" + tar -jcpf ${MAXKERNPACKAGE} * || gen_die 'Could not compress the kernel package!' + cd "${TEMP}" && rm -rf "${TEMP}/maxkernpackage" > /dev/null 2>&1 +} diff --git a/genkernel b/genkernel index 07ee224..e096d98 100755 --- a/genkernel +++ b/genkernel @@ -284,6 +284,7 @@ else print_info 1 'initrd: Not building since only the kernel was requested...' fi [ "${MINKERNPACKAGE}" != "" ] && gen_minkernpackage +[ "${MAXKERNPACKAGE}" != "" ] && gen_maxkernpackage # Clean up... [ -n "${CTEMP}" ] && rm -rf "${TEMP}" diff --git a/genkernel.8 b/genkernel.8 index 2fc4bc5..baadba9 100644 --- a/genkernel.8 +++ b/genkernel.8 @@ -199,6 +199,9 @@ Don't compile busybox, and use this static .bz2 binary instead. \fB\-\-minkernpackage=\fR File to output a .tar.bz2'd kernel and initrd: no modules outside of the initrd will be included... +.TP +\fB\-\-maxkernpackage=\fR +File to output a .tar.bz2'd kernel, initrd, contents of /lib/modules/ and the kernel config" .SH INITRD OPTIONS The following options can be passed as kernel parameters from the bootloader, which the initrd scripts would recognize. -- 2.26.2