A collection of system hardening and generally-useful scripts for Linux systems. Targets Artix, works on any distro. Some inits require disabling the included boot parameter hardening, otherwise they won't boot (systemd)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

32 lines
1.1 KiB

#!/bin/bash
echo "PARSEC: '$0': Running..."
#### Taken from /etc/makepkg.conf
#-- Options to be used when stripping binaries. See `man strip' for details.
STRIP_BINARIES="--strip-all"
#-- Options to be used when stripping shared libraries. See `man strip' for details.
STRIP_SHARED="--strip-unneeded"
#-- Options to be used when stripping static libraries. See `man strip' for details.
STRIP_STATIC="--strip-debug"
####
builddir="$1"
while read -rd '' file; do
# echo "Stripping: '$file'"
strip -v --strip-unneeded "$file" &> /dev/null
# echo -ne "\tMIME type "
# mime="$(file -bi "$file")"
# echo "$mime"
# case "$mime" in
# application/x-sharedlib\;*) # Libraries (.so)
# strip -v $STRIP_SHARED "$file" ;;
# application/x-archive\;*) # Libraries (.a)
# strip -v $STRIP_STATIC "$file" ;;
# application/x-executable\;*) # Binaries
# strip -v $STRIP_BINARIES "$file" ;;
# application/x-pie-executable\;*) # Relocatable binaries
# strip -v $STRIP_SHARED "$file" ;;
# esac
done < <(find "$builddir" -type f -perm -u+x ! -name vmlinux -print0)
echo "PARSEC: '$0': Done."