changes for livecd stuff
authorBrad House <brad_mssw@gentoo.org>
Tue, 23 Dec 2003 03:51:28 +0000 (03:51 +0000)
committerBrad House <brad_mssw@gentoo.org>
Tue, 23 Dec 2003 03:51:28 +0000 (03:51 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@30 67a159dc-881f-0410-a524-ba9dfbe2cb84

gen_cmdline.sh
gen_determineargs.sh
gen_package.sh [new file with mode: 0644]
genkernel.sh

index 19ef7fb047115b83027e3b3f26ff355e60ed0c15..ef18dc94837d2f438a2e6571d6e031621b253c59 100755 (executable)
@@ -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
index aded8d8bbee08147854339d715d226ced82eb95e..e26b55ee148cf027abbacd8f1b52179846bee0db 100644 (file)
@@ -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 (file)
index 0000000..666d32c
--- /dev/null
@@ -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"      
+}
index 5dc99678bd09d5e2fb133e3d4f30cf2c843f0f26..775bdb84fa5263ed7bf55dfaf7c9ffcb89123a93 100755 (executable)
@@ -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"