• Jiri Benc's avatar
    selftests: fix too long argument · c363eb48
    Jiri Benc authored
    With some shells, the command construed for install of bpf selftests becomes
    too large due to long list of files:
    
    make[1]: execvp: /bin/sh: Argument list too long
    make[1]: *** [../lib.mk:73: install] Error 127
    
    Currently, each of the file lists is replicated three times in the command:
    in the shell 'if' condition, in the 'echo' and in the 'rsync'. Reduce that
    by one instance by using make conditionals and separate the echo and rsync
    into two shell commands. (One would be inclined to just remove the '@' at
    the beginning of the rsync command and let 'make' echo it by itself;
    unfortunately, it appears that the '@' in the front of mkdir silences output
    also for the following commands.)
    
    Also, separate handling of each of the lists to its own shell command.
    
    The semantics of the makefile is unchanged before and after the patch. The
    ability of individual test directories to override INSTALL_RULE is retained.
    Reported-by: default avatarYauheni Kaliuta <yauheni.kaliuta@redhat.com>
    Tested-by: default avatarYauheni Kaliuta <yauheni.kaliuta@redhat.com>
    Signed-off-by: default avatarJiri Benc <jbenc@redhat.com>
    Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
    c363eb48
lib.mk 4.78 KB