Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Linux Software

2.2.1x Kernel Building Problems 25

rips asks: "I've been a moderately skilled Linux user for several years now but my problem solving skills on this one have got me stumped. I have compiled many kernels before but when compiling a recent kernel (2.2.11 or 2.2.12) the compilation will run without a hitch, lilo (v20) will accept the changes but after a reboot the system will crash at: 'Uncompressing Linux... Ok'. I have tried compiling the 2.2.12 kernel on 3 different machines with 2 different distributions (RedHat 6.0 and Slackware 3.2.0) and for different target processors and kernel options but nothing seems to work. I've even tried running off a boot disk incase it was LILO but to no avail. This has really got me stumped. Has anyone else figured out the cause/solution to this?"
This discussion has been archived. No new comments can be posted.

2.2.1x Kernel Building Problems

Comments Filter:
  • by davie ( 191 ) on Thursday October 14, 1999 @05:06AM (#1614026) Journal

    Your boot image may be too large. This is why we now have the option to build a (smaller) bzip-compressed image, instead of a gzip-compressed image. At the end of the final make stage (make boot, make Zimage, etc.) the last few lines of output should tell you the size of the image, e.g.:

    Root device is (3, 1)
    Boot sector 512 bytes.
    Setup is 3436 bytes.
    System is 515 kB

    I believe the max is 1024kB, give or take a few, since the image has to fit in one MB (correct me if I'm wrong). At any rate, if your image is close to 1024kB, try either making a bzip-compressed image, with "make bZimage," or make more of your drivers modular.

    If that doesn't fix the problem, post your "make the kernel" command and the last few lines of output.

  • > Your boot image may be too large. This is why we > now have the option to build a (smaller) > bzip-compressed image, instead of a > gzip-compressed image. make bzImage doesn't make a bzipped kernel image. the 'b' stands for 'big'. from Documentation/kbuild/commands.txt in the 2.2 source tree:
    • Note: the difference between 'zImage' files and 'bzImage' files is that 'bzImage' uses a different layout and a different loading algorithm, and thus has a larger capacity. Both files use gzip compression. The 'bz' in 'bzImage' stands for 'big zImage', not for 'bzip'!
    (I used to think it meant bzip as well, until I r'd tfm.)
  • Thanks for the correction. I was just grepping through the docs looking for more on this issue; I could swear I read something there that explained the whole problem of large images and what bzImage does to solve it, but I haven't found it yet. Maybe it was on the kernel list?

  • If I may correct myself, it's "make bzImage," not "make bZimage."

    Still suffering from early-morning caffeine deficiency syndrome.

  • by Matts ( 1628 )
    Reading the kernel archives it looks like there may be problems with some versions of GCC. Check out the kernel mailing list synopsis (url anyone?) for further details. Also patch to Alan Cox's latest pre kernel.

    perl -e 'print scalar reverse q(\)-: ,hacker Perl another Just)'
  • I had a similar problem because I had deselected a few things in the kernel config like "PCI quirks" and "CMD640 fix", "RZ1000 bugfix" etc. If you took those out thinking that your bios is fine, put them back in a retest.
    Joseph Elwell.
  • by davie ( 191 )

    IIRC, the problem when compiling with the latest gccs shows up as random lockups, not during the boot phase. FWIW, I've never had a problem with a kernel built with the latest gcc, maybe I'm just lucky.

  • In upgrading my 2.2.1x kernel I noticed that the order in which the task is done is important. Make sure that the order in which you configure and compile is *exactly* the same. Perhaps a stupid thing to mention, but I'd been caught out on this more than once (OK, so maybe I'm an idiot!).


  • I've had no problem compiling Linux 2.2.12, and have even got it to compile with the reiserfs, pps, international, acs and freeswan patches, all shovelled in.

    However, I would advise checking the following:

    • Your version of GCC. I'm using PGCC 2.95.1, and that works just fine. Vanilla 2.95 seems to have some bugs, and snapshots of gcc/egcs might do almost anything. (Though if they can make breakfast and take the dog for a walk, the programmers'll be on to a winner.)
    • Your libc. I wouldn't want to try running 2.2.12 under libc5.
    • Compiler flags. Try bumping up/down the level of optimization, in case an optimizer bug is mangling the compilation.
    • Compile with bzimage, rather than zimage, and see if that works better for you.
    • Put -EVERYTHING- you don't need into modules, in case there's some kind of clash. This'll help identify the problem, as well as give you a temporary fix.
    • Check that /usr/include/linux and /usr/include/asm point to the kernel source tree and not their own local copy. I've run into that with some distros.
    • Try compiling 2.3.21, and see if that works any better. It could be a driver bug, which is version-specific.

    Hope this helps.

  • I'm just like the guy who started this thing:
    "I've been a moderately skilled Linux user for several years now but my problem solving skills on this one have got me stumped. I have compiled many kernels before ..."

    ... except my problem is different. kernel builds find, modules build fine, modules install fine, kernel starts out booting just fine... except at the end it hangs, I think when it tries to load modules. When I do a "depmod -a 2.2.12-20" for the new kernel version, I get tons of "unresolved symbol(s)" errors messages. I suspect that is the problem

    In searching for help I've seen suggestions like "clean out your old modules" and in RedHat's instructions it says stuff like "rm System.map ; ln -s System.map-2.2.12 System.map" but I haven't tried that because I think I should be able to have old and new on there at once... what if new doesn't work (it doesn't!). I'm glad I can reboot old and don't want to lose that.

    Rebuilding the kernel used to be easy but I have not got the hang of the modular kernels. Sometimes I rebuild the sucker and then just put the once eensy little .o that I want down into lib/modules and that has worked well. Can anybody point me to what newish facts about kernel modules that I'm missing?

  • "I think I should be able to have old and new on there at once... "

    Well, if you should be able to then make it so.
    Well, if you don't want to make kernel changes which allow such things then try some things in lilo.conf.

    If the "map" option can be specified for several image entries then you could have separate maps for various kernels (test it with links to the "old" map entry first and last, with the "new" kernel and the "new" map entry in the middle, so the new will only happen if multiple ones are recognized).

    Or you could have several root partitions, with different /boot directories. Or put the new kernel root on a floppy...

  • In 2.2, there's an option to put console on the serial port. If that's the case, it wont print out the kernel messages to your monitor, but to your serial port. Check to see if that's what's happening. I'll bet it is.

    If not, well, good luck :)

    - hal9k
  • Funny, I seem to be running a 2.2.12 kernel just fine on my slack4 box. I don't think your libc has anything to do with whether your kernel will boot or not, considering that libc will not be around when you do boot.
  • See Kernel Traffic #36 [linuxcare.com] for a start; a bit later in the thread referenced there Alan Cox said that he'll be looking to solve the problems with more recent version of GCC in 2.2.14 or 2.2.15, for now he advises compiling production kernels with GCC 2.7.2.3.

    Of course, RH6 has already switched to later versions, and doesn't include or make available GCC 2.7 anymore. I haven't yet done it but it seems to me that it shouldn't be too hard to install an older version just for kernels. That step prolly won't be needed for all that long, anyway. Anybody with experiance want to post some tips on the process?

    As I understand it the main trouble with newer GCC versions is that certain parts of the kernel rely on bugs or at least strangeness in the older versions. My current system is a well patched 2.2.9 compiled with egcs 2.91 and I haven't seen any problems, but for my important servers I don't want the possibility of random lockups if I can avoid it.
  • It seems that when using older .config files with newer kernels, certain options you would expect to default to 'Yes' dont.

    I'm talking inparticular to the 'Virtual Console' option. It seems that when using .config files from older kernels (2.0.36 systems in my case), even after running make config and adding extra options, it didn't turn on the Virtual Console option.

    So my computer booted away silently in the background (fscking in this case was misinterpretted by me as a crash). I didn't discover it until I deleted my .config files and let it build the defaults up from scratch.

    'Virtual Console' to me didn't suggest a console on the local terminal. I assumed it meant a console on a serial port and therefore I skipped it. Maybe a warning is needed in the kernel config?
  • The following worked for me when I first had symbol problems (RedHat and Mandrake):

    Using 2.2.12 as an example:

    If you are using the distro supplied source, edit the Makefile and make sure that the version numbers match the kernel release. Mandrake eg put MDx as the extra version number (or similar). This can cause you confusion - remove it so:

    VERSION = 2

    PATCHLEVEL = 2

    SUBLEVEL = 12

    EXTRA VERSION =

    #make menuconfig

    etc etc virtually everything as a module

    #make dep

    #make clean

    #make bzImage

    #make modules

    (now mv /lib/modules/2.2.12

    /lib/modules/2.2.12-old, do this whilst mods compiling)

    #make modules_install

    #cp /boot/vmlinuz vmlinuz-old

    #cp /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinuz

    #cp /usr/src/linux/System.map /boot

    now update /etc/lilo.conf and run /sbin/lilo

    Make sure that /boot/vmlinuz-old has an option just in case, to get you in if something horrible happens

    After a reboot depmod should be run for you. uname -a should show you 2.2.12 as the kernel version, the modules should have installed as /lib/modules/2.2.12 and everything should be fine. RH and Mandy both have Linuxconf and various tools for managing the kernels but frankly I don't trust them and besides I don't like having fancy distro specific stuff in my kernels.

    Also if you patch your own or download new ones they will work with the above recipe.

  • The best solution to this problem is probably to use 'make oldconfig' to ask the kernel to 'use my old options, but tell me about anything new so I can decide'.

    As for a warning about virtual consoles, well, in my opinion the help should be good enough.
  • thanks a lot for taking the time, and a learned a bit, but it didn't fix the problem.

    I had to adapt some of what you wrote.

    • I got rid of the EXTRA VERSION as you suggested... rebuilt the works
    • I've got a 2.2.5 kernel (RH60) that works and I'm trying to upgrade to 2.2.12, so I presume that both can co-reside in /lib so I don't need to move anything out of the way... but I did anyway. same with the kernel file itself
    • copied new System.map to /boot
    • screwed with all of the symbolic links that Redhat puts in /boot
    • liloed

    running depmod -a still prints a bezillion unresolveds, and rebooting freezes at the spot where it would ordinarily start to load modules

  • What are the unresolved symbols?

    There are some modules that depend upon other modules being available, although the configuration process does not check - a common one being the bttv TV card driver, which also requires sound drivers enabled.

    More infomation will allow others to help you better.

  • I am right now testing a new kernel (2.2.12, upgrade from 2.2.5), and I just used make bzImage on the recommendation of a coworker. He was having similar problems using make zimage, and make bzImage worked for him. I would give that a try.

    Also, rather than compiling everything you are unsure of as modules, take the time to really check all your hardware and compile only exactly what you need into your kernel. This new kernel is 400K or so, with no modules (I don't have a network card but I do have a sound card and SCSI drives).

    darren

  • don't forget to modify your con.modules so that is points to the correct modules.

  • I had exactly this problem - "Uncompressing kernel....ok, done" and then nothing. In my case, it was a combonation of having a serial console configured and not getting the boot messages, and then also booting from a SCSI disk but not having both scsi adapter supported and 'scsi diskk support' compiled in.

  • thanks for tyring to help.

    here's the first 250 lines of 4000+ lines
    of unresolveds. my sense is that it is something
    "systemic", i.e. after the build is completed
    cleanly, depmod is not finding the perfectly
    good symbols... but what do I know:

    /lib/modules/2.2.12/fs/nls_koi8-r.o: unresolved symbol(s)
    register_nls
    unregister_nls
    /lib/modules/2.2.12/fs/nls_iso8859-15.o: unresolved symbol(s)
    register_nls
    unregister_nls
    /lib/modules/2.2.12/fs/nls_iso8859-14.o: unresolved symbol(s)
    register_nls
    unregister_nls
    /lib/modules/2.2.12/fs/nls_iso8859-9.o: unresolved symbol(s)
    register_nls
    unregister_nls
    /lib/modules/2.2.12/fs/nls_iso8859-8.o: unresolved symbol(s)
    register_nls
    unregister_nls
    /lib/modules/2.2.12/fs/nls_iso8859-7.o: unresolved symbol(s)
    register_nls
    unregister_nls
    /lib/modules/2.2.12/fs/nls_iso8859-6.o: unresolved symbol(s)
    register_nls
    unregister_nls
    /lib/modules/2.2.12/fs/nls_iso8859-5.o: unresolved symbol(s)
    register_nls
    unregister_nls
    /lib/modules/2.2.12/fs/nls_iso8859-4.o: unresolved symbol(s)
    register_nls
    unregister_nls
    /lib/modules/2.2.12/fs/nls_iso8859-3.o: unresolved symbol(s)
    register_nls
    unregister_nls
    /lib/modules/2.2.12/fs/nls_iso8859-2.o: unresolved symbol(s)
    register_nls
    unregister_nls
    /lib/modules/2.2.12/fs/nls_iso8859-1.o: unresolved symbol(s)
    register_nls
    unregister_nls
    /lib/modules/2.2.12/fs/nls_cp874.o: unresolved symbol(s)
    register_nls
    unregister_nls
    /lib/modules/2.2.12/fs/nls_cp869.o: unresolved symbol(s)
    register_nls
    unregister_nls
    /lib/modules/2.2.12/fs/nls_cp866.o: unresolved symbol(s)
    register_nls
    unregister_nls
    /lib/modules/2.2.12/fs/nls_cp865.o: unresolved symbol(s)
    register_nls
    unregister_nls
    /lib/modules/2.2.12/fs/nls_cp864.o: unresolved symbol(s)
    register_nls
    unregister_nls
    /lib/modules/2.2.12/fs/nls_cp863.o: unresolved symbol(s)
    register_nls
    unregister_nls
    /lib/modules/2.2.12/fs/nls_cp862.o: unresolved symbol(s)
    register_nls
    unregister_nls
    /lib/modules/2.2.12/fs/nls_cp861.o: unresolved symbol(s)
    register_nls
    unregister_nls
    /lib/modules/2.2.12/fs/nls_cp860.o: unresolved symbol(s)
    register_nls
    unregister_nls
    /lib/modules/2.2.12/fs/nls_cp857.o: unresolved symbol(s)
    register_nls
    unregister_nls
    /lib/modules/2.2.12/fs/nls_cp855.o: unresolved symbol(s)
    register_nls
    unregister_nls
    /lib/modules/2.2.12/fs/nls_cp852.o: unresolved symbol(s)
    register_nls
    unregister_nls
    /lib/modules/2.2.12/fs/nls_cp850.o: unresolved symbol(s)
    register_nls
    unregister_nls
    /lib/modules/2.2.12/fs/nls_cp775.o: unresolved symbol(s)
    register_nls
    unregister_nls
    /lib/modules/2.2.12/fs/nls_cp737.o: unresolved symbol(s)
    register_nls
    unregister_nls
    /lib/modules/2.2.12/fs/nls_cp437.o: unresolved symbol(s)
    register_nls
    unregister_nls
    /lib/modules/2.2.12/fs/binfmt_misc.o: unresolved symbol(s)
    dput
    prepare_binprm
    kmalloc
    _ctype
    create_proc_entry
    open_namei
    copy_strings
    register_binfmt
    kfree
    remove_proc_entry
    search_binary_handler
    sprintf
    unregister_binfmt
    remove_arg_zero
    printk
    /lib/modules/2.2.12/fs/binfmt_aout.o: unresolved symbol(s)
    send_sig
    filp_open
    lookup_exec_domain
    dump_thread
    read_exec
    setup_arg_pages
    open_dentry
    sys_close
    compute_creds
    filp_close
    register_binfmt
    do_mmap
    fput
    jiffies
    flush_old_exec
    unregister_binfmt
    printk
    /lib/modules/2.2.12/fs/autofs.o: unresolved symbol(s)
    lookup_dentry
    dput
    __wake_up
    kmalloc
    unregister_filesystem
    iput
    is_root_busy
    d_rehash
    iget
    register_filesystem
    d_alloc_root
    cap_bset
    interruptible_sleep_on
    kfree
    __wait_on_super
    fput
    xtime
    simple_strtoul
    jiffies
    d_instantiate
    strtok
    printk
    __generic_copy_to_user
    /lib/modules/2.2.12/fs/romfs.o: unresolved symbol(s)
    lookup_dentry
    dput
    __wake_up
    kmalloc
    kdevname
    init_fifo
    unregister_filesystem
    bread
    generic_file_mmap
    d_rehash
    iget
    generic_file_read
    register_filesystem
    free_pages
    d_alloc_root
    kfree
    __wait_on_super
    chrdev_inode_operations
    set_blocksize
    mem_map
    blkdev_inode_operations
    __brelse
    d_instantiate
    printk
    __generic_copy_to_user
    /lib/modules/2.2.12/fs/ufs.o: unresolved symbol(s)
    lookup_dentry
    securebits
    send_sig
    dput
    d_delete
    __wake_up
    in_group_p
    __generic_copy_from_user
    schedule
    update_atime
    vsprintf
    clear_inode
    kmalloc
    kdevname
    __wait_on_buffer
    mark_buffer_uptodate
    init_fifo
    __mark_inode_dirty
    file_fsync
    unregister_filesystem
    iput
    bread
    getblk
    update_vm_cache
    generic_file_mmap
    d_rehash
    panic
    ll_rw_block
    iget
    generic_file_read
    register_filesystem
    d_alloc_root
    cap_bset
    get_hash_table
    event
    refile_buffer
    kfree
    __wait_on_super
    __bforget
    chrdev_inode_operations
    get_empty_inode
    set_blocksize
    xtime
    blkdev_inode_operations
    __brelse
    d_instantiate
    insert_inode_hash
    strtok
    printk
    set_writetime
    __generic_copy_to_user
    generic_readpage
    /lib/modules/2.2.12/fs/ntfs.o: unresolved symbol(s)
    __wake_up
    load_nls
    vsprintf
    kmalloc
    __wait_on_buffer
    load_nls_default
    unregister_filesystem
    iput
    bread
    generic_file_mmap
    d_rehash
    iget
    register_filesystem
    unload_nls
    d_alloc_root
    refile_buffer
    kfree
    __wait_on_super
    set_blocksize
    xtime
    simple_strtoul
    __brelse
    d_instantiate
    strtok
    printk
    set_writetime
    __generic_copy_to_user
    generic_readpage

We warn the reader in advance that the proof presented here depends on a clever but highly unmotivated trick. -- Howard Anton, "Elementary Linear Algebra"

Working...