systemrescue-zfs/airootfs/usr/bin/check-binaries.sh
Gerd v. Egidy 89b721e142 add ldd check for modesetting_drv.so too
modesetting_drv.so is the library that links to libgbm.so. We not only want
that libgbm.so has all dependecies satisfied, but also the lib that needs
libgbm.so in the first place.
2021-12-31 11:53:00 +01:00

32 lines
851 B
Bash
Executable file

#!/bin/bash
errcnt=0
for curfile in /usr/bin/{*btrfs*,*xfs*,dislocker*,udp*,dump,restore} \
/usr/bin/{ms-sys,nwipe,whdd,zerofree} \
/opt/firefox*/firefox* \
/usr/lib/ntfs-3g/ntfs-plugin*.so \
/usr/lib/libgbm.so* \
/usr/lib/xorg/modules/drivers/modesetting_drv.so \
/usr/lib/libdislocker.so*
do
test -x ${curfile} || continue
file --mime ${curfile} | grep -q -E "x-pie-executable|x-sharedlib" || continue
if ldd ${curfile} | grep -q -F 'not found'
then
echo "ERROR: Program ${curfile} is missing libraries"
ldd ${curfile}
errcnt=$((errcnt + 1))
fi
done
if [ ${errcnt} -eq 0 ]
then
echo "SUCCESS: Have not found any missing library"
exit 0
else
echo "FAILURE: Have found ${errcnt} issues"
exit 1
fi