All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/fail2ban: fix fail2ban-python symlink
@ 2020-10-05  5:58 Peter Korsgaard
  2020-10-08 20:13 ` Thomas Petazzoni
  2020-10-10 21:00 ` Peter Korsgaard
  0 siblings, 2 replies; 4+ messages in thread
From: Peter Korsgaard @ 2020-10-05  5:58 UTC (permalink / raw)
  To: buildroot

Fixes (reproducible):
http://autobuild.buildroot.net/results/50f/50f199bfe06d054cc6770760e73ac0de594a0670/diffoscope-results.txt

Fail2ban installs the fail2ban-python symlink pointing to the host python
intepreter used to run setup.py, which is naturally not valid at runtime and
breaks the reproducible tests as shown in the diffoscope results:

? -lrwxrwxrwx   0        0        0        0 2020-10-04 10:50:38.000000 ./usr/bin/fail2ban-python -> /home/naourr/work/instance-0/output-1/host/bin/python
? +lrwxrwxrwx   0        0        0        0 2020-10-04 10:50:38.000000 ./usr/bin/fail2ban-python -> /home/naourr/work/instance-0/output-2/host/bin/python

As a workaround, update the symlink after installation to point to the
correct target python.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
 package/fail2ban/fail2ban.mk | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/package/fail2ban/fail2ban.mk b/package/fail2ban/fail2ban.mk
index a0a2dc704b..a4ee0852cc 100644
--- a/package/fail2ban/fail2ban.mk
+++ b/package/fail2ban/fail2ban.mk
@@ -27,6 +27,13 @@ define FAIL2BAN_FIX_DEFAULT_CONFIG
 endef
 FAIL2BAN_POST_INSTALL_TARGET_HOOKS += FAIL2BAN_FIX_DEFAULT_CONFIG
 
+# fail2ban-python points to host python
+define FAIL2BAN_FIX_FAIL2BAN_PYTHON_SYMLINK
+	ln -snf $(if $(BR2_PACKAGE_PYTHON),python,python3) \
+		$(TARGET_DIR)/usr/bin/fail2ban-python
+endef
+FAIL2BAN_POST_INSTALL_TARGET_HOOKS += FAIL2BAN_FIX_FAIL2BAN_PYTHON_SYMLINK
+
 define FAIL2BAN_INSTALL_INIT_SYSV
 	$(INSTALL) -D -m 755 package/fail2ban/S60fail2ban \
 		$(TARGET_DIR)/etc/init.d/S60fail2ban
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH] package/fail2ban: fix fail2ban-python symlink
  2020-10-05  5:58 [Buildroot] [PATCH] package/fail2ban: fix fail2ban-python symlink Peter Korsgaard
@ 2020-10-08 20:13 ` Thomas Petazzoni
  2020-10-08 21:01   ` Peter Korsgaard
  2020-10-10 21:00 ` Peter Korsgaard
  1 sibling, 1 reply; 4+ messages in thread
From: Thomas Petazzoni @ 2020-10-08 20:13 UTC (permalink / raw)
  To: buildroot

On Mon,  5 Oct 2020 07:58:08 +0200
Peter Korsgaard <peter@korsgaard.com> wrote:

> Fixes (reproducible):
> http://autobuild.buildroot.net/results/50f/50f199bfe06d054cc6770760e73ac0de594a0670/diffoscope-results.txt
> 
> Fail2ban installs the fail2ban-python symlink pointing to the host python
> intepreter used to run setup.py, which is naturally not valid at runtime and
> breaks the reproducible tests as shown in the diffoscope results:
> 
> ? -lrwxrwxrwx   0        0        0        0 2020-10-04 10:50:38.000000 ./usr/bin/fail2ban-python -> /home/naourr/work/instance-0/output-1/host/bin/python
> ? +lrwxrwxrwx   0        0        0        0 2020-10-04 10:50:38.000000 ./usr/bin/fail2ban-python -> /home/naourr/work/instance-0/output-2/host/bin/python
> 
> As a workaround, update the symlink after installation to point to the
> correct target python.
> 
> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
> ---
>  package/fail2ban/fail2ban.mk | 7 +++++++
>  1 file changed, 7 insertions(+)

It would have been nicer to have something supported by upstream
fail2ban. I guess like me you looked at the setup.py logic, and
realized that it was too convoluted to find a reasonably simple fix?

So applied to master. Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH] package/fail2ban: fix fail2ban-python symlink
  2020-10-08 20:13 ` Thomas Petazzoni
@ 2020-10-08 21:01   ` Peter Korsgaard
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Korsgaard @ 2020-10-08 21:01 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@bootlin.com> writes:

Hi,

 > It would have been nicer to have something supported by upstream
 > fail2ban. I guess like me you looked at the setup.py logic, and
 > realized that it was too convoluted to find a reasonably simple fix?

Indeed ;)

 > So applied to master. Thanks!

Thanks!

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH] package/fail2ban: fix fail2ban-python symlink
  2020-10-05  5:58 [Buildroot] [PATCH] package/fail2ban: fix fail2ban-python symlink Peter Korsgaard
  2020-10-08 20:13 ` Thomas Petazzoni
@ 2020-10-10 21:00 ` Peter Korsgaard
  1 sibling, 0 replies; 4+ messages in thread
From: Peter Korsgaard @ 2020-10-10 21:00 UTC (permalink / raw)
  To: buildroot

>>>>> "Peter" == Peter Korsgaard <peter@korsgaard.com> writes:

 > Fixes (reproducible):
 > http://autobuild.buildroot.net/results/50f/50f199bfe06d054cc6770760e73ac0de594a0670/diffoscope-results.txt

 > Fail2ban installs the fail2ban-python symlink pointing to the host python
 > intepreter used to run setup.py, which is naturally not valid at runtime and
 > breaks the reproducible tests as shown in the diffoscope results:

 > ? -lrwxrwxrwx   0        0        0        0 2020-10-04 10:50:38.000000 ./usr/bin/fail2ban-python -> /home/naourr/work/instance-0/output-1/host/bin/python
 > ? +lrwxrwxrwx   0        0        0        0 2020-10-04 10:50:38.000000 ./usr/bin/fail2ban-python -> /home/naourr/work/instance-0/output-2/host/bin/python

 > As a workaround, update the symlink after installation to point to the
 > correct target python.

 > Signed-off-by: Peter Korsgaard <peter@korsgaard.com>

Committed to 2020.02.x, 2020.05.x and 2020.08.x, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-10-10 21:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-05  5:58 [Buildroot] [PATCH] package/fail2ban: fix fail2ban-python symlink Peter Korsgaard
2020-10-08 20:13 ` Thomas Petazzoni
2020-10-08 21:01   ` Peter Korsgaard
2020-10-10 21:00 ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.