add binary check to environment

This commit is contained in:
Tobias Powalowski 2022-01-28 08:24:31 +01:00
parent b725175e3c
commit 23f796ae84
3 changed files with 40 additions and 0 deletions

View file

@ -0,0 +1,36 @@
#!/bin/bash
#!/usr/bin/env bash
# created by Tobias Powalowski <tpowa@archlinux.org>
_BASENAME="$(basename "${0}")"
usage () {
echo "${_BASENAME}: usage"
echo "Check on missing binaries in archboot environment"
echo "-------------------------------------------------"
echo "Usage: ${_BASENAME} <package>"
echo "This will check binaries from package, if they exist"
echo "and report missing to binary.txt"
echo ""
echo " -h This message."
exit 0
}
[[ -z "${1}" ]] && usage
if [[ ! "$(cat /etc/hostname)" == "archboot" ]]; then
echo "This script should only be run in booted archboot environment. Aborting..."
exit 1
fi
while [ $# -gt 0 ]; do
case ${1} in
-h|--h|?) usage; exit 0 ;;
esac
shift
done
echo $1 >binary.txt
for i in $(pacman -Ql $1 | grep "/usr/bin/..*");do
which $i >/dev/null || echo $i>>binary.txt
done

View file

@ -59,7 +59,9 @@ if [[ "${_D_SCRIPTS}" == "1" ]]; then
[[ -e /usr/bin/tz ]] && wget -q "$_INSTALLER_SOURCE/archboot-tz.sh?inline=false" -O /usr/bin/tz >/dev/null 2>&1
[[ -e /usr/bin/archboot-${_RUNNING_ARCH}-create-container.sh ]] && wget -q "$_INSTALLER_SOURCE/archboot-${_RUNNING_ARCH}-create-container.sh?inline=false" -O "/usr/bin/archboot-${_RUNNING_ARCH}-create-container.sh" >/dev/null 2>&1
[[ -e /usr/bin/archboot-${_RUNNING_ARCH}-release.sh ]] && wget -q "$_INSTALLER_SOURCE/archboot-${_RUNNING_ARCH}-release.sh?inline=false" -O "/usr/bin/archboot-${_RUNNING_ARCH}-release.sh" >/dev/null 2>&1
[[ -e /usr/bin/archboot-binary-check.sh ]] && wget -q "$_INSTALLER_SOURCE/archboot-binary-check.sh?inline=false" -O /usr/bin/archboot-binary-check.sh >/dev/null 2>&1
[[ -e /usr/bin/update-installer.sh ]] && wget -q "$_INSTALLER_SOURCE/archboot-update-installer.sh?inline=false" -O /usr/bin/update-installer.sh >/dev/null 2>&1
echo "Finished: Downloading scripts done."
exit 0
fi

View file

@ -89,6 +89,8 @@ build ()
add_file "/usr/bin/archboot-copy-mountpoint.sh"
### add rsync-backup.sh
add_file "/usr/bin/archboot-rsync-backup.sh"
### add binary add_check
add_file "/usr/bin/archboot-binary-check.sh"
### add pam
apps="mkhomedir_helper pam_timestamp_check unix_chkpwd unix_update"