Dummy needs help for kernel rebuilding…

Home Page Forums Network Management ZeroShell Dummy needs help for kernel rebuilding…

This topic contains 2 replies, has 0 voices, and was last updated by  Mastus 9 years ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #42241

    Mastus
    Member

    Hi,

    I would request some nudge in the right direction of how to rebuild the kernel on 1.0beta12.

    I downloaded the CD-image and the appropriate precompiled kernel source (2.6.25.20).

    So far, my procedure has been the following. All is done on a separate machine, not the ZS machine:
    1) Untar the kernel sources
    2) make menuconfig -> load alternate configuration file -> .config -> make the needed changes -> save alternate configuration file
    3) make (no errors …)
    4) mount the cd iso-image and copy all contents to /someDirectory
    5) replace the /isolinux/vmlinuz with the builded bzImage file
    6) replace the contents of /modules/2.6.25.20/kernel/ directory and all subdirectories with the compiled modules
    7) replace the loop.ko in the initrd.gz with the freshly built one
    8) roll it on a iso file using:

     sudo mkisofs -o output.iso -b isolinux/isolinux.bin -c isolinux/isolinux.cat -no-emul-boot -boot-load-size 4 -boot-info-table -l -R -r /someDirectory 

    9) Burn or use qemu

    And the result always is kernel panic regarding /bin/loop.ko invalid module format and “maybe the kernel does not know about the loop device.”

    I am a total newbie regarding kernel bulding, so I must have done something very very wrong. Please advice, how you have managed to rebuild the kernel and rolled the result in a bootable iso file…

    #49764

    Mastus
    Member

    Some progress…

    Seems like i have copied some wrong files…
    After make i did

     make modules_install INSTALL_MOD_PATH=/someDir  

    Then i copied the files from /someDir to the /isoRoot/modules/…

    Seems like the trouble is now on the initrd file… upon boot i get the error message “kernel panic – not syncing: VFS unable to mount root fs on unknown block (5,8)”

    I have replaced the loop.ko file in initrd, but what else should I modify there (except the sata and usb modules)? Should I use the GCC from the zeroshell page or what am I missing?

    Please advice.

    #49765

    jfreivald
    Member

    I am new to zeroshell, but not to Linux or kernel compiling. Therefore I can only offer generic advice, but I noticed that you have not received a reply, so, here it goes.

    The first thing you need to ask is: what is your hardware that you are compiling the kernel for?

    If it does not match the unit you are compiling from, then you will need a cross-compiler. Also, not so much with the kernel, but if you are not using the same version of linux to compile with, then you will most likely need a tool-kit and the appropriate libraries to match the version of zeroshell you are using.

    Very often, new users will find it easier to recompile the kernel and other software directly on the target system. This can take *forever* if it is an embedded system, but will almost always give you the correct software, linked to the correct libraries. In the kernel’s case, it can be *much* easier than setting up the cross compiler for the novice.

    If you are certain that you are compiling for the correct architecture, then check to ensure that you are starting from the correct configuration file. Copy the original configuration file (usually aptly named in the distributions kernel source package) to .config and then do your make menuconfig. Check to make sure that all your target hardware is supported. It looks to me from your error messages that it is not finding your root file system – which is either a problem with the bootloader/kernel boot parameters, or with your inital ramdisk, or with the kernel itself not having the correct devices loaded. If they are not compiled monolithicly into the kernel, then you have to be sure they are loaded into the initrd *and* the root file system, and that the initrd loads them properly, or else it will never find the root file system.

    I realize that this is pretty generic, and may not be much help, but I hate seeing posts with no reply.

    #49766

    Mastus
    Member

    @jfreivald wrote:

    I am new to zeroshell, but not to Linux or kernel compiling. Therefore I can only offer generic advice, but I noticed that you have not received a reply, so, here it goes.

    The first thing you need to ask is: what is your hardware that you are compiling the kernel for?

    If it does not match the unit you are compiling from, then you will need a cross-compiler. Also, not so much with the kernel, but if you are not using the same version of linux to compile with, then you will most likely need a tool-kit and the appropriate libraries to match the version of zeroshell you are using.

    Very often, new users will find it easier to recompile the kernel and other software directly on the target system. This can take *forever* if it is an embedded system, but will almost always give you the correct software, linked to the correct libraries. In the kernel’s case, it can be *much* easier than setting up the cross compiler for the novice.

    If you are certain that you are compiling for the correct architecture, then check to ensure that you are starting from the correct configuration file. Copy the original configuration file (usually aptly named in the distributions kernel source package) to .config and then do your make menuconfig. Check to make sure that all your target hardware is supported. It looks to me from your error messages that it is not finding your root file system – which is either a problem with the bootloader/kernel boot parameters, or with your inital ramdisk, or with the kernel itself not having the correct devices loaded. If they are not compiled monolithicly into the kernel, then you have to be sure they are loaded into the initrd *and* the root file system, and that the initrd loads them properly, or else it will never find the root file system.

    I realize that this is pretty generic, and may not be much help, but I hate seeing posts with no reply.

    Thank you for your reply.

    Earlier problem was simple – just forgot to issue the rdev command so kernel tried to boot from wrong partition.

    Recompiling the kernel wasn’t much of an use though… The problem lies on libc/gcc utilities. My findings are reported here.http://zeroshell.net/eng/forum/viewtopic.php?t=1997

    I dived some dumpsters and luckily I found a working PII MMX cpu and mobo. As it’s i686 – zeroshell runs fine with it.

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

You must be logged in to reply to this topic.