> sudo find | sudo cpio -o -H newc | sudo gzip -1 > ../456.gz
18182 blocks
> ./advdef -z4 456.gz
4230967 3701889 87% 456.gz
4230967 3701889 87%
> sudo find | sudo cpio -o -H newc | sudo gzip -9 > ../456.gz
18182 blocks
> ./advdef -z4 456.gz
3846705 3701889 96% 456.gz
3846705 3701889 96%
> ./advdef -V
advancecomp v2.1 by Andrea Mazzoleni, http://www.advancemame.it> sudo find | sudo cpio -o -H newc ../123.cpio
> 7z a -tgzip -mx9 123.gz 123.cpio
7-Zip 26.00 (x64) : Copyright (c) 1999-2026 Igor Pavlov : 2026-02-12
64-bit locale=en_US.UTF-8 Threads:12 OPEN_MAX:1024, ASM
Scanning the drive:
1 file, 9309184 bytes (9091 KiB)
Creating archive: 123.gz
Add new data to archive: 1 file, 9309184 bytes (9091 KiB)
Files read from disk: 1
Archive size: 3684655 bytes (3599 KiB)
Everything is Ok> ls -alB
drwxr-xr-x - abc 13 Mär 12:18 .
drwxr-xr-x@ - abc 13 Mär 12:12 ..
drwxr-xr-x - abc 13 Mär 12:10 tmp
.rw-r--r-- 9.309.184 abc 13 Mär 10:49 123.cpio
.rw-r--r-- 3.684.655 abc 13 Mär 11:55 123.gz
.rw-r--r-- 3.701.889 abc 13 Mär 12:18 456.gz
.rwxr-xr-x 97.456 abc 3 Nov 2018 advdef
.rw-r--r-- 3.697.459 abc 8 Mär 15:22 rootfs.gzThe rootfs is decompressed into RAM, so the size on the disk is not important.1. Really? this is "disturbing", that using same original compression program offered by TC and the same input original TC data, for a single-threaded advdef you said I can not obtain the same result.
Reproducing compression is nearly impossible….even though it is lossless.
... 2. The decompressed size in RAM is/must/should be the same because is LossLESS algorithm, but size on disk/ storage matters also (a little?) because is the boot-loader speed to read+load rootfs.gz in memory FROM HDD/USB/CDROM. ...Boot loader speed will also be influenced by the storage device:
CDROM Slowest
USB Faster
HDD Much faster
SSD Fastest
> inxi
CPU: 10-core (2-mt/8-st) 13th Gen Intel Core i5-1335U (-MST AMCP-)
speed/min/max: 400/400/4600:3400 MHz Kernel: 6.19.6-2-cachyos x86_64 Up: 2m
Mem: 2.6/31.06 GiB (8.4%) Storage: 476.94 GiB (6.4% used) Procs: 276
Shell: fish inxi: 3.3.401. Really? this is "disturbing", that using same original compression program offered by TC and the same input original TC data, for a single-threaded advdef you said I can not obtain the same result.
sudo find -type f -printf '%s %p\n' | sort -n | cut -f2 -d" " | sudo cpio -o -H newc > ../x1.cpio
18057 blocks
#normal un-sorted cpio
sudo find | sudo cpio -o -H newc > ../x2.cpio
18182 blocks
> ls -alB ../x*
.rw-r--r-- 9.245.184 abc 13 Mär 19:16 ../x1.cpio
.rw-r--r-- 9.309.184 abc 13 Mär 19:16 ../x2.cpio > gzip -1 x1.cpio
> gzip -1 x2.cpio
> ls -alB ./x*.gz
.rw-r--r-- 3.677.872 abc 13 Mär 19:20 ./x0.gz
.rw-r--r-- 4.218.542 abc 13 Mär 19:16 ./x1.cpio.gz
.rw-r--r-- 4.230.975 abc 13 Mär 19:16 ./x2.cpio.gz > ./advdef -z4 x1.cpio.gz
4218542 3695808 87% x1.cpio.gz
4218542 3695808 87%
> ./advdef -z4 x2.cpio.gz
4230975 3701897 87% x2.cpio.gz
4230975 3701897 87%
> ls -alB ./x*.gz
.rw-r--r-- 3.677.872 abc 13 Mär 19:20 ./x0.gz ; 7zip of sorted X0.cpio
.rw-r--r-- 3.695.808 abc 13 Mär 19:25 ./x1.cpio.gz ; advdef of x1.cpio (pre-sorted)
.rw-r--r-- 3.701.897 abc 13 Mär 19:26 ./x2.cpio.gz ; advdef of x2.cpio not-sortedso with pre-sorted x0.cpio I obtained with 7z even a better rootfs.gz , than initial reported .rw-r--r-- 3.684.655 abc 13 Mär 11:55 123.gzsummary: best in class solution (until now): 7z ver.26 with per-sorted cpio archive.
1 . One of your stated goals was trying to exactly produce the distributed initrd.gz file, which I was trying to help you understand was impossible.1. I try to understand first, then maybe to improve TC17. There are NO clear instructions how to reproduce rootfs.gz. If it can not be reproduced then so be it. Survive but not happy.
2. If your definition of better is the compressed size of the initrd, then why not use xz or zstd to compress the image.
3. If your definition of better is boot time, did you try a uncompressed initrd, or just a gzip -1 compressed file.
-rw-r--r-- 1 paul paul 12633088 Mar 13 19:46 rootfs-piCore64-17.0.uncompressed
-rw-r--r-- 1 paul paul 4466798 Mar 13 19:42 rootfs-piCore64-17.0.gzip9
-rw-rw-r-- 1 paul paul 4246873 Mar 13 19:49 rootfs-piCore64-17.0.gz.advdevz4
-rw-rw-r-- 1 paul paul 4235095 Mar 13 19:50 rootfs-piCore64-17.0.gz.7zmx9
-rw-r--r-- 1 paul paul 4206895 Mar 13 19:42 rootfs-piCore64-17.0.pigz.zopfli.noiterations
-rw-r--r-- 1 paul paul 4205410 Mar 13 19:42 rootfs-piCore64-17.0.pigz.zopfli.I100
-rw-r--r-- 1 paul paul 4006378 Mar 13 19:42 rootfs-piCore64-17.0.zst-10
-rw-r--r-- 1 paul paul 3458360 Mar 13 19:42 rootfs-piCore64-17.0.zst-19
-rw-r--r-- 1 paul paul 3030460 Mar 13 19:42 rootfs-piCore64-17.0.xz-6
gzip9: mesreal 0m0.078s
advdef: real 0m0.075s
7zmx9: real 0m0.085s
pigzzopfli: real 0m0.075s
pigzzopfli100: real 0m0.091s
zstd-10: real 0m0.035s
zstd-19: real 0m0.028s
xz: real 0m0.154s[ 0.031569] Trying to unpack rootfs image as initramfs...
[ 0.102147] Freeing initrd memory: 5664K
[ 0.630088] Run /init as init process
[ 0.038710] Trying to unpack rootfs image as initramfs...
[ 0.080141] Freeing initrd memory: 5424K
[ 0.633339] Run /init as init process