From: Chris Gianelloni Date: Thu, 2 Feb 2006 14:31:52 +0000 (+0000) Subject: Added patch from Kumba to make certain initrd functions less mips-specific. X-Git-Tag: v3.4.10.902~389 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5d0df2cf70835738638618975be5ce82cd6db999;p=genkernel.git Added patch from Kumba to make certain initrd functions less mips-specific. git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@363 67a159dc-881f-0410-a524-ba9dfbe2cb84 --- diff --git a/gen_cmdline.sh b/gen_cmdline.sh index dabb2d4..81c2183 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -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= Location of the kernel sources" echo " --kernel-config= 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" diff --git a/gen_determineargs.sh b/gen_determineargs.sh index f9c7ac2..cb3b1b2 100644 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -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}" diff --git a/gen_initramfs.sh b/gen_initramfs.sh index 319225e..81056b3 100644 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -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 diff --git a/gen_initrd.sh b/gen_initrd.sh index 614f299..c7a4afa 100644 --- a/gen_initrd.sh +++ b/gen_initrd.sh @@ -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 } diff --git a/genkernel b/genkernel index a4addf3..949ba89 100755 --- 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