Force ZFS to explicitly import pool when LUKS is present
[genkernel.git] / gen_configkernel.sh
index 2e0737f37d8e69cc8efb020d68961269d2192de1..b0837dd05a6c10bba6ffed87518a5bbce580b6b2 100755 (executable)
@@ -24,6 +24,7 @@ determine_config_file() {
        else
                gen_die 'Error: No kernel .config specified, or file not found!'
        fi
+    KERNEL_CONFIG="$(readlink -f "${KERNEL_CONFIG}")"
 }
 
 config_kernel() {
@@ -55,7 +56,13 @@ config_kernel() {
        # or we might remove configurations someone is trying to test.
        if isTrue "${MRPROPER}" || [ ! -f "${KERNEL_DIR}/.config" ]
        then
-               cp "${KERNEL_CONFIG}" "${KERNEL_DIR}/.config" || gen_die 'Could not copy configuration file!'
+               local message='Could not copy configuration file!'
+               if [[ "$(file --brief --mime-type "${KERNEL_CONFIG}")" == application/x-gzip ]]; then
+                       # Support --kernel-config=/proc/config.gz, mainly
+                       zcat "${KERNEL_CONFIG}" > "${KERNEL_DIR}/.config" || gen_die "${message}"
+               else
+                       cp "${KERNEL_CONFIG}" "${KERNEL_DIR}/.config" || gen_die "${message}"
+               fi
        fi
 
        if isTrue "${OLDCONFIG}"
@@ -72,11 +79,11 @@ config_kernel() {
        else
                print_info 1 "kernel: --clean is disabled; not running 'make clean'."
        fi
-       
+
        if isTrue ${MENUCONFIG}
        then
                print_info 1 'kernel: >> Invoking menuconfig...'
-               compile_generic menuconfig runtask
+               compile_generic menuconfig kernelruntask
                [ "$?" ] || gen_die 'Error: menuconfig failed!'
        elif isTrue ${CMD_GCONFIG}
        then