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
cleanup-cruft
Chris Gianelloni 19 years ago
parent 9b6ebc4e66
commit 5d0df2cf70

@ -42,6 +42,8 @@ longusage() {
echo " --callback=<...> Run the specified arguments after the" echo " --callback=<...> Run the specified arguments after the"
echo " kernel and modules have been compiled" echo " kernel and modules have been compiled"
echo " --static Build a static (monolithic kernel)." echo " --static Build a static (monolithic kernel)."
echo " --initramfs Builds initramfs before kernel and embeds it"
echo " into the kernel."
echo " Kernel settings" echo " Kernel settings"
echo " --kerneldir=<dir> Location of the kernel sources" echo " --kerneldir=<dir> Location of the kernel sources"
echo " --kernel-config=<file> Kernel configuration file to use for compilation" echo " --kernel-config=<file> Kernel configuration file to use for compilation"
@ -370,6 +372,10 @@ parse_cmdline() {
CMD_STATIC=1 CMD_STATIC=1
print_info 2 "CMD_STATIC: $CMD_STATIC" print_info 2 "CMD_STATIC: $CMD_STATIC"
;; ;;
--initramfs)
CMD_INITRAMFS=1
print_info 2 "CMD_INITRAMFS: $CMD_INITRAMFS"
;;
--tempdir=*) --tempdir=*)
TEMP=`parse_opt "$*"` TEMP=`parse_opt "$*"`
print_info 2 "TEMP: $TEMP" print_info 2 "TEMP: $TEMP"

@ -315,6 +315,18 @@ determine_real_args() {
BUILD_STATIC=0 BUILD_STATIC=0
fi 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}" != '' ] if [ "${CMD_SAVE_CONFIG}" != '' ]
then then
SAVE_CONFIG="${CMD_SAVE_CONFIG}" SAVE_CONFIG="${CMD_SAVE_CONFIG}"

@ -32,7 +32,7 @@ create_base_layout_cpio() {
# SGI LiveCDs need the following binary (no better place for it than here) # SGI LiveCDs need the following binary (no better place for it than here)
# getdvhoff is a DEPEND of genkernel, so it *should* exist # 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 then
[ -e /usr/lib/getdvhoff/getdvhoff ] \ [ -e /usr/lib/getdvhoff/getdvhoff ] \
&& cp /usr/lib/getdvhoff/getdvhoff ${TEMP}/initramfs-base-temp/bin \ && cp /usr/lib/getdvhoff/getdvhoff ${TEMP}/initramfs-base-temp/bin \
@ -519,7 +519,7 @@ merge_initramfs_cpio_archives(){
rm ${TMPDIR}/initramfs-${KV} rm ${TMPDIR}/initramfs-${KV}
# Mips also mimics Pegasos to merge the initramfs into the kernel # 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 cp ${TMPDIR}/initramfs-${KV} ${KERNEL_DIR}/initramfs.cpio.gz
gunzip -f ${KERNEL_DIR}/initramfs.cpio.gz gunzip -f ${KERNEL_DIR}/initramfs.cpio.gz
fi fi

@ -55,7 +55,7 @@ create_base_initrd_sys() {
# SGI LiveCDs need the following binary (no better place for it than here) # SGI LiveCDs need the following binary (no better place for it than here)
# getdvhoff is a DEPEND of genkernel, so it *should* exist # getdvhoff is a DEPEND of genkernel, so it *should* exist
if [ "${MIPS_EMBEDDED_IMAGE}" != '' ] if [ ${BUILD_INITRAMFS} -eq 1 ]
then then
[ -e /usr/lib/getdvhoff/getdvhoff ] \ [ -e /usr/lib/getdvhoff/getdvhoff ] \
&& cp /usr/lib/getdvhoff/getdvhoff ${TEMP}/initrd-temp/bin \ && cp /usr/lib/getdvhoff/getdvhoff ${TEMP}/initrd-temp/bin \
@ -401,6 +401,6 @@ create_initrd() {
rm ${TMPDIR}/initrd-${KV} rm ${TMPDIR}/initrd-${KV}
# Mips also mimics Pegasos to merge the initrd into the kernel # 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 && cp ${TMPDIR}/initrd-${KV} ${KERNEL_DIR}/mips/ramdisk/initrd.img.gz
} }

@ -2,7 +2,7 @@
# Genkernel v3 # Genkernel v3
PATH="/bin:/usr/bin:/sbin:/usr/sbin" PATH="/bin:/usr/bin:/sbin:/usr/sbin"
GK_V='3.3.11_pre7' GK_V='3.3.11_pre8'
TMPDIR='/var/tmp/genkernel' TMPDIR='/var/tmp/genkernel'
TODEBUGCACHE=1 # Until an error occurs or DEBUGFILE is fully qualified. 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 # Compile kernel; If using --genzimage, or building a mips kernel, skip compile
# till after initrd/initramfs is done # 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 # Compile modules
if [ ${BUILD_MODULES} -eq 1 -a ${BUILD_STATIC} -eq 0 ] if [ ${BUILD_MODULES} -eq 1 -a ${BUILD_STATIC} -eq 0 ]
@ -230,7 +230,7 @@ then
fi fi
if [ "${KERNCACHE}" != "" ] if [ "${KERNCACHE}" != "" ]
then then
if [ "${GENERATE_Z_IMAGE}" = '' -a "${MIPS_EMBEDDED_IMAGE}" = '' ] if [ "${GENERATE_Z_IMAGE}" = '' -a ${BUILD_INITRAMFS} -eq 0 ]
then then
gen_kerncache gen_kerncache
fi fi
@ -330,7 +330,7 @@ else
fi fi
# Pegasos fix # Pegasos fix
if [ "${GENERATE_Z_IMAGE}" != '' -o "${MIPS_EMBEDDED_IMAGE}" != '' ] if [ "${GENERATE_Z_IMAGE}" != '' -o ${BUILD_INITRAMFS} -eq 1 ]
then then
# Compile kernel, intergrating the initrd into it for Pegasos & mips # Compile kernel, intergrating the initrd into it for Pegasos & mips
compile_kernel compile_kernel

Loading…
Cancel
Save