update initramfs

Asked by Anthony G

I am attempting to remaster an Ubuntu 20.04.1 image downloaded from ubuntu.com 2020-08-07. Basic functions like adding/removing software and changing system files seems to work fine. When I attempt to run update-initramfs -u I run into issues. I found a reported bug that identifies an issue with the version of initramfs-tools included in 20.04 and a work around. Even with the workaround, running update-initramfs -u does not result in changes to the live image.

Running the same commands (without the workaround) when remastering an Ubuntu 18.04.4 image on the same system result in the expected changes to the live system.

I am running the latest version of cubic on two identical laptops, one running 18.04.4 and one running 20.04.1. Both give the same result.

I also installed the downloaded Ubuntu 20.04.1 image in a VirtualBox and ran the remaster commands with success. The commands include some modprobe blocks and updating the plymouth boot images.

Is there a different way I should be updating initramfs in the chrooted environment when remastering 20.04.1? It seems the methods used in 18.04 are not working.

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
Cubic PPA (cubic-wizard) said :
#1

I tried to run `update-initramfs -u` while customizing 20.04.1.
Nothing happens after pressing <Enter>.

Is this the bug you are referring to?

What was the work-around you attempted?

Revision history for this message
Cubic PPA (cubic-wizard) said :
#2

I remembered that the /boot directory does not contain the initrd and vmlinuz files, so it is necessary to install these first.

I installed these missing files, ensuring "5.4.0-40" in the following command matches the kernel version shown at the top right of Cubic's virtual environment terminal:

$ apt update
$ apt install --reinstall linux-headers-5.4.0-40 linux-headers-5.4.0-40-generic linux-image-5.4.0-40-generic

Then I executed:

$ update-initramfs -u

The command worked fine. (The cryptsetup errors can be ignored).
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    update-initramfs: Generating /boot/initrd.img-5.4.0-40-generic
    cryptsetup: ERROR: Couldn't resolve device tmpfs
    cryptsetup: WARNING: Couldn't determine root device
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

The old file was:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    43769721 Aug 10 22:00 initrd.img-5.4.0-40-generic
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

And the new file was:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    43769766 Aug 10 22:01 initrd.img-5.4.0-40-generic
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

You can see the file size and time stamp changed.

I ran Cubic from a Ubuntu 20.04 host with kernel version 5.4.0-40-generic.
Are you running Cubic in Ubuntu 20.04.1 or Ubuntu 20.04 ?

Revision history for this message
Best Cubic PPA (cubic-wizard) said :
#3

I just re-read your question, and I see you are using both 18.04.4 and 20.04.1, so that answers my question in comment #2.

Try the technique I described in comment #2 and let me know if it works?

Be sure to first install the inited and vmlinuz files for the kernel version you want.

Also, remember that the "-u" option will only update the initrd file for the kernel version shown at the top right of Cubic's terminal page. If you have installed a different kernel, you may want to try the following command to update all initrd files.

$ update-initramfs -k all

Revision history for this message
Anthony G (9-ant) said :
#4

The work around I mentioned earlier that didn't work is touch /boot/initrd.img-$(uname -r) found here:
https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/1829805

While that does allow update-initramfs -u to run, it does not seem to take effect on the live system.

It is similar to your answer in #2 and in this question:
https://answers.launchpad.net/cubic/+question/692073

reinstalling the kernel did work for me as you described, I just matched the version number that came on the ISO (5.4.0-42). I guess over time this would have remedied itself once a newer kernel was available and I ran an update.

Thank you for looking into it

Revision history for this message
Anthony G (9-ant) said :
#5

Thanks Cubic PPA, that solved my question.