Added patch from Kumba to make certain initrd functions less mips-specific.
authorChris Gianelloni <wolf31o2@gentoo.org>
Thu, 2 Feb 2006 14:31:52 +0000 (14:31 +0000)
committerChris Gianelloni <wolf31o2@gentoo.org>
Thu, 2 Feb 2006 14:31:52 +0000 (14:31 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@363 67a159dc-881f-0410-a524-ba9dfbe2cb84

gen_cmdline.sh
gen_determineargs.sh
gen_initramfs.sh
gen_initrd.sh
genkernel

index dabb2d48e0eac7b0d8486b34a15e37f59841d39b..81c2183c4992bdad1c5557642e129a5fc6035a49 100755 (executable)
@@ -42,6 +42,8 @@ longusage() {
   echo "       --callback=<...>        Run the specified arguments after the"
   echo "                               kernel and modules have been compiled"
   echo "       --static                Build a static (monolithic kernel)."
+  echo "       --initramfs             Builds initramfs before kernel and embeds it"
+  echo "                               into the kernel."
   echo "  Kernel settings"
   echo "       --kerneldir=<dir>       Location of the kernel sources"
   echo "       --kernel-config=<file>  Kernel configuration file to use for compilation"
@@ -370,6 +372,10 @@ parse_cmdline() {
                      CMD_STATIC=1
                      print_info 2 "CMD_STATIC: $CMD_STATIC"
              ;;
+             --initramfs)
+                     CMD_INITRAMFS=1
+                     print_info 2 "CMD_INITRAMFS: $CMD_INITRAMFS"
+             ;;
              --tempdir=*)
                      TEMP=`parse_opt "$*"`
                      print_info 2 "TEMP: $TEMP"
index f9c7ac245253f0bf6de26f3a24c7d9186bb46d84..cb3b1b2be3c38f7d85e6dac1907622fbab8f28fd 100644 (file)
@@ -315,6 +315,18 @@ determine_real_args() {
                BUILD_STATIC=0
        fi
 
+       if [ "${CMD_INITRAMFS}" != '' ]
+       then
+               BUILD_INITRAMFS=${CMD_INITRAMFS}
+       fi
+
+       if isTrue ${BUILD_INITRAMFS}
+       then
+               BUILD_INITRAMFS=1
+       else
+               BUILD_INITRAMFS=0
+       fi
+
        if [ "${CMD_SAVE_CONFIG}" != '' ]
        then
                SAVE_CONFIG="${CMD_SAVE_CONFIG}"
index 319225e2cedd9109b637f9e37b6736d48ce1b9e8..81056b32812f81dac929b7a9356fda317f285062 100644 (file)
@@ -32,7 +32,7 @@ create_base_layout_cpio() {
 
        # SGI LiveCDs need the following binary (no better place for it than here)
        # getdvhoff is a DEPEND of genkernel, so it *should* exist
-       if [ "${MIPS_EMBEDDED_IMAGE}" != '' -a "${MIPS_LIVECD}" != '' ]
+       if [ ${BUILD_INITRAMFS} -eq 1 -a "${MIPS_LIVECD}" != '' ]
        then
                [ -e /usr/lib/getdvhoff/getdvhoff ] \
                        && cp /usr/lib/getdvhoff/getdvhoff ${TEMP}/initramfs-base-temp/bin \
@@ -519,7 +519,7 @@ merge_initramfs_cpio_archives(){
                        rm ${TMPDIR}/initramfs-${KV}
 
        # Mips also mimics Pegasos to merge the initramfs into the kernel
-       if [ "${MIPS_EMBEDDED_IMAGE}" != '' ]; then
+       if [ ${BUILD_INITRAMFS} -eq 1 ]; then
                cp ${TMPDIR}/initramfs-${KV} ${KERNEL_DIR}/initramfs.cpio.gz
                gunzip -f ${KERNEL_DIR}/initramfs.cpio.gz
        fi
index 614f299c6795ac9141405a85b35942f1a58c6982..c7a4afae71c2d52a961b5023dad3bb2427047dba 100644 (file)
@@ -55,7 +55,7 @@ create_base_initrd_sys() {
 
        # SGI LiveCDs need the following binary (no better place for it than here)
        # getdvhoff is a DEPEND of genkernel, so it *should* exist
-       if [ "${MIPS_EMBEDDED_IMAGE}" != '' ]
+       if [ ${BUILD_INITRAMFS} -eq 1 ]
        then
                [ -e /usr/lib/getdvhoff/getdvhoff ] \
                        && cp /usr/lib/getdvhoff/getdvhoff ${TEMP}/initrd-temp/bin \
@@ -401,6 +401,6 @@ create_initrd() {
                rm ${TMPDIR}/initrd-${KV}
 
        # Mips also mimics Pegasos to merge the initrd into the kernel
-       [ "${MIPS_EMBEDDED_IMAGE}" != '' ] \
+       [ ${BUILD_INITRAMFS} -eq 1 ] \
                && cp ${TMPDIR}/initrd-${KV} ${KERNEL_DIR}/mips/ramdisk/initrd.img.gz
 }
index a4addf348528609186aecba27d1ae6c1be22f924..949ba8948edb78e809902e7e53761e74c5121452 100755 (executable)
--- a/genkernel
+++ b/genkernel
@@ -2,7 +2,7 @@
 # Genkernel v3
 
 PATH="/bin:/usr/bin:/sbin:/usr/sbin"
-GK_V='3.3.11_pre7'
+GK_V='3.3.11_pre8'
 
 TMPDIR='/var/tmp/genkernel'
 TODEBUGCACHE=1 # Until an error occurs or DEBUGFILE is fully qualified.
@@ -214,7 +214,7 @@ then
 
        # Compile kernel; If using --genzimage, or building a mips kernel, skip compile
        # till after initrd/initramfs is done
-       [ "${GENERATE_Z_IMAGE}" = '' -a "${MIPS_EMBEDDED_IMAGE}" = '' ] && compile_kernel
+       [ "${GENERATE_Z_IMAGE}" = '' -a ${BUILD_INITRAMFS} -eq 0 ] && compile_kernel
 
        # Compile modules
        if [ ${BUILD_MODULES} -eq 1 -a ${BUILD_STATIC} -eq 0 ]
@@ -230,7 +230,7 @@ then
        fi
        if [ "${KERNCACHE}" != "" ]
        then
-               if [ "${GENERATE_Z_IMAGE}" = '' -a "${MIPS_EMBEDDED_IMAGE}" = '' ]
+               if [ "${GENERATE_Z_IMAGE}" = '' -a ${BUILD_INITRAMFS} -eq 0 ]
                then
                        gen_kerncache
                fi
@@ -330,7 +330,7 @@ else
 fi
 
 # Pegasos fix
-if [ "${GENERATE_Z_IMAGE}" != '' -o "${MIPS_EMBEDDED_IMAGE}" != '' ]
+if [ "${GENERATE_Z_IMAGE}" != '' -o ${BUILD_INITRAMFS} -eq 1 ]
 then
        # Compile kernel, intergrating the initrd into it for Pegasos & mips
        compile_kernel