Re: Correct way to set DRIDRIVERS and GALLIUMDRIVERS from mesa bbappend
Mike Crowe
Hi Alex,
toggle quoted message
Show quoted text
It's not a case of simply deleting the so files we don't need since the mesa build system stuffs everything into a small number of files and then hard links them together. For example, the current unmodified oe-core build for qemux86-64 yields: $ ls -l tmp-glibc/deploy/ipk/core2-64/mesa-megadriver_21.3.0-r0_core2-64.ipk -rw-r--r-- 2 mac mac 7993248 Dec 2 09:13 tmp-glibc/deploy/ipk/core2-64/mesa-megadriver_21.3.0-r0_core2-64.ipk $ dpkg-deb -c tmp-glibc/deploy/ipk/core2-64/mesa-megadriver_21.3.0-r0_core2-64.ipk drwxr-xr-x root/root 0 2021-11-17 20:17 ./usr/ drwxr-xr-x root/root 0 2021-11-17 20:17 ./usr/lib/ drwxr-xr-x root/root 0 2021-11-17 20:17 ./usr/lib/dri/ -rwxr-xr-x root/root 17728664 2021-11-17 20:17 ./usr/lib/dri/crocus_dri.so hrwxr-xr-x root/root 0 2021-11-17 20:17 ./usr/lib/dri/i915_dri.so link to ./usr/lib/dri/crocus_dri.so -rwxr-xr-x root/root 15903952 2021-11-17 20:17 ./usr/lib/dri/i965_dri.so hrwxr-xr-x root/root 0 2021-11-17 20:17 ./usr/lib/dri/iris_dri.so link to ./usr/lib/dri/crocus_dri.so hrwxr-xr-x root/root 0 2021-11-17 20:17 ./usr/lib/dri/kms_swrast_dri.so link to ./usr/lib/dri/crocus_dri.so hrwxr-xr-x root/root 0 2021-11-17 20:17 ./usr/lib/dri/nouveau_vieux_dri.so link to ./usr/lib/dri/i965_dri.so hrwxr-xr-x root/root 0 2021-11-17 20:17 ./usr/lib/dri/r200_dri.so link to ./usr/lib/dri/i965_dri.so hrwxr-xr-x root/root 0 2021-11-17 20:17 ./usr/lib/dri/radeon_dri.so link to ./usr/lib/dri/i965_dri.so hrwxr-xr-x root/root 0 2021-11-17 20:17 ./usr/lib/dri/swrast_dri.so link to ./usr/lib/dri/crocus_dri.so hrwxr-xr-x root/root 0 2021-11-17 20:17 ./usr/lib/dri/virtio_gpu_dri.so link to ./usr/lib/dri/crocus_dri.so drwxr-xr-x root/root 0 2021-11-17 20:17 ./usr/share/ drwxr-xr-x root/root 0 2021-11-17 20:17 ./usr/share/drirc.d/ -rw-r--r-- root/root 44273 2021-11-17 20:16 ./usr/share/drirc.d/00-mesa-defaults.conf If I prune the default configuration do_install:append so I only keep swrast_dri.so then I get: $ ls -l tmp-glibc/deploy/ipk/core2-64/mesa-megadriver_21.3.0-r0_core2-64.ipk -rw-r--r-- 2 mac mac 4247362 Dec 2 15:29 tmp-glibc/deploy/ipk/core2-64/mesa-megadriver_21.3.0-r0_core2-64.ipk $ dpkg-deb -c tmp-glibc/deploy/ipk/core2-64/mesa-megadriver_21.3.0-r0_core2-64.ipk drwxr-xr-x root/root 0 2021-11-17 20:17 ./usr/ drwxr-xr-x root/root 0 2021-11-17 20:17 ./usr/lib/ drwxr-xr-x root/root 0 2021-11-17 20:17 ./usr/lib/dri/ -rwxr-xr-x root/root 17728664 2021-11-17 20:17 ./usr/lib/dri/swrast_dri.so drwxr-xr-x root/root 0 2021-11-17 20:17 ./usr/share/ drwxr-xr-x root/root 0 2021-11-17 20:17 ./usr/share/drirc.d/ -rw-r--r-- root/root 44273 2021-11-17 20:16 ./usr/share/drirc.d/00-mesa-defaults.conf If I do no pruning but force: DRIDRIVERS = "" GALLIUMDRIVERS = "swrast" then I get: $ ls -l tmp-glibc/deploy/ipk/core2-64/mesa-megadriver_21.3.0-r0_core2-64.ipk -rw-r--r-- 2 mac mac 2590320 Dec 2 15:15 tmp-glibc/deploy/ipk/core2-64/mesa-megadriver_21.3.0-r0_core2-64.ipk $ dpkg-deb -c tmp-glibc/deploy/ipk/core2-64/mesa-megadriver_21.3.0-r0_core2-64.ipk drwxr-xr-x root/root 0 2021-11-17 20:17 ./usr/ drwxr-xr-x root/root 0 2021-11-17 20:17 ./usr/lib/ drwxr-xr-x root/root 0 2021-11-17 20:17 ./usr/lib/dri/ -rwxr-xr-x root/root 11981240 2021-11-17 20:17 ./usr/lib/dri/kms_swrast_dri.so hrwxr-xr-x root/root 0 2021-11-17 20:17 ./usr/lib/dri/swrast_dri.so link to ./usr/lib/dri/kms_swrast_dri.so drwxr-xr-x root/root 0 2021-11-17 20:17 ./usr/share/ drwxr-xr-x root/root 0 2021-11-17 20:17 ./usr/share/drirc.d/ -rw-r--r-- root/root 44273 2021-11-17 20:16 ./usr/share/drirc.d/00-mesa-defaults.conf This is an uncompressed saving of over five megabytes (32%) and a compressed saving of 1.6MiB (39%) (assuming that the ipk compression is indicative of whatever rootfs compression is used.) I tried just crocus and just iris and there were still savings, albeit not quite as large as for swrast. (I have to admit that when I first started investigating this I misread the numbers and thought they were a factor of ten higher. Nevertheless, it's clear that there is a difference.) Justin Bronder's suggestion has given me a workaround if you don't believe that the space saving is more generally useful. Thanks. Mike. On Wednesday 01 December 2021 at 21:33:39 +0100, Alexander Kanavin wrote:
I'd like to see specifics though to understand the use case better. What |
|