]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: check for binariers in [usr/][s]bin
authorLuca Boccassi <bluca@debian.org>
Tue, 22 Dec 2020 17:50:34 +0000 (17:50 +0000)
committerLuca Boccassi <bluca@debian.org>
Fri, 1 Jan 2021 21:33:16 +0000 (21:33 +0000)
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

index 03685f8da4aff2c637a05fa434fffeb29ae57721..1359156b17a2c7e387d973c183ddf42577429131 100644 (file)
@@ -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}