why does cubic show different kernel version

Asked by ibrahim bondokji

i have realized that running uname -r inside the chroot gives the kernel version of the computer running cubic not the kernel of the image i am creating a custom image from. why is that? would not that create problems while customizing the image as it assumes it has a different kernel version?

Question information

Language:
English Edit question
Status:
Solved
For:
Cubic Edit question
Assignee:
No assignee Edit question
Solved by:
Cubic PPA
Solved:
Last query:
Last reply:
Revision history for this message
Best Cubic PPA (cubic-wizard) said :
#1

This is a very good question!

[1]

You are correct, the kernel you are running inside Cubic's Terminal (or "container") is the same as the kernel on your host machine. This kernel version is always shown at the top right of Cubic's Terminal page.

This is is just how the container works. The *primary* function of the container is to allow you to make changes to files as root, without affecting your host system, and this function does not depend on which kernel you are using.

[2]

When installing packages, the kernel version usually is not an issue, because packages are just a set of files that are copied into your file system (starting at "/"). As I mentioned above, the container allows you to manage files as a root user, and this is exactly what you need when installing packages.

Instead of the kernel version, installing packages does depends on the Distro version. Note that the Distro version (`lsb_rlease --all`) will be different in Cubic than on your host system (usually). The Distro version guides apt to install the correct package versions for your system. (Ultimately, apt relies on the repositories you have configured under /etc/apt which correspond to your Distro version).

Nevertheless, if you are installing additional kernel *modules* or *drivers*, you must take care to install the modules or drivers for the correct kernel. (Of course, you must install that kernel 1st!). In this case, the kernel version becomes important, because modules and drivers are installed for a specific kernel.

If you are manually installing modules, make sure you copy the files into the correct kernel directory under /lib/modules/<kernel version>. (/etc/modules may also be used).

I suggest installing the dkms package to "have DKMS modules automatically rebuilt when a new kernel is installed. [...] It allows the installation of a new driver on an existing system, running an arbitrary kernel version, without any need for manual compilation or precompiled packages provided by the vendor." (Reference https://en.wikipedia.org/wiki/Dynamic_Kernel_Module_Support).

Revision history for this message
ibrahim bondokji (ibrahimbond) said :
#2

Thanks Cubic PPA, that solved my question.

Revision history for this message
ibrahim bondokji (ibrahimbond) said :
#3

i have actually ran into a kernel problem when i was trying to install nvidia driver before, where the distro and my pc had different kernel versions then i learned that i need dkms and the correct kernel. but i did not understand what is going on exactly. was just randomly searching and trying solutions. now the image is clear for me! :)

I thank you so much for your elaborate explanation!! as a growing developer i owe all i am learning to people like you, willing to put the effort to invest in the community. i have had a good experience using cubic so far especially with your first hand support.