Welcome to the Linux Foundation Forum!

Custom Kernel compilation to be at custom volume

Hi.

I wanna compile a kernel myself, but haven't proceeded yet.

I've just used menuconfig to save the default ".config" file :-D . As I know, I must now run:

make
make module_install
make install


(The Kernel is 3.1.8, obviously from kernel.org)

Here are my questions:

1. Is the order above correct?

2. As I know, just as I run the above commands, my compilation will replace the kernel of this Ubuntu, (since it'll go to directories like /boot /etc, which are my CURRENT UBUNTU, at the time of installation), but what I want and have meant to do, is to install it to my /dev/sda5. How may I do this?

3. And then an update-grub from here in Ubuntu should add the kernel to boot list, yet keeping this Ubuntu's GRUB/MBR config, right?

thanks so much for you helps.

Comments

  • marc
    marc Posts: 647
    1 - yes (although I think the module_install is not neeeded anymore,it's kept for historical reason)
    2 - it won't replace it as ubuntu most probably will add some sort of id string to the kernel and directories (as an example: 3.1.8-1-ARCH in Archlinux).

    What do you mean by installing to "/dev/sda5"? If you want it to install somewhere different you'll have to modify the Makefile the sources provide (I do not know if it accepts destionation parameters, haven't checked ;) )
    3- I rather add everything manually, specially if you do something out of the normal

    Regards
  • ActiveX
    ActiveX Posts: 59
    Well, documentations confused me a little bit.

    I have some new questions now: So you mean that even if I omit "make module_install" still the .config file applies it, right? I mean loadable modules are activated by default, as I left it to itself, so it won't actually need make module_install, and they WILL be installed, right?

    About the sda thing: I have created 4 partitions on my HDD for OS, of which 2 are Ubuntu and Kubuntu now, and the 2 others I've left, 1 for messing with and shuffling and twiddling my custom kernel compilation(s), and the otherone just to keep one stable operational kernel that I'll compile myself.

    Now:
    sda1 -> Ubuntu,
    sda2 -> Kubuntu,
    sda3 -> Stable, working Kernel,
    sda4 -> (extended),
    sda5 -> messy kernel,

    What I'm asking you to tell me, is the most straight forward procedure to put my kernel in /dev/sda5, just how in GUI of installation I chose my Kubuntu to go to /dev/sda2.
    I haven't yet tried modifying the makefile, but I wonder if there was some way, built into the makefile itself (or something like that) that makes the choice of installation directory more automated.

    Thanks :)
  • marc
    marc Posts: 647
    What you want is a separate /boot partition (maybe even a /lib one as well)

    Regards
  • ActiveX
    ActiveX Posts: 59
    edited January 2012
    Yes, that's exactly what I want. OK, now, assume I want a kernel, with the traits similar to the one of Ubuntu, I mean all main Kernel directories put there under /, including /boot and /lib. What part in the above process I wanna do I'm omitting, or I'm doing wrong? Since it'll all be done when I know this (what am I NOT doing and what am I doing wrong).

    Still thanks for your helps Marc.

Categories

Upcoming Training