Unable to build a working cloop


Forum: Other Help Topics
Topic: Unable to build a working cloop
started by: rmd6502

Posted by rmd6502 on Jan. 31 2007,19:58
I needed to remaster to kernel 2.6.18.  I took the stock sources off ftp.kernel.org, copied .config from DSL-N, did a 'make oldconfig', choosing 'm' for every new module it asked about.  I then downloaded the cloop-2.04 sources from < http://debian-knoppix.alioth.debian.org/sources. >

After building the kernel I added it to my SUSE installation for testing and booted it.  I then attempted to build cloop.There were two issues with the build.  One (which may be the problem) is that I would get '/lib/modules/2.6.18/build/include/asm/processor.h:80: error: `CONFIG_X86_L1_CACHE_SHIFT' undeclared here (not in a function)'.  A google search said that I was not building the module with the same kernel configuration as I had built the kernel.  This was clearly not the case.  I even did a make clean on the kernel to be sure.  There was a comment in /usr/src/linux/include/linux/config.h that the configuration was now included using -imacros, so I added -imacros <path>/autoconf.h to the module make options.  Problem 1 solved.

Next problem was that devfs_name was no longer a member of struct gendisk.  Another search revealed that devfs had been removed from kernels, and there didn't seem to be anything to replace it, so I commented that line out in cloop_init.  Now I got a cloop.ko without any warnings or errors.

However, every time I try modprobe cloop I get a kernel oops.  I am appending the excerpt from /var/log/messages.  I see the struct_module error, which suggests the kernel build environment still doesn't match the module build environment, but I am at a loss to see how.  Any help would be really appreciated.  Thanks in advance.

Jan 30 19:53:20 fremont kernel: cloop: no version for "struct_module" found: kernel tainted.
Jan 30 19:53:20 fremont kernel: kobject cloop: registering. parent: <NULL>, set: module
Jan 30 19:53:20 fremont kernel: kobject_uevent
Jan 30 19:53:20 fremont kernel: fill_kobj_path: path = '/module/cloop'
Jan 30 19:53:20 fremont kernel: cloop: Initializing cloop v2.04
Jan 30 19:53:20 fremont kernel: major_nr 240 blockdev name cloop
Jan 30 19:53:20 fremont kernel: kobject cloop0: registering. parent: <NULL>, set: block
Jan 30 19:53:20 fremont kernel: kobject holders: registering. parent: cloop0, set: <NULL>
Jan 30 19:53:20 fremont kernel: kobject_uevent
Jan 30 19:53:20 fremont kernel: kobject slaves: registering. parent: cloop0, set: <NULL>
Jan 30 19:53:20 fremont kernel: kobject_uevent
Jan 30 19:53:20 fremont kernel: kobject_uevent
Jan 30 19:53:20 fremont kernel: fill_kobj_path: path = '/block/cloop0'
Jan 30 19:53:20 fremont kernel: kobject cloop1: registering. parent: <NULL>, set: block
Jan 30 19:53:20 fremont kernel: kobject holders: registering. parent: cloop1, set: <NULL>
Jan 30 19:53:20 fremont kernel: kobject_uevent
Jan 30 19:53:20 fremont kernel: kobject slaves: registering. parent: cloop1, set: <NULL>
Jan 30 19:53:20 fremont kernel: kobject_uevent
Jan 30 19:53:20 fremont kernel: kobject_uevent
Jan 30 19:53:20 fremont kernel: fill_kobj_path: path = '/block/cloop1'
Jan 30 19:53:20 fremont kernel: ------------[ cut here ]------------
Jan 30 19:53:20 fremont kernel: kernel BUG at mm/slab.c:2602!
Jan 30 19:53:20 fremont kernel: invalid opcode: 0000 [#1]
Jan 30 19:53:20 fremont kernel: SMP
Jan 30 19:53:20 fremont kernel: Modules linked in: cloop acpi_cpufreq freq_table ipv6 snd_pcm_oss snd_mixer_oss snd_seq snd_seq_device thermal processor binfmt_misc fan button battery ac loop md_mod dm_mod snd_intel8x0 b44 snd_ac97_codec snd_ac97_bus snd_pcm mii snd_timer snd soundcore snd_page_alloc 8250_pnp 8250 serial_core parport_pc lp parport
Jan 30 19:53:20 fremont kernel: CPU:    0
Jan 30 19:53:20 fremont kernel: EIP:    0060:[<c0167003>]    Tainted: GF     VLI
Jan 30 19:53:20 fremont kernel: EFLAGS: 00010086   (2.6.18 #5)
Jan 30 19:53:20 fremont kernel: EIP is at cache_grow+0x173/0x180
Jan 30 19:53:20 fremont kernel: eax: c1386980   ebx: d0c10860   ecx: 00000000   edx: d0c10860
Jan 30 19:53:20 fremont kernel: esi: c1398bd0   edi: c1386980   ebp: c1f75efc   esp: c1f75ed4
Jan 30 19:53:20 fremont kernel: ds: 007b   es: 007b   ss: 0068
Jan 30 19:53:20 fremont kernel: Process modprobe (pid: 3847, ti=c1f74000 task=cfd04070 task.ti=c1f74000)
Jan 30 19:53:20 fremont kernel: Stack: 00000001 c1f75ef0 00000046 c1398bf4 c1398be4 c1398bd0 00000000 00000000
Jan 30 19:53:20 fremont kernel:        c1398bd0 0000000c c1f75f28 c0167171 c1398bc8 c1398be4 c139b9c0 c1398bc0
Jan 30 19:53:20 fremont kernel:        d0c10860 c1386980 c1386980 00000286 d0c10860 c1f75f3c c0167423 d0c10860
Jan 30 19:53:20 fremont kernel: Call Trace:
Jan 30 19:53:20 fremont kernel:  [<c0167171>] cache_alloc_refill+0x161/0x1f0
Jan 30 19:53:20 fremont kernel:  [<c0167423>] kmem_cache_alloc+0x63/0x70
Jan 30 19:53:20 fremont kernel:  [<c0209b61>] blk_alloc_queue_node+0x11/0x90
Jan 30 19:53:20 fremont kernel:  [<c0209b4b>] blk_alloc_queue+0xb/0x10
Jan 30 19:53:20 fremont kernel:  [<d0a4f318>] cloop_init+0x318/0x59a [cloop]
Jan 30 19:53:20 fremont kernel: DWARF2 unwinder stuck at cloop_init+0x318/0x59a [cloop]
Jan 30 19:53:20 fremont kernel: Leftover inexact backtrace:
Jan 30 19:53:20 fremont kernel:  [<c01042e0>] show_stack_log_lvl+0x80/0xa0
Jan 30 19:53:20 fremont kernel:  [<c01044a3>] show_registers+0x153/0x1c0
Jan 30 19:53:20 fremont kernel:  [<c01046a6>] die+0x116/0x1f0
Jan 30 19:53:20 fremont kernel:  [<c010481f>] do_trap+0x9f/0xb0
Jan 30 19:53:20 fremont kernel:  [<c0104ab5>] do_invalid_op+0x95/0xa0
Jan 30 19:53:20 fremont kernel:  [<c0103db9>] error_code+0x39/0x40
Jan 30 19:53:20 fremont kernel:  [<c0167171>] cache_alloc_refill+0x161/0x1f0
Jan 30 19:53:20 fremont kernel:  [<c0167423>] kmem_cache_alloc+0x63/0x70
Jan 30 19:53:20 fremont kernel:  [<c0209b61>] blk_alloc_queue_node+0x11/0x90
Jan 30 19:53:20 fremont kernel:  [<c0209b4b>] blk_alloc_queue+0xb/0x10
Jan 30 19:53:20 fremont kernel:  [<d0a4f318>] cloop_init+0x318/0x59a [cloop]
Jan 30 19:53:20 fremont kernel:  [<c013ee15>] sys_init_module+0x115/0x190
Jan 30 19:53:20 fremont kernel:  [<c0102bbd>] sysenter_past_esp+0x56/0x99
Jan 30 19:53:20 fremont kernel: Code: ea fc ff eb b7 89 f2 89 f8 e8 0a f2 ff ff f6 45 e8 10 75 04 31 c0 eb dd fa e8 4a ea fc ff eb f4 e8 13 e9 fc ff fb e9 31 ff ff ff <0f> 0b 2a 0a 5f 62 38 c0 e9 9c fe ff ff 55 89 e5 57 56 53 83 ec
Jan 30 19:53:20 fremont kernel: EIP: [<c0167003>] cache_grow+0x173/0x180 SS:ESP 0068:c1f75ed4
Jan 30 19:53:20 fremont kernel:  <4>cloop: pseudo-major != 240

Posted by rmd6502 on Feb. 05 2007,18:28
Cloop 2.04 builds on 2.6.19.2, once I applied the following patches:
*** compressed_loop.c   Sun May 14 12:15:32 2006
--- compressed_loop.c.patched   Mon Feb  5 10:32:52 2007
***************
*** 34,39 ****
--- 34,40 ----
 /* #define REDHAT_KERNEL */

 #include <linux/kernel.h>
+ #include <linux/autoconf.h>
 #include <linux/version.h>
 #include <linux/module.h>
 #include <linux/init.h>
*************** static int clo_set_file(int cloop_num, s
*** 501,507 ****
    clo->underlying_blksize = block_size(inode->i_bdev);
  }
 else
!    clo->underlying_blksize = inode->i_blksize;
 #else
  /* Get initial block size out of device */
  clo->underlying_blksize = get_blksize(dev);
--- 502,508 ----
    clo->underlying_blksize = block_size(inode->i_bdev);
  }
 else
!    clo->underlying_blksize = 1UL << inode->i_blkbits;
 #else
  /* Get initial block size out of device */
  clo->underlying_blksize = get_blksize(dev);
*************** static struct block_device_operations cl
*** 827,832 ****
--- 828,834 ----

 /static int register_cloop_blkdev(int major_nr)
 {
+ printk("major_nr %d blockdev name %s\n", major_nr, cloop_name);
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
  return devfs_register_blkdev(major_nr, cloop_name, &clo_fops);
 #else
*************** static int __init cloop_init(void)
*** 900,906 ****
    clo->disk->first_minor = i;
    clo->disk->fops = &clo_fops;
    sprintf(clo->disk->disk_name, "%s%d", cloop_name, i);
!    sprintf(clo->disk->devfs_name, "%s/%d", cloop_name, i);
    clo->disk->private_data = clo;
    add_disk(clo->disk);
   }
--- 902,908 ----
    clo->disk->first_minor = i;
    clo->disk->fops = &clo_fops;
    sprintf(clo->disk->disk_name, "%s%d", cloop_name, i);
!    //sprintf(clo->disk->devfs_name, "%s/%d", cloop_name, i);
    clo->disk->private_data = clo;
    add_disk(clo->disk);
   }

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.