3 determine_config_file() {
4 if [ "${CMD_KERNEL_CONFIG}" != "" ]
6 KERNEL_CONFIG="${CMD_KERNEL_CONFIG}"
7 elif [ -f "/etc/kernels/kernel-config-${ARCH}-${KV}" ]
9 KERNEL_CONFIG="/etc/kernels/kernel-config-${ARCH}-${KV}"
10 elif [ -f "${GK_SHARE}/${ARCH}/kernel-config-${KV}" ]
12 KERNEL_CONFIG="${GK_SHARE}/${ARCH}/kernel-config-${KV}"
13 elif [ "${DEFAULT_KERNEL_CONFIG}" != "" -a -f "${DEFAULT_KERNEL_CONFIG}" ]
15 KERNEL_CONFIG="${DEFAULT_KERNEL_CONFIG}"
16 elif [ -f "${GK_SHARE}/${ARCH}/kernel-config-${VER}.${PAT}" ]
18 KERNEL_CONFIG="${GK_SHARE}/${ARCH}/kernel-config-${VER}.${PAT}"
19 elif [ -f "${GK_SHARE}/${ARCH}/kernel-config" ]
21 KERNEL_CONFIG="${GK_SHARE}/${ARCH}/kernel-config"
23 gen_die "no kernel config specified, or file not found"
28 print_info 1 "kernel: configuring source"
32 cd "${KERNEL_DIR}" || gen_die "could not switch to kernel directory"
36 print_info 1 "kernel: running mrproper"
37 compile_generic "mrproper" kernel
40 # If we're not cleaning, then we don't want to try to overwrite the configs there
41 # or we might screw up something someone is trying to test.
44 print_info 1 "kernel: using config from ${KERNEL_CONFIG} -- prev backed up to .config.bak"
45 cp "${KERNEL_DIR}/.config" "${KERNEL_DIR}/.config.bak" > /dev/null 2>&1
46 cp "${KERNEL_CONFIG}" "${KERNEL_DIR}/.config" || gen_die "could not copy config file"
48 print_info 1 "kernel: running oldconfig"
49 yes "" | compile_generic "oldconfig" kernel
51 print_info 1 "kernel: running clean"
52 compile_generic "clean" kernel
54 print_info 1 "kernel: skipping copy of config. CLEAN is OFF"
57 if isTrue ${MENUCONFIG}
59 print_info 1 "kernel: running menuconfig"
61 [ "$?" != "0" ] && gen_die "menuconfig failed"