check for loop devices and fix debug printing
authorBrad House <brad_mssw@gentoo.org>
Thu, 8 Jan 2004 02:42:23 +0000 (02:42 +0000)
committerBrad House <brad_mssw@gentoo.org>
Thu, 8 Jan 2004 02:42:23 +0000 (02:42 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@39 67a159dc-881f-0410-a524-ba9dfbe2cb84

gen_compile.sh
gen_funcs.sh
genkernel

index a2c7700bde2b03306824b33699ba390238805608..7da2325a58f4e33d8d86c204816fc2741269c511 100644 (file)
@@ -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
index bfb6dfb91a87f536be7ea18f700b2a8f2b2dbe1b..d4bba7b145b5e65a4f43dea20c3c59312be8aca3 100755 (executable)
@@ -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
+}
index bdc16dfcc20ac5914b600df64c35f8e1ef07bfda..cb6c300479062ec59571a4a3215a313d17838fb8 100755 (executable)
--- 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