Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass all modules from O2/O3 (optimized for speed) to Os (optimize for space) #1121

Merged
merged 1 commit into from
Mar 8, 2023

Conversation

tlaurion
Copy link
Collaborator

@tlaurion tlaurion commented Feb 22, 2022

Adresses @aesrentai suggestion to pass modules optimization from O2 (performance) to Os (space) here: #590 (comment)

Will comment on gains after build succeeds.
Still impossible as of now to build xx30-flash boards on top of linux 5.10.4...... EDIT: without kernel networking support, this now passes.

@tlaurion
Copy link
Collaborator Author

tlaurion commented Feb 23, 2022

Rebased on master to reuse CircleCI 4.11 fixed cache by #1122

@tlaurion
Copy link
Collaborator Author

tlaurion commented Feb 24, 2022

Checkspots:

  • Builds are happening for a new build. Compare boards hashes.txt between builds to see if reproducibility is more broken then with O2. Should not be the case, since make is now being correctly build, and musl-cross-make is being used to build all modules not coreboot, and coreboot toolchain is reproducible to build coreboot. So checking hashes.txt across builds (between different CircleCI used caches) should point new reproducibility errors.
  • Make sure passing CFLAGS in modules is not removing ./configure passed CFLAGS for built modules. We might want to reuse and expend CFLAGS, not just overwrite them.

Todo:

  • Expose space gains before and after passing 02 -> Os.

  • Make issues for reproducibility issues.

  • Update trace of external commands. We should expect to not have any external calls to Make but the built one from now on.

    • We now depend on OS locally exposed gawk and make

@tlaurion
Copy link
Collaborator Author

Not all modules are passed from default O2 to Os as of original commit:
user@heads-tests:~/heads$ find modules/ | while read line; do echo $line; grep Os $line; done

modules/libassuan
modules/io386
modules/popt
modules/libusb-compat
modules/msrtools
modules/zlib
	CFLAGS="-Os" \
modules/coreboot
modules/gpg
	CFLAGS="-Os"  \
modules/flashtools
modules/libksba
modules/musl-cross
modules/libusb
modules/libgcrypt
	CFLAGS="-Os"  \
modules/frotz
modules/dropbear
modules/slang
modules/lvm2
	CFLAGS="-Os"  \
modules/gpg2
modules/libhidapi-libusb
	CC="$(heads_cc) -Os" \
modules/u-root
modules/json-c
modules/fbwhiptail
modules/linuxboot
modules/kexec
modules/busybox
	CFLAGS="-Os"  \
modules/npth
modules/tpmtotp
	CFLAGS="-I$(INSTALL)/include -Os" \
modules/linux
modules/hidapi
modules/hotp-verification
modules/mbedtls
modules/nkstorecli
modules/libgpg-error
	CFLAGS="-Os"  \
modules/cairo
	CFLAGS="-DCAIRO_NO_MUTEX=1 -Os"  \
modules/util-linux
	CFLAGS="-Os"  \
modules/flashrom
	CFLAGS="-Os" \
modules/coreboot-blobs
modules/libnitrokey
	-DCMAKE_CXX_FLAGS="-Os -fdata-sections -ffunction-sections -ffile-prefix-map=$(pwd)=heads -gno-record-gcc-switches -D__MUSL__ -I$(INSTALL)/include -L$(INSTALL)/lib " \
modules/newt
modules/pixman
	CFLAGS="-Os"  \
modules/qrencode
modules/purism-blobs
modules/pinentry
modules/cryptsetup
	CFLAGS="-Os" \
modules/cryptsetup2
modules/pciutils
modules/libpng
	CFLAGS="-Os" \

@tlaurion
Copy link
Collaborator Author

Master at 2cfa940

Comparison is done on downloaded initrd.cpio.xz from CircleCI artifact, doing:
xz -d initrd.cpio.xz ; for i in initrd.cpio modules.cpio tools.cpio heads.cpio; do cpio -i < $i; done && find . -type f -ls | sort -r -n -k7

user@heads-tests:/tmp/master$ find . -type f -ls | sort -r -n -k7
   134004  12564 -rw-r--r--   1 user     user     12879360 Jun 28 13:07 ./initrd.cpio
   134108   1592 -rwx------   1 user     user      1627856 Jun 30 12:35 ./bin/lvm
   134231   1136 -rwx------   1 user     user      1160520 Jun 30 12:35 ./lib/libgcrypt.so.20
   134065    896 -rwx------   1 user     user       915328 Jun 30 12:35 ./bin/gpg
   134228    740 -rwx------   1 user     user       757232 Jun 30 12:35 ./lib/libcairo.so.2
   134239    652 -rwx------   1 user     user       666216 Jun 30 12:35 ./lib/libpixman-1.so.0
   134227    584 -rwx------   1 user     user       596544 Jun 30 12:35 ./lib/libc.so
   134053    568 -rwx------   1 user     user       580568 Jun 30 12:35 ./bin/flashrom
   134017    496 -rwx------   1 user     user       507776 Jun 30 12:35 ./bin/busybox
   134229    456 -rwx------   1 user     user       464560 Jun 30 12:35 ./lib/libcryptsetup.so.12
   134144    408 -rwx------   1 user     user       416040 Jun 30 12:35 ./bin/scdaemon
   134066    372 -rwx------   1 user     user       380120 Jun 30 12:35 ./bin/gpg-agent
   134243    332 -rwx------   1 user     user       339304 Jun 30 12:35 ./lib/libtpm.so
   134230    328 -rwx------   1 user     user       333240 Jun 30 12:35 ./lib/libdevmapper.so.1.02
   134235    320 -rwx------   1 user     user       325104 Jun 30 12:35 ./lib/libmbedcrypto.so.0
   134248    300 -rw-------   1 user     user       304272 Jun 30 12:35 ./lib/modules/e1000e.ko
   134226    268 -rwx------   1 user     user       271040 Jun 30 12:35 ./lib/libblkid.so.1
   134234    252 -rwx------   1 user     user       256376 Jun 30 12:35 ./lib/libksba.so.8
   134240    204 -rwx------   1 user     user       207912 Jun 30 12:35 ./lib/libpng16.so.16
   134041    184 -rwx------   1 user     user       184824 Jun 30 12:35 ./bin/dropbear
   134162    176 -rwx------   1 user     user       176408 Jun 30 12:35 ./bin/ssh
   134084    168 -rwx------   1 user     user       170984 Jun 30 12:35 ./bin/kexec
   134252    160 -rw-------   1 user     user       159840 Jun 30 12:35 ./lib/modules/xhci-hcd.ko
   134040    136 -rwx------   1 user     user       137464 Jun 30 12:35 ./bin/dmsetup
   134251    132 -rw-------   1 user     user       132360 Jun 30 12:35 ./lib/modules/usb-storage.ko
   134232    128 -rwx------   1 user     user       130000 Jun 30 12:35 ./lib/libgpg-error.so.0
   134178    124 -rwx------   1 user     user       126584 Jun 30 12:35 ./bin/tpm
   134030    116 -rwx------   1 user     user       115192 Jun 30 12:35 ./bin/cryptsetup
   134247    108 -rwx------   1 user     user       108832 Jun 30 12:35 ./lib/libz.so.1
   134245     96 -rwx------   1 user     user        96896 Jun 30 12:35 ./lib/libusb-1.0.so.0
   134031     88 -rwx------   1 user     user        87968 Jun 30 12:35 ./bin/cryptsetup-reencrypt
   134233     80 -rwx------   1 user     user        81024 Jun 30 12:35 ./lib/libjson-c.so.5
   134225     76 -rwx------   1 user     user        76736 Jun 30 12:35 ./lib/libassuan.so.0
   134105     72 -rwx------   1 user     user        73600 Jun 30 12:35 ./bin/lspci
   134249     64 -rw-------   1 user     user        64800 Jun 30 12:35 ./lib/modules/ehci-hcd.ko
   134238     52 -rwx------   1 user     user        52272 Jun 30 12:35 ./lib/libpci.so.3.5.4
   134237     52 -rwx------   1 user     user        52272 Jun 30 12:35 ./lib/libpci.so.3
   134130     52 -rwx------   1 user     user        52200 Jun 30 12:35 ./bin/pinentry-tty
   134049     52 -rwx------   1 user     user        51616 Jun 30 12:35 ./bin/fbwhiptail
   134241     48 -rwx------   1 user     user        48088 Jun 30 12:35 ./lib/libpopt.so.0
   134242     48 -rwx------   1 user     user        47448 Jun 30 12:35 ./lib/libqrencode.so.3
   134195     48 -rwx------   1 user     user        45264 Jun 30 12:35 ./bin/veritysetup
   134081     32 -rwx------   1 user     user        29944 Jun 30 12:35 ./bin/hotp_verification
   134211     28 -rw-------   1 user     user        27936 Jun 30 12:35 ./etc/distro/keys/tails.key
   134023     28 -rwx------   1 user     user        27048 Jun 30 12:35 ./bin/cbmem
   134123     24 -rwx------   1 user     user        24517 Jun 30 12:35 ./bin/oem-factory-reset
   134145     24 -rwx------   1 user     user        22664 Jun 30 12:35 ./bin/scp
   134055     24 -rwx------   1 user     user        22432 Jun 30 12:35 ./bin/flashtool
   134071     20 -rwx------   1 user     user        18844 Jun 30 12:35 ./bin/gui-init
   134244     20 -rwx------   1 user     user        18464 Jun 30 12:35 ./lib/libusb-0.1.so.4
   134021     20 -rwx------   1 user     user        18352 Jun 30 12:35 ./bin/cbfs
   134183     20 -rwx------   1 user     user        18320 Jun 30 12:35 ./bin/uefi
   134246     16 -rwx------   1 user     user        14656 Jun 30 12:35 ./lib/libuuid.so.1
   134236     16 -rwx------   1 user     user        14552 Jun 30 12:35 ./lib/libnpth.so.0
   134133     16 -rwx------   1 user     user        14200 Jun 30 12:35 ./bin/poke
   134250     12 -rw-------   1 user     user        10728 Jun 30 12:35 ./lib/modules/ehci-pci.ko
   134253     12 -rw-------   1 user     user        10568 Jun 30 12:35 ./lib/modules/xhci-pci.ko
   134127     12 -rwx------   1 user     user        10096 Jun 30 12:35 ./bin/peek
   134012     12 -rwx------   1 user     user        10088 Jun 30 12:35 ./bin/base32
   134176     12 -rwx------   1 user     user        10048 Jun 30 12:35 ./bin/totp
   134079     12 -rwx------   1 user     user        10024 Jun 30 12:35 ./bin/hotp
   134093     12 -rwx------   1 user     user        10022 Jun 30 12:35 ./bin/kexec-select-boot
   134217     12 -rw-------   1 user     user         9734 Jun 30 12:35 ./etc/luks-functions
   134067     12 -rwx------   1 user     user         9003 Jun 30 12:35 ./bin/gpg-gui.sh
   134213     12 -rwx------   1 user     user         8892 Jun 30 12:35 ./etc/functions
   134138      8 -rwx------   1 user     user         5912 Jun 30 12:35 ./bin/qrenc
   134052      8 -rwx------   1 user     user         5268 Jun 30 12:35 ./bin/flash.sh
   134027      8 -rwx------   1 user     user         5030 Jun 30 12:35 ./bin/config-gui.sh
   134092      8 -rwx------   1 user     user         4195 Jun 30 12:35 ./bin/kexec-seal-key
   134222      4 -rwx------   1 user     user         3891 Jun 30 12:35 ./init
   134089      4 -rwx------   1 user     user         3785 Jun 30 12:35 ./bin/kexec-parse-boot
   134116      4 -rwx------   1 user     user         3510 Jun 30 12:35 ./bin/mount-usb
   134090      4 -rwx------   1 user     user         3408 Jun 30 12:35 ./bin/kexec-save-default
   134146      4 -rwx------   1 user     user         3381 Jun 30 12:35 ./bin/seal-hotpkey
   134085      4 -rwx------   1 user     user         3118 Jun 30 12:35 ./bin/kexec-boot
   134210      4 -rw-------   1 user     user         3078 Jun 30 12:35 ./etc/distro/keys/qubes-testing.key
   134051      4 -rwx------   1 user     user         2557 Jun 30 12:35 ./bin/flash-gui.sh
   134086      4 -rwx------   1 user     user         2344 Jun 30 12:35 ./bin/kexec-insert-key
   134124      4 -rwx------   1 user     user         2303 Jun 30 12:35 ./bin/oem-system-info-xx30
   134193      4 -rwx------   1 user     user         2101 Jun 30 12:35 ./bin/usb-scan
   134088      4 -rwx------   1 user     user         2059 Jun 30 12:35 ./bin/kexec-parse-bls
   134147      4 -rwx------   1 user     user         2026 Jun 30 12:35 ./bin/seal-totp
   134094      4 -rwx------   1 user     user         1909 Jun 30 12:35 ./bin/kexec-sign-config
   134215      4 -rwx------   1 user     user         1888 Jun 30 12:35 ./etc/gui_functions
   134188      4 -rwx------   1 user     user         1838 Jun 30 12:35 ./bin/unseal-hotp
   134208      4 -rw-------   1 user     user         1725 Jun 30 12:35 ./etc/distro/keys/archlinux.key
   134091      4 -rwx------   1 user     user         1677 Jun 30 12:35 ./bin/kexec-save-key
   134209      4 -rw-------   1 user     user         1629 Jun 30 12:35 ./etc/distro/keys/qubes-4.key
   134119      4 -rwx------   1 user     user         1596 Jun 30 12:35 ./bin/network-init-recovery
   134087      4 -rwx------   1 user     user         1430 Jun 30 12:35 ./bin/kexec-iso-init
   134254      4 -rwx------   1 user     user         1373 Jun 30 12:35 ./mount-boot
   134063      4 -rwx------   1 user     user         1299 Jun 30 12:35 ./bin/generic-init
   133722      4 -rw-------   1 user     user         1247 Jun 30 12:35 ./.ash_history
   134080      4 -rwx------   1 user     user         1087 Jun 30 12:35 ./bin/hotp_initialize
   134095      4 -rwx------   1 user     user         1044 Jun 30 12:35 ./bin/kexec-unseal-key
   134271      4 -rwx------   1 user     user         1000 Jun 30 12:35 ./sbin/insmod
   134260      4 -rwx------   1 user     user          922 Jun 30 12:35 ./sbin/config-dhcp.sh
   134022      4 -rwx------   1 user     user          799 Jun 30 12:35 ./bin/cbfs-init
   134096      4 -rwx------   1 user     user          770 Jun 30 12:35 ./bin/key-init
   134179      4 -rwx------   1 user     user          694 Jun 30 12:35 ./bin/tpm-reset
   134184      4 -rwx------   1 user     user          661 Jun 30 12:35 ./bin/uefi-init
   134189      4 -rwx------   1 user     user          634 Jun 30 12:35 ./bin/unseal-totp
   134207      4 -rw-------   1 user     user          625 Jun 30 12:35 ./etc/config
   134201      4 -rwx------   1 user     user          574 Jun 30 12:35 ./bin/x230-flash.init
   134168      4 -rwx------   1 user     user          574 Jun 30 12:35 ./bin/t430-flash.init
   134139      4 -rwx------   1 user     user          538 Jun 30 12:35 ./bin/qubes-measure-luks
   134054      4 -rwx------   1 user     user          360 Jun 30 12:35 ./bin/flashrom-kgpe-d16-openbmc.sh
   134199      4 -rwx------   1 user     user          320 Jun 30 12:35 ./bin/wget-measure.sh
   134140      4 -rwx------   1 user     user          258 Jun 30 12:35 ./bin/reboot
   134192      4 -rwx------   1 user     user          220 Jun 30 12:35 ./bin/usb-init
   134134      4 -rwx------   1 user     user          205 Jun 30 12:35 ./bin/poweroff
   134212      4 -rw-------   1 user     user          197 Jun 30 12:35 ./etc/fstab
   134218      4 -rw-------   1 user     user          174 Jun 30 12:35 ./etc/motd
   134068      4 -rwx------   1 user     user          106 Jun 30 12:35 ./bin/gpgv
   134005      4 -rw-------   1 user     user           73 Jun 30 12:35 ./.gnupg/gpg-agent.conf
   134200      4 -rwx------   1 user     user           35 Jun 30 12:35 ./bin/whiptail
   134221      4 -rw-------   1 user     user           27 Jun 30 12:35 ./etc/shells
   134220      4 -rw-------   1 user     user           27 Jun 30 12:35 ./etc/passwd
   134216      4 -rw-------   1 user     user           20 Jun 30 12:35 ./etc/hosts
   134214      4 -rw-------   1 user     user           10 Jun 30 12:35 ./etc/group
   134006      4 -rw-------   1 user     user           10 Jun 30 12:35 ./.gnupg/gpg.conf
   134255      0 -rw-------   1 user     user            0 Jun 30 12:35 ./run/cryptsetup/.placeholder

Current optimization of this PR effect:

user@heads-tests:/tmp/pr$ find . -type f -ls | sort -r -n -k7
   133724  11644 -rw-r--r--   1 user     user     11938816 Jun 30 11:32 ./initrd.cpio
   133821   1384 -rwx------   1 user     user      1414928 Jun 30 12:35 ./bin/lvm
   133948   1032 -rwx------   1 user     user      1054216 Jun 30 12:35 ./lib/libgcrypt.so.20
   133780    896 -rwx------   1 user     user       915328 Jun 30 12:35 ./bin/gpg
   133944    584 -rwx------   1 user     user       596544 Jun 30 12:35 ./lib/libc.so
   133774    568 -rwx------   1 user     user       580568 Jun 30 12:35 ./bin/flashrom
   133956    560 -rwx------   1 user     user       572016 Jun 30 12:35 ./lib/libpixman-1.so.0
   133738    496 -rwx------   1 user     user       507776 Jun 30 12:35 ./bin/busybox
   133945    480 -rwx------   1 user     user       491024 Jun 30 12:35 ./lib/libcairo.so.2
   133946    456 -rwx------   1 user     user       464560 Jun 30 12:35 ./lib/libcryptsetup.so.12
   133857    408 -rwx------   1 user     user       416040 Jun 30 12:35 ./bin/scdaemon
   133781    372 -rwx------   1 user     user       380120 Jun 30 12:35 ./bin/gpg-agent
   133952    320 -rwx------   1 user     user       325104 Jun 30 12:35 ./lib/libmbedcrypto.so.0
   133960    308 -rwx------   1 user     user       314728 Jun 30 12:35 ./lib/libtpm.so
   133965    300 -rw-------   1 user     user       304272 Jun 30 12:35 ./lib/modules/e1000e.ko
   133947    280 -rwx------   1 user     user       284184 Jun 30 12:35 ./lib/libdevmapper.so.1.02
   133951    252 -rwx------   1 user     user       256376 Jun 30 12:35 ./lib/libksba.so.8
   133943    236 -rwx------   1 user     user       238208 Jun 30 12:35 ./lib/libblkid.so.1
   133762    184 -rwx------   1 user     user       184824 Jun 30 12:35 ./bin/dropbear
   133876    176 -rwx------   1 user     user       176408 Jun 30 12:35 ./bin/ssh
   133957    168 -rwx------   1 user     user       171032 Jun 30 12:35 ./lib/libpng16.so.16
   133797    168 -rwx------   1 user     user       170984 Jun 30 12:35 ./bin/kexec
   133969    160 -rw-------   1 user     user       159840 Jun 30 12:35 ./lib/modules/xhci-hcd.ko
   133968    132 -rw-------   1 user     user       132360 Jun 30 12:35 ./lib/modules/usb-storage.ko
   133761    120 -rwx------   1 user     user       121080 Jun 30 12:35 ./bin/dmsetup
   133894    116 -rwx------   1 user     user       118392 Jun 30 12:35 ./bin/tpm
   133751    116 -rwx------   1 user     user       115192 Jun 30 12:35 ./bin/cryptsetup
   133949    108 -rwx------   1 user     user       109520 Jun 30 12:35 ./lib/libgpg-error.so.0
   133962     96 -rwx------   1 user     user        96896 Jun 30 12:35 ./lib/libusb-1.0.so.0
   133752     88 -rwx------   1 user     user        87968 Jun 30 12:35 ./bin/cryptsetup-reencrypt
   133950     80 -rwx------   1 user     user        81024 Jun 30 12:35 ./lib/libjson-c.so.5
   133942     76 -rwx------   1 user     user        76736 Jun 30 12:35 ./lib/libassuan.so.0
   133964     76 -rwx------   1 user     user        76040 Jun 30 12:35 ./lib/libz.so.1
   133818     72 -rwx------   1 user     user        73600 Jun 30 12:35 ./bin/lspci
   133966     64 -rw-------   1 user     user        64800 Jun 30 12:35 ./lib/modules/ehci-hcd.ko
   133955     52 -rwx------   1 user     user        52272 Jun 30 12:35 ./lib/libpci.so.3.5.4
   133954     52 -rwx------   1 user     user        52272 Jun 30 12:35 ./lib/libpci.so.3
   133843     52 -rwx------   1 user     user        52200 Jun 30 12:35 ./bin/pinentry-tty
   133770     52 -rwx------   1 user     user        51616 Jun 30 12:35 ./bin/fbwhiptail
   133958     48 -rwx------   1 user     user        48088 Jun 30 12:35 ./lib/libpopt.so.0
   133959     48 -rwx------   1 user     user        47448 Jun 30 12:35 ./lib/libqrencode.so.3
   133912     48 -rwx------   1 user     user        45264 Jun 30 12:35 ./bin/veritysetup
   133928     28 -rw-------   1 user     user        27936 Jun 30 12:35 ./etc/distro/keys/tails.key
   133744     28 -rwx------   1 user     user        27048 Jun 30 12:35 ./bin/cbmem
   133836     24 -rwx------   1 user     user        24517 Jun 30 12:35 ./bin/oem-factory-reset
   133858     24 -rwx------   1 user     user        22664 Jun 30 12:35 ./bin/scp
   133776     24 -rwx------   1 user     user        22432 Jun 30 12:35 ./bin/flashtool
   133786     20 -rwx------   1 user     user        18844 Jun 30 12:35 ./bin/gui-init
   133961     20 -rwx------   1 user     user        18464 Jun 30 12:35 ./lib/libusb-0.1.so.4
   133742     20 -rwx------   1 user     user        18352 Jun 30 12:35 ./bin/cbfs
   133899     20 -rwx------   1 user     user        18320 Jun 30 12:35 ./bin/uefi
   133963     16 -rwx------   1 user     user        14720 Jun 30 12:35 ./lib/libuuid.so.1
   133953     16 -rwx------   1 user     user        14552 Jun 30 12:35 ./lib/libnpth.so.0
   133846     16 -rwx------   1 user     user        14200 Jun 30 12:35 ./bin/poke
   133967     12 -rw-------   1 user     user        10728 Jun 30 12:35 ./lib/modules/ehci-pci.ko
   133970     12 -rw-------   1 user     user        10568 Jun 30 12:35 ./lib/modules/xhci-pci.ko
   133840     12 -rwx------   1 user     user        10096 Jun 30 12:35 ./bin/peek
   133892     12 -rwx------   1 user     user        10032 Jun 30 12:35 ./bin/totp
   133806     12 -rwx------   1 user     user        10022 Jun 30 12:35 ./bin/kexec-select-boot
   133934     12 -rw-------   1 user     user         9734 Jun 30 12:35 ./etc/luks-functions
   133782     12 -rwx------   1 user     user         9003 Jun 30 12:35 ./bin/gpg-gui.sh
   133930     12 -rwx------   1 user     user         8892 Jun 30 12:35 ./etc/functions
   133794      8 -rwx------   1 user     user         5912 Jun 30 12:35 ./bin/hotp
   133732      8 -rwx------   1 user     user         5912 Jun 30 12:35 ./bin/base32
   133851      8 -rwx------   1 user     user         5904 Jun 30 12:35 ./bin/qrenc
   133773      8 -rwx------   1 user     user         5268 Jun 30 12:35 ./bin/flash.sh
   133748      8 -rwx------   1 user     user         5030 Jun 30 12:35 ./bin/config-gui.sh
   133805      8 -rwx------   1 user     user         4195 Jun 30 12:35 ./bin/kexec-seal-key
   133939      4 -rwx------   1 user     user         3891 Jun 30 12:35 ./init
   133802      4 -rwx------   1 user     user         3785 Jun 30 12:35 ./bin/kexec-parse-boot
   133829      4 -rwx------   1 user     user         3510 Jun 30 12:35 ./bin/mount-usb
   133803      4 -rwx------   1 user     user         3408 Jun 30 12:35 ./bin/kexec-save-default
   133859      4 -rwx------   1 user     user         3381 Jun 30 12:35 ./bin/seal-hotpkey
   133798      4 -rwx------   1 user     user         3118 Jun 30 12:35 ./bin/kexec-boot
   133927      4 -rw-------   1 user     user         3078 Jun 30 12:35 ./etc/distro/keys/qubes-testing.key
   133772      4 -rwx------   1 user     user         2557 Jun 30 12:35 ./bin/flash-gui.sh
   133799      4 -rwx------   1 user     user         2344 Jun 30 12:35 ./bin/kexec-insert-key
   133837      4 -rwx------   1 user     user         2303 Jun 30 12:35 ./bin/oem-system-info-xx30
   133910      4 -rwx------   1 user     user         2101 Jun 30 12:35 ./bin/usb-scan
   133801      4 -rwx------   1 user     user         2059 Jun 30 12:35 ./bin/kexec-parse-bls
   133860      4 -rwx------   1 user     user         2026 Jun 30 12:35 ./bin/seal-totp
   133807      4 -rwx------   1 user     user         1909 Jun 30 12:35 ./bin/kexec-sign-config
   133932      4 -rwx------   1 user     user         1888 Jun 30 12:35 ./etc/gui_functions
   133905      4 -rwx------   1 user     user         1838 Jun 30 12:35 ./bin/unseal-hotp
   133925      4 -rw-------   1 user     user         1725 Jun 30 12:35 ./etc/distro/keys/archlinux.key
   133804      4 -rwx------   1 user     user         1677 Jun 30 12:35 ./bin/kexec-save-key
   133926      4 -rw-------   1 user     user         1629 Jun 30 12:35 ./etc/distro/keys/qubes-4.key
   133832      4 -rwx------   1 user     user         1596 Jun 30 12:35 ./bin/network-init-recovery
   133800      4 -rwx------   1 user     user         1430 Jun 30 12:35 ./bin/kexec-iso-init
   133971      4 -rwx------   1 user     user         1373 Jun 30 12:35 ./mount-boot
   133778      4 -rwx------   1 user     user         1299 Jun 30 12:35 ./bin/generic-init
   133723      4 -rw-------   1 user     user         1247 Jun 30 12:35 ./.ash_history
   133808      4 -rwx------   1 user     user         1044 Jun 30 12:35 ./bin/kexec-unseal-key
   133988      4 -rwx------   1 user     user         1000 Jun 30 12:35 ./sbin/insmod
   133977      4 -rwx------   1 user     user          922 Jun 30 12:35 ./sbin/config-dhcp.sh
   133743      4 -rwx------   1 user     user          799 Jun 30 12:35 ./bin/cbfs-init
   133809      4 -rwx------   1 user     user          770 Jun 30 12:35 ./bin/key-init
   133895      4 -rwx------   1 user     user          694 Jun 30 12:35 ./bin/tpm-reset
   133900      4 -rwx------   1 user     user          661 Jun 30 12:35 ./bin/uefi-init
   133906      4 -rwx------   1 user     user          634 Jun 30 12:35 ./bin/unseal-totp
   133924      4 -rw-------   1 user     user          615 Jun 30 12:35 ./etc/config
   133918      4 -rwx------   1 user     user          574 Jun 30 12:35 ./bin/x230-flash.init
   133882      4 -rwx------   1 user     user          574 Jun 30 12:35 ./bin/t430-flash.init
   133852      4 -rwx------   1 user     user          538 Jun 30 12:35 ./bin/qubes-measure-luks
   133775      4 -rwx------   1 user     user          360 Jun 30 12:35 ./bin/flashrom-kgpe-d16-openbmc.sh
   133916      4 -rwx------   1 user     user          320 Jun 30 12:35 ./bin/wget-measure.sh
   133853      4 -rwx------   1 user     user          258 Jun 30 12:35 ./bin/reboot
   133909      4 -rwx------   1 user     user          220 Jun 30 12:35 ./bin/usb-init
   133847      4 -rwx------   1 user     user          205 Jun 30 12:35 ./bin/poweroff
   133929      4 -rw-------   1 user     user          197 Jun 30 12:35 ./etc/fstab
   133935      4 -rw-------   1 user     user          174 Jun 30 12:35 ./etc/motd
   133783      4 -rwx------   1 user     user          106 Jun 30 12:35 ./bin/gpgv
   133725      4 -rw-------   1 user     user           73 Jun 30 12:35 ./.gnupg/gpg-agent.conf
   133917      4 -rwx------   1 user     user           35 Jun 30 12:35 ./bin/whiptail
   133938      4 -rw-------   1 user     user           27 Jun 30 12:35 ./etc/shells
   133937      4 -rw-------   1 user     user           27 Jun 30 12:35 ./etc/passwd
   133933      4 -rw-------   1 user     user           20 Jun 30 12:35 ./etc/hosts
   133931      4 -rw-------   1 user     user           10 Jun 30 12:35 ./etc/group
   133726      4 -rw-------   1 user     user           10 Jun 30 12:35 ./.gnupg/gpg.conf
   133972      0 -rw-------   1 user     user            0 Jun 30 12:35 ./run/cryptsetup/.placeholder

@tlaurion
Copy link
Collaborator Author

Adding gpg2 and cryptsetup2

@tlaurion
Copy link
Collaborator Author

master:

Name                           Offset     Type           Size   Comp
cbfs master header             0x0        cbfs header        32 none
fallback/romstage              0x80       stage           85100 none
cpu_microcode_blob.bin         0x14d80    microcode       26624 none
fallback/ramstage              0x1b600    stage           97676 none
config                         0x33400    raw               786 none
revision                       0x33780    raw               691 none
fallback/dsdt.aml              0x33a80    raw             14615 none
vbt.bin                        0x37400    raw              1433 LZMA (4281 decompressed)
cmos_layout.bin                0x37a00    cmos_layout      1884 none
fallback/postcar               0x381c0    stage           25816 none
fallback/payload               0x3e700    simple elf    7309255 none
(empty)                        0x736f00   null          4361880 none
bootblock                      0xb5fdc0   bootblock       65536 none

Actual PR:

Name                           Offset     Type           Size   Comp
cbfs master header             0x0        cbfs header        32 none
fallback/romstage              0x80       stage           85100 none
cpu_microcode_blob.bin         0x14d80    microcode       26624 none
fallback/ramstage              0x1b600    stage           97707 none
config                         0x33400    raw               791 none
revision                       0x33780    raw               696 none
fallback/dsdt.aml              0x33a80    raw             14615 none
vbt.bin                        0x37400    raw              1433 LZMA (4281 decompressed)
cmos_layout.bin                0x37a00    cmos_layout      1884 none
fallback/postcar               0x381c0    stage           25816 none
fallback/payload               0x3e700    simple elf    6884295 none
(empty)                        0x6cf300   null          4786840 none
bootblock                      0xb5fdc0   bootblock       65536 none

4786840 - 4361880 = 424960
gain of 424kb from this PR alone

@tlaurion
Copy link
Collaborator Author

Impact on changes in build logs: master vs this pr:

modules/libassuan
modules/io386
modules/popt
modules/libusb-compat
modules/msrtools
modules/zlib : O2 -> Os
modules/coreboot
modules/gpg : -g -O2 -> Os
modules/flashtools
modules/libksba
modules/musl-cross
modules/libusb
modules/libgcrypt : -g -O2 -> Os
modules/frotz
modules/dropbear
modules/slang
modules/lvm2 : O2 -> Os
modules/gpg2
modules/libhidapi-libusb : not applied
modules/u-root
modules/json-c
modules/fbwhiptail
modules/linuxboot
modules/kexec
modules/busybox Some files O2-> Os, some stays O2.
modules/npth
modules/tpmtotp not specified -> Os
modules/linux
modules/hidapi
modules/hotp-verification
modules/mbedtls
modules/nkstorecli
modules/libgpg-error : -g -O2 -> Os
modules/cairo : 03 -> Os
modules/util-linux : -g -O2 -> Os
modules/flashrom Already Os
modules/coreboot-blobs
modules/libnitrokey : Os
modules/pixman : -g -O2 -> Os
modules/qrencode
modules/purism-blobs
modules/pinentry
modules/cryptsetup : -g -O2 -> Os
modules/cryptsetup2 : -g -O2 -> Os
modules/pciutils
modules/libpng : -g -O2 -> Os 

@tlaurion
Copy link
Collaborator Author

tlaurion commented Aug 24, 2022

@JonathonHall-Purism @SergiiDmytruk : LGTM, not perfect, but interesting 400kb gain for all boards as observed under #1121 (comment)

This would permit us to start adding other stuff, including (while needing prioritizing)

Recommendations on this PR?
From previous post:

modules/busybox Some files O2-> Os, some stays O2.
modules/libhidapi-libusb : not applied

Where some previous -g -O2 is now being -Os.

@SergiiDmytruk
Copy link
Contributor

The changes look sane to me.

@JonathonHall-Purism
Copy link
Collaborator

@tlaurion Agree the ~400 KB is significant, however GPG key generation during OEM reset now takes much longer - on Mini v2, went from ~4 minutes to ~7 minutes. I agree -Os makes sense as a default otherwise.

The only other thing I can think of that might be noticeably affected is LUKS re-encryption - I have not actually tried this at all yet, not sure if it is typically I/O or CPU bound.

  • How much of the 400 KB comes from libgcrypt? I'm guessing probably libgcrypt contains the critical path affecting key generation, not gpg/gpg2, have not tested though.
  • Any experience to suggest whether/how LUKS re-encryption might be affected?

@tlaurion
Copy link
Collaborator Author

tlaurion commented Aug 24, 2022

@tlaurion Agree the ~400 KB is significant, however GPG key generation during OEM reset now takes much longer - on Mini v2, went from ~4 minutes to ~7 minutes. I agree -Os makes sense as a default otherwise.

@JonathonHall-Purism : Houla. Will test re-ownership and check re-encryption and gpg in-smartcard generation, not sure how this could be related to this change though, since keys are generated inside of the USB Security dongle; I would understand if in-heads generated keys were affected though, and cryptsetup-reencrypt speed being maybe affected.

Re-encryption is both CPU and IO bound, since blocks are being rewritten in direct-io mode from cryptsetup-reencrypt. Will check results on same disk and same USB Security dongle with master and this PR and report back results editing this post.


EDIT:
Used the following oem-factory-reset script, ran from usb (mount-usb, chmod +x that script, ran that script) to use ROM binaries but have the same test case between roms, with dates being printed on screen (and basically just inserting date commands between tasks to be measured so that nothing interrupts the tests):
oem-factory-reset.txt
Basically applying

--- initrd/bin/oem-factory-reset
+++ initrd/bin/oem-factory-reset
@@ -573,11 +573,15 @@
 
 if [ -n "$luks_new_Disk_Recovery_Key_desired" -a -n "$luks_new_Disk_Recovery_Key_passphrase_desired" ]; then
   #Reencryption of disk, disk recovery key and Disk Recovery Key passphrase change is requested
+  date
   luks_reencrypt
+  date
   luks_change_passphrase
 elif [ -n "$luks_new_Disk_Recovery_Key_desired" -a -z "$luks_new_Disk_Recovery_Key_passphrase_desired" ]; then
   #Reencryption of disk was requested but not passphrase change
+  date
   luks_reencrypt
+  date
 elif [ -z "$luks_new_Disk_Recovery_Key_desired" -a -n "$luks_new_Disk_Recovery_Key_passphrase_desired" ]; then
   #Passphrase change is requested without disk reencryption
   luks_change_passphrase
@@ -603,8 +607,9 @@
 
 ## reset the GPG Key
 echo -e "\nResetting GPG Key...\n(this will take around 3 minutes...)\n"
+date
 gpg_key_reset
-
+date
 # parse name of generated key
 GPG_GEN_KEY=`grep -A1 pub /tmp/gpg_card_edit_output | tail -n1 | sed -nr 's/^([ ])*//p'`
 PUBKEY="/tmp/${GPG_GEN_KEY}.asc"
@@ -727,4 +732,4 @@
 unset luks_passphrase_changed
 unset tpm_password_changed
 
-reboot
+#reboot

This means a variation of

  • 3.3 seconds per key generation (there is 3 keypairs generated in the smartcard)
    • This is not significant to me, and in this test, would be to the advantage of this PR (which would not make sense).
  • less then 30 seconds variation on cryptsetup-reencrypt with direct-io enforced on a Critical mx500 250Gb drive.
    • This would need retesting on better drive then the mx500 drive used in this test. Unfortunately, the best speed I normally get is with Evo PRO 860 drives and I do not have any handy as of now. But the speed is in the normal on my side, but the IO is normally the limit here, and this test at 162Mb/s is in the range for those drives on the x230 i5/i7. The CPU is not the bottleneck here, the IO of the drive normally is, where EVO pro 860 are around 220 mb/s (and I have niot witnessed better speeds in x230 tested drives and seen many).

@JonathonHall-Purism
Copy link
Collaborator

Thanks @tlaurion , I ran several more tests to get some better data. Bottom line is that the variations in GPG key reset seem to be normal and it was just coincidence in the first few tests that the -Os tests happened to be longer. With that in mind, and LUKS re-encrypt confirmed fine, this PR looks good to me.

Screenshot_20220825_115301

(The failed LUKS tests were apparently just due to lack of space for key slot expansion or something on that disk, unrelated to this PR, I took the 970 EVO from the L14 and put it in the mini to continue.)

Thanks for confirming this with me!

@tlaurion
Copy link
Collaborator Author

@SergiiDmytruk @JonathonHall-Purism One area of concern is still:

modules/busybox Some files O2-> Os, some stays O2.
modules/libhidapi-libusb : not applied

For busybox, my Make fu is not good enough to understand why some are passing -02 and some ware passing -0s. I will clean the PR to remove modules which have no change with this PR to clear things up and force push again for one last review before merging.

This freed space is important.

@tlaurion
Copy link
Collaborator Author

tlaurion commented Aug 25, 2022

Also, just to be clear, hardcoding CFLAGS="-Os" is removing debugging information (no more -g in the table above).
To me its a bonus, but we have to keep that in mind for the future (where everything is stripped per Makefile call to copy binaries and libraries to initrd anyway.)

@tlaurion
Copy link
Collaborator Author

Current state of master:

# Use coreboot.rom, because custom output files might not be processed by cbfstool
"/home/user/heads/build/coreboot-4.13/qemu-coreboot-fbwhiptail-tpm1-hotp/cbfstool" "/home/user/heads/build/coreboot-4.13/qemu-coreboot-fbwhiptail-tpm1-hotp/coreboot.rom" print
FMAP REGION: COREBOOT
Name                           Offset     Type           Size   Comp
cbfs master header             0x0        cbfs header        32 none
fallback/romstage              0x80       stage           22660 none
fallback/ramstage              0x5980     stage           66122 none
fallback/dsdt.aml              0x15c40    raw              6946 none
cmos_layout.bin                0x177c0    cmos_layout       676 none
fallback/postcar               0x17ac0    stage           23256 none
fallback/payload               0x1d600    simple elf    7931475 none
(empty)                        0x7adcc0   null          1892568 none
bootblock                      0x97bdc0   bootblock       16384 none

Current state of this PR per 9e54fc4:

# Use coreboot.rom, because custom output files might not be processed by cbfstool
"/home/user/heads/build/coreboot-4.13/qemu-coreboot-fbwhiptail-tpm1-hotp/cbfstool" "/home/user/heads/build/coreboot-4.13/qemu-coreboot-fbwhiptail-tpm1-hotp/coreboot.rom" print
FMAP REGION: COREBOOT
Name                           Offset     Type           Size   Comp
cbfs master header             0x0        cbfs header        32 none
fallback/romstage              0x80       stage           22660 none
fallback/ramstage              0x5980     stage           66129 none
fallback/dsdt.aml              0x15c40    raw              6946 none
cmos_layout.bin                0x177c0    cmos_layout       676 none
fallback/postcar               0x17ac0    stage           23256 none
fallback/payload               0x1d600    simple elf    7527507 none
(empty)                        0x74b2c0   null          2296536 none
bootblock                      0x97bdc0   bootblock       16384 none

Modules explicitely passing Os in the builds:

user@heads-tests:~/heads$ grep -e "Os " build/log/* | awk -F ":" {'print $1'} | uniq
build/log/cairo.configure.log
build/log/cairo.log
build/log/cryptsetup2.configure.log
build/log/gpg2.configure.log
build/log/gpg2.log
build/log/kexec.log
build/log/libgcrypt.configure.log
build/log/libgcrypt.log
build/log/libgpg-error.configure.log
build/log/libgpg-error.log
build/log/libksba.configure.log
build/log/libksba.log
build/log/libpng.configure.log
build/log/libpng.log
build/log/lvm2.configure.log
build/log/lvm2.log
build/log/pixman.configure.log
build/log/tpmtotp.log
build/log/util-linux.configure.log
build/log/util-linux.log
build/log/zlib.configure.log

Modules still having O2/O3 instead of Os in the build:

user@heads-tests:~/heads$ grep -e "O3 " -e "O2 " build/log/* | awk -F ":" {'print $1'} | uniq
build/log/kexec.log
build/log/libassuan.log
build/log/pinentry.log

@tlaurion
Copy link
Collaborator Author

Adding

diff --git a/modules/busybox b/modules/busybox
index e011402a..197dcaf7 100644
--- a/modules/busybox
+++ b/modules/busybox
@@ -13,6 +13,7 @@ busybox_config := config/busybox.config
 busybox_output := busybox
 busybox_target := \
        $(CROSS_TOOLS) \
+       CFLAGS="-Os"  \
        $(MAKE_JOBS) \
 
 # Install symlinks when the busybox program is installed
diff --git a/modules/kexec b/modules/kexec
index 19cee214..1ffd350a 100644
--- a/modules/kexec
+++ b/modules/kexec
@@ -8,6 +8,7 @@ kexec_hash := 40623d4321be2865ef9ea2cd6ec998d31dcf93d0f74353cbd3aa06d8821e3e41
 
 kexec_configure := ./configure \
        $(CROSS_TOOLS) \
+       CFLAGS="-Os" \
        --host i386-elf-linux \
        --target x86_64 \
        --prefix="/" \
diff --git a/modules/libassuan b/modules/libassuan
index 111e6625..89054efc 100644
--- a/modules/libassuan
+++ b/modules/libassuan
@@ -7,6 +7,7 @@ libassuan_hash := 91bcb0403866b4e7c4bc1cc52ed4c364a9b5414b3994f718c70303f7f765e7
 
 libassuan_configure := ./configure \
        $(CROSS_TOOLS) \
+       CFLAGS="-Os" \
        --host x86_64-linux-musl \

Results in increased gain:

"/home/user/heads/build/coreboot-4.13/qemu-coreboot-fbwhiptail-tpm1-hotp/cbfstool" "/home/user/heads/build/coreboot-4.13/qemu-coreboot-fbwhiptail-tpm1-hotp/coreboot.rom" print
FMAP REGION: COREBOOT
Name                           Offset     Type           Size   Comp
cbfs master header             0x0        cbfs header        32 none
fallback/romstage              0x80       stage           22668 none
fallback/ramstage              0x5980     stage           66120 none
fallback/dsdt.aml              0x15c00    raw              6946 none
cmos_layout.bin                0x17780    cmos_layout       676 none
fallback/postcar               0x17a80    stage           23256 none
fallback/payload               0x1d5c0    simple elf    7513171 none
(empty)                        0x747a80   null          2310936 none
bootblock                      0x97bdc0   bootblock       16384 none

@tlaurion
Copy link
Collaborator Author

Rebased on current master for comparison with additional freed space for maximized boards

@tlaurion
Copy link
Collaborator Author

Will compare t420-htop-maximized from master to this pr (this board is the one having less space avail):

Master:
https://app.circleci.com/pipelines/github/osresearch/heads/520/workflows/7f2bbd21-72b5-4857-85a6-c1d4ef6d373a/jobs/7318

2023-02-17 15:23:09-05:00 DONE coreboot
touch /root/project/build/x86/coreboot-4.13/t420-hotp-maximized/.build 
# Use coreboot.rom, because custom output files might not be processed by cbfstool
"/root/project/build/x86/coreboot-4.13/t420-hotp-maximized/cbfstool" "/root/project/build/x86/coreboot-4.13/t420-hotp-maximized/coreboot.rom" print
FMAP REGION: COREBOOT
Name                           Offset     Type           Size   Comp
cbfs master header             0x0        cbfs header        32 none
fallback/romstage              0x80       stage           87724 none
cpu_microcode_blob.bin         0x157c0    microcode       26624 none
fallback/ramstage              0x1c040    stage          119368 none
config                         0x392c0    raw               904 none
revision                       0x39680    raw               691 none
fallback/dsdt.aml              0x39980    raw             14615 none
vbt.bin                        0x3d300    raw              1368 LZMA (3985 decompressed)
cmos.default                   0x3d8c0    cmos_default      256 none
cmos_layout.bin                0x3da00    cmos_layout      1992 none
fallback/postcar               0x3e200    stage           27288 none
fallback/payload               0x44d00    simple elf    7221191 none
(empty)                        0x727d00   null           622744 none
bootblock                      0x7bfdc0   bootblock       65536 none

This PR:
https://app.circleci.com/pipelines/github/tlaurion/heads/1471/workflows/c5f98e3d-d6fe-4a6b-ae0c-378267b31bea/jobs/16848/parallel-runs/0/steps/0-103

2023-02-18 17:46:06-05:00 DONE coreboot
touch /root/project/build/x86/coreboot-4.13/t420-hotp-maximized/.build 
# Use coreboot.rom, because custom output files might not be processed by cbfstool
"/root/project/build/x86/coreboot-4.13/t420-hotp-maximized/cbfstool" "/root/project/build/x86/coreboot-4.13/t420-hotp-maximized/coreboot.rom" print
FMAP REGION: COREBOOT
Name                           Offset     Type           Size   Comp
cbfs master header             0x0        cbfs header        32 none
fallback/romstage              0x80       stage           87724 none
cpu_microcode_blob.bin         0x157c0    microcode       26624 none
fallback/ramstage              0x1c040    stage          119372 none
config                         0x39300    raw               904 none
revision                       0x396c0    raw               691 none
fallback/dsdt.aml              0x399c0    raw             14615 none
vbt.bin                        0x3d340    raw              1368 LZMA (3985 decompressed)
cmos.default                   0x3d900    cmos_default      256 none
cmos_layout.bin                0x3da40    cmos_layout      1992 none
fallback/postcar               0x3e240    stage           27288 none
fallback/payload               0x44d40    simple elf    6766023 none
(empty)                        0x6b8b40   null          1077848 none
bootblock                      0x7bfdc0   bootblock       65536 none

So 622744-1077848=-455104
So increase of 0.46mb

tlaurion added a commit to tlaurion/heads that referenced this pull request Feb 19, 2023
…, yubikey test regression for oem-factory-reset, optimized for space (03-O2->Os) and fix for sh: argument expected, with local CONFIG_DEBUG_OUTPUT enabled and fused in ROM.

Includes linuxboot#1317, linuxboot#1121, linuxboot#1312, linuxboot#1305 for test on daily driver
tlaurion added a commit to tlaurion/heads that referenced this pull request Feb 19, 2023
…ix-sh_argument_expected-yubikey-oem-factory-reset_dasharo-flashrom

Daily driver test fo x230-hotp-maximized on coreboot 4.19, with debug, yubikey test regression for oem-factory-reset, optimized for space (03-O2->Os) and fix for sh: argument expected, with local CONFIG_DEBUG_OUTPUT enabled and fused in ROM.
    Includes linuxboot#1317, linuxboot#1121, linuxboot#1312, linuxboot#1305, linuxboot#1251 for test on daily driver
tlaurion referenced this pull request in tlaurion/heads Feb 19, 2023
…ix-sh_argument_expected-yubikey-oem-factory-reset_dasharo-flashrom

Daily driver test fo x230-hotp-maximized on coreboot 4.19, with debug, yubikey test regression for oem-factory-reset, optimized for space (03-O2->Os) and fix for sh: argument expected, with local CONFIG_DEBUG_OUTPUT enabled and fused in ROM.
    Includes osresearch#1317, osresearch#1121, osresearch#1312, osresearch#1305, osresearch#1251 for test on daily driver
@tlaurion
Copy link
Collaborator Author

Using x230-hotp-maximized from CircleCI builds as of now. Nothing to report as of now as regression.

tlaurion added a commit to tlaurion/heads that referenced this pull request Feb 21, 2023
…gument_expected-yubikey-oem-factory-reset_dasharo-flashrom

- Additional -O2 -O3 -> -Os fixes to linuxboot#1121
@tlaurion
Copy link
Collaborator Author

tlaurion commented Mar 1, 2023

  • Compare diffoscope output of tools.cpio from master and this branch for binary size difference
    • Compare x230-hotp-maximized (fbwhiptail and all hotp deps)
    • Compare t430-legacy-hotp (whiptail and dependencies)

@tlaurion tlaurion changed the title WiP: Pass all modules from O2 to Os to optimize for space. Pass all modules from O2/O3 (optimized for speed) to Os (optimize for space) Mar 1, 2023
@tlaurion
Copy link
Collaborator Author

tlaurion commented Mar 1, 2023

master vs pr:

master:

"/root/project/build/x86/coreboot-4.13/x230-hotp-maximized/cbfstool" "/root/project/build/x86/coreboot-4.13/x230-hotp-maximized/coreboot.rom" print
FMAP REGION: COREBOOT
Name                           Offset     Type           Size   Comp
cbfs master header             0x0        cbfs header        32 none
fallback/romstage              0x80       stage           85100 none
cpu_microcode_blob.bin         0x14d80    microcode       26624 none
fallback/ramstage              0x1b600    stage           97671 none
config                         0x333c0    raw               834 none
revision                       0x33740    raw               691 none
fallback/dsdt.aml              0x33a40    raw             14615 none
vbt.bin                        0x373c0    raw              1433 LZMA (4281 decompressed)
cmos_layout.bin                0x379c0    cmos_layout      1884 none
fallback/postcar               0x38180    stage           25816 none
fallback/payload               0x3e6c0    simple elf    7320519 none
(empty)                        0x739ac0   null          4743896 none
bootblock                      0xbbfdc0   bootblock       65536 none

pr:

"/root/project/build/x86/coreboot-4.13/x230-hotp-maximized/cbfstool" "/root/project/build/x86/coreboot-4.13/x230-hotp-maximized/coreboot.rom" print
FMAP REGION: COREBOOT
Name                           Offset     Type           Size   Comp
cbfs master header             0x0        cbfs header        32 none
fallback/romstage              0x80       stage           85100 none
cpu_microcode_blob.bin         0x14d80    microcode       26624 none
fallback/ramstage              0x1b600    stage           97679 none
config                         0x33400    raw               834 none
revision                       0x33780    raw               691 none
fallback/dsdt.aml              0x33a80    raw             14615 none
vbt.bin                        0x37400    raw              1433 LZMA (4281 decompressed)
cmos_layout.bin                0x37a00    cmos_layout      1884 none
fallback/postcar               0x381c0    stage           25816 none
fallback/payload               0x3e700    simple elf    6865863 none
(empty)                        0x6cab00   null          5198488 none
bootblock                      0xbbfdc0   bootblock       65536 none

4743896 - 5198488 = -454592 (gain of 0.45Mb)


diffoscope output for tools.cpio differences (first diff) for x230-hotp-maximized (master vs pr)

We can see that dasharo/flashrom is bigger then master's:

user@heads-tests:~/heads$ diffoscope /tmp/master/tools.cpio /tmp/pass_O2_to_Os/tools.cpio 
--- /tmp/master/tools.cpio
+++ /tmp/pass_O2_to_Os/tools.cpio
│┄ comprises of 1 embedded members
├── .cpio file embedded at offset 0
│ ├── file list
│ │ @@ -1,113 +1,113 @@
│ │  drwx------   0        0        0        0 1970-01-01 00:00:00.000000 .
│ │  drwx------   0        0        0        0 1970-01-01 00:00:00.000000 bin
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/[ -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/[[ -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/arch -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/ash -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/awk -> busybox
│ │ --rwx------   0        0        0    10088 1970-01-01 00:00:00.000000 bin/base32
│ │ +-rwx------   0        0        0     5912 1970-01-01 00:00:00.000000 bin/base32
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/base64 -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/basename -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/bash -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/bunzip2 -> busybox
│ │  -rwx------   0        0        0   507776 1970-01-01 00:00:00.000000 bin/busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/bzcat -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/bzip2 -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/cat -> busybox
│ │ --rwx------   0        0        0    18360 1970-01-01 00:00:00.000000 bin/cbfs
│ │ +-rwx------   0        0        0    14240 1970-01-01 00:00:00.000000 bin/cbfs
│ │  -rwx------   0        0        0    27048 1970-01-01 00:00:00.000000 bin/cbmem
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/chattr -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/chmod -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/cmp -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/cp -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/cpio -> busybox
│ │ --rwx------   0        0        0   115192 1970-01-01 00:00:00.000000 bin/cryptsetup
│ │ --rwx------   0        0        0    87968 1970-01-01 00:00:00.000000 bin/cryptsetup-reencrypt
│ │ +-rwx------   0        0        0   102904 1970-01-01 00:00:00.000000 bin/cryptsetup
│ │ +-rwx------   0        0        0    83872 1970-01-01 00:00:00.000000 bin/cryptsetup-reencrypt
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/cut -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/date -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/dc -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/dd -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/df -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/diff -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/dirname -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/dmesg -> busybox
│ │ --rwx------   0        0        0   137464 1970-01-01 00:00:00.000000 bin/dmsetup
│ │ +-rwx------   0        0        0   121080 1970-01-01 00:00:00.000000 bin/dmsetup
│ │  -rwx------   0        0        0   184824 1970-01-01 00:00:00.000000 bin/dropbear
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/du -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/echo -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/env -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/expr -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/factor -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/fallocate -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/false -> busybox
│ │  -rwx------   0        0        0    51616 1970-01-01 00:00:00.000000 bin/fbwhiptail
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/find -> busybox
│ │ --rwx------   0        0        0   580568 1970-01-01 00:00:00.000000 bin/flashrom
│ │ --rwx------   0        0        0    22432 1970-01-01 00:00:00.000000 bin/flashtool
│ │ +-rwx------   0        0        0   703224 1970-01-01 00:00:00.000000 bin/flashrom
│ │ +-rwx------   0        0        0    18336 1970-01-01 00:00:00.000000 bin/flashtool
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/fold -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/getopt -> busybox
│ │ --rwx------   0        0        0   915328 1970-01-01 00:00:00.000000 bin/gpg
│ │ --rwx------   0        0        0   380120 1970-01-01 00:00:00.000000 bin/gpg-agent
│ │ +-rwx------   0        0        0   751456 1970-01-01 00:00:00.000000 bin/gpg
│ │ +-rwx------   0        0        0   314584 1970-01-01 00:00:00.000000 bin/gpg-agent
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/grep -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/groups -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/gunzip -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/gzip -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/hd -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/head -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/hexdump -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/hexedit -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/hostid -> busybox
│ │ --rwx------   0        0        0    10024 1970-01-01 00:00:00.000000 bin/hotp
│ │ +-rwx------   0        0        0     5912 1970-01-01 00:00:00.000000 bin/hotp
│ │  -rwx------   0        0        0     1087 1970-01-01 00:00:00.000000 bin/hotp_initialize
│ │  -rwx------   0        0        0    29944 1970-01-01 00:00:00.000000 bin/hotp_verification
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/id -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/install -> busybox
│ │ --rwx------   0        0        0   170984 1970-01-01 00:00:00.000000 bin/kexec
│ │ +-rwx------   0        0        0   154568 1970-01-01 00:00:00.000000 bin/kexec
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/kill -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/killall -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/less -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/link -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/ln -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/ls -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/lsattr -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/lsof -> busybox
│ │  -rwx------   0        0        0    73600 1970-01-01 00:00:00.000000 bin/lspci
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/lsscsi -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/lsusb -> busybox
│ │ --rwx------   0        0        0  1627856 1970-01-01 00:00:00.000000 bin/lvm
│ │ +-rwx------   0        0        0  1414928 1970-01-01 00:00:00.000000 bin/lvm
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/md5sum -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/mkdir -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/mkfifo -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/mknod -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/mktemp -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/more -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/mount -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/mv -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/nc -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/nl -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/nproc -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/nslookup -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/paste -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/patch -> busybox
│ │ --rwx------   0        0        0    10096 1970-01-01 00:00:00.000000 bin/peek
│ │ +-rwx------   0        0        0    10088 1970-01-01 00:00:00.000000 bin/peek
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/pgrep -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/pidof -> busybox
│ │ --rwx------   0        0        0    52200 1970-01-01 00:00:00.000000 bin/pinentry-tty
│ │ +-rwx------   0        0        0    44008 1970-01-01 00:00:00.000000 bin/pinentry-tty
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/ping -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/pkill -> busybox
│ │ --rwx------   0        0        0    14200 1970-01-01 00:00:00.000000 bin/poke
│ │ +-rwx------   0        0        0    10096 1970-01-01 00:00:00.000000 bin/poke
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/printf -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/ps -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/pwd -> busybox
│ │ --rwx------   0        0        0     5912 1970-01-01 00:00:00.000000 bin/qrenc
│ │ +-rwx------   0        0        0     5904 1970-01-01 00:00:00.000000 bin/qrenc
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/resume -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/rm -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/rmdir -> busybox
│ │ --rwx------   0        0        0   416040 1970-01-01 00:00:00.000000 bin/scdaemon
│ │ +-rwx------   0        0        0   346376 1970-01-01 00:00:00.000000 bin/scdaemon
│ │  -rwx------   0        0        0    22664 1970-01-01 00:00:00.000000 bin/scp
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/sed -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/seq -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/setfattr -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/setpriv -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/setserial -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/setsid -> busybox
│ │ @@ -128,63 +128,63 @@
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/tail -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/tar -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/tee -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/test -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/tftp -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/time -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/top -> busybox
│ │ --rwx------   0        0        0    10048 1970-01-01 00:00:00.000000 bin/totp
│ │ +-rwx------   0        0        0    10032 1970-01-01 00:00:00.000000 bin/totp
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/touch -> busybox
│ │ --rwx------   0        0        0   126584 1970-01-01 00:00:00.000000 bin/tpm
│ │ +-rwx------   0        0        0   118392 1970-01-01 00:00:00.000000 bin/tpm
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/tr -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/true -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/tty -> busybox
│ │ --rwx------   0        0        0    18320 1970-01-01 00:00:00.000000 bin/uefi
│ │ +-rwx------   0        0        0    14208 1970-01-01 00:00:00.000000 bin/uefi
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/umount -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/uname -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/uniq -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/unxz -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/unzip -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/usleep -> busybox
│ │ --rwx------   0        0        0    45264 1970-01-01 00:00:00.000000 bin/veritysetup
│ │ +-rwx------   0        0        0    41168 1970-01-01 00:00:00.000000 bin/veritysetup
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/vi -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/wc -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/wget -> busybox
│ │  -rwx------   0        0        0       35 1970-01-01 00:00:00.000000 bin/whiptail
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/xargs -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/xxd -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/xz -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/xzcat -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/zcat -> busybox
│ │  drwx------   0        0        0        0 1970-01-01 00:00:00.000000 etc
│ │  -rw-------   0        0        0      625 1970-01-01 00:00:00.000000 etc/config
│ │  drwx------   0        0        0        0 1970-01-01 00:00:00.000000 lib
│ │ --rwx------   0        0        0    76736 1970-01-01 00:00:00.000000 lib/libassuan.so.0
│ │ --rwx------   0        0        0   271040 1970-01-01 00:00:00.000000 lib/libblkid.so.1
│ │ +-rwx------   0        0        0    64448 1970-01-01 00:00:00.000000 lib/libassuan.so.0
│ │ +-rwx------   0        0        0   238208 1970-01-01 00:00:00.000000 lib/libblkid.so.1
│ │  -rwx------   0        0        0   596544 1970-01-01 00:00:00.000000 lib/libc.so
│ │ --rwx------   0        0        0   757232 1970-01-01 00:00:00.000000 lib/libcairo.so.2
│ │ --rwx------   0        0        0   464560 1970-01-01 00:00:00.000000 lib/libcryptsetup.so.12
│ │ --rwx------   0        0        0   333240 1970-01-01 00:00:00.000000 lib/libdevmapper.so.1.02
│ │ --rwx------   0        0        0  1160520 1970-01-01 00:00:00.000000 lib/libgcrypt.so.20
│ │ --rwx------   0        0        0   130000 1970-01-01 00:00:00.000000 lib/libgpg-error.so.0
│ │ +-rwx------   0        0        0   491024 1970-01-01 00:00:00.000000 lib/libcairo.so.2
│ │ +-rwx------   0        0        0   403152 1970-01-01 00:00:00.000000 lib/libcryptsetup.so.12
│ │ +-rwx------   0        0        0   284184 1970-01-01 00:00:00.000000 lib/libdevmapper.so.1.02
│ │ +-rwx------   0        0        0  1054216 1970-01-01 00:00:00.000000 lib/libgcrypt.so.20
│ │ +-rwx------   0        0        0   109520 1970-01-01 00:00:00.000000 lib/libgpg-error.so.0
│ │  -rwx------   0        0        0    81024 1970-01-01 00:00:00.000000 lib/libjson-c.so.5
│ │ --rwx------   0        0        0   256376 1970-01-01 00:00:00.000000 lib/libksba.so.8
│ │ --rwx------   0        0        0   325104 1970-01-01 00:00:00.000000 lib/libmbedcrypto.so.0
│ │ +-rwx------   0        0        0   199016 1970-01-01 00:00:00.000000 lib/libksba.so.8
│ │ +-rwx------   0        0        0   288272 1970-01-01 00:00:00.000000 lib/libmbedcrypto.so.0
│ │  -rwx------   0        0        0    14552 1970-01-01 00:00:00.000000 lib/libnpth.so.0
│ │  -rwx------   0        0        0    52272 1970-01-01 00:00:00.000000 lib/libpci.so.3
│ │  -rwx------   0        0        0    52272 1970-01-01 00:00:00.000000 lib/libpci.so.3.5.4
│ │ --rwx------   0        0        0   666216 1970-01-01 00:00:00.000000 lib/libpixman-1.so.0
│ │ --rwx------   0        0        0   207912 1970-01-01 00:00:00.000000 lib/libpng16.so.16
│ │ +-rwx------   0        0        0   572016 1970-01-01 00:00:00.000000 lib/libpixman-1.so.0
│ │ +-rwx------   0        0        0   171032 1970-01-01 00:00:00.000000 lib/libpng16.so.16
│ │  -rwx------   0        0        0    48088 1970-01-01 00:00:00.000000 lib/libpopt.so.0
│ │ --rwx------   0        0        0    47448 1970-01-01 00:00:00.000000 lib/libqrencode.so.3
│ │ --rwx------   0        0        0   339304 1970-01-01 00:00:00.000000 lib/libtpm.so
│ │ --rwx------   0        0        0    18464 1970-01-01 00:00:00.000000 lib/libusb-0.1.so.4
│ │ --rwx------   0        0        0    96896 1970-01-01 00:00:00.000000 lib/libusb-1.0.so.0
│ │ --rwx------   0        0        0    14656 1970-01-01 00:00:00.000000 lib/libuuid.so.1
│ │ --rwx------   0        0        0   108832 1970-01-01 00:00:00.000000 lib/libz.so.1
│ │ +-rwx------   0        0        0    39232 1970-01-01 00:00:00.000000 lib/libqrencode.so.3
│ │ +-rwx------   0        0        0   314728 1970-01-01 00:00:00.000000 lib/libtpm.so
│ │ +-rwx------   0        0        0    18440 1970-01-01 00:00:00.000000 lib/libusb-0.1.so.4
│ │ +-rwx------   0        0        0    84584 1970-01-01 00:00:00.000000 lib/libusb-1.0.so.0
│ │ +-rwx------   0        0        0    14720 1970-01-01 00:00:00.000000 lib/libuuid.so.1
│ │ +-rwx------   0        0        0    76040 1970-01-01 00:00:00.000000 lib/libz.so.1
│ │  drwx------   0        0        0        0 1970-01-01 00:00:00.000000 sbin
│ │  lrwx------   0        0        0       14 1970-01-01 00:00:00.000000 sbin/arp -> ../bin/busybox
│ │  lrwx------   0        0        0       14 1970-01-01 00:00:00.000000 sbin/blkid -> ../bin/busybox
│ │  lrwx------   0        0        0       14 1970-01-01 00:00:00.000000 sbin/blockdev -> ../bin/busybox
│ │  lrwx------   0        0        0       14 1970-01-01 00:00:00.000000 sbin/chroot -> ../bin/busybox
│ │  lrwx------   0        0        0       14 1970-01-01 00:00:00.000000 sbin/devmem -> ../bin/busybox
│ │  lrwx------   0        0        0       14 1970-01-01 00:00:00.000000 sbin/fdisk -> ../bin/busybox

@tlaurion
Copy link
Collaborator Author

tlaurion commented Mar 1, 2023

t430-legacy-hotp master vs pr

master:

"/root/project/build/x86/coreboot-4.13/t430-legacy/cbfstool" "/root/project/build/x86/coreboot-4.13/t430-legacy/coreboot.rom" print
FMAP REGION: COREBOOT
Name                           Offset     Type           Size   Comp
cbfs master header             0x0        cbfs header        32 none
fallback/romstage              0x80       stage           87948 none
cpu_microcode_blob.bin         0x15880    microcode       26624 none
fallback/ramstage              0x1c100    stage          119377 none
config                         0x393c0    raw               669 none
revision                       0x396c0    raw               691 none
fallback/dsdt.aml              0x399c0    raw             14609 none
vbt.bin                        0x3d340    raw              1409 LZMA (4459 decompressed)
cmos.default                   0x3d900    cmos_default      256 none
cmos_layout.bin                0x3da40    cmos_layout      1980 none
fallback/postcar               0x3e240    stage           27288 none
fallback/payload               0x44d40    simple elf    6858183 none
(empty)                        0x6cf340   null            68184 none
bootblock                      0x6dfdc0   bootblock       65536 none

pr:

"/root/project/build/x86/coreboot-4.13/t430-hotp-legacy/cbfstool" "/root/project/build/x86/coreboot-4.13/t430-hotp-legacy/coreboot.rom" print
FMAP REGION: COREBOOT
Name                           Offset     Type           Size   Comp
cbfs master header             0x0        cbfs header        32 none
fallback/romstage              0x80       stage           87948 none
cpu_microcode_blob.bin         0x15880    microcode       26624 none
fallback/ramstage              0x1c100    stage          119366 none
config                         0x39380    raw               679 none
revision                       0x39680    raw               691 none
fallback/dsdt.aml              0x39980    raw             14609 none
vbt.bin                        0x3d300    raw              1409 LZMA (4459 decompressed)
cmos.default                   0x3d8c0    cmos_default      256 none
cmos_layout.bin                0x3da00    cmos_layout      1980 none
fallback/postcar               0x3e200    stage           27288 none
fallback/payload               0x44d00    simple elf    6553031 none
(empty)                        0x684b00   null           373400 none
bootblock                      0x6dfdc0   bootblock       65536 none

68184 - 37340 = loss of 30844 (flashrom/flashrom to dasharo/flashrom really increased :()


diffoscope (to see whiptail and dependencies (newt) diffs in size)

--- /tmp/master/tools.cpio
+++ /tmp/pass_O2_to_Os/tools.cpio
│┄ comprises of 1 embedded members
├── .cpio file embedded at offset 0
│ ├── file list
│ │ @@ -1,109 +1,111 @@
│ │  drwx------   0        0        0        0 1970-01-01 00:00:00.000000 .
│ │  drwx------   0        0        0        0 1970-01-01 00:00:00.000000 bin
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/[ -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/[[ -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/arch -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/ash -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/awk -> busybox
│ │ --rwx------   0        0        0    10088 1970-01-01 00:00:00.000000 bin/base32
│ │ +-rwx------   0        0        0     5912 1970-01-01 00:00:00.000000 bin/base32
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/base64 -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/basename -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/bash -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/bunzip2 -> busybox
│ │  -rwx------   0        0        0   507776 1970-01-01 00:00:00.000000 bin/busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/bzcat -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/bzip2 -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/cat -> busybox
│ │ --rwx------   0        0        0    18360 1970-01-01 00:00:00.000000 bin/cbfs
│ │ +-rwx------   0        0        0    14240 1970-01-01 00:00:00.000000 bin/cbfs
│ │  -rwx------   0        0        0    27048 1970-01-01 00:00:00.000000 bin/cbmem
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/chattr -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/chmod -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/cmp -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/cp -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/cpio -> busybox
│ │ --rwx------   0        0        0   115192 1970-01-01 00:00:00.000000 bin/cryptsetup
│ │ --rwx------   0        0        0    87968 1970-01-01 00:00:00.000000 bin/cryptsetup-reencrypt
│ │ +-rwx------   0        0        0   102904 1970-01-01 00:00:00.000000 bin/cryptsetup
│ │ +-rwx------   0        0        0    83872 1970-01-01 00:00:00.000000 bin/cryptsetup-reencrypt
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/cut -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/date -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/dc -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/dd -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/df -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/diff -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/dirname -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/dmesg -> busybox
│ │ --rwx------   0        0        0   137464 1970-01-01 00:00:00.000000 bin/dmsetup
│ │ +-rwx------   0        0        0   121080 1970-01-01 00:00:00.000000 bin/dmsetup
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/du -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/echo -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/env -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/expr -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/factor -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/fallocate -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/false -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/find -> busybox
│ │ --rwx------   0        0        0   580568 1970-01-01 00:00:00.000000 bin/flashrom
│ │ --rwx------   0        0        0    22432 1970-01-01 00:00:00.000000 bin/flashtool
│ │ +-rwx------   0        0        0   703224 1970-01-01 00:00:00.000000 bin/flashrom
│ │ +-rwx------   0        0        0    18336 1970-01-01 00:00:00.000000 bin/flashtool
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/fold -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/getopt -> busybox
│ │ --rwx------   0        0        0   915328 1970-01-01 00:00:00.000000 bin/gpg
│ │ --rwx------   0        0        0   380120 1970-01-01 00:00:00.000000 bin/gpg-agent
│ │ +-rwx------   0        0        0   751456 1970-01-01 00:00:00.000000 bin/gpg
│ │ +-rwx------   0        0        0   314584 1970-01-01 00:00:00.000000 bin/gpg-agent
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/grep -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/groups -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/gunzip -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/gzip -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/hd -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/head -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/hexdump -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/hexedit -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/hostid -> busybox
│ │ --rwx------   0        0        0    10024 1970-01-01 00:00:00.000000 bin/hotp
│ │ +-rwx------   0        0        0     5912 1970-01-01 00:00:00.000000 bin/hotp
│ │ +-rwx------   0        0        0     1087 1970-01-01 00:00:00.000000 bin/hotp_initialize
│ │ +-rwx------   0        0        0    29944 1970-01-01 00:00:00.000000 bin/hotp_verification
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/id -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/install -> busybox
│ │ --rwx------   0        0        0   170984 1970-01-01 00:00:00.000000 bin/kexec
│ │ +-rwx------   0        0        0   154568 1970-01-01 00:00:00.000000 bin/kexec
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/kill -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/killall -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/less -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/link -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/ln -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/ls -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/lsattr -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/lsof -> busybox
│ │  -rwx------   0        0        0    73600 1970-01-01 00:00:00.000000 bin/lspci
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/lsscsi -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/lsusb -> busybox
│ │ --rwx------   0        0        0  1627856 1970-01-01 00:00:00.000000 bin/lvm
│ │ +-rwx------   0        0        0  1414928 1970-01-01 00:00:00.000000 bin/lvm
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/md5sum -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/mkdir -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/mkfifo -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/mknod -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/mktemp -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/more -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/mount -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/mv -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/nc -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/nl -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/nproc -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/nslookup -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/paste -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/patch -> busybox
│ │ --rwx------   0        0        0    10096 1970-01-01 00:00:00.000000 bin/peek
│ │ +-rwx------   0        0        0    10088 1970-01-01 00:00:00.000000 bin/peek
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/pgrep -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/pidof -> busybox
│ │ --rwx------   0        0        0    52200 1970-01-01 00:00:00.000000 bin/pinentry-tty
│ │ +-rwx------   0        0        0    44008 1970-01-01 00:00:00.000000 bin/pinentry-tty
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/ping -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/pkill -> busybox
│ │ --rwx------   0        0        0    14200 1970-01-01 00:00:00.000000 bin/poke
│ │ +-rwx------   0        0        0    10096 1970-01-01 00:00:00.000000 bin/poke
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/printf -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/ps -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/pwd -> busybox
│ │ --rwx------   0        0        0     5912 1970-01-01 00:00:00.000000 bin/qrenc
│ │ +-rwx------   0        0        0     5904 1970-01-01 00:00:00.000000 bin/qrenc
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/resume -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/rm -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/rmdir -> busybox
│ │ --rwx------   0        0        0   416040 1970-01-01 00:00:00.000000 bin/scdaemon
│ │ +-rwx------   0        0        0   346376 1970-01-01 00:00:00.000000 bin/scdaemon
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/sed -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/seq -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/setfattr -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/setpriv -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/setserial -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/setsid -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/sh -> busybox
│ │ @@ -122,62 +124,62 @@
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/tail -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/tar -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/tee -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/test -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/tftp -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/time -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/top -> busybox
│ │ --rwx------   0        0        0    10048 1970-01-01 00:00:00.000000 bin/totp
│ │ +-rwx------   0        0        0    10032 1970-01-01 00:00:00.000000 bin/totp
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/touch -> busybox
│ │ --rwx------   0        0        0   126584 1970-01-01 00:00:00.000000 bin/tpm
│ │ +-rwx------   0        0        0   118392 1970-01-01 00:00:00.000000 bin/tpm
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/tr -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/true -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/tty -> busybox
│ │ --rwx------   0        0        0    18320 1970-01-01 00:00:00.000000 bin/uefi
│ │ +-rwx------   0        0        0    14208 1970-01-01 00:00:00.000000 bin/uefi
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/umount -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/uname -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/uniq -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/unxz -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/unzip -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/usleep -> busybox
│ │ --rwx------   0        0        0    45264 1970-01-01 00:00:00.000000 bin/veritysetup
│ │ +-rwx------   0        0        0    41168 1970-01-01 00:00:00.000000 bin/veritysetup
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/vi -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/wc -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/wget -> busybox
│ │ --rwx------   0        0        0    27136 1970-01-01 00:00:00.000000 bin/whiptail
│ │ +-rwx------   0        0        0    23032 1970-01-01 00:00:00.000000 bin/whiptail
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/xargs -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/xxd -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/xz -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/xzcat -> busybox
│ │  lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/zcat -> busybox
│ │  drwx------   0        0        0        0 1970-01-01 00:00:00.000000 etc
│ │ --rw-------   0        0        0      628 1970-01-01 00:00:00.000000 etc/config
│ │ +-rw-------   0        0        0      638 1970-01-01 00:00:00.000000 etc/config
│ │  drwx------   0        0        0        0 1970-01-01 00:00:00.000000 lib
│ │ --rwx------   0        0        0    76736 1970-01-01 00:00:00.000000 lib/libassuan.so.0
│ │ --rwx------   0        0        0   271040 1970-01-01 00:00:00.000000 lib/libblkid.so.1
│ │ +-rwx------   0        0        0    64448 1970-01-01 00:00:00.000000 lib/libassuan.so.0
│ │ +-rwx------   0        0        0   238208 1970-01-01 00:00:00.000000 lib/libblkid.so.1
│ │  -rwx------   0        0        0   596544 1970-01-01 00:00:00.000000 lib/libc.so
│ │ --rwx------   0        0        0   464560 1970-01-01 00:00:00.000000 lib/libcryptsetup.so.12
│ │ --rwx------   0        0        0   333240 1970-01-01 00:00:00.000000 lib/libdevmapper.so.1.02
│ │ --rwx------   0        0        0  1160520 1970-01-01 00:00:00.000000 lib/libgcrypt.so.20
│ │ --rwx------   0        0        0   130000 1970-01-01 00:00:00.000000 lib/libgpg-error.so.0
│ │ +-rwx------   0        0        0   403152 1970-01-01 00:00:00.000000 lib/libcryptsetup.so.12
│ │ +-rwx------   0        0        0   284184 1970-01-01 00:00:00.000000 lib/libdevmapper.so.1.02
│ │ +-rwx------   0        0        0  1054216 1970-01-01 00:00:00.000000 lib/libgcrypt.so.20
│ │ +-rwx------   0        0        0   109520 1970-01-01 00:00:00.000000 lib/libgpg-error.so.0
│ │  -rwx------   0        0        0    81024 1970-01-01 00:00:00.000000 lib/libjson-c.so.5
│ │ --rwx------   0        0        0   256376 1970-01-01 00:00:00.000000 lib/libksba.so.8
│ │ --rwx------   0        0        0   325104 1970-01-01 00:00:00.000000 lib/libmbedcrypto.so.0
│ │ --rwx------   0        0        0    85632 1970-01-01 00:00:00.000000 lib/libnewt.so.0.52
│ │ +-rwx------   0        0        0   199016 1970-01-01 00:00:00.000000 lib/libksba.so.8
│ │ +-rwx------   0        0        0   288272 1970-01-01 00:00:00.000000 lib/libmbedcrypto.so.0
│ │ +-rwx------   0        0        0    77408 1970-01-01 00:00:00.000000 lib/libnewt.so.0.52
│ │  -rwx------   0        0        0    14552 1970-01-01 00:00:00.000000 lib/libnpth.so.0
│ │  -rwx------   0        0        0    52272 1970-01-01 00:00:00.000000 lib/libpci.so.3
│ │  -rwx------   0        0        0    52272 1970-01-01 00:00:00.000000 lib/libpci.so.3.5.4
│ │  -rwx------   0        0        0    48088 1970-01-01 00:00:00.000000 lib/libpopt.so.0
│ │ --rwx------   0        0        0    47448 1970-01-01 00:00:00.000000 lib/libqrencode.so.3
│ │ +-rwx------   0        0        0    39232 1970-01-01 00:00:00.000000 lib/libqrencode.so.3
│ │  -rwx------   0        0        0  1169184 1970-01-01 00:00:00.000000 lib/libslang.so.2
│ │ --rwx------   0        0        0   339304 1970-01-01 00:00:00.000000 lib/libtpm.so
│ │ --rwx------   0        0        0    18464 1970-01-01 00:00:00.000000 lib/libusb-0.1.so.4
│ │ --rwx------   0        0        0    96896 1970-01-01 00:00:00.000000 lib/libusb-1.0.so.0
│ │ --rwx------   0        0        0    14656 1970-01-01 00:00:00.000000 lib/libuuid.so.1
│ │ --rwx------   0        0        0   108832 1970-01-01 00:00:00.000000 lib/libz.so.1
│ │ +-rwx------   0        0        0   314728 1970-01-01 00:00:00.000000 lib/libtpm.so
│ │ +-rwx------   0        0        0    18440 1970-01-01 00:00:00.000000 lib/libusb-0.1.so.4
│ │ +-rwx------   0        0        0    84584 1970-01-01 00:00:00.000000 lib/libusb-1.0.so.0
│ │ +-rwx------   0        0        0    14720 1970-01-01 00:00:00.000000 lib/libuuid.so.1
│ │ +-rwx------   0        0        0    76040 1970-01-01 00:00:00.000000 lib/libz.so.1
│ │  drwx------   0        0        0        0 1970-01-01 00:00:00.000000 sbin
│ │  lrwx------   0        0        0       14 1970-01-01 00:00:00.000000 sbin/arp -> ../bin/busybox
│ │  lrwx------   0        0        0       14 1970-01-01 00:00:00.000000 sbin/blkid -> ../bin/busybox
│ │  lrwx------   0        0        0       14 1970-01-01 00:00:00.000000 sbin/blockdev -> ../bin/busybox
│ │  lrwx------   0        0        0       14 1970-01-01 00:00:00.000000 sbin/chroot -> ../bin/busybox
│ │  lrwx------   0        0        0       14 1970-01-01 00:00:00.000000 sbin/devmem -> ../bin/busybox
│ │  lrwx------   0        0        0       14 1970-01-01 00:00:00.000000 sbin/fdisk -> ../bin/busybox

@tlaurion
Copy link
Collaborator Author

tlaurion commented Mar 1, 2023

Seems like we can go to flashrom/dasharo but space is really really tight even with this merge.
And bash requirement for gui-init will make things tighter....

@tlaurion
Copy link
Collaborator Author

tlaurion commented Mar 7, 2023

Removed dasharo/flashrom.
rebased on master including #1329. Waiting for that to build roms on master and will compare one last time between master and current PR for sizes.


Ok so we can compare https://app.circleci.com/pipelines/github/osresearch/heads/526/workflows/bdef2e57-923b-441e-94ff-ad10707bd3a5 with https://app.circleci.com/pipelines/github/tlaurion/heads/1523/workflows/92558d5a-87e0-4e8f-8229-fedfcc4c6715


Taking x230-hotp-maximized tools.cpio for both.

mkdir /tmp/master
wget https://output.circle-artifacts.com/output/job/4c1d84cf-9064-401a-b954-e86d2f1e1340/artifacts/0/build/x86/x230-hotp-maximized/tools.cpio -O /tmp/master/tools.cpio
mkdir /tmp/pass_O2_OS
wget https://output.circle-artifacts.com/output/job/341e675d-506d-4691-8692-13c16bed1c1a/artifacts/0/build/x86/x230-hotp-maximized/tools.cpio -O /tmp/pass_O2_OS/tools.cpio
diffoscope /tmp/master/tools.cpio /tmp/pass_O2_OS/tools.cpio --markdown pass_02_OS_gains.md

Extract of diffoscope diffing cpio file listing only (first report):

-: master
+: this PR per last commit

Extract from top to end of filelist of Mardown output from last command:

user@heads-tests:~/heads$ cat pass_02_OS_gains.md
# Comparing /tmp/master/tools.cpio & /tmp/pass_O2_OS/tools.cpio

comprises of 1 embedded members

## .cpio file embedded at offset 0

### file list

    @@ -1,113 +1,113 @@
     drwx------   0        0        0        0 1970-01-01 00:00:00.000000 .
     drwx------   0        0        0        0 1970-01-01 00:00:00.000000 bin
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/[ -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/[[ -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/arch -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/ash -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/awk -> busybox
    --rwx------   0        0        0    10088 1970-01-01 00:00:00.000000 bin/base32
    +-rwx------   0        0        0     5912 1970-01-01 00:00:00.000000 bin/base32
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/base64 -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/basename -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/bash -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/bunzip2 -> busybox
     -rwx------   0        0        0   507776 1970-01-01 00:00:00.000000 bin/busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/bzcat -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/bzip2 -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/cat -> busybox
    --rwx------   0        0        0    18360 1970-01-01 00:00:00.000000 bin/cbfs
    +-rwx------   0        0        0    14240 1970-01-01 00:00:00.000000 bin/cbfs
     -rwx------   0        0        0    27048 1970-01-01 00:00:00.000000 bin/cbmem
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/chattr -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/chmod -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/cmp -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/cp -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/cpio -> busybox
    --rwx------   0        0        0   115192 1970-01-01 00:00:00.000000 bin/cryptsetup
    --rwx------   0        0        0    87968 1970-01-01 00:00:00.000000 bin/cryptsetup-reencrypt
    +-rwx------   0        0        0   102904 1970-01-01 00:00:00.000000 bin/cryptsetup
    +-rwx------   0        0        0    83872 1970-01-01 00:00:00.000000 bin/cryptsetup-reencrypt
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/cut -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/date -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/dc -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/dd -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/df -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/diff -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/dirname -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/dmesg -> busybox
    --rwx------   0        0        0   137464 1970-01-01 00:00:00.000000 bin/dmsetup
    +-rwx------   0        0        0   121080 1970-01-01 00:00:00.000000 bin/dmsetup
     -rwx------   0        0        0   184824 1970-01-01 00:00:00.000000 bin/dropbear
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/du -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/echo -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/env -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/expr -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/factor -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/fallocate -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/false -> busybox
     -rwx------   0        0        0    51616 1970-01-01 00:00:00.000000 bin/fbwhiptail
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/find -> busybox
     -rwx------   0        0        0   580568 1970-01-01 00:00:00.000000 bin/flashrom
    --rwx------   0        0        0    22432 1970-01-01 00:00:00.000000 bin/flashtool
    +-rwx------   0        0        0    18336 1970-01-01 00:00:00.000000 bin/flashtool
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/fold -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/getopt -> busybox
    --rwx------   0        0        0   915328 1970-01-01 00:00:00.000000 bin/gpg
    --rwx------   0        0        0   380120 1970-01-01 00:00:00.000000 bin/gpg-agent
    +-rwx------   0        0        0   751456 1970-01-01 00:00:00.000000 bin/gpg
    +-rwx------   0        0        0   314584 1970-01-01 00:00:00.000000 bin/gpg-agent
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/grep -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/groups -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/gunzip -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/gzip -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/hd -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/head -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/hexdump -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/hexedit -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/hostid -> busybox
    --rwx------   0        0        0    10024 1970-01-01 00:00:00.000000 bin/hotp
    +-rwx------   0        0        0     5912 1970-01-01 00:00:00.000000 bin/hotp
     -rwx------   0        0        0     1087 1970-01-01 00:00:00.000000 bin/hotp_initialize
     -rwx------   0        0        0    29944 1970-01-01 00:00:00.000000 bin/hotp_verification
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/id -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/install -> busybox
    --rwx------   0        0        0   170984 1970-01-01 00:00:00.000000 bin/kexec
    +-rwx------   0        0        0   154568 1970-01-01 00:00:00.000000 bin/kexec
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/kill -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/killall -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/less -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/link -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/ln -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/ls -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/lsattr -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/lsof -> busybox
     -rwx------   0        0        0    73600 1970-01-01 00:00:00.000000 bin/lspci
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/lsscsi -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/lsusb -> busybox
    --rwx------   0        0        0  1627856 1970-01-01 00:00:00.000000 bin/lvm
    +-rwx------   0        0        0  1414928 1970-01-01 00:00:00.000000 bin/lvm
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/md5sum -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/mkdir -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/mkfifo -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/mknod -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/mktemp -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/more -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/mount -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/mv -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/nc -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/nl -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/nproc -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/nslookup -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/paste -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/patch -> busybox
    --rwx------   0        0        0    10096 1970-01-01 00:00:00.000000 bin/peek
    +-rwx------   0        0        0    10088 1970-01-01 00:00:00.000000 bin/peek
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/pgrep -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/pidof -> busybox
    --rwx------   0        0        0    52200 1970-01-01 00:00:00.000000 bin/pinentry-tty
    +-rwx------   0        0        0    44008 1970-01-01 00:00:00.000000 bin/pinentry-tty
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/ping -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/pkill -> busybox
    --rwx------   0        0        0    14200 1970-01-01 00:00:00.000000 bin/poke
    +-rwx------   0        0        0    10096 1970-01-01 00:00:00.000000 bin/poke
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/printf -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/ps -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/pwd -> busybox
    --rwx------   0        0        0     5912 1970-01-01 00:00:00.000000 bin/qrenc
    +-rwx------   0        0        0     5904 1970-01-01 00:00:00.000000 bin/qrenc
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/resume -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/rm -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/rmdir -> busybox
    --rwx------   0        0        0   416040 1970-01-01 00:00:00.000000 bin/scdaemon
    +-rwx------   0        0        0   346376 1970-01-01 00:00:00.000000 bin/scdaemon
     -rwx------   0        0        0    22664 1970-01-01 00:00:00.000000 bin/scp
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/sed -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/seq -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/setfattr -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/setpriv -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/setserial -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/setsid -> busybox
    @@ -128,63 +128,63 @@
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/tail -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/tar -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/tee -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/test -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/tftp -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/time -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/top -> busybox
    --rwx------   0        0        0    10048 1970-01-01 00:00:00.000000 bin/totp
    +-rwx------   0        0        0    10032 1970-01-01 00:00:00.000000 bin/totp
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/touch -> busybox
    --rwx------   0        0        0   126584 1970-01-01 00:00:00.000000 bin/tpm
    +-rwx------   0        0        0   118392 1970-01-01 00:00:00.000000 bin/tpm
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/tr -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/true -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/tty -> busybox
    --rwx------   0        0        0    18320 1970-01-01 00:00:00.000000 bin/uefi
    +-rwx------   0        0        0    14208 1970-01-01 00:00:00.000000 bin/uefi
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/umount -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/uname -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/uniq -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/unxz -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/unzip -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/usleep -> busybox
    --rwx------   0        0        0    45264 1970-01-01 00:00:00.000000 bin/veritysetup
    +-rwx------   0        0        0    41168 1970-01-01 00:00:00.000000 bin/veritysetup
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/vi -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/wc -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/wget -> busybox
     -rwx------   0        0        0       35 1970-01-01 00:00:00.000000 bin/whiptail
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/xargs -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/xxd -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/xz -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/xzcat -> busybox
     lrwx------   0        0        0        7 1970-01-01 00:00:00.000000 bin/zcat -> busybox
     drwx------   0        0        0        0 1970-01-01 00:00:00.000000 etc
     -rw-------   0        0        0      625 1970-01-01 00:00:00.000000 etc/config
     drwx------   0        0        0        0 1970-01-01 00:00:00.000000 lib
    --rwx------   0        0        0    76736 1970-01-01 00:00:00.000000 lib/libassuan.so.0
    --rwx------   0        0        0   271040 1970-01-01 00:00:00.000000 lib/libblkid.so.1
    +-rwx------   0        0        0    64448 1970-01-01 00:00:00.000000 lib/libassuan.so.0
    +-rwx------   0        0        0   238208 1970-01-01 00:00:00.000000 lib/libblkid.so.1
     -rwx------   0        0        0   596544 1970-01-01 00:00:00.000000 lib/libc.so
    --rwx------   0        0        0   757232 1970-01-01 00:00:00.000000 lib/libcairo.so.2
    --rwx------   0        0        0   464560 1970-01-01 00:00:00.000000 lib/libcryptsetup.so.12
    --rwx------   0        0        0   333240 1970-01-01 00:00:00.000000 lib/libdevmapper.so.1.02
    --rwx------   0        0        0  1160520 1970-01-01 00:00:00.000000 lib/libgcrypt.so.20
    --rwx------   0        0        0   130000 1970-01-01 00:00:00.000000 lib/libgpg-error.so.0
    +-rwx------   0        0        0   491024 1970-01-01 00:00:00.000000 lib/libcairo.so.2
    +-rwx------   0        0        0   403152 1970-01-01 00:00:00.000000 lib/libcryptsetup.so.12
    +-rwx------   0        0        0   284184 1970-01-01 00:00:00.000000 lib/libdevmapper.so.1.02
    +-rwx------   0        0        0  1054216 1970-01-01 00:00:00.000000 lib/libgcrypt.so.20
    +-rwx------   0        0        0   109520 1970-01-01 00:00:00.000000 lib/libgpg-error.so.0
     -rwx------   0        0        0    81024 1970-01-01 00:00:00.000000 lib/libjson-c.so.5
    --rwx------   0        0        0   256376 1970-01-01 00:00:00.000000 lib/libksba.so.8
    --rwx------   0        0        0   325104 1970-01-01 00:00:00.000000 lib/libmbedcrypto.so.0
    +-rwx------   0        0        0   199016 1970-01-01 00:00:00.000000 lib/libksba.so.8
    +-rwx------   0        0        0   288272 1970-01-01 00:00:00.000000 lib/libmbedcrypto.so.0
     -rwx------   0        0        0    14552 1970-01-01 00:00:00.000000 lib/libnpth.so.0
     -rwx------   0        0        0    52272 1970-01-01 00:00:00.000000 lib/libpci.so.3
     -rwx------   0        0        0    52272 1970-01-01 00:00:00.000000 lib/libpci.so.3.5.4
    --rwx------   0        0        0   666216 1970-01-01 00:00:00.000000 lib/libpixman-1.so.0
    --rwx------   0        0        0   207912 1970-01-01 00:00:00.000000 lib/libpng16.so.16
    +-rwx------   0        0        0   572016 1970-01-01 00:00:00.000000 lib/libpixman-1.so.0
    +-rwx------   0        0        0   171032 1970-01-01 00:00:00.000000 lib/libpng16.so.16
     -rwx------   0        0        0    48088 1970-01-01 00:00:00.000000 lib/libpopt.so.0
    --rwx------   0        0        0    47448 1970-01-01 00:00:00.000000 lib/libqrencode.so.3
    --rwx------   0        0        0   339304 1970-01-01 00:00:00.000000 lib/libtpm.so
    --rwx------   0        0        0    18464 1970-01-01 00:00:00.000000 lib/libusb-0.1.so.4
    --rwx------   0        0        0    96896 1970-01-01 00:00:00.000000 lib/libusb-1.0.so.0
    --rwx------   0        0        0    14656 1970-01-01 00:00:00.000000 lib/libuuid.so.1
    --rwx------   0        0        0   108832 1970-01-01 00:00:00.000000 lib/libz.so.1
    +-rwx------   0        0        0    39232 1970-01-01 00:00:00.000000 lib/libqrencode.so.3
    +-rwx------   0        0        0   314728 1970-01-01 00:00:00.000000 lib/libtpm.so
    +-rwx------   0        0        0    18440 1970-01-01 00:00:00.000000 lib/libusb-0.1.so.4
    +-rwx------   0        0        0    84584 1970-01-01 00:00:00.000000 lib/libusb-1.0.so.0
    +-rwx------   0        0        0    14720 1970-01-01 00:00:00.000000 lib/libuuid.so.1
    +-rwx------   0        0        0    76040 1970-01-01 00:00:00.000000 lib/libz.so.1
     drwx------   0        0        0        0 1970-01-01 00:00:00.000000 sbin
     lrwx------   0        0        0       14 1970-01-01 00:00:00.000000 sbin/arp -> ../bin/busybox
     lrwx------   0        0        0       14 1970-01-01 00:00:00.000000 sbin/blkid -> ../bin/busybox
     lrwx------   0        0        0       14 1970-01-01 00:00:00.000000 sbin/blockdev -> ../bin/busybox
     lrwx------   0        0        0       14 1970-01-01 00:00:00.000000 sbin/chroot -> ../bin/busybox
     lrwx------   0        0        0       14 1970-01-01 00:00:00.000000 sbin/devmem -> ../bin/busybox
     lrwx------   0        0        0       14 1970-01-01 00:00:00.000000 sbin/fdisk -> ../bin/busybox

@tlaurion
Copy link
Collaborator Author

tlaurion commented Mar 7, 2023

So on modules, last validation for success:

  • +++ b/modules/busybox
  • +++ b/modules/cairo
  • +++ b/modules/cryptsetup
  • +++ b/modules/cryptsetup2
  • +++ b/modules/flashtools
  • +++ b/modules/gpg
  • +++ b/modules/gpg2
  • +++ b/modules/kexec
  • +++ b/modules/libassuan
  • +++ b/modules/libgcrypt
  • +++ b/modules/libgpg-error
  • +++ b/modules/libksba
  • +++ b/modules/libpng
  • +++ b/modules/libusb
  • +++ b/modules/libusb-compat
  • +++ b/modules/lvm2
  • +++ b/modules/mbedtls
  • +++ b/modules/newt
  • +++ b/modules/npth
  • +++ b/modules/pinentry
  • +++ b/modules/pixman
  • +++ b/modules/qrencode
  • +++ b/modules/tpmtotp
  • +++ b/modules/util-linux
  • +++ b/modules/zlib

@tlaurion
Copy link
Collaborator Author

tlaurion commented Mar 7, 2023

For next forced push commit, remove non-working attempted changes for the following modules/*:

  • zlib
  • busybox
  • npth

and compare t430-legacy boards (CONFIG_NEWT=y ->whiptail based board configuration) to see success/failure for:

  • newt

Adresses @easrentai suggestion to pass modules build optimization for space here: linuxboot#590 (comment)

- Uniformized module's $(CROSS_TOOLS) being passed as environment variable, prior of ./configure call

Doesn't work for:
- busybox (HOSTCXXFLAGS="-Os" attempted prior of ./configure call)
- zlib (CFLAGS="-Os" attempted prior of ./configure call)
- npth (CFLAGS="-Os" attempted prior of ./configure call)
@tlaurion
Copy link
Collaborator Author

tlaurion commented Mar 7, 2023

Ok so we can compare https://app.circleci.com/pipelines/github/osresearch/heads/526/workflows/bdef2e57-923b-441e-94ff-ad10707bd3a5 with https://app.circleci.com/pipelines/github/tlaurion/heads/1523/workflows/92558d5a-87e0-4e8f-8229-fedfcc4c6715

but this time for t430-hotp-legacy, which is whiptail based for now:

rm -rf /tmp/master /tmp/pass_O2_OS
mkdir /tmp/master
wget https://output.circle-artifacts.com/output/job/fb31fb38-fa46-4953-9d8f-c23fa905af52/artifacts/0/build/x86/t430-hotp-legacy/tools.cpio -O /tmp/master/tools.cpio
mkdir /tmp/pass_O2_OS
wget https://output.circle-artifacts.com/output/job/74ba4bd5-f27c-4790-bb71-4e51672efda5/artifacts/0/build/x86/t430-hotp-legacy/tools.cpio -O /tmp/pass_O2_OS/tools.cpio
diffoscope /tmp/master/tools.cpio /tmp/pass_O2_OS/tools.cpio --markdown pass_02_OS_gains.md

Comparison of diffoscope extract, only for newt:

    --rwx------   0        0        0    85632 1970-01-01 00:00:00.000000 lib/libnewt.so.0.52
    +-rwx------   0        0        0    77408 1970-01-01 00:00:00.000000 lib/libnewt.so.0.52

Success for tackled modules.
@JonathonHall-Purism : ready to for review.

@tlaurion
Copy link
Collaborator Author

tlaurion commented Mar 7, 2023

Leaving changes for gpg and cryptsetup1 even if not tested. Can revert if desired.

@JonathonHall-Purism
Copy link
Collaborator

Looks great @tlaurion ! None of our boards have gpg or cryptsetup1 so I have no issues there. I'm thrilled that we have space for bash in #1292 and even space left over. Let's merge it 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants