Dienstag, 3. Oktober 2017

uncompressing, editing and recompressing an initrd

  1. Create a directory and switch into it:

    # mkdir test
    # cd test
  2. Then uncompress and extract the initrd:

    # zcat /boot/initrd.img | cpio -idmv
  3. Edit the contents (if needed)
  4. Repack and compress the initrd image:

    # find . | cpio -o -c | gzip -9 > /boot/test.img
  5. For image compressed with xz format, use commands below to extract the initrd image.

    # mkdir /tmp/initrd
    # cd /tmp/initrd
    # xz -dc < initrd.img | cpio --quiet -i --make-directories
  6. Edit the contents (if needed)
  7. Repack and compress the initrd image:

    # cd /tmp/initrd
    # find . 2>/dev/null | cpio --quiet -c -o | xz -9 --format=lzma >"initrd.img"

found on: https://access.redhat.com/solutions/24029

Keine Kommentare:

Kommentar veröffentlichen