4 determine_config_file() {
5 if [ "${CMD_KERNEL_CONFIG}" != "" ]
7 KERNEL_CONFIG="${CMD_KERNEL_CONFIG}"
8 elif [ -f "/etc/kernels/kernel-config-${ARCH}-${KV}" ]
10 KERNEL_CONFIG="/etc/kernels/kernel-config-${ARCH}-${KV}"
11 elif [ -f "${GK_SHARE}/arch/${ARCH}/kernel-config-${KV}" ]
13 KERNEL_CONFIG="${GK_SHARE}/arch/${ARCH}/kernel-config-${KV}"
14 elif [ "${DEFAULT_KERNEL_CONFIG}" != "" -a -f "${DEFAULT_KERNEL_CONFIG}" ]
16 KERNEL_CONFIG="${DEFAULT_KERNEL_CONFIG}"
17 elif [ -f "${GK_SHARE}/arch/${ARCH}/kernel-config-${VER}.${PAT}" ]
19 KERNEL_CONFIG="${GK_SHARE}/arch/${ARCH}/kernel-config-${VER}.${PAT}"
20 elif [ -f "${GK_SHARE}/arch/${ARCH}/kernel-config" ]
22 KERNEL_CONFIG="${GK_SHARE}/arch/${ARCH}/kernel-config"
24 gen_die 'Error: No kernel .config specified, or file not found!'
30 cd "${KERNEL_DIR}" || gen_die 'Could not switch to the kernel directory!'
32 isTrue "${CLEAN}" && cp "${KERNEL_DIR}/.config" "${KERNEL_DIR}/.config.bak" > /dev/null 2>&1
35 print_info 1 'kernel: >> Running mrproper...'
36 compile_generic mrproper kernel
39 # If we're not cleaning, then we don't want to try to overwrite the configs
40 # or we might remove configurations someone is trying to test.
44 print_info 1 "config: Using config from ${KERNEL_CONFIG}"
45 print_info 1 ' Previous config backed up to .config.bak'
46 cp "${KERNEL_CONFIG}" "${KERNEL_DIR}/.config" || gen_die 'Could not copy configuration file!'
48 if isTrue "${OLDCONFIG}"
50 print_info 1 ' >> Running oldconfig...'
51 yes '' 2>/dev/null | compile_generic oldconfig kernel 2>/dev/null
55 print_info 1 'kernel: >> Cleaning...'
56 compile_generic clean kernel
58 print_info 1 "config: --no-clean is enabled; leaving the .config alone."
61 if isTrue ${MENUCONFIG}
63 print_info 1 'config: >> Invoking menuconfig...'
64 compile_generic menuconfig runtask
65 [ "$?" ] || gen_die 'Error: menuconfig failed!'
66 elif isTrue ${CMD_GCONFIG}
68 print_info 1 'config: >> Invoking gconfig...'
69 compile_generic gconfig kernel
70 [ "$?" ] || gen_die 'Error: gconfig failed!'
75 if isTrue ${CMD_XCONFIG}
77 print_info 1 'config: >> Invoking xconfig...'
78 compile_generic xconfig kernel
79 [ "$?" ] || gen_die 'Error: xconfig failed!'
82 # Force this on if we are using --genzimage
83 if isTrue ${CMD_GENZIMAGE}
85 # Make sure Ext2 support is on...
86 sed -e 's/#\? \?CONFIG_EXT2_FS[ =].*/CONFIG_EXT2_FS=y/g' \
87 -i ${KERNEL_DIR}/.config
90 # Make sure lvm modules are on if --lvm
93 sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_BLK_DEV_DM is.*/CONFIG_BLK_DEV_DM=m/g'
94 sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_DM_SNAPSHOT is.*/CONFIG_DM_SNAPSHOT=m/g'
95 sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_DM_MIRROR is.*/CONFIG_DM_MIRROR=m/g'
98 # Make sure dmraid modules are on if --dmraid
99 if isTrue ${CMD_DMRAID}
101 sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_BLK_DEV_DM is.*/CONFIG_BLK_DEV_DM=m/g'
106 sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_FB_SPLASH is.*/CONFIG_FB_SPLASH=y/g'