Get rid of the ENABLE_PEGASOS_HACKS hacks

Add INTEGRATED_INITRAMFS option to optionally insert the generated initramfs directly into the kernel image
Change default build order to build the kernel last to facilitate the INTEGRATED_INITRAMFS option
Add GENZIMAGE option and change various checks from ENABLE_PEGASOS_HACKS to GENZIMAGE

git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@631 67a159dc-881f-0410-a524-ba9dfbe2cb84
cleanup-cruft
Andrew Gaffney 17 years ago
parent 1664faa9df
commit d176b8c104

@ -2,6 +2,15 @@
# Copyright 2006-2008 Gentoo Foundation; Distributed under the GPL v2
# $Header: $
13 Mar 2008; Andrew Gaffney <agaffney@gentoo.org> gen_cmdline.sh,
gen_compile.sh, gen_determineargs.sh, gen_initramfs.sh, gen_initrd.sh,
gen_package.sh, genkernel:
Get rid of the ENABLE_PEGASOS_HACKS hacks Add INTEGRATED_INITRAMFS option to
optionally insert the generated initramfs directly into the kernel image
Change default build order to build the kernel last to facilitate the
INTEGRATED_INITRAMFS option Add GENZIMAGE option and change various checks
from ENABLE_PEGASOS_HACKS to GENZIMAGE
13 Mar 2008; Andrew Gaffney <agaffney@gentoo.org> gen_initramfs.sh:
Argh...Changing the right line helps

@ -126,6 +126,9 @@ longusage() {
echo " Specifies specific firmware files to copy. This"
echo " overrides --firmware-dir. For multiple files,"
echo " separate the filenames with a comma"
echo " --integrated-initramfs"
echo " Build the generated initramfs into the kernel instead of"
echo " keeping it as a separate file"
}
usage() {
@ -474,8 +477,9 @@ parse_cmdline() {
--genzimage)
KERNEL_MAKE_DIRECTIVE_2='zImage.initrd'
KERNEL_BINARY_2='arch/powerpc/boot/zImage.initrd'
ENABLE_PEGASOS_HACKS="yes"
print_info 2 "ENABLE_PEGASOS_HACKS: ${ENABLE_PEGASOS_HACKS}"
CMD_GENZIMAGE="yes"
# ENABLE_PEGASOS_HACKS="yes"
# print_info 2 "ENABLE_PEGASOS_HACKS: ${ENABLE_PEGASOS_HACKS}"
;;
--disklabel)
CMD_DISKLABEL=1

@ -332,7 +332,7 @@ compile_kernel() {
"System.map" \
"System.map-${KNAME}-${ARCH}-${KV}"
if [ "${ENABLE_PEGASOS_HACKS}" = 'yes' ]
if isTrue "${GENZIMAGE}"
then
copy_image_with_preserve "kernelz" \
"${KERNEL_BINARY_2}" \
@ -343,7 +343,7 @@ compile_kernel() {
gen_die "Could not copy the kernel binary to ${TMPDIR}!"
cp "System.map" "${TMPDIR}/System.map-${KNAME}-${ARCH}-${KV}" ||
gen_die "Could not copy System.map to ${TMPDIR}!"
if [ "${ENABLE_PEGASOS_HACKS}" = 'yes' ]
if isTrue "${GENZIMAGE}"
then
cp "${KERNEL_BINARY_2}" "${TMPDIR}/kernelz-${KV}" ||
gen_die "Could not copy the kernelz binary to ${TMPDIR}!"

@ -117,6 +117,8 @@ determine_real_args() {
set_config_with_override 1 FIRMWARE CMD_FIRMWARE
set_config_with_override 2 FIRMWARE_DIR CMD_FIRMWARE_DIR "/lib/firmware"
set_config_with_override 2 FIRMWARE_FILES CMD_FIRMWARE_FILES
set_config_with_override 1 INTEGRATED_INITRAMFS CMD_INTEGRATED_INITRAMFS
set_config_with_override 1 GENZIMAGE CMD_GENZIMAGE
BOOTDIR=`arch_replace "${BOOTDIR}"`
BOOTDIR=${BOOTDIR%/} # Remove any trailing slash
@ -198,5 +200,10 @@ determine_real_args() {
mkdir -p `dirname ${KERNCACHE}`
fi
if ! isTrue "${BUILD_INITRD}"
then
INTEGRATED_INITRAMFS=0
fi
get_KV
}

@ -492,21 +492,15 @@ create_initramfs() {
gzip -9 "${CPIO}"
mv -f "${CPIO}.gz" "${CPIO}"
if [ "${ENABLE_PEGASOS_HACKS}" = 'yes' ]
if isTrue "${INTEGRATED_INITRAMFS}"
then
# Pegasos hack for merging the initramfs into the kernel at compile time
cp ${TMPDIR}/initramfs-${KV} ${KERNEL_DIR}/arch/powerpc/boot/ramdisk.image.gz &&
rm ${TMPDIR}/initramfs-${KV}
elif [ ${BUILD_INITRAMFS} -eq '1' ]
then
# Mips also mimics Pegasos to merge the initramfs into the kernel
cp ${TMPDIR}/initramfs-${KV} ${KERNEL_DIR}/initramfs.cpio.gz
gunzip -f ${KERNEL_DIR}/initramfs.cpio.gz
fi
if ! isTrue "${CMD_NOINSTALL}"
then
if [ "${ENABLE_PEGASOS_HACKS}" != 'yes' ]
if ! isTrue "${INTEGRATED_INITRAMFS}"
then
copy_image_with_preserve "initramfs" \
"${TMPDIR}/initramfs-${KV}" \

@ -348,10 +348,10 @@ create_initrd() {
"initrd-${KNAME}-${ARCH}-${KV}"
fi
if [ "${ENABLE_PEGASOS_HACKS}" = 'yes' ]
then
# Pegasos hack for merging the initramfs into the kernel at compile time
cp ${TMPDIR}/initrd-${KV} ${KERNEL_DIR}/arch/${ARCH}/boot/images/ramdisk.image.gz &&
rm ${TMPDIR}/initrd-${KV}
fi
# if [ "${ENABLE_PEGASOS_HACKS}" = 'yes' ]
# then
# # Pegasos hack for merging the initramfs into the kernel at compile time
# cp ${TMPDIR}/initrd-${KV} ${KERNEL_DIR}/arch/${ARCH}/boot/images/ramdisk.image.gz &&
# rm ${TMPDIR}/initrd-${KV}
# fi
}

@ -8,7 +8,7 @@ gen_minkernpackage() {
then
/bin/tar -xj -C ${TEMP}/minkernpackage -f ${KERNCACHE} kernel-${ARCH}-${KV}
/bin/tar -xj -C ${TEMP}/minkernpackage -f ${KERNCACHE} config-${ARCH}-${KV}
if [ "${ENABLE_PEGASOS_HACKS}" = 'yes' ]
if isTrue "${GENZIMAGE}"
then
/bin/tar -xj -C ${TEMP}/minkernpackage -f ${KERNCACHE} kernelz-${ARCH}-${KV}
fi
@ -16,13 +16,13 @@ gen_minkernpackage() {
cd "${KERNEL_DIR}"
cp "${KERNEL_BINARY}" "${TEMP}/minkernpackage/kernel-${KV}" || gen_die 'Could not the copy kernel for the min kernel package!'
cp ".config" "${TEMP}/minkernpackage/config-${ARCH}-${KV}" || gen_die 'Could not the copy kernel config for the min kernel package!'
if [ "${ENABLE_PEGASOS_HACKS}" = 'yes' ]
if isTrue "${GENZIMAGE}"
then
cp "${KERNEL_BINARY_2}" "${TEMP}/minkernpackage/kernelz-${KV}" || gen_die "Could not copy the kernelz for the min kernel package"
fi
fi
if [ "${ENABLE_PEGASOS_HACKS}" != 'yes' ]
if ! isTrue "${INTEGRATED_INITRAMFS}"
then
if [ "${KERN_24}" != '1' ]
then
@ -69,7 +69,7 @@ gen_kerncache()
cp "${KERNEL_BINARY}" "${TEMP}/kerncache/kernel-${ARCH}-${KV}" || gen_die 'Could not the copy kernel for the kernel package!'
cp "${KERNEL_DIR}/.config" "${TEMP}/kerncache/config-${ARCH}-${KV}"
cp "${KERNEL_DIR}/System.map" "${TEMP}/kerncache/System.map-${ARCH}-${KV}"
if [ "${ENABLE_PEGASOS_HACKS}" = 'yes' ]
if isTrue "${GENZIMAGE}"
then
cp "${KERNEL_BINARY_2}" "${TEMP}/kerncache/kernelz-${ARCH}-${KV}" || gen_die "Could not copy the kernelz for the kernel package"
fi
@ -98,7 +98,7 @@ gen_kerncache_extract_kernel()
"${TEMP}/kernel-${ARCH}-${KV}" \
"kernel-${KNAME}-${ARCH}-${KV}"
if [ "${ENABLE_PEGASOS_HACKS}" = 'yes' ]
if isTrue "${GENZIMAGE}"
then
copy_image_with_preserve "kernelz" \
"${TEMP}/kernelz-${ARCH}-${KV}" \

@ -231,10 +231,6 @@ then
# KV may have changed due to the configuration
get_KV
# Compile kernel; If using --genzimage, or building a mips kernel, skip
# compile until after initrd/initramfs is done
[ "${ENABLE_PEGASOS_HACKS}" != 'yes' -a ${BUILD_INITRAMFS} -eq '0' ] && compile_kernel
# Compile modules
if [ ${BUILD_MODULES} -eq '1' -a ${BUILD_STATIC} -eq '0' ]
then
@ -247,13 +243,6 @@ then
[ ! -e '/etc/kernels' ] && mkdir -p /etc/kernels
cp "${KERNEL_DIR}/.config" "/etc/kernels/kernel-config-${ARCH}-${KV}"
fi
if [ "${KERNCACHE}" != "" ]
then
if [ "${ENABLE_PEGASOS_HACKS}" != 'yes' -a ${BUILD_INITRAMFS} -eq 0 ]
then
gen_kerncache
fi
fi
fi
if ! isTrue "${CMD_NOINSTALL}"
@ -326,10 +315,8 @@ else
print_info 1 'initrd: Not building since only the kernel was requested...'
fi
# Pegasos fix
if [ "${ENABLE_PEGASOS_HACKS}" = 'yes' -o ${BUILD_INITRAMFS} -eq 1 ]
if isTrue "${INTEGRATED_INITRAMFS}" || [ ${BUILD_KERNEL} -eq '1' -a "${KERNCACHE_IS_VALID}" == "0" ]
then
# Compile kernel, intergrating the initrd into it for Pegasos & mips
compile_kernel
# We skipped the kernel build and kerncache generation

Loading…
Cancel
Save