[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: "I: update-initramfs is disabled (live system is running on read-only media)" ...



On 2024-02-16 at 14:44, Albretch Mueller wrote:

> I've got a relatively old laptop with an ATI Radeon HD card, which
> firmware I can't update. Wild pixelations happen even on relatively
> simple pages not just videos. It seems to be a common problem. What I
> have searched and found out is that I will have to un/repack initramfs
> ..., but I haven't found a relatively safe, complete procedure.
> 
> How can you update the initramfs on read-only media?

At a guess:

* Copy the read-only media to a writable location. This is "the image
  tree".

* Extract the initramfs from the file which contains it, into an empty
  directory. This is "the extracted initramfs".

* Modify the files in the extracted initramfs. The result is "the
  updated extracted initramfs".

* Create a new initramfs whose contents are the updated extracted
  initramfs. Copy it into the image tree. The result is "the updated
  image tree".

* Write the updated image tree to new read-only media. Depending on what
  form the media is, this may require other steps first; for example, if
  it's a CD or DVD, you will probably need to create an ISO using a tool
  like genisoimage or (I think) xorriso.

Read-only media is by definition not update-able. You can only create
new media, using a modified copy of the files from the read-only media.

I have successfully built updated versions of live-boot CDs, with
updated kernels and initrd environments and so forth, using this basic
method. It has been a long time, but I can confirm that it works, if
done correctly.


Now, if what you want to know is how to extract the initramfs... that
depends on how it's compressed, which may depend on what live-system
boot media you're working with, but typically it will be a
gzip-compressed cpio archive.

In that case, working from memory based on the last time I was doing
such a thing, what you'd need to do is something like:

$ mkdir /tmp/extract
$ cp /path/to/image/tree/initrd.gz /tmp/extract
$ gunzip /tmp/extract/initrd.gz
$ mkdir /tmp/extract/extracted-initramfs
$ cd /tmp/extract/extracted-initramfs
$ cpio -i < ../initrd

And to create a new one (without overwriting anything created during the
above), you'd do something like:

$ mv /tmp/extract/initrd /tmp/extract/initrd.unmodified
$ cd /tmp/extract/extracted-initramfs
$ find . | cpio -o > ../initrd
$ gzip -9 /tmp/extract/initrd
$ mv /tmp/extract/initrd.gz /path/to/image/tree/initrd.gz

*DO* *NOT* just take this as a recipe to follow. Read the documentation
of the programs involved, look for examples online if that documentation
doesn't make things clear in your mind, and use this as a *starting
point* to figure out what the correct thing to do in your circumstance
actually is.

-- 
   The Wanderer

The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man.         -- George Bernard Shaw

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: