Find the answer to your Linux question:
Results 1 to 10 of 10
Ok, I have RH 9 on a dual boot box with win2k on the other partition. I wanted to add ntfs read support in the kernel. I configured my kernel, ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2003
    Posts
    27

    kernel build problem


    Ok, I have RH 9 on a dual boot box with win2k on the other partition. I wanted to add ntfs read support in the kernel. I configured my kernel, and made ntfs read support built-in (not modular). I then did the following as root:

    make dep && make clean && make && make install

    when i reboot and try the new kernel, i get something along the lines of

    kernel panic, no init found, try passing an argument at command line (init = )

    at the beginning of boot. I tried again with:

    make dep && make clean && make bzImage
    then copied bzImage over to /boot, updated lilo.conf manually, and ran lilo && lilo -q... same result.


    Also, is it right that I didn't do a 'make modules && make modules_install' since all I did was add something to the kernel that was built-in?


    any help would be much appreciated

  2. #2
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    It looks like the wrong partition got mounted as the root file system. Which partition do you have your root file system on?

    As for not making modules, it depends. Sometimes the versioning information in the kernel changes, and that renders all previously compiled modules unusable for the new kernel. The reason is to ensure that modules that won't work with the kernel cannot even be loaded.

  3. #3
    Just Joined!
    Join Date
    Apr 2003
    Posts
    27
    I ran fdisk and printed the partition table, and it is using the right partition... so I don't think it's that. Also, I looked more thoroughly at my /etc/lilo.conf and saw some things I've never seen before, and was wondering if anyone could explain it and tell me if I need to put similar lines in the area for my new kernel build

    Here is what my current stable build has

    image=/boot/vmlinuz-2.4.20-13.9
    label=linux
    append="hdb=ide-scsi root=LABEL=/"
    read-only
    initrd=/boot/initrd-2.4.20-13.9.img
    what is inird=... mean? and why root=.... in with the append and not by it self?
    how do you make/find the right '.img' ?

    and now the part that really bugs me... as I'm sure most of you know if I do a 'make install' for a new kernel build, it updates /etc/lilo.conf automatically. So, I have the following entry for the new build, which does not work

    image=/boot/vmlinuz-2.4.20-13.9custom
    label=2.4.20-13.9cust
    append="hdb=ide-scsi root=LABEL=/"
    read-only
    initrd=/boot/initrd-2.4.20-13.9custom.img
    any ideas why this doesn't work?
    thanks again

  4. #4
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    An initrd is an initialization ramdisk. The file that you specify is loaded into memory by the boot loader (ie. before the kernel is booted), and the kernel is given the address to it. The file contains an image of a filesystem (usually ext2, but I think it can be anything that has support in your kernel), that the kernel mounts as the root file system. RedHat's initrds usually load some filesystem modules and so before the actual root file system is used, so if you have built support for the filesystem on your root partition into your kernel, you don't need it at all.
    I have found that sometimes, new kernels fail to locate the partition labels. Try the device number instead (eg. 0305 for hda5).
    The root device can be given either in an append directive or in a root directive; they're the same. root=x is basically an alias for append="root=x", just as read-only is an alias for append="ro". I don't really know why they have all those aliases.
    Also, might I suggest using GRUB instead of LILO?

  5. #5
    Just Joined!
    Join Date
    Apr 2003
    Posts
    27
    If I build a kernel using

    Code:
    make dep && make clean && make bzImage
    how can I create the right '.img' to go in /etc/lilo.conf for the initrd=... entry?

    also, I tried to 'make modules' and got a whole bunch of errors... too many to post here. Are there any general reasons why this would fail? I didn't change any modules

    finally, how can I change froim lilo to grub?

  6. #6
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    You don't need to make an initrd. Just remove that directive from your lilo config. Like I said, RedHat's initrds are only for loading additional modules before the root filesystem is mounted, so if you have all the necessary support built into your core kernel, there's no need for an initrd.
    You need to post at least a sample of your errors when making modules.
    Check GRUB's texinfo for information on how to use and install it.

  7. #7
    Just Joined!
    Join Date
    Apr 2003
    Posts
    27
    here's a snapshot of the output from 'make modules'

    Code:
    /usr/src/linux-2.4.20-13.9/include/linux/netdevice.h:600: parse error before numeric constant
    /usr/src/linux-2.4.20-13.9/include/linux/netdevice.h:600: `dev_ioctl_R_ver_str'
    declared as function returning a function
    /usr/src/linux-2.4.20-13.9/include/linux/netdevice.h:600: warning: function declaration isn't a prototype
    /usr/src/linux-2.4.20-13.9/include/linux/netdevice.h: In function `netif_rx_ni':/usr/src/linux-2.4.20-13.9/include/linux/netdevice.h:615: `f0a529b7' undeclared
    (first use in this function)
    /usr/src/linux-2.4.20-13.9/include/linux/netdevice.h:615: called object is not a function
    In file included from /usr/src/linux-2.4.20-13.9/include/net/dst.h:12,
                     from /usr/src/linux-2.4.20-13.9/include/net/sock.h:107,
                     from cipe.h:69,
                     from module.c:15:
    /usr/src/linux-2.4.20-13.9/include/net/neighbour.h: In function `neigh_confirm':/usr/src/linux-2.4.20-13.9/include/net/neighbour.h:233: `jiffies_R0da02d67' undeclared (first use in this function)
    /usr/src/linux-2.4.20-13.9/include/net/neighbour.h: In function `neigh_event_send':
    /usr/src/linux-2.4.20-13.9/include/net/neighbour.h:248: `jiffies_R0da02d67' undeclared (first use in this function)
    In file included from /usr/src/linux-2.4.20-13.9/include/net/sock.h:107,
                     from cipe.h:69,
                     from module.c:15:
    /usr/src/linux-2.4.20-13.9/include/net/dst.h: In function `dst_set_expires':
    /usr/src/linux-2.4.20-13.9/include/net/dst.h:149: `jiffies_R0da02d67' undeclared (first use in this function)
    In file included from cipe.h:69,
                     from module.c:15:
    /usr/src/linux-2.4.20-13.9/include/net/sock.h: In function `sk_filter_release':
    /usr/src/linux-2.4.20-13.9/include/net/sock.h:959: warning: implicit declaration of function `kfree_R037a0cba'
    /usr/src/linux-2.4.20-13.9/include/net/sock.h: In function `sock_orphan':
    /usr/src/linux-2.4.20-13.9/include/net/sock.h:1041: `do_softirq_Rf0a529b7' undeclared (first use in this function)
    /usr/src/linux-2.4.20-13.9/include/net/sock.h: In function `sock_graft':
    /usr/src/linux-2.4.20-13.9/include/net/sock.h:1050: `do_softirq_Rf0a529b7' undeclared (first use in this function)
    /usr/src/linux-2.4.20-13.9/include/net/sock.h: In function `sock_recv_timestamp':
    /usr/src/linux-2.4.20-13.9/include/net/sock.h:1293: warning: implicit declaration of function `put_cmsg_Rf39bf4d9'
    module.c: In function `cipe_check_kernel':
    module.c:73: warning: implicit declaration of function `printk_R1b7d4074'
    /usr/src/linux-2.4.20-13.9/include/linux/skbuff.h: In function `kunmap_skb_frag':
    /usr/src/linux-2.4.20-13.9/include/linux/skbuff.h:1129: warning: asm operand 1 probably doesn't match constraints
    make[3]: *** [module.o] Error 1
    make[3]: Leaving directory `/usr/src/linux-2.4.20-13.9/drivers/addon/cipe'
    make[2]: *** [_modsubdir_cipe] Error 2
    make[2]: Leaving directory `/usr/src/linux-2.4.20-13.9/drivers/addon'
    make[1]: *** [_modsubdir_addon] Error 2
    make[1]: Leaving directory `/usr/src/linux-2.4.20-13.9/drivers'
    make: *** [_mod_drivers] Error 2
    hope this helps

    also, i tried to take out the initrd=... entry, and wrote this entry

    Code:
    image=/boot/vmlinuz-2.4.20-13.9_51703
            label=linuxtest
            append="hdb=ide-scsi"
            read-only
            root=/dev/hda2
    and got the 'kernel panic: init not found' error like before. What's wrong with this entry?
    I'm going to try putting in the partition number (i guess its 0302 for /deev/hda2?) instead of the label.

  8. #8
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Yeah, I recognize those module errors. It was the same when I tried to compile a kernel from RH7.1's kernel source tree. Somehow, RH seems to mess things up with the versioning information every now and then. I dunno if that's something you're just supposed to know how to fix, but I do know that when I downloaded a vanilla kernel from kernel.org, it worked perfectly. You could try that, too.

    As for your init problem, could you post your partition table? I'd just like to have a look at it. And yes, 0302 is hda2. To see for yourself, ls -l /dev/hda2, and you'll see something like 3, 2 in the output. The 3 is the major number for the device and the 2 is the minor number. To construct a number to pass to the kernel at boot, write the numbers in hexadecimal, fill it with zeroes to two hexadecimal digits, and concatenate them. That way, you get 0302 for hda2 or 210a for hde10.

  9. #9
    Just Joined!
    Join Date
    Apr 2003
    Posts
    27
    Here is my parition table, from fdisk

    Code:
    Command (m for help): p
     
    Disk /dev/hda: 80.0 GB, 80026361856 bytes
    255 heads, 63 sectors/track, 9729 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
     
       Device Boot    Start       End    Blocks   Id  System
    /dev/hda1   *         1      8667  69617646    7  HPFS/NTFS
    /dev/hda2          8668      9470   6450097+  83  Linux
    /dev/hda3          9471      9535    522112+  82  Linux swap
    /dev/hda4          9536      9729   1558305    f  Win95 Ext'd (LBA)
    /dev/hda5          9536      9729   1558273+  83  Linux
    just to be clear, hda2 is mounted on / and hda5 is mounted on /home

  10. #10
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Can you try passing "root=0302 init=/bin/sh" to the kernel?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •