From 0515e4c17d50dcdd9d903f5ac8b6d9988cb149fa Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Tue, 22 Dec 2020 17:50:34 +0000 Subject: [PATCH] test: check for binariers in [usr/][s]bin The image build function greps for ExecStart lines in unit files, but some of them (eg: systemd-firstboot) do not use a full path. It then falls back to 'type -P' but that only works if you have the binary installed. For optional binaries like systemd-firstboot, the installation can then fail. Manually check if the binary already exists in /[usr/][s]bin. --- test/test-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test-functions b/test/test-functions index 03685f8da4..1359156b17 100644 --- a/test/test-functions +++ b/test/test-functions @@ -1575,7 +1575,7 @@ inst_binary() { # In such cases, let's check if the binary indeed exists in the image # before doing any other chcecks. If it does, immediately return with # success. - [[ $# -eq 1 && -e $initdir/$1 ]] && return 0 + [[ $# -eq 1 && -e $initdir/$1 || -e $initdir/bin/$1 || -e $initdir/sbin/$1 || -e $initdir/usr/bin/$1 || -e $initdir/usr/sbin/$1 ]] && return 0 _bin=$(find_binary "$1") || return 1 _target=${2:-$_bin}