LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Kernel version 4.1 and 4.2 upgrade/compile guide (https://www.linuxquestions.org/questions/debian-26/kernel-version-4-1-and-4-2-upgrade-compile-guide-4175552272/)

m_yates 09-04-2015 12:53 PM

You have a typo. You wrote:
Code:

make deb-pkg LOCALVERSION=-3.16.0-4-amd64 KDEB PKGVERSION=1
It should be:
Code:

make deb-pkg LOCALVERSION=-3.16.0-4-amd64 KDEB_PKGVERSION=1

mzsade 09-04-2015 01:34 PM

Darn me and my myopia, you have already taught me to purge as below:
Code:

su
rm -rf /lib/modules/4.2.0
rm -f /boot/vmlinuz-4.2.0*
rm -f /boot/initrd.img-4.2.0*
rm -f /boot/config-4.2.0*
rm -f /boot/System.map-4.2.0*
update-grub

There was a reference to "stale .o files' in the README. Does this cover that before i try again?

m_yates 09-04-2015 03:44 PM

I think you are fine in regards to stale .o files as long as you run "make clean" first before compiling.

mzsade 09-05-2015 08:48 AM

Success at last. yu de man!
Code:

dpkg-deb: building package `linux-firmware-image-4.2.0-3.16.0-4-amd64' in `../linux-firmware-image-4.2.0-3.16.0-4-amd64_1_amd64.deb'.
dpkg-deb: building package `linux-headers-4.2.0-3.16.0-4-amd64' in `../linux-headers-4.2.0-3.16.0-4-amd64_1_amd64.deb'.
dpkg-deb: building package `linux-libc-dev' in `../linux-libc-dev_1_amd64.deb'.
dpkg-deb: building package `linux-image-4.2.0-3.16.0-4-amd64' in `../linux-image-4.2.0-3.16.0-4-amd64_1_amd64.deb'.
dpkg-deb: building package `linux-image-4.2.0-3.16.0-4-amd64-dbg' in `../linux-image-4.2.0-3.16.0-4-amd64-dbg_1_amd64.deb'.
root@Sinai:/usr/src/linux#

Along with this;
Code:

dpkg -i linux-image-4.2.0-3.16.0-4-amd64_1_amd64.deb
dpkg -i linux-headers-4.2.0-3.16.0-4-amd64_1_amd64.deb

do you advise
Code:

dpkg -i linux-firmware-image-4.2.0-3.16.0-4-amd64_1_amd64.deb
dpkg -i linux-image-4.2.0-3.16.0-4-amd64-dbg_1_amd64.deb

?

Whether i am able to boot in the new kernel or not will be related to compatibility of my H/W with the combination of the distribution and the new kernel and i will pursue that elsewhere. I have only just begun to appreciate the thought and care put in, the in-depth understanding of the Linux kernel and the upgrade process involved, and the many years of Linux experience behind it, compressed into every step you have outlined in this tutorial and i am truly grateful for it.

mzsade 09-07-2015 06:13 AM

Ran
Code:

dpkg -i linux-image-4.2.0-3.16.0-4-amd64_1_amd64.deb
and it returned an error in locating archive. Felt like i was punched hard in my stomach. Then collected myself and ran
Code:

dpkg -i /usr/src/linux-image-4.2.0-3.16.0-4-amd64_1_amd64.deb
dpkg -i /usr/src/linux-headers-4.2.0-3.16.0-4-amd64_1_amd64.deb

Yaba-daba-doo! :D
Code:

sade@Sinai:~$ uname -r
4.2.0-3.16.0-4-amd64


silvanus-deb 11-21-2015 07:25 AM

Because I am on the "testing" release (64 bit), the upgraded kernels (both 4.1 and 4.2) have been installed through regularly running "apt-get dist-upgrade".

However, the system won't boot using 4.1 or 4.2. In order to successfully boot to the login screen, I have to select 4.0.0-2-amd64 in GRUB. When I try using 4.1 or 4.2, the last boot message I get is the result of fsck (clean). Shortly later the screen flickers and the message font changes (as in normal boot-up), so presumably the video driver has loaded successfully (???) but the system freezes at this point. I installed the realtek firmware, in case that was causing the problem, but it didn't help.

For what it's worth, I'm on a Dell Inspiron Mini 1012. Is there something in the latest kernels that won't cooperate with my old hardware?

I'm a non-technical user, but can type terminal commands and edit settings files like a trained seal if given specific instructions

m_yates 11-21-2015 11:40 PM

Silvanus-deb: You will probably get more help by creating a new thread. You should also clarify what kernel version works, since 4.2 is the default in Testing and you say it won't boot. You were apparently able to boot some kernel and install firmware. If all you care about is having it working, you can always just boot into the one that works, uninstall the others, and pin the kernel version in apt so it won't be upgraded again.

m_yates 11-25-2015 01:04 PM

If anyone follows this guide for compiling the 4.3 kernel from the sources from kernel.org, it will fail with the error:
Code:

openssl/opensslv.h: No such file or directory
You can fix that by installing libssl-dev:
Code:

apt-get install libssl-dev
After that do:
Code:

make clean
Then re-start the compilation and it will proceed as normal. I was going to put this in the original post, but it looks like I can no longer edit it.

mzsade 02-20-2016 01:33 AM

@m_yates, i cannot thank you enough for this awesome compile guide, learn something new each time i use it. This time i compiled the kernel on LMDE 2 using it's /boot/config and
<make localyesconfig> instead of <make oldconfig> and the results seem to have worked out very well for me. For one thing, the whole build took just a little over an hour as compared to the usual 4-5 hours, the linux-image and linux-headers were only 7 MB each and my system hasn't frozen on me once since then. What are your recommendations in this respect? I mean, is there a downside to this?

My laptop screen. :D

m_yates 02-20-2016 09:09 PM

Glad it has been of use. I've never actually tried using the localyesconfig target. As I understand it, localyesconfig takes all loaded modules from your running kernel and compiles them into a monolithic kernel without modules. There is also a localmodconfig option that is similar, except it selects all of your currently loaded modules from your running kernel and selects only those modules to compile for the new kernel.

The localmodconfig and localyesconfig targets will eliminate all modules that you aren't currently using, so it will be fast to compile and also make the kernel smaller. It is actually pretty clever to automate it, because a lot of people want to eliminate unused modules and options. Eliminating all the unused modules manually using menuconfig is time consuming and prone to error. If you do it manually and mistakenly delete something you need, the kernel won't work.

There are only a couple of problems with localyesconfig that I see:

1) The kernel you compile will only work on the computer that you compiled it on (or another computer that has exactly the same hardware).

2) If you add new hardware to your computer (such as an expansion card or peripheral), it won't work without compiling a module for it, or compiling a new kernel that has the required module for the new hardware built into it.

When you follow what I did, there are tons of modules compiled that you don't need. That is why the compile time is long and the size is huge. On the plus side, you take the resulting deb files that you compiled the way I did and install them on most any computer and it will work. What you did is make the kernel about as slim and lean as it can be.

mzsade 02-21-2016 02:51 AM

Thanks for the clarification, you are right about the peripherals, didn't think to check it before but now after you mentioned it i see that my flash drives are not being detected. But the localyesconfig/localmodconfig options are too attractive to pass up as i intend to compile the kernel only for the machine i am currently running it on, will try it once more with a couple of them plugged in while compiling. If i have understood the whole thing correctly that ought to work..

Edit: Oh yes, it works and how! Except for the odd SanDisk all my pen drives are Transcend so i plugged in a Transcend before compiling but now i can see every pen drive i plug in, in xfe file manager. :D

Xeratul 06-14-2016 02:03 PM

Quote:

Originally Posted by mzsade (Post 5414186)
Thank you for the guide, @m_yates. In my peculiar case both the kernels that came with the distribution, 4.1 and 4.1-rt, failed to boot but i somehow bungled my way into successfully upgrading to kernel 4.2 without recourse to the old config.
Don't wish to clutter the thread by rambling on about it so i'll just post a link to my screenshot. :D


Your method is quite long and might be much simpler.

You mention that you just need to grab the .config to make it work, but there is visibly much more than that to make a working kernel like you can find already compiled on the repositories !

best regards

rannyjohns 11-19-2018 03:34 AM

Nice to have it
 
Keep solving problems of he people.


All times are GMT -5. The time now is 06:20 AM.