1

I want to learn how to amend initramfs. I use Linux Mint. I've used the answer to https://superuser.com/questions/1556241/initrd-file-cpio-archive-x-cpio-type-of-file-how-to-recompile to remake and it booted.

The solution uses unmkinitramfs to unpack, result contains two folders with kernel and rootfs folder. It even booted when I remade initrd with only rootfs filesystem (3rd step of appending to a file only), no microcode "kernel/x86/microcode/AuthenticAMD.bin"/"kernel/x86/microcode/GenuineIntel.bin".

What microcodes for CPUs are for in initrd? Some info on initrd does not mention them, QAs on SE some mention them w/out explaining what they are for.

Output of binwalk on initrd from distro (see below [1] for full) contained (in addition to files extracted by unmkinitramfs) mentions of "TRAILER!!!", Unix path: /lib/firmware/amdgpu/(many files), Cisco IOS microcode, Certificate in DER format, Copyright string.

On the other hand in newly re-packed file (see [2]) there is Windows Script Encoded Data (screnc.exe) which was not in the output of binwalk on original file. What does it mean?

What is their importance? How to extract them too and repack as was originally?

I've looked in: https://askubuntu.com/questions/777260/how-to-repack-initrd-img
https://wiki.gentoo.org/wiki/Initramfs/Guide
https://serverfault.com/questions/876140/cpio-incorrectly-unpacking-initrd-in-ubuntu-xenial
Why is it that my initrd only has one directory, namely, 'kernel'?
https://access.redhat.com/solutions/24029
https://www.linuxjournal.com/article/1213

I have a guess TRAILER!!! is how binwalk shows end of cpio archive and all firmware is for kernel to check if corresponding hardware is present, then try to update firmware (hence "microcode update" files). If so, it is to my surprise booting Linux can update my CPU, etc. w/out asking me, AFAIK firmware updates if gone wrong can make hardware non-working unless taken to service. Or it does ask if update is recommended?

1:biwalk initrd.lz

DECIMAL       HEXADECIMAL     DESCRIPTION
--------------------------------------------------------------------------------
0             0x0             ASCII cpio archive (SVR4 with no CRC), file name: ".", file name length: "0x00000002", file size: "0x00000000"
112           0x70            ASCII cpio archive (SVR4 with no CRC), file name: "kernel", file name length: "0x00000007", file size: "0x00000000"
232           0xE8            ASCII cpio archive (SVR4 with no CRC), file name: "kernel/x86", file name length: "0x0000000B", file size: "0x00000000"
356           0x164           ASCII cpio archive (SVR4 with no CRC), file name: "kernel/x86/microcode", file name length: "0x00000015", file size: "0x00000000"
488           0x1E8           ASCII cpio archive (SVR4 with no CRC), file name: "kernel/x86/microcode/AuthenticAMD.bin", file name length: "0x00000026", file size: "0x00007752"
31184         0x79D0          ASCII cpio archive (SVR4 with no CRC), file name: "TRAILER!!!", file name length: "0x0000000B", file size: "0x00000000"
31744         0x7C00          ASCII cpio archive (SVR4 with no CRC), file name: "kernel", file name length: "0x00000007", file size: "0x00000000"
31864         0x7C78          ASCII cpio archive (SVR4 with no CRC), file name: "kernel/x86", file name length: "0x0000000B", file size: "0x00000000"
31988         0x7CF4          ASCII cpio archive (SVR4 with no CRC), file name: "kernel/x86/microcode", file name length: "0x00000015", file size: "0x00000000"
32120         0x7D78          ASCII cpio archive (SVR4 with no CRC), file name: "kernel/x86/microcode/.enuineIntel.align.0123456789abc", file name length: "0x00000036", file size: "0x00000000"
32284         0x7E1C          ASCII cpio archive (SVR4 with no CRC), file name: "kernel/x86/microcode/GenuineIntel.bin", file name length: "0x00000026", file size: "0x004C8000"
5045936       0x4CFEB0        ASCII cpio archive (SVR4 with no CRC), file name: "TRAILER!!!", file name length: "0x0000000B", file size: "0x00000000"
8917606       0x881266        Unix path: /lib/firmware/amdgpu/beige_goby_mec2.bin
9118372       0x8B22A4        ASCII cpio archive (SVR4 with no CRC), file name: "usr/lib/firmware/amdgpu/beige_goby_sos.bin", file name length: "0x0000002B", file size: "0x000314A0"
10612118      0xA1ED96        Unix path: /lib/firmware/amdgpu/cyan_skillfish2_mec2.bin
10795026      0xA4B812        Unix path: /lib/firmware/amdgpu/dimgrey_cavefish_mec2.bin
13686104      0xD0D558        Unix path: /lib/firmware/amdgpu/navi10_mec2.bin
13755619      0xD1E4E3        Cisco IOS microcode, for ""
15245172      0xE89F74        Unix path: /lib/firmware/amdgpu/navi14_mec
16207180      0xF74D4C        Unix path: /lib/firmware/amdgpu/navy_flounder_sos.bin
17354846      0x108D05E       Certificate in DER format (x509 v3), header length: 4, sequence length: 26645
17988464      0x1127B70       Unix path: /lib/firmware/amdgpu/polaris10_mec_2.bin
18631505      0x11C4B51       Unix path: /lib/firmware/amdgpu/polaris11_mec_2.bin
19277483      0x12626AB       Unix path: /lib/firmware/amdgpu/polaris12_mec_2.bin
21601111      0x1499B57       Unix path: /lib/firmware/amdgpu/sienna_cichlid_sos.bin
24525944      0x1763C78       Unix path: /lib/firmware/amdgpu/vega10_sos.bin
24692428      0x178C6CC       ASCII cpio archive (SVR4 with no CRC), file name: "usr/lib/firmware/amdgpu/vega10_uvd.bin", file name length: "0x00000027", file size: "0x0005CFA0"
28541045      0x1B38075       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
28556045      0x1B3BB0D       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
28571521      0x1B3F781       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
28603896      0x1B475F8       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
28613989      0x1B49D65       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
28628017      0x1B4D431       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
28631873      0x1B4E341       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
28632009      0x1B4E3C9       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
28646005      0x1B51A75       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
28659715      0x1B55003       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
28674715      0x1B58A9B       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
28690179      0x1B5C703       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
28710427      0x1B6161B       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
28724191      0x1B64BDF       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
28728931      0x1B65E63       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
28729099      0x1B65F0B       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
28742355      0x1B692D3       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
28762248      0x1B6E088       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
28775820      0x1B7158C       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
28782860      0x1B7310C       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
28783004      0x1B7319C       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
28796924      0x1B767FC       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
28798316      0x1B76D6C       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
28798460      0x1B76DFC       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
28812944      0x1B7A690       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
28828512      0x1B7E360       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
28843904      0x1B81F80       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
28860027      0x1B85E7B       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
28873795      0x1B89443       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
28878535      0x1B8A6C7       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
28878695      0x1B8A767       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
28901164      0x1B8FF2C       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
28914728      0x1B93428       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
28922131      0x1B95113       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
28922275      0x1B951A3       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
28936187      0x1B987FB       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
28937579      0x1B98D6B       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
28937723      0x1B98DFB       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
28952211      0x1B9C693       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
28967407      0x1BA01EF       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
28982815      0x1BA3E1F       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29009905      0x1BAA7F1       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29025387      0x1BAE46B       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29038763      0x1BB18AB       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29052995      0x1BB5043       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29062699      0x1BB762B       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29062899      0x1BB76F3       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29076655      0x1BBACAF       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29089803      0x1BBE00B       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29102731      0x1BC128B       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29117515      0x1BC4C4B       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29131819      0x1BC842B       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29145355      0x1BCB90B       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29151302      0x1BCD046       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29151422      0x1BCD0BE       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29164566      0x1BD0416       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29172646      0x1BD23A6       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29172822      0x1BD2456       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29186722      0x1BD5AA2       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29201714      0x1BD9532       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29213558      0x1BDC376       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29228578      0x1BDFE22       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29244546      0x1BE3C82       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29260274      0x1BE79F2       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29273374      0x1BEAD1E       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29294424      0x1BEFF58       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29307896      0x1BF33F8       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29321288      0x1BF6848       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29335532      0x1BF9FEC       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29345184      0x1BFC5A0       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29345392      0x1BFC670       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29359004      0x1BFFB9C       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29372995      0x1C03243       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29385807      0x1C0644F       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29400571      0x1C09DFB       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29414991      0x1C0D64F       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29428511      0x1C10B1F       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29434643      0x1C12313       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29434763      0x1C1238B       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29447899      0x1C156DB       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29455979      0x1C1766B       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29456155      0x1C1771B       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29470043      0x1C1AD5B       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29485043      0x1C1E7F3       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
29496895      0x1C2163F       gzip compressed data, from NTFS filesystem (NT), last modified: 1970-01-01 00:00:00 (null date)
36341095      0x22A8567       Unix path: /lib/firmware/mellanoxD000081A416242A497001865BC3B/mlxsw_spectrum-13.2008.2406.mfa2
36342467      0x22A8AC3       xz compressed data
37822499      0x2412023       Unix path: /lib/firmware/mellanox/mlxsw_spectrum2-29.2008.2406.mfa2
37823106      0x2412282       xz compressed data
38935482      0x2521BBA       Unix path: /lib/firmware/mellanox/mlxsw_spectrum3-30.2008.2406.mfa2
38935957      0x2521D95       xz compressed data
42560238      0x2896AEE       Zlib compressed data, best compression
42561296      0x2896F10       Zlib compressed data, best compression
42568190      0x28989FE       Zlib compressed data, best compression
42574143      0x289A13F       Zlib compressed data, best compression
42919535      0x28EE66F       Zlib compressed data, best compression
42987187      0x28FEEB3       Zlib compressed data, best compression
43001547      0x29026CB       Zlib compressed data, best compression
43003751      0x2902F67       Zlib compressed data, best compression
43009609      0x2904649       Zlib compressed data, best compression
43012426      0x290514A       Zlib compressed data, best compression
43016822      0x2906276       Zlib compressed data, best compression
43019485      0x2906CDD       Zlib compressed data, best compression
43020256      0x2906FE0       Zlib compressed data, best compression
43026654      0x29088DE       Zlib compressed data, best compression
43033186      0x290A262       Zlib compressed data, best compression
43035049      0x290A9A9       Zlib compressed data, best compression
43041625      0x290C359       Zlib compressed data, best compression
43044778      0x290CFAA       Zlib compressed data, best compression
43049364      0x290E194       Zlib compressed data, best compression
43128220      0x292159C       Zlib compressed data, best compression
43128395      0x292164B       Zlib compressed data, best compression
43133729      0x2922B21       Zlib compressed data, best compression
43146898      0x2925E92       Zlib compressed data, best compression
43147278      0x292600E       Zlib compressed data, best compression
43148336      0x2926430       Zlib compressed data, best compression
43161331      0x29296F3       Zlib compressed data, best compression
43502272      0x297CAC0       Zlib compressed data, best compression
43570171      0x298D3FB       Zlib compressed data, best compression
43584611      0x2990C63       Zlib compressed data, best compression
43586809      0x29914F9       Zlib compressed data, best compression
43592650      0x2992BCA       Zlib compressed data, best compression
43595465      0x29936C9       Zlib compressed data, best compression
43599908      0x2994824       Zlib compressed data, best compression
43602574      0x299528E       Zlib compressed data, best compression
43603346      0x2995592       Zlib compressed data, best compression
43609216      0x2996C80       Zlib compressed data, best compression
43613139      0x2997BD3       Zlib compressed data, best compression
43615757      0x299860D       Zlib compressed data, best compression
43617613      0x2998D4D       Zlib compressed data, best compression
43624229      0x299A725       Zlib compressed data, best compression
43627383      0x299B377       Zlib compressed data, best compression
43631970      0x299C562       Zlib compressed data, best compression
43710994      0x29AFA12       Zlib compressed data, best compression
43711168      0x29AFAC0       Zlib compressed data, best compression
43716187      0x29B0E5B       Zlib compressed data, best compression
43716740      0x29B1084       Zlib compressed data, best compression
43729655      0x29B42F7       Zlib compressed data, best compression
43835920      0x29CE210       Zlib compressed data, default compression
43851256      0x29D1DF8       Zlib compressed data, default compression
43867188      0x29D5C34       Zlib compressed data, default compression
43883000      0x29D99F8       Zlib compressed data, default compression
43898692      0x29DD744       Zlib compressed data, default compression
43913800      0x29E1248       Zlib compressed data, default compression
43929260      0x29E4EAC       Zlib compressed data, default compression
43942524      0x29E827C       Zlib compressed data, default compression
43957112      0x29EBB78       Zlib compressed data, default compression
43960295      0x29EC7E7       Zlib compressed data, default compression
43975267      0x29F0263       Zlib compressed data, default compression
43991107      0x29F4043       Zlib compressed data, default compression
44007579      0x29F809B       Zlib compressed data, default compression
44019839      0x29FB07F       Zlib compressed data, default compression
44034179      0x29FE883       Zlib compressed data, default compression
44041587      0x2A00573       Zlib compressed data, default compression
44055971      0x2A03DA3       Zlib compressed data, default compression
44068899      0x2A07023       Zlib compressed data, default compression
44099762      0x2A0E8B2       Zlib compressed data, default compression
44114274      0x2A12162       Zlib compressed data, default compression
44115418      0x2A125DA       Zlib compressed data, default compression
44131166      0x2A1635E       Zlib compressed data, default compression
44146882      0x2A1A0C2       Zlib compressed data, default compression
44157642      0x2A1CACA       Zlib compressed data, default compression
44172326      0x2A20426       Zlib compressed data, default compression
44187338      0x2A23ECA       Zlib compressed data, default compression
44201086      0x2A2747E       Zlib compressed data, default compression
44227325      0x2A2DAFD       Zlib compressed data, default compression
44240753      0x2A30F71       Zlib compressed data, default compression
44256953      0x2A34EB9       Zlib compressed data, default compression
44271209      0x2A38669       Zlib compressed data, default compression
44286361      0x2A3C199       Zlib compressed data, default compression
44299657      0x2A3F589       Zlib compressed data, default compression
44314037      0x2A42DB5       Zlib compressed data, default compression
44324193      0x2A45561       Zlib compressed data, default compression
44338429      0x2A48CFD       Zlib compressed data, default compression
47567211      0x2D5D16B       Zip archive data, encrypted at least v2.0 to extract, compressed size: 163, uncompressed size: 1024, name: T1:X3_101115_1_8_1_expROM_FW_uni_template_eeprom0.bin
47567457      0x2D5D261       Zip archive data, encrypted at least v2.0 to extract, compressed size: 33, uncompressed size: 19, name: T1A:X3_101115_1_8_1_expROM_FW_uni_template_rmt_cmd_line.txt
47567579      0x2D5D2DB       Zip archive data, encrypted at least v2.0 to extract, compressed size: 239940, uncompressed size: 2097152, name: T1A:X3_101115_1_8_1_expROM_FW_uni_template_flash0.bin
47807608      0x2D97C78       Zip archive data, encrypted at least v2.0 to extract, compressed size: 163, uncompressed size: 1024, name: T1A:X3_101115_1_8_1_expROM_FW_uni_template_eeprom0.bin
47808460      0x2D97FCC       End of Zip archive, footer length: 22
47808484      0x2D97FE4       ASCII cpio archive (SVR4 with no CRC), file name: "usr/lib/firmware/vxge/X3fw.ncf", file name length: "0x0000001F", file size: "0x00057A86"
78097859      0x4A7ADC3       MySQL MISAM index file Version 5
91420612      0x572F7C4       Object signature in DER format (PKCS header length: 4, sequence length: 677
91421339      0x572FA9B       Unix path: /lib/modules//kernel/lib/zstd2000081A4162B30E3400050AF143/zstd_compress
117957065     0x707E1C9       Copyright string: "Copyright 2011 Canonical Ltd.  Licensed under the Ubuntu Font Licence 1.0MonoRegular  Version 0.80UbuntuMono-andare registered t"
117964519     0x707FEE7       Object signature in DER format (PKCS header length: 4, sequence length: 6414
117964639     0x707FF5F       Certificate in DER format (x509 v3), header length: 4, sequence length: 1366
117965630     0x708033E       Certificate in DER format (x509 v3), header length: 4, sequence length: 1024
117968145     0x7080D11       PNG image, 100 x 100, 8-bit/color RGBA, non-interlaced
117968304     0x7080DB0       Zlib compressed data, best compression
118172121     0x70B29D9       Zlib compressed data, best compression
118180535     0x70B4AB7       Zlib compressed data, default compression
118183100     0x70B54BC       Zlib compressed data, best compression
118183370     0x70B55CA       Zlib compressed data, best compression
118375331     0x70E43A3       Zlib compressed data, default compression

[2] binwalk repacked is much shorter:

DECIMAL       HEXADECIMAL     DESCRIPTION
--------------------------------------------------------------------------------
0             0x0             ASCII cpio archive (SVR4 with no CRC), file name: ".", file name length: "0x00000002", file size: "0x00000000"
112           0x70            ASCII cpio archive (SVR4 with no CRC), file name: "kernel", file name length: "0x00000007", file size: "0x00000000"
232           0xE8            ASCII cpio archive (SVR4 with no CRC), file name: "kernel/x86", file name length: "0x0000000B", file size: "0x00000000"
356           0x164           ASCII cpio archive (SVR4 with no CRC), file name: "kernel/x86/microcode", file name length: "0x00000015", file size: "0x00000000"
488           0x1E8           ASCII cpio archive (SVR4 with no CRC), file name: "kernel/x86/microcode/AuthenticAMD.bin", file name length: "0x00000026", file size: "0x00007752"
31184         0x79D0          ASCII cpio archive (SVR4 with no CRC), file name: "TRAILER!!!", file name length: "0x0000000B", file size: "0x00000000"
31744         0x7C00          ASCII cpio archive (SVR4 with no CRC), file name: "kernel", file name length: "0x00000007", file size: "0x00000000"
31864         0x7C78          ASCII cpio archive (SVR4 with no CRC), file name: "kernel/x86", file name length: "0x0000000B", file size: "0x00000000"
31988         0x7CF4          ASCII cpio archive (SVR4 with no CRC), file name: "kernel/x86/microcode", file name length: "0x00000015", file size: "0x00000000"
32120         0x7D78          ASCII cpio archive (SVR4 with no CRC), file name: "kernel/x86/microcode/GenuineIntel.bin", file name length: "0x00000026", file size: "0x004C8000"
5045772       0x4CFE0C        ASCII cpio archive (SVR4 with no CRC), file name: "kernel/x86/microcode/.enuineIntel.align.0123456789abc", file name length: "0x00000036", file size: "0x00000000"
5045936       0x4CFEB0        ASCII cpio archive (SVR4 with no CRC), file name: "TRAILER!!!", file name length: "0x0000000B", file size: "0x00000000"
5046272       0x4D0000        LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: -1 bytes
15101115      0xE66CBB        Encrypted Hilink uImage firmware header
28331955      0x1B04FB3       Windows Script Encoded Data (screnc.exe)
1

1 Answer 1

1

"initrd" is an old name for Linux mechanism that was reshaped and extended into its current form that is known as initramfs. Debian/Ubuntu/Mint uses the old initrd.img-<kernel version> naming scheme for historical reasons, although it is really an initramfs file.

Microcode updates are non-persistent: they need to be reloaded every time the system is booted, to avoid just the kind of situations you seem to be afraid of. If a microcode update breaks your system, you just reset the system to get rid of the failed update, and reboot using an initramfs that does not include the buggy microcode update.

Some severe hardware bugs (in e.g. Intel Haswell and Broadwell CPUs) require that the microcode update that works around the bug is loaded before particular CPU features are used at all (since last CPU reset). To guarantee that this requirement is satisfied, an early microcode load functionality was built into Linux kernel, and is now the preferred form of CPU microcode updates. It loads the applicable microcode update as early in the boot process as possible.

The TRAILER!!! is a standard marker at the end cpio archives. See this cpio file format document in IBM z/OS documentation for more details.

The last record of the archive always contains the name TRAILER!!!.

Some AMD GPUs also require firmware to work, and those firmware files are included to allow switching the display to high-resolution graphics mode as early in the boot as possible, to be able to display a nice splash screen at boot. As you discovered, it is possible to omit them and the system will still boot, although if you have the GPU that would require firmware, it means the display resolution switch happens a bit later (like about 0.5 seconds later, with modern systems... "blink and you miss it").

Since binwalk attempts to look inside files to detect recognizable data structures, it may detect things like DER-format certificates that are part of e.g. GPU firmware files, or copyright strings.

Cisco IOS microcode, for "" is probably a misidentification resulting from a very short "magic string" used to identify it.

1
  • Thank you. 1. How to add Unix path firmware back to the file? I don't know better way to extract initramfs than unmkinitramfs. 2, Also I've noticed in my re-packed files now there is Windows Script Encoded Data (screnc.exe) which was not in the output of binwalk on original file. What does it mean? Commented Dec 30, 2022 at 1:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .