Ollittm
Posts: 32
Joined: Wed Mar 02, 2016 9:07 am

How to prevent kernel updates?

Thu Sep 21, 2017 10:11 am

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?

User avatar
RaTTuS
Posts: 9895
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: How to prevent kernel updates?

Thu Sep 21, 2017 11:32 am

don't run
sudo apt-get upgrade
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

Ollittm
Posts: 32
Joined: Wed Mar 02, 2016 9:07 am

Re: How to prevent kernel updates?

Thu Sep 21, 2017 1:13 pm

That tends to stop any updates at all.

User avatar
RaTTuS
Posts: 9895
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: How to prevent kernel updates?

Thu Sep 21, 2017 1:30 pm

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]
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

Ollittm
Posts: 32
Joined: Wed Mar 02, 2016 9:07 am

Re: How to prevent kernel updates?

Thu Sep 21, 2017 3:00 pm

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.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5083
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: How to prevent kernel updates?

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).

User avatar
RaTTuS
Posts: 9895
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: How to prevent kernel updates?

Thu Sep 21, 2017 3:36 pm

after boot , mount /boot to be from somewhere else
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

Ollittm
Posts: 32
Joined: Wed Mar 02, 2016 9:07 am

Re: How to prevent kernel updates?

Thu Sep 21, 2017 4:00 pm

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?

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5083
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: How to prevent kernel updates?

Thu Sep 21, 2017 5:24 pm

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.

User avatar
rpdom
Posts: 12497
Joined: Sun May 06, 2012 5:17 am
Location: Essex, UK

Re: How to prevent kernel updates?

Thu Sep 21, 2017 7:01 pm

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".

Ollittm
Posts: 32
Joined: Wed Mar 02, 2016 9:07 am

Re: How to prevent kernel updates?

Fri Sep 22, 2017 10:20 am

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.

User avatar
rpdom
Posts: 12497
Joined: Sun May 06, 2012 5:17 am
Location: Essex, UK

Re: How to prevent kernel updates?

Fri Sep 22, 2017 1:11 pm

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.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5083
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: How to prevent kernel updates?

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.

Ollittm
Posts: 32
Joined: Wed Mar 02, 2016 9:07 am

Re: How to prevent kernel updates?

Mon Sep 25, 2017 9:26 am

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.

Return to “Linux Kernel”

Who is online

Users browsing this forum: No registered users and 3 guests