Add support for maxkernpackage
authorEric Edgar <rocket@gentoo.org>
Thu, 24 Feb 2005 17:59:39 +0000 (17:59 +0000)
committerEric Edgar <rocket@gentoo.org>
Thu, 24 Feb 2005 17:59:39 +0000 (17:59 +0000)
    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
gen_determineargs.sh
gen_package.sh
genkernel
genkernel.8

index b6562b3a20e1af5463c1935a090df4ec72aa155f..3266ca179106d494024177f3866b1b55e956d2db 100755 (executable)
@@ -77,6 +77,8 @@ longusage() {
   echo "        --minkernpackage=<tbz2> File to output a .tar.bz2'd kernel and initrd:"
   echo "                                No modules outside of the initrd will be"
   echo "                                included..."
+  echo "        --maxkernpackage=<tbz2> 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"
index 6ea48adda8a38afbaca805949448efcb56add864..3678f770fc350a9c860e36c3dab02c863c8dc64b 100644 (file)
@@ -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}"
index b0eb238ab2443947c825b492b095c948de7185ef..c62ccc271d7b7cb6929cc199b3686bc033ddb8fe 100644 (file)
@@ -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
+}
index 07ee22407d474e5f6fccf74e2a6dd98b460eee72..e096d984d37a5e8db96f590ee2ffbe807914a211 100755 (executable)
--- 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}"
index 2fc4bc548d97817f50d4c606825f2af2fccc8897..baadba944a17c6eaf13cfe51652ba00e5f9061e9 100644 (file)
@@ -199,6 +199,9 @@ Don't compile busybox, and use this static .bz2 binary instead.
 \fB\-\-minkernpackage=\fR<tbz2>
 File to output a .tar.bz2'd kernel and initrd: no modules outside of the
 initrd will be included...
+.TP
+\fB\-\-maxkernpackage=\fR<tbz2>
+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.