Remove broken grub code
[genkernel.git] / genkernel
index 552205b7318173a690e6860e54d26ff4f6e9652d..fc423e7b2fff7ab44a6f3700f048feaaebbd64af 100755 (executable)
--- a/genkernel
+++ b/genkernel
@@ -1,7 +1,7 @@
 #!/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.
@@ -40,11 +40,9 @@ source ${GK_SHARE}/gen_arch.sh || gen_die "Could not read ${GK_SHARE}/gen_arch.s
 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.$$
 
@@ -74,7 +72,7 @@ cleanup(){
 
 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...
@@ -86,7 +84,7 @@ do
 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
@@ -102,7 +100,7 @@ get_official_arch
 
 # 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
@@ -124,12 +122,13 @@ set_kernel_arch
 
 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
@@ -221,18 +220,17 @@ 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
@@ -280,15 +278,11 @@ 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
@@ -298,38 +292,29 @@ then
        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
 
@@ -338,20 +323,18 @@ fi
 
 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'
@@ -360,22 +343,11 @@ then
                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...'