View previous topic :: View next topic |
Author |
Message |
colag Tux's lil' helper

Joined: 26 Sep 2009 Posts: 100 Location: Dhaka, Bangladesh
|
Posted: Mon Jan 02, 2017 3:15 pm Post subject: Compiling kernel from another pc can I use it to my pc? |
|
|
There is a pc with intel core i5 32 bit linux system. I've compiled kernel 4.7 there. Can I use this compiled kernel to my home pc. Home computer has also 32 bit same linux operating system. |
|
Back to top |
|
 |
Keruskerfuerst Advocate


Joined: 01 Feb 2006 Posts: 2288 Location: near Augsburg, Germany
|
Posted: Tue Jan 03, 2017 10:15 am Post subject: |
|
|
How is the kernel configured and compiled?
When the hardware of both machines is the same, the kernel can be transferred. |
|
Back to top |
|
 |
colag Tux's lil' helper

Joined: 26 Sep 2009 Posts: 100 Location: Dhaka, Bangladesh
|
Posted: Tue Jan 03, 2017 1:05 pm Post subject: |
|
|
Keruskerfuerst wrote: | How is the kernel configured and compiled?
When the hardware of both machines is the same, the kernel can be transferred. |
cd linux-4.7.2
make menuconfig
make -j2
Compiled with intel core i5 3.3 GHz. I want to copy linux-4.7.2 to home pc. Home pc has intel pentium D 2.66GHz. Both have same linux operating system.
Last edited by colag on Tue Jan 03, 2017 1:44 pm; edited 1 time in total |
|
Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 44178 Location: 56N 3W
|
Posted: Tue Jan 03, 2017 1:28 pm Post subject: |
|
|
colag,
You must make a kernel that has all the drivers for both systems.
e.g. if one system has a realtec network card and the other an intel card, you need both drivers.
Its the same for all the hardware.
You need to transfer the kernel file, initrd file, if you use one and the modules directory /lib/modules/<kernel-version>
Its useful to copy /usr/src/<kernel-version>/[.config Makefile] too as some build systems refer to these files.
Typically, the build won't fail, you will just get warnings about kernel checks failing.
If you can live with the warnings, these files are not required. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
 |
colag Tux's lil' helper

Joined: 26 Sep 2009 Posts: 100 Location: Dhaka, Bangladesh
|
Posted: Tue Jan 03, 2017 1:50 pm Post subject: |
|
|
NeddySeagoon wrote: | colag,
You must make a kernel that has all the drivers for both systems.
e.g. if one system has a realtec network card and the other an intel card, you need both drivers.
Its the same for all the hardware.
You need to transfer the kernel file, initrd file, if you use one and the modules directory /lib/modules/<kernel-version>
Its useful to copy /usr/src/<kernel-version>/[.config Makefile] too as some build systems refer to these files.
Typically, the build won't fail, you will just get warnings about kernel checks failing.
If you can live with the warnings, these files are not required. |
I will run the kernel at home only. So I selected/checked only those drivers I need for home use. Will it work? Why do I need to check/select drivers of the pc with intel core i5?
Does make -j2 create initrd file? And make modules_install should copy modules in /lib/modules/<kernel-version> |
|
Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 44178 Location: 56N 3W
|
Posted: Tue Jan 03, 2017 2:01 pm Post subject: |
|
|
colag,
make -j2 does not make the initrd file. If you configure the kernel with everything for booting set to <*> then no initrd is needed.
If you will only use the kernel at home, it need only support that hardware.
Reading you post, I read that you wanted to use it on both systems.
There is a small trap. /lib/modules/<kernel-version> will be overwritten if it exists.
You can avoid that with Code: | make modules_install INSTALL_MOD_PATH=/mnt/floppy | or whatever alternate path you want.
It might be a very bad thing to overwrite your work /lib/modules/<kernel-version> with your home one. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
 |
colag Tux's lil' helper

Joined: 26 Sep 2009 Posts: 100 Location: Dhaka, Bangladesh
|
Posted: Tue Jan 03, 2017 2:33 pm Post subject: |
|
|
@NeddySeagoon,
I will not use this linux-4.7.2 in that pc with intel core i5 3.3 GHz. I will use it only at home. It's compiled with drivers and necessary modules or other options for home pc. I will copy linux-4.7.2 in my home pc, delete /lib/modules/<kernel-version>. Then
make modules_install
cp arch/x86/boot/bzImage /boot/vmlinuz-4.7.2
cp System.map /boot/System.map-4.7.2
cp .config /boot/config-4.7.2
Will it work? |
|
Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 44178 Location: 56N 3W
|
Posted: Tue Jan 03, 2017 3:03 pm Post subject: |
|
|
colag,
To run make modules_install at home, you need the entire kernel tree.
I had in mind you would only take home the pieces that you need.
What you say will work. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
 |
|