Find the answer to your Linux question:
Page 1 of 16 1 2 3 4 5 11 ... LastLast
Results 1 to 10 of 154
One of my driver instructions tells me: ------------------------------------------------- 2. Build the 2.4.18 kernel with; CONFIG_EXPERIMENTAL=y CONFIG_MODULES=y CONFIG_KMOD=y CONFIG_NET_RADIO=y CONFIG_DEBUG_KERNEL=y CONFIG_DEBUG_BUGVERBOSE=y ------------------------------------------------- Just switched to Mandrake 9.1 from XP. Trying to ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2003
    Posts
    1

    Compiling the kernel.....


    One of my driver instructions tells me:

    -------------------------------------------------
    2. Build the 2.4.18 kernel with;
    CONFIG_EXPERIMENTAL=y
    CONFIG_MODULES=y
    CONFIG_KMOD=y
    CONFIG_NET_RADIO=y
    CONFIG_DEBUG_KERNEL=y
    CONFIG_DEBUG_BUGVERBOSE=y
    -------------------------------------------------

    Just switched to Mandrake 9.1 from XP. Trying to install one of the drivers for my wireless pci card. Can someone tell me step by step commands/directions to accomplishig these instructions.

  2. #2
    Linux Engineer
    Join Date
    Apr 2003
    Location
    Sweden
    Posts
    796
    It means that you have to compile you kernel with thoose options turned on, check under your /usr/src directory. Hopefully you have your kernelsource files located there. It they doesnt exist there you have to download the kernel from for example http://www.kernel.org.

    Then as root step to the /usr/src/<2.4.18 kernel directory>

    Then type make menuconfig if you running redhat, make xconfig if you are using mandrake. The other dialects i dont know. Choose the the support you want to have on your kernel, and save.

    If you want to base the support on the old kernel you can use make oldconfig.

    After this step you should have a .config file located in that directory. You can look at it to see if it looks good.

    NOTE!! If you are already running 2.4.18 change the name in Makefile so you dont overwrite you old kernel. Now build your new kernel with following commands

    make dep;make install;make modules;make modules_install

    If you are using redhat use following command to create a boot image and include your modules.

    mkinitrd -f /boot/initrd-<kernel version>.img /lib/<kernelname>

    Make new entries in /etc/lilo.conf with the new filenames and execute the lilo command.

    Done! Now try to reboot on the new kernel.

    For more info on building kernels, read on my homepage under the howto section on the adress below or on http://www.kernel.org. Its important that yo uknow what you are doing when to build a new kernel. So read before trying to do it. Good Luck..
    Regards

    Andutt

  3. #3
    Linux Engineer
    Join Date
    Nov 2002
    Location
    Queens, NY
    Posts
    1,319

    kernel newbie

    andutt,

    I'm a newbie with kernel compiling so please be patient with my questions. First, I've tried and succesfully installed kernels from debian via it's kernel-images. However, I'm still not satisfied with them hence, I'd like to try and build a kernel and configure for my needs. Another reason for doing this is to better understand this procedure for future purposes.
    Then type make menuconfig if you running redhat, make xconfig if you are using mandrake. The other dialects i dont know. Choose the the support you want to have on your kernel, and save.
    Can you describe what happens when you run 'menuconfig' or 'xconfig'? I once saw a guy doing something with kernel configuration by loading modules from a GUI menu. Is this what this is?
    If you want to base the support on the old kernel you can use make oldconfig.
    After this step you should have a .config file located in that directory. You can look at it to see if it looks good.
    How do I make oldconfig? I'm under the impression that I just need to modify the grub file.
    NOTE!! If you are already running 2.4.18 change the name in Makefile so you dont overwrite you old kernel. Now build your new kernel with following commands.
    As I'm planning to install kernel 2.4.20 and I'm currently running 2.4.18, I don't think I'll have to rename anything in the makefile once I get the source.
    mkinitrd -f /boot/initrd-<kernel version>.img /lib/<kernelname>
    Why is this necessary?
    The best things in life are free.

  4. #4
    Linux Engineer
    Join Date
    Apr 2003
    Location
    Sweden
    Posts
    796
    Ok, here comes a litte explanaition..

    You asked:
    Can you describe what happens when you run 'menuconfig' or 'xconfig'? I once saw a guy doing something with kernel configuration by loading modules from a GUI menu. Is this what this is?

    When you execute make manuconfig or make xconfig under you kernel source directory, a GUI will apear on the screen. You will be able to walk around with your arrow buttons an choose the support you need with the space button, for example which cpu-family support your kernel should have. You are not loading modules the the current kernel, only choosing which support the new kernel should have.

    You asked:
    How do I make oldconfig? I'm under the impression that I just need to modify the grub file.

    Make oldconfig will base the support of the new kernel as the "old" kernel that you are running, the good with this is if you havent the kernel source for your old kernel you can still base support on that anyhow. It will create a .config file that you can manipulate with vi or pico, and then enable the support that you needed.

    You asked:
    As I'm planning to install kernel 2.4.20 and I'm currently running 2.4.18, I don't think I'll have to rename anything in the makefile once I get the source.

    No then you dont need to do anything, but its good to always look att the header on Makefile just to make sure..

    Code:
    mkinitrd -f /boot/initrd-<kernel version>.img /lib/<kernelname>
    In redhat this will build an bootimage under /boot called initrd-<kernel version>.img that you later specify in /etc/lilo.conf so you can boot on your new kernel, it also includes you modules under /lib/<kernelname> if any modules are needed on boot time.

    I hope that solves your question

    Regards

    You can view on my howto on building a kernel on http://www.utterberg.com under the howtos section if you want.
    Regards

    Andutt

  5. #5
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Both make menuconfig and make xconfig will work on any distribution, since they're part of the standard kernel makefile. They sure work with all kernels I've got from kernel.org. To be more precise, make menuconfig is a terminal mode utility using ncurses, and you'll walk around with your arrow keys, enter submenus with enter and choosing features with Y (to include into the base kernel), M (to compile it as a module) and N (to exclude it). Do read the instructions at the top of the screen. Make xconfig, as the name implies, brings you an X config utility, using Tcl/Tk.

    Are you sure about the usage of oldconfig, andutt? As far as I've heard, you can copy an .config file from an old kernel source and make oldconfig to make it add all the options that have been added to the new version as "N". One thing is certain, at least: you don't need to edit the generated .config file with a text editor. That's what make menuconfig and make xconfig is for. They automatically load the .config file when they start.
    I don't really see how make oldconfig could extract the configuration from the current kernel without its sources?

    Are you sure that you need an initrd? I never use one, and my kernel runs just fine without it.

    I never use make install, since I don't really trust automated scripts with editing my LILO and GRUB configurations. This is how I do it:
    make dep && make bzImage && make modules && make modules_install
    That will generate arch/i386/boot/bzImage, which is the compressed kernel and its bootstrapper. Then I copy it to my boot dir and give it a more suitable name, like vmlinuz-2.4.20. Then I add it to my GRUB config manually. Also, that way, you don't need to do anything to your Makefile or so.

  6. #6
    Linux Engineer
    Join Date
    Nov 2002
    Location
    Queens, NY
    Posts
    1,319
    Make oldconfig will base the support of the new kernel as the "old" kernel that you are running, the good with this is if you havent the kernel source for your old kernel you can still base support on that anyhow. It will create a .config file that you can manipulate with vi or pico, and then enable the support that you needed.
    It looks like I was misunderstanding this whole concept regarding make oldconfig. So this is used to extract support from the old kernel to the new kernel.
    Do I actually type 'make oldconfig' on the console? Once I get the .config file, how can I use it to build the new kernel with it?
    The best things in life are free.

  7. #7
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Now, I haven't actually used it, but I do not think that that is what make oldconfig does. I can think of no non-bloated way of extracting that information from a running kernel. I think it reads the .config file from an old kernel source, and augments it with the new options that have been added between kernel versions. Like I said, though, I don't know, but I feel pretty sure.
    The .config file is the file that is used when compiling, so once you have it, you basically just make the target you want (that would be make bzImage and make modules for me). make menuconfig and make xconfig also read the .config file and generate a new one when they start and exit.

    If you want to read it, there is a Kernel-HOWTO on tldp.org.

  8. #8
    Linux Engineer
    Join Date
    Apr 2003
    Location
    Sweden
    Posts
    796
    Im just posting things that i´ve experiensed myself and things i know have worked for me..

    I´m running redhat 7.3 and on a standard installation and i had no kernelsource tree. After i had downloaded my kernel i extracted it under /usr/src. No .config file existed, but i anyway could perform the make oldconfig command to create and .config file that seemed based on my current system, i dont really know how.. but it worked for me.

    The make bzImage command doesnt seem to work under redhat!? When i build kernels under Mandrake i always use the make bzimage command. But on redhat i use

    Code:
    make -j3 dep;make -j3 install;make -j3 modules; make -j3 modules_install
    and then the mkinitrd command

    That will create the vmlinuz image under /boot for my new kernel, Its possible that you dont need the mkinitrd command if you dont need to preload modules on bootup time, but i always perform it on my produktion systems at work because we are using tapedrives and SAN solutions, but i have never done it on Mandrake.. but i always does it on Redhat installations.

    Mkinitrd command does:
    mkinitrd creates filesystem images which are suitable for
    use as Linux initial ramdisk (initrd) images. Such images
    are often used for preloading the block device modules
    (such as SCSI or RAID) which are needed to access the root
    filesystem. mkinitrd automatically loads all
    scsi_hostadapter entries in /etc/conf.modules, which makes
    it simple to build and use kernels using moduler SCSI
    devices. Any module options specified in /etc/conf.modules are
    passed to the modules as they are loaded by the initial
    ramdisk.
    I hope i dont have confused anyone... but it have worked for me.

    Regards

    Regards

    Andutt

  9. #9
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Why do you use initrds instead of just compiling the drivers directly into the kernel? Seems like unnecessary bloat to me.
    I assure you the bzImage target works perfectly on RedHat. I always compile my kernels that way. Sure, I most often get the source directly from kernel.org, but I've done it with RH's kernel trees as well, several times on several versions (not on 7.3, though).

    You don't really need to make oldconfig at all, though. Just make (menu|x|)config and configure all the options yourself. The kernel trees always come with a default .config. Beware that it's usually to use a P3 CPU by default, which you will want to change if you don't have a P3.

    Also, sorry not to mention this before, but you should always make clean after you have maked dep, to ensure that no relocatables for a strange arch linger around.

  10. #10
    Linux Engineer
    Join Date
    Apr 2003
    Location
    Sweden
    Posts
    796
    Hmmm Make bzImage dont work for me on my RH 7.3,8.0 dists so are you aure abourt that??.... Make oldconfig is much faster for then jumping around x,menuconfig, and you can copy chunk of lines so it can really be an option sometimes, at least i think so. Also i never use make clean and i have never bumped into trouble for that.
    Regards

    Andutt

Page 1 of 16 1 2 3 4 5 11 ... LastLast

Posting Permissions

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