How to change the extension of the initrd file?

Asked by Cubic PPA

How to change the extension of the initrd file on the ISO and in the boot configuration files?

- The initrd file on the ISO (usually in the directory /casper)
- The references to the initrd file in the boot configuration files shown on the ISO Boot tab on the Options page

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

[1]
Customize your Linux file system on the Terminal page in Cubic.

[2]
Ensure you have the kernel files.

$ cd /boot

$ ls -la

You should see initrd and vmlinuz files.

If you see broken symlinks, follow the instructions here...

https://answers.launchpad.net/cubic/+question/688169

...to install the missing kernel files.

[3]
Select your compression algorithm (i.e. the extension for the initrd file).

$ cd /etc/initramfs-tools/

$ nano initramfs.conf

Set your desired compression algorithm ("gzip" is used in this example).
Options are "gzip", "bzip2", "lz4", "lzma", "lzop, or "xz".

Replace
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    COMPRESS=lz4
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
With
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    COMPRESS=gzip
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Press <CTRL><X>, <Y>, <Enter> to save the file.

[4]
Update the initrd file.

$ cd /boot

$ ls -la

Note the time stamp of the initrd.img-* file.

$ update-initramfs -c -k 5.4.0-7642-generic

In the above command, replace "5.4.0-7642-generic" with the kernel version you want to update or with "all" to update all of the kernels in your /boot directory.

$ ls -la

Verify that the time stamp of the initrd.img-* file has changed.

Do *NOT* change the file extension of the initrd file. Cubic will automatically apply the correct extension on the ISO Kernel tab and the ISO Boot tab of the Options page.

[5]
When you get to the Options page, click on the ISO Kernel tab.

Select the kernel for the initrd.img-* file you updated in step [4].

Make sure the note for the kernel you select references the correct extension (for example "initrd.gz"):

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Reference these files as vmlinuz and initrd.gz in the ISO Boot configurations.
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Note:
- This is usually NOT the 1st kernel listed.
- This will be a kernel with version numbers in the vmlinuz and initrd files names (such as "vmlinuz-5.4.0-7642-generic" and "initrd.img-5.4.0-7642-generic").

[6]
Verify that the boot configurations.

After you have selected the correct kernel, click on the ISO Boot tab, and confirm that the correct extension (for example "initrd.gz") appears in the boot parameters.

/boot/grub/grub.cfg
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 initrd /casper/initrd.gz
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

/isolinux/isolinux.cfg
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    append initrd=/casper/initrd.gz
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -