User Tools

Site Tools


doc:appunti:linux:sa:if_rename

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
doc:appunti:linux:sa:if_rename [2024/06/21 17:48] – [With Debian 10 Buster] niccolodoc:appunti:linux:sa:if_rename [2024/06/21 17:54] (current) – [Beware of initramfs image] niccolo
Line 29: Line 29:
 ==== Beware of initramfs image ==== ==== Beware of initramfs image ====
  
-If you have some files in **/etc/systemd/network/** to rename network interfaces and you update the **initramfs image** (e.g. by running the **update-initramfs** tool), a copy of these files are placed into the image itself (under the path **usr/lib/systemd/network/**).+:!: If you have some files in **/etc/systemd/network/** to rename network interfaces and you update the **initramfs image** (e.g. by running the **update-initramfs** tool), a copy of these files are placed into the image itself (under the path **usr/lib/systemd/network/**).
  
 These files are considered by ''init'' before it considers the content of **/etc/systemd/network/**. When the latter files are processed, some renaming may have already occurred and rules may not longer apply or may fail. These files are considered by ''init'' before it considers the content of **/etc/systemd/network/**. When the latter files are processed, some renaming may have already occurred and rules may not longer apply or may fail.
Line 41: Line 41:
 === How to unpack the iniramfs image to inspect its content === === How to unpack the iniramfs image to inspect its content ===
  
-In Debian 12 the iniramfs image is composed by cpio archive containing the Intel microcode followed by the Zstandard compressed cpio archive of the initramfs. To extract both, do the following:+In **Debian 12** the iniramfs image may be composed by two appended cpio archives. The first containing the Intel microcode in //ASCII cpio archive// format, and the second containing the actual initramfs as a //Zstandard compressed cpio archive//. To extract both, do the following:
  
- +Extract **the microcode part** (take note of the number of blocks printed on stderr):
-Extract the microcode (take note of the number of blocks printed on stderr):+
  
 <code> <code>
Line 51: Line 50:
 </code> </code>
  
-Make a copy of initramfs stripping the microcode and decompress it:+Make a copy of **the initramfs part** stripping the microcode and decompress it:
  
 <code> <code>
-dd if=/boot/initrd.img-6.1.0-21-amd64 of=initramfs.img.zstd bs=512 skip=14080 +dd if=/boot/initrd.img-6.1.0-21-amd64 of=initramfs.img.zst bs=512 skip=14080 
-unzstd initramfs.img.zstd --stdout | cpio --extract --make-directories  --no-absolute-filenames+unzstd initramfs.img.zst --stdout | cpio --extract --make-directories  --no-absolute-filenames
 </code> </code>
  
doc/appunti/linux/sa/if_rename.1718984921.txt.gz · Last modified: 2024/06/21 17:48 by niccolo