Initial commit of tools.

This commit is contained in:
Darren 'Tadgy' Austin 2022-09-07 14:40:52 +01:00
commit c6cb9f4286
5 changed files with 468 additions and 0 deletions

24
check-dependancies Executable file
View file

@ -0,0 +1,24 @@
#!/bin/bash
# Version: 0.0.2
# Copyright (c) 2007 - 2017:
# Darren 'Tadgy' Austin <darren (at) afterdark.org.uk>
# Licensed under the terms of the GNU General Public License version 3.
#
# This is a quick^Wslow dirty hack to check binaries and libraries for missing
# dependancies using ldd. Only those files with missing dependancies (along
# with the missing library information itself) will be written to stderr.
# Redirecting stderr to a file is advised, since this can produce a large
# volume of output on a system with many missing libraries.
echo "This will take a while..."
{ find -P ${1:-/} -regextype posix-extended \
\( -regex "^/(boot|data|dev|etc|home|lost\+found|media|mnt|proc|root|run|srv|sys|tmp|var)" -a -prune \) -o \
\( -regex "^/lib(64)?/ld-.*" -a -prune \) -o \
\( -regex "^/lib/(dhcpcd|firmware|modprobe\.d|modules)" -a -prune \) -o \
\( -regex "^/(opt|usr|usr/local)/(doc|etc|include|info|man|share|src)" -a -prune \) -o \
\( -regex "^/usr/lib(64)?/(firefox|java|jdk|jre|seamonkey|thunderbird)-.*" -a -prune \) -o \
\( -regex "^/usr/lib(64)?/(locale|qt/plugins/.*.debug)" -a -prune \) -o \
-type f -print0 | \
xargs -0 -r file -N -0 | egrep -a ".*ELF.*(executable|shared object).*dynamically" | cut -d $'\0' -f1 | sort | \
xargs -r ldd 2>/dev/null | egrep "(^/|not found)" | egrep -B 1 "^[[:space:]]" | egrep -v "^--" ; } >&2