Re: ipset make modules_install always fail unless module already loaded?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Oskar,

On Tue, 29 Oct 2019, Oskar Berggren wrote:

> In Makefile.am there is this block:
> 
> modules_install:
> if WITH_KMOD
>     ${MAKE} -C $(KBUILD_OUTPUT) M=$$PWD/kernel/net \
>             KDIR=$$PWD/kernel modules_install
>     @modinfo -b ${INSTALL_MOD_PATH} ip_set_hash_ip | ${GREP} /extra/
> >/dev/null || echo "$$DEPMOD_WARNING"
>     @lsmod | ${GREP} '^ip_set' >/dev/null && echo "$$MODULE_WARNING"
> else
>     @echo Skipping kernel modules due to --with-kmod=no
> endif
> 
> I'm rusty on shell script, but it seems to me that the line with lsmod 
> will print the warning and return exit code 0 if a matching module is 
> loaded but if such a module is NOT loaded, grep will give exit code 1 
> (intended) and it will not print the warning (intended) but then the 
> whole line will return exit code 1 cause make to stop with an error. If 
> being run from another script it can/will stop that script from 
> continuing.
> 
> In short - make modules_install will only run successfully if an ipset
> module is already loaded. At least I seem to get this problem.

Yes, that was not taken care of. I'm committing the patch

diff --git a/Makefile.am b/Makefile.am
index 8d718e1..eab32ee 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -73,7 +73,7 @@ if WITH_KMOD
        ${MAKE} -C $(KBUILD_OUTPUT) M=$$PWD/kernel/net \
                        KDIR=$$PWD/kernel modules_install
        @modinfo -b ${INSTALL_MOD_PATH} ip_set_hash_ip | ${GREP} /extra/ >/dev/null || echo "$$DEPMOD_WARNING"
-       @lsmod | ${GREP} '^ip_set' >/dev/null && echo "$$MODULE_WARNING"
+       @lsmod | ${GREP} '^ip_set' >/dev/null && echo "$$MODULE_WARNING"; true
 else
        @echo Skipping kernel modules due to --with-kmod=no
 endif

to fix the issue.

Best regards,
Jozsef
-
E-mail  : kadlec@xxxxxxxxxxxxxxxxx, kadlecsik.jozsef@xxxxxxxxxxxxx
PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address : Wigner Research Centre for Physics
          H-1525 Budapest 114, POB. 49, Hungary



[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux