3

I work for Nimbix and have access to some pretty powerful multicore systems, I intend to make a kernel compilation service.

The systems can have upto 128 cores and in my initial test with 32 cores, I can compile really fast - these are the times for make -j32 for Linux 4.8.12:

real    2m16.366s
user    29m18.732s
sys     2m28.616s

On my Dell Precision 6500 laptop, it had still not compiled after about 25 minutes.

My first test is to try to build a kernel for my own system (Arch Linux).

I got the bzImage the /lib/modules directory from the remote system copied over to my system.

Now when I try to do a mkinitcpio I get the error:

==> ERROR: '/lib/modules/4.8.14-2-ck-nehalem' is not a valid kernel module directory

(I took the base kernel .config file from /proc/config.gz - I have that ck-nehalem kernel version)

How do I get this to work? What's the general way to transfer modules from another system to the one where the initramfs image is built? Can the initramfs be built remotely too?

On a slight tangent, would such a kernel compile service be useful for kernel devs and tinkerers? The cost of using the compute cluster is about 3$ per hour so a single compile end up costing hardly anything.

  • That’s lots of related questions in one post. Regarding Can the initramfs be built remotely too?, should you find anything on that, you’re invited to answer my similar question from some time ago. – phg Dec 15 '16 at 13:04
1

So I'm answering my own question in case it is useful for someone else.

You can definitely build an initramfs remotely as long as you run

make modules_install

on the remote system - however, I could never get the image to contain the modules I needed - especially the md raido stuff. ,I was unable to create an initramfs that would boot my system. But I think it can be done if you explicitly mention all modules in mkinitcpio.conf

Some modules like nvidia also require dkms to be run to build the modules needed.

If you copy the modules in /lib/modules/ to your local system, you have to remake the links build and source to point to a directory that contains the linux kernel source - the links made on the remote side will be invalid.

  • You didnt mention vmlinuz. Can you run it without vmlinuz? I think you followed all step of compiling kernel process.Did you need modules.dep? That file contained all loaded modules. – supriady Dec 26 '16 at 16:32
  • My answer was better solution rather than you didt it. Building binary kernel from kernel source code as .rpm/.deb and install on remote.Your solution is easy to do it. I didnt need to compile new kernel on linuxmint and centos 6.2 32 bit. – supriady Dec 26 '16 at 16:45
  • You make absolutely no sense – rep_movsd Dec 26 '16 at 16:52
  • You can not skip all step of compiling kernel.You cant install modules without you created modules. You can not skip bzImage when you created modules.I seached some articles about initramfs. They copied initramfs for rescue kernel panic. – supriady Dec 26 '16 at 17:02
  • I am not linux newbie. You can not cheat me with your solution.I learned to compile linux kernel since kernel 2.4.xx untl kernel 4.x now. – supriady Dec 26 '16 at 17:08
1

Regarding the missing md raid modules in initramfs - there is also a way to open an initramfs file and add whichever modules you need, and then recreate a new initramfs based on the original one, but including this time the modules you added. I did it in Fedora several times, and I believe this can be done also in Arch linux. Alternatively, maybe this can be done via configuring the mkinitcpio.conf file, or by a parameter to mkinitcpio.

Rami Rosen

  • Yes that can be done - My quest was to be able to do the whole kernel thing automatically – rep_movsd Dec 28 '16 at 9:09
-1

You should compile kernel on local and build compiled kernel as .deb/.rpm package and install on remote.Like you installed binary kernel from repos.

  • Why should I build on a local system? All the stock kernels are built elsewhere – rep_movsd Dec 15 '16 at 15:48
  • Where did you extract your kernel source code? Tell me how to make initramfs when you didnt make bzimage and installed all modules.Maybe I didnt understand your question.I have built kernel from source code since kernel 2.4 until kernel 4.x.But i didnt know how to make initramfs from remote when remote didnt have kernel souce code include bzimage and all modules. – supriady Dec 17 '16 at 9:17
  • Show me how to build initramfs without /boot/vmlinuz and /lib/modules.If you used standard linux kernel not vanilla kernel and not another embedded linux kernel. – supriady Dec 17 '16 at 9:44
  • Dude, I already have built the kernel and installed the modules inside the docker contained - I was having issues with mkinitcpio, but I have solved the problem now, I will post the solution here later – rep_movsd Dec 17 '16 at 14:00
  • @rep_movsd, I am still waiting your answer.How can you build initramfs on Remote? I cant find any answer yet. – supriady Dec 25 '16 at 13:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.