Replacing kernel module (unsupported ethernet card)

Home Page Forums Network Management ZeroShell Replacing kernel module (unsupported ethernet card)

This topic contains 7 replies, has 0 voices, and was last updated by  aviegas 5 years ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #42453

    aviegas
    Member

    I would like to share my experience rebuilding the ISO and CF/USB/HD Zeroshell images in order to add support for a new ethernet card.

    Background: I’m building a router using a SuperMicro X7SPA-HF motherboard. This is a tiny micro-ITX mobo, with an Intel D510 Atom processor (1.6GHz, dual core with Hyperthreading). It also support IPMI 2.0 and iKVM, so one gets full remote console over IP out of the box. It comes with 2 Intel Gigabit adapters, 8 USB ports, 6 SATA and much more. The issue with ZeroShell is that the Intel Gigabit chipset is not supported by the version of the e1000e module in the current ZeroShell kernel.

    Solution: After some investigation and forum browsing, the simplest way to tackle the problem is to “replace” the kernel module with one compiled with the latest e1000e sources from Intel.

    Acknowledgments: Thanks for Fulvio for the great ZeroShell distro, and to all other that posted their kernel / image rebuilding experiences in this forum.

    These as the steps I’ve used to replace the module:

    Requirements:
    . ZS kernel source
    . Another Linux system, setup for kernel development/build, in 32bit mode and running kernel 2.6.x, referred as the “aux” system here. It can even be a live system running under vmware.
    . The updated source for the device driver module (in my case e1000e from Intel).
    . The CF/USB/HD ZS image on a USB stick

    Step 1) Building the new module:

    1) Login to the aux linux and create a working directory.
    2) Expand the kernel sources
    3) Find the location of the module you need to replaced the source, erase the code there and add the new module source.
    4) From a running ZeroShell, extract the current Kernel configuration by running “zcat /proc/config.gz >.config”. Since I had no ethernet, I have to place it in the /Database directory and use the USB stick to move it from the ZS system to the aux linux (/Directory is the 3rd parition on the USB stick).
    5) On the aux, go to the root of the kernel source, do a “make mrproper” to clean things up copy the kenel config (.config) to this directory. Now simply run “make”. Sit down and relax as it will take a while.

    2) Step 2: recreating the ISO image

    1) Plug the USB stick in the aux system and if it automounts any filesystem, unmount it.
    2) Copy all 3 partitions to the hard drive using dd. Assuming the USB stick is mounted at /dev/sdb
    dd if=/dev/sdb1 of=boot.img
    dd if=/dev/sdb2 of=iso.img
    dd if=/dev/sdb3 of=db.img

    These 3 files will be used to remake the USB stick later
    3) mount the iso.img: mount -o loop iso.img /mnt
    4) Copy all files from it to a temp directory with “cp -pr /mnt “.
    5) replace the required module in the newly copied modules directory (look inside the newly created directory).
    6) now, rebuild the modules dependencies. First you need to “mimic” the correct location for the modules, so the the 2.6.25.20 directory in modules must be located inside a /lib/modules/2.6.25.20. Create this temporary location (/lib/modules) and “mv” the 2.6.25.20 directory there (from the modules directory in the iso copy).
    Then run depmod with the -b flag: “depmod -b
    “. Move the 2.6.25.20 directory back to it’s original location in the copy.
    7) Now rebuild the ISO image file with mkisofs (or genisoimage)

    mkisofs -o newiso.img -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -r -l

    8) Voila! The new ISO image is ok and should work, if you are using a CD to book ZS.

    Note the only problem I have here is that I could not get it to shrink back to the same/approximate size.

    Step 3) Place it back on the stick
    1) The size of the newiso.img is too big to fit in the same place of the original in the stick. So let’s make some room. You will need a 2G or bigger USB Stick for this.

    Note: if someone knows how to make the newiso.img smaller, please let me know what am I missing here. I know it has to do with the file slack that is not being removed from the files from the HD to the CD image.

    2) using fdisk on the aux system, create 3 primary partitions on the USB stick with the following sizes: 14MB, 400MB, 600MB. This will give you plenty of space to toy around without risking overwriting the partitions.

    3) Now dd pack the 3 images:

    dd if=boot.img of=/dev/sdb1
    dd if=newiso.img of=/dev/sdb2
    dd if=db.imb of=/dev/sdb3

    This new stick should boot without a problem. The USB stick can be replaced with a CF card or a HD here.

    #50479

    jasonh100
    Member

    Hey, I am trying to put zeroshell on the same motherboard. Can you send me the files that you created?

    #50480

    jasonh100
    Member

    I have a linux system that meets the requirements of the “aux” system. compiling right now. I have my fingers crossed. Thanks for this guide!

    #50481

    jasonh100
    Member

    Ok, I gave this a shot and got pretty close. When booting ZS it says:

    Looking for PCI hardware:

    loading …. e1000e

    Then later on in the boot when it gets to the parts where it initializes netfileter, qos, and anything else related to network it displays some messages that reference dependencies. The path to the dependency has 2.6.9-1.667 in it which is the kernel version on the system that I compiled everything on. So I’m guessing I messed up on the dependency mod part.

    Can anyone provide any tips?

    Or if you see this aviegas, can you send me the newiso.img file that you created?

    Thanks,
    Jason

    #50482

    jasonh100
    Member

    I copied the 2.6.25.20 folder to 2.6.9-1.667 and now everything is working. So I’m good for now. Thanks again for this guide.

    #50483

    eric.f
    Member

    hello

    i want to put zeroshell on the same motherboard . Can you share the iso that you created?

    thank you.

    #50484

    stepik
    Member

    its good to specify version of kernel u wanna run depmod for, like:
    depmod -b 2.6.25.20
    had to read docu of depmod:))

    and while creating image i get an error with something like this:
    (…)rr_moved’ have the same Rock Ridge name ‘rr_moved’.

    Then, remove this directory:
    rr_moved from your working directory (with copy of iso.img)

    #50485

    My suggestion would be to use the “-hide-rr-moved” option of mkisofs instead of removing

    rr_moved.

    And the best option to use with depmod is “–dry-run” or “-n” . This sends the resulting

    modules.dep and the various map files to standard output rather than writing them into

    the module directory(FROM MAN PAGE)/. From there you can redirect the output to a file

    which you can later on rename to modules.dep in the target modules dir.

    Boot up with the required kernel (let it produce the module dependency errors while

    booting) on the target machine.

    Once you get to the shell run “depmod -n > /lib/modules/$(uname -r)/modules.dep”.

    Regards.

    #50486

    jultra
    Member

    Hi,

    I have a supermicro motherboard that has 2 onboard lans that have the same issue. Where can I get ZS kernel source so I can follow your instruction here.

    thanks!

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.