This is the old SliTaz forum - Please use the main forum.slitaz.org

[SOLVED] Compiling Kernnel with initramfs enabled causes error
  • PaoloPaolo April 2010
    Hello,
    I was trying to build a custom kernel.
    I installed the dev tools and the kernel sources with the package manager as described in the Slitaz handbook.

    Then in the General Config I enable the Initial RAM filesystem and RAM disk (initramfs/initrd) support.

    Then I try to build the kernel and givez the following error:

    $> make bzImage

    scripts/kconfig/conf -s arch/x86/Kconfig
    CHK include/linux/version.h
    CHK include/linux/utsrelease.h
    SYMLINK include/asm -> include/asm-x86
    CALL scripts/checksyscalls.sh
    CHK include/linux/compile.h
    CC init/initramfs.o
    init/initramfs.c: In function ‘unpack_to_rootfs’:
    init/initramfs.c:491: error: ‘compress_name’ undeclared (first use in this function)
    init/initramfs.c:491: error: (Each undeclared identifier is reported only once
    init/initramfs.c:491: error: for each function it appears in.)
    make[1]: *** [init/initramfs.o] Error 1
    make: *** [init] Error 2

    If in the setup I disable the initramdisk the kernel compile successfully.

    What's wrong?
    Do I have to enable some other features to successfully build the kernel with Initrd?

    Is the source buggy???

    Any suggestions are welcome!

    Thanks in advance! :)
  • Hi,
    I have no other solution than the one given by Ernia (Ernia is amazing ) in this post:
    http://forum.slitaz.org/index.php/discussion/853/initramfs.c-is-buggy-in-linux-source/#Item_12

    @slitaz dev. guy: please check what is wrong in the linux sources you are supplying.

    Cheers.
    Stephane
  • PaoloPaolo April 2010
    Thanks Stephane!

    From the link to the post you gave to me I see that this problems appears in the same way.

    Unfortunately I need the initramfs enabled in my kernel.

    Yes, it would be nice if the slitaz devs guys could check and submit a solution.

    Paolo.
  • erniaernia April 2010
    try this:
    open /usr/src/linux-2.6.30.6-slitaz/init/initramfs.c with an editor and add, after row 462 (which contains "decompress_fn decompress;"), a brand new row with this content:
    const char *compress_name;
    it seems to work, but i have no time to compile the whole kernel to test.
  • erniaernia April 2010
    solution was so trivial that i'm almost shocked.
    intramfs and some other files were patched by developers.
    when you install linux-source these patches are applied using the patch command in some script.
    guess what happens if you have busybox's patch instead of the real patch?
    who needs crosswords anymore, i have slitaz now ...
    solution:
    rm -r /usr/src/linux-2.6.30.6-slitaz && tazpkg get-install patch && tazpkg get-install linux-source --forced

    ignore the wget error, it's because you already have /usr/src/linux-2.6.30.6.tar.bz2
    now you can succesfully build your own kernel
    @Paolo
    may you put SOLVED in the topic title?
  • Thanks Ernia. Once again you're very helpful.

    If I understand you correctly, before trying to compile and according to http://community.slitaz.org/fr/node/14 (which should be updated), one should:

    # tazpkg get-install slitaz-toolchain
    # tazpkg get-install ncurses-dev
    # tazpkg get-install perl
    # tazpkg get-install linux-source
    # tazpkg get-install patch //<= this is the new step to add in wiki<br />


    Please confirm that I understood correctly.
    Cheers
    Stephane
  • erniaernia April 2010
    @Stephane
    linux-source now has all necessary packages as dependencies, it just lacks patch.
    I'm not sure that patch is really needed, it could be that the patching script calls some patch options that busybox does not recognize, i've opened a bug in slitaz labs, let's see what happens.
    until this is fixed you can compile the whole kernel installing patch before to install linux-source, so the patching script can do correctly its job. if you have linux-source already installed you just remove /usr/src/linux-2.6.30.6-slitaz , install patch and reinstall --forced linux-source.
    beware, patching happens when you install linux-source so patch must be already installed when you install linux-source.
    may you put SOLVED in the topic title you previously opened, post a last message in it with a link to this topic and close it? You should be able to close it in the options box in the top right corner.
    if jozee allow us we could update this guide until the bug is fixed:
    http://doc.slitaz.org/en:guides:kernel
    Cheers
    Fabio
  • Thanks for the explanation. That makes more sense to me.

    As suggested I closed previous topic.

    :-)
    Stephane
  • PaoloPaolo April 2010
    Thank you Ernia!
    After applying your suggestions it worked perfectly!

    Great!!!!

    Paolo.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

SliTaz Social