Page 1 of 1

How to prevent kernel updates?

Posted: Thu Sep 21, 2017 10:11 am
by Ollittm
Now that I have my 4.13 kernel set up the way I want it and our baseline RPi image done, I don't want updates to overwrite the kernel with stock version..

How to prevent that automagically?

Re: How to prevent kernel updates?

Posted: Thu Sep 21, 2017 11:32 am
by RaTTuS
don't run
sudo apt-get upgrade

Re: How to prevent kernel updates?

Posted: Thu Sep 21, 2017 1:13 pm
by Ollittm
That tends to stop any updates at all.

Re: How to prevent kernel updates?

Posted: Thu Sep 21, 2017 1:30 pm
by RaTTuS
I've not tried but
sudo apt-cache showpkg linux-image
sudo apt-mark hold linux-image

but if you upgrade anything you may find that that will break because of changes ...
so you have to build a new kernal
do the upgrade then get the source , build it to your .config file, then install that and modules etc
then prey and reboot

I used to have to do similar rebuild in the old days for running off a USB HD that was not supported in the default config [this has changed]

Re: How to prevent kernel updates?

Posted: Thu Sep 21, 2017 3:00 pm
by Ollittm
Yeah, looking online that package trick comes up but you'd apparently have to compile the kernel as a package and install it with apt for it to work. Another suggestion was to rename the kernel and set kernel image name in config.txt but I'm not sure that works. At least if you don't have kernel7.img present in /boot, it won't boot whatever kernel you define in config.txt.

Re: How to prevent kernel updates?

Posted: Thu Sep 21, 2017 3:33 pm
by ShiftPlusOne
The official kernel comes from the raspberrypi-kernel package, which you can just remove (before copying in your own kernel and modules).

Re: How to prevent kernel updates?

Posted: Thu Sep 21, 2017 3:36 pm
by RaTTuS
after boot , mount /boot to be from somewhere else

Re: How to prevent kernel updates?

Posted: Thu Sep 21, 2017 4:00 pm
by Ollittm
ShiftPlusOne wrote:
Thu Sep 21, 2017 3:33 pm
The official kernel comes from the raspberrypi-kernel package, which you can just remove (before copying in your own kernel and modules).
Not a bad idea. Will the dist-upgrade still get a new one, thought?

Re: How to prevent kernel updates?

Posted: Thu Sep 21, 2017 5:24 pm
by ShiftPlusOne
Only if something adds it as a dependency

You could make a dummy raspberry pi kernel package which contains nothing but has a version that will always be higher than anything we release.

Re: How to prevent kernel updates?

Posted: Thu Sep 21, 2017 7:01 pm
by rpdom
ShiftPlusOne wrote:
Thu Sep 21, 2017 5:24 pm
You could make a dummy raspberry pi kernel package which contains nothing but has a version that will always be higher than anything we release.
There are various ways of doing this. The "equivs" package (apt-get install equivs) may help.

If you prefix the version number with something like "1:" (called an Epoch version), then it will always take priority over any version without a "1:" at the start. 1:0.1 is "newer" than "0.2".

Re: How to prevent kernel updates?

Posted: Fri Sep 22, 2017 10:20 am
by Ollittm
I think I'll go with removing the raspberrypi-kernel for now. Thanks for the tip! Interesting idea about making fake package.. Can you actually make a kernel debian package with 'make deb-pkg' for RPi?

By the way.. Is there a package containing the elf and fixup files from /boot? You can pull it from firmware git but you get whopping pile of stuff on top of the ones you want.

Re: How to prevent kernel updates?

Posted: Fri Sep 22, 2017 1:11 pm
by rpdom
Ollittm wrote:
Fri Sep 22, 2017 10:20 am
Is there a package containing the elf and fixup files from /boot?
I think those are in the raspberrypi-bootloader package. I haven't checked the contents.

Re: How to prevent kernel updates?

Posted: Fri Sep 22, 2017 1:58 pm
by ShiftPlusOne
You can run dpkg -L <package> to list the content of an installed package. Or, dpkg -S </path/to/file> to find which package a file belongs to.

Re: How to prevent kernel updates?

Posted: Mon Sep 25, 2017 9:26 am
by Ollittm
ShiftPlusOne wrote:
Fri Sep 22, 2017 1:58 pm
You can run dpkg -L <package> to list the content of an installed package. Or, dpkg -S </path/to/file> to find which package a file belongs to.
Thanks. Indeed the raspberrypi-bootloader package.

I had at one point LEDs broken which is caused by out-of-date bootloader files. And the bluetooth issue (on update) as well.