site  contact  subhomenews

Delete .a library files in devx SFS

May 23, 2026 — BarryK

In woofQ2, the EasyOS build system, the script woofq2/rootfs/3create-devx-sfs creates the devx SFS. The latest is 'devx_7.3.4_amd64.sfs'. Due to more rigorous finding of "-dev" packages to match those builtin in 'easy.sfs', the devx SFS has grown in size, from 553MB in Easy 7.3.3, to 689MB in Easy 7.3.4

A lot of the "-dev" packages contain static library files, for example 'libcdio.a', that are not really needed, unless creating a statically-linked binary executable. There are some exceptions, where a dynamically-linked executable is created, with one or two statically-linked libraries in it; but that is unusual.

To bring down the size of the devx SFS, this could be done:

find ${SB}/devx-rw/usr/lib/${xARCH}-linux-gnu -maxdepth 1 -type f -name '*.a' ! -name 'libc*' ! -name 'libm.a' ! -name 'libgcc*' ! -name 'libstd*' -delete

However, I decided to be more cautious, and only delete the .a if there is a matching .so, for example for libcdio.a there exists libcdio.so:

find ${SB}/devx-rw/usr/lib/${xARCH}-linux-gnu -maxdepth 1 -type f -name '*.a' ! -name 'libc*' ! -name 'libm.a' ! -name 'libgcc*' ! -name 'libstd*' > /tmp/zzdevx-excl
for aF in $(cat /tmp/zzdevx-excl | tr ' ' 'X')
do
[ -z "$aF" ] && continue
if [ -f ${aF/.a/.so} -o -h ${aF/.a/.so} ];then
rm -f ${SB}/devx-rw/usr/lib/${xARCH}-linux-gnu/${aF##*/}
fi
done

Seems ok to do this.    

Tags: easy