#!/bin/bash
PATH="${PATH}:/sbin:/usr/sbin"
-GK_V='3.4.10_pre5'
+GK_V='3.4.10'
# Set the default for TMPDIR. May be modified by genkernel.conf or the
# --tempdir command line option.
source ${GK_SHARE}/gen_determineargs.sh || gen_die "Could not read ${GK_SHARE}/gen_determineargs.sh"
source ${GK_SHARE}/gen_compile.sh || gen_die "Could not read ${GK_SHARE}/gen_compile.sh"
source ${GK_SHARE}/gen_configkernel.sh || gen_die "Could not read ${GK_SHARE}/gen_configkernel.sh"
-source ${GK_SHARE}/gen_initrd.sh || gen_die "Could not read ${GK_SHARE}/gen_initrd.sh"
source ${GK_SHARE}/gen_initramfs.sh || gen_die "Could not read ${GK_SHARE}/gen_initramfs.sh"
source ${GK_SHARE}/gen_moddeps.sh || gen_die "Could not read ${GK_SHARE}/gen_moddeps.sh"
source ${GK_SHARE}/gen_package.sh || gen_die "Could not read ${GK_SHARE}/gen_package.sh"
-source ${GK_SHARE}/gen_bootloader.sh || gen_die "Could not read ${GK_SHARE}/gen_bootloader.sh"
TEMP=${TMPDIR}/$RANDOM.$RANDOM.$RANDOM.$$
trap trap_cleanup SIGHUP SIGQUIT SIGINT SIGTERM SIGKILL
BUILD_KERNEL=0
-BUILD_INITRD=0
+BUILD_RAMDISK=0
BUILD_MODULES=0
# Parse all command line options...
done
# Check if no action is specified...
-if [ "${BUILD_KERNEL}" -eq '0' -a "${BUILD_INITRD}" -eq '0' ]
+if [ "${BUILD_KERNEL}" -eq '0' -a "${BUILD_RAMDISK}" -eq '0' ]
then
usage
exit 1
# Read arch-specific config
source ${ARCH_CONFIG} || gen_die "Could not read ${ARCH_CONFIG}"
-source ${GK_SHARE}/${ARCH}/modules_load || gen_die "Could not read ${GK_SHARE}/${ARCH}/modules_load"
+source ${GK_SHARE}/arch/${ARCH}/modules_load || gen_die "Could not read ${GK_SHARE}/arch/${ARCH}/modules_load"
# Merge modules_load from config
for group_modules in ${!AMODULES_*}; do
setup_cache_dir
+check_distfiles
dump_debugcache
NORMAL=${BOLD} print_info 1 "Linux Kernel ${BOLD}${KV}${NORMAL} for ${BOLD}${ARCH}${NORMAL}..."
-if [ "${BUILD_INITRD}" -ne '0' ]
+if [ "${BUILD_RAMDISK}" -ne '0' ]
then
if ! has_loop
then
# Configure kernel
config_kernel
- # Make deps
- compile_dep
-
- # Make prepare [2.6]
+ # Make prepare
if [ "${ARCH_HAVENOPREPARE}" = '' ]
then
- [ "${VER}" -gt '2' ] || [ "${VER}" -eq '2' -a "${PAT}" -ge '6' ] && compile_generic prepare kernel
+ compile_generic prepare kernel
fi
# KV may have changed due to the configuration
get_KV
+ compile_kernel
+
# Compile modules
if [ ${BUILD_MODULES} -eq '1' -a ${BUILD_STATIC} -eq '0' ]
then
if [ "${CALLBACK_ESCAPE}" -eq '0' ]
then
echo
- echo "DEBUG: callback: ARCH=${ARCH}"
- ORIG_ARCH=${ARCH}
- unset ARCH
echo
eval ${CMD_CALLBACK} | tee -a ${LOGFILE}
CMD_STATUS="${PIPESTATUS[0]}"
echo
print_info 1 "<<< Callback exit status: ${CMD_STATUS}"
- export ARCH=${ORIG_ARCH}
[ "${CMD_STATUS}" -ne 0 ] && gen_die '--callback failed!'
else
echo
print_info 1 "" 1 0
fi
-if [ "${BUILD_INITRD}" -eq '1' ]
+if [ "${BUILD_RAMDISK}" -eq '1' ]
then
[ "${DISKLABEL}" -eq '1' ] && compile_e2fsprogs
- if [ "${KERN_24}" != '1' ]
+ if [ "${BUSYBOX}" -eq '1' ]
then
- if [ "${BUSYBOX}" -eq '1' ]
- then
# Compile Busybox
compile_busybox
- fi
-
- # Compile initramfs
- create_initramfs
- else
- # Create initrd
- compile_busybox
- create_initrd
fi
+
+ # Compile initramfs
+ create_initramfs
else
print_info 1 'initrd: Not building since only the kernel was requested...'
fi
-if isTrue "${INTEGRATED_INITRAMFS}" || [ ${BUILD_KERNEL} -eq '1' -a "${KERNCACHE_IS_VALID}" == "0" ]
+if isTrue "${INTEGRATED_INITRAMFS}" #|| [ ${BUILD_KERNEL} -eq '1' -a "${KERNCACHE_IS_VALID}" == "0" ]
then
+ # We build the kernel a second time to include the initramfs
compile_kernel
-
- # We skipped the kernel build and kerncache generation
- # So do it here
- [ "${KERNCACHE}" != "" ] && gen_kerncache
fi
+[ "${KERNCACHE}" != "" ] && gen_kerncache
[ "${MINKERNPACKAGE}" != '' ] && gen_minkernpackage
[ "${MODULESPACKAGE}" != '' ] && gen_modulespackage
if [ "${BUILD_KERNEL}" -eq '1' ]
then
- set_bootloader
print_info 1 ''
print_info 1 "Kernel compiled successfully!"
print_info 1 ''
print_info 1 'Required Kernel Parameters:'
- if [ "${BUILD_INITRD}" -eq '0' ]
+ if [ "${BUILD_RAMDISK}" -eq '0' ]
then
print_info 1 ' root=/dev/$ROOT'
print_info 1 ' [ And "vga=0x317 splash=verbose" if you use a framebuffer ]'
print_info 1 ''
print_info 1 ' Where $ROOT is the device node for your root partition as the'
print_info 1 ' one specified in /etc/fstab'
- elif [ "${KERN_24}" != '1' ]
- then
+ else
print_info 1 ' real_root=/dev/$ROOT'
print_info 1 ''
print_info 1 ' Where $ROOT is the device node for your root partition as the'
print_info 1 "If you require Genkernel's hardware detection features; you MUST"
print_info 1 'tell your bootloader to use the provided INITRAMFS file. Otherwise;'
print_info 1 'substitute the root argument for the real_root argument if you are'
- print_info 1 'not planning to use the initrd...'
- else
- print_info 1 ' root=/dev/ram0 real_root=/dev/$ROOT init=/linuxrc'
- [ "${INITRD_SIZE}" -ge 4096 ] && print_info 1 " ramdisk_size=${INITRD_SIZE}"
- print_info 1 ''
- print_info 1 ' Where $ROOT is the device node for your root partition as the'
- print_info 1 ' one specified in /etc/fstab'
- print_info 1 ''
- print_info 1 "If you require Genkernel's hardware detection features; you MUST"
- print_info 1 'tell your bootloader to use the provided INITRD file. Otherwise;'
- print_info 1 'substitute the root argument for the real_root argument if you are'
- print_info 1 'not planning to use the initrd...'
+ print_info 1 'not planning to use the initramfs...'
fi
fi
-if [ "${BUILD_INITRD}" -eq '1' ]
+if [ "${BUILD_RAMDISK}" -eq '1' ]
then
echo
print_info 1 'WARNING... WARNING... WARNING...'