From: Brad House Date: Thu, 8 Jan 2004 02:42:23 +0000 (+0000) Subject: check for loop devices and fix debug printing X-Git-Tag: v3.4.10.902~713 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=586760c4d8603af19f63b85caa50b74fdcd876b7;p=genkernel.git check for loop devices and fix debug printing git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@39 67a159dc-881f-0410-a524-ba9dfbe2cb84 --- diff --git a/gen_compile.sh b/gen_compile.sh index a2c7700..7da2325 100644 --- a/gen_compile.sh +++ b/gen_compile.sh @@ -191,10 +191,11 @@ compile_modules() { compile_kernel() { [ "${KERNEL_MAKE}" = "" ] && gen_die "KERNEL_MAKE undefined. Don't know how to compile kernel for arch." cd ${KERNEL_DIR} - print_info 1 "kernel: Starting compile of linux ${KV} ${KERNEL_MAKE}" + print_info 1 "kernel: Starting compile of linux ${KV} ${KERNEL_MAKE_DIRECTIVE}" compile_generic "${KERNEL_MAKE_DIRECTIVE}" kernel if [ "${KERNEL_MAKE_DIRECTIVE_2}" != "" ] then + print_info 1 "kernel: Starting suppliment compile of linux ${KV} ${KERNEL_MAKE_DIRECTIVE_2}" compile_generic "${KERNEL_MAKE_DIRECTIVE_2}" kernel fi cp "${KERNEL_BINARY}" "/boot/kernel-${KV}" || gen_die "Could not copy kernel binary to boot" @@ -219,7 +220,7 @@ compile_busybox() { # UTILS_CC="${TEMP}/diet/bin/diet ${UTILS_CC}" # fi print_info 1 "Busybox: make oldconfig" - compile_generic "oldconfig" utils + yes "" | compile_generic "oldconfig" utils print_info 1 "Busybox: make all" compile_generic "all" utils # Busybox and dietlibc don't play nice right now diff --git a/gen_funcs.sh b/gen_funcs.sh index bfb6dfb..d4bba7b 100755 --- a/gen_funcs.sh +++ b/gen_funcs.sh @@ -167,3 +167,14 @@ gen_die() { fi exit 1 } + +has_loop() { + if [ -e "/dev/loop0" -o -e "/dev/loop/0" ] + then + # We found devfs or standard dev loop device, assume + # loop is compiled into the kernel or the module is loaded + return 0 + else + return 1 + fi +} diff --git a/genkernel b/genkernel index bdc16df..cb6c300 100755 --- a/genkernel +++ b/genkernel @@ -50,6 +50,13 @@ determine_real_args print_info 1 "ARCH: ${ARCH}" print_info 1 "KERNEL VER: ${KV}" +if !has_loop +then + print_info 1 "Your kernel does not appear to have loop device support. " + print_info 1 "Please 'modprobe loop' if it is a module before running genkernel" + gen_die "----Load loop support----" +fi + # Configure kernel config_kernel