Kernel, Grub and Plymouth update after major release

Asked by András Varga on 2020-06-22

Hi!
I made my custom oem installable system, but i have a question.
If ubuntu updates for a major release (20.04.01) my system will install new kernel, plymouth and grub propably.
Can i prevent this thing? I dont want to lose those customizations on the os, because im using it for my small company.

Question information

Language:
English Edit question
Status:
Answered
For:
Cubic Edit question
Assignee:
No assignee Edit question
Last query:
2020-06-22
Last reply:
2020-07-01
Cubic PPA (cubic-wizard) said : #1

(1)

I think you have to "hold back" packages.

    echo "<package-name> hold" | dpkg --set-selections

(2)

A trick I use is to automatically execute a script after every package install.
The script resets something the way ~I~ want it.
This works for simple things, since the script it has to be very reliable.
(The script should also ~not~ make changes, if apt did not change or overwrite your initial settings).

Perhaps you can do something similar.
Here is an example to black list nouveau, if apt removed my grub changes...

Add an entry to `/etc/apt/apt.conf.d/80update`.
This entry should invoke a script that makes the updates/changes that you want.

For example, to the file:
    /etc/apt/apt.conf.d/80update
Add:
    DPkg::Post-Invoke {"/opt/apt/grub-blacklist-nouveau";};

Then create the file:
    /opt/apt/grub-blacklist-nouveau

With the contents:

#!/bin/bash

# Blacklist the Nouveau display driver for X.org is in Grub, if it is
# not already blacklisted.
#
# Usage: sudo grub-blacklist-nouveau

match=$(cat /etc/default/grub | grep 'modprobe.blacklist=nouveau')
if [[ ! $match ]]; then
    echo "Blacklist the Nouveau display driver for X.org in Grub."
    sed --in-place "s|splash|splash modprobe.blacklist=nouveau|g" /etc/default/grub
    update-grub
else
    echo "The Nouveau display driver for X.org is already blacklisted in Grub, so no changes are necessary."
fi
grep GRUB_CMDLINE_LINUX_DEFAULT /etc/default/grub
echo

Synema (kensei99) said : #2

how do i use the hold thing? just use it in cubics terminal and when i install the system, its gonna be ready?

Can you help with this problem?

Provide an answer of your own, or ask András Varga for more information if necessary.

To post a message you must log in.