Blogger Tips and TricksLatest Tips And TricksBlogger Tricks

Tuesday, May 21, 2024

initrd extraction commands for ubuntu 23.10 and above

 You can use the following steps to unpack and repack

This is initrd-extraction for ubuntu24.04
# Extract and prepare the working directories
# -------------------------------------------
mkdir /initrd-extraction
mkdir /initrd-extraction/extracted
cp initrd /initrd-extraction
cd /initrd-extraction
unmkinitramfs initrd  /extracted
cd extracted
# Add the first microcode firmware
# --------------------------------
cd early
find . -print0 | cpio --null --create --format=newc > ../../newinitrd
# Add the second microcode firmware
# ---------------------------------
cd ../early2
find kernel -print0 | cpio --null --create --format=newc >> ../../newinitrd
cd ../early3
find . -print0 | cpio --null --create –format=newc >> ../../newinitrd
# Add the ram fs file system
# --------------------------
cd ../main
find . | cpio --create --format=newc | xz --format=lzma >> ../../newinitrd
Finally rename newinitrd to initrd

No comments:

Post a Comment