-
Notifications
You must be signed in to change notification settings - Fork 698
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ufw: bump version to 0.36 and add services
This commit brings the version of ufw up to 0.36 since version 0.33 had some problems: * The setup.py calls sed to replace some variables in the source code with the correct paths. However, this is done using a hardcoded path and conflicts with distutils * The python shebang was not properly corrected in setup.py, leading to a script that only run if there is a python symlink to python2 or python3 The first issue is addressed by the bump in version, while the second one is fixed in patch 0003 of the recipe. Also, the new version provides examples for systemd service and sysvinit scripts to autostart ufw. These are added into the recipe now. Signed-off-by: Silcet <camorga1@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
- Loading branch information
Showing
10 changed files
with
140 additions
and
389 deletions.
There are no files selected for viewing
37 changes: 25 additions & 12 deletions
37
meta-networking/recipes-connectivity/ufw/ufw/0001-optimize-boot.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,38 @@ | ||
Author: Jamie Strandboge <jamie@canonical.com> | ||
Description: to improve boot speed when disabled, don't source all of | ||
ufw-init-functions (which also sources in other files). | ||
From 92fcdbc1a57086e4decc1597217c0739dc16342a Mon Sep 17 00:00:00 2001 | ||
From: Silcet <camorga1@gmail.com> | ||
Date: Tue, 27 Apr 2021 05:34:59 +0000 | ||
Subject: [PATCH] Author: Jamie Strandboge <jamie@canonical.com> | ||
Description: | ||
to improve boot speed when disabled, don't source all of ufw-init-functions | ||
(which also sources in other files). | ||
|
||
Upstream-Status: Inappropriate [ not author ] | ||
|
||
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com> | ||
|
||
Index: ufw-0.31/src/ufw-init | ||
=================================================================== | ||
--- ufw-0.31.orig/src/ufw-init 2012-03-09 17:07:11.000000000 -0600 | ||
+++ ufw-0.31/src/ufw-init 2012-03-17 09:37:51.000000000 -0500 | ||
@@ -18,6 +18,12 @@ | ||
# | ||
set -e | ||
The patch was imported from the OpenEmbedded git server | ||
(git://git.openembedded.org/openembedded) as of commit id | ||
2cc1bd9dd060f5002c2fde7aacba86fe230c12af. | ||
|
||
Signed-off-by: Silcet <camorga1@gmail.com> | ||
--- | ||
src/ufw-init | 6 ++++++ | ||
1 file changed, 6 insertions(+) | ||
|
||
diff --git a/src/ufw-init b/src/ufw-init | ||
index 3505a02..dde37f0 100755 | ||
--- a/src/ufw-init | ||
+++ b/src/ufw-init | ||
@@ -31,6 +31,12 @@ if [ "$1" = "--datadir" ] && [ -s "$2" ]; then | ||
fi | ||
export DATA_DIR="$datadir" | ||
|
||
+# Debian/Ubuntu: small boot speed improvement | ||
+. "#CONFIG_PREFIX#/ufw/ufw.conf" | ||
+if [ "$1" = "start" ] && [ "$2" = "quiet" ] && [ "$ENABLED" = "no" ]; then | ||
+ exit 0 | ||
+fi | ||
+ | ||
if [ -s "#STATE_PREFIX#/ufw-init-functions" ]; then | ||
. "#STATE_PREFIX#/ufw-init-functions" | ||
if [ -s "${rootdir}#STATE_PREFIX#/ufw-init-functions" ]; then | ||
. "${rootdir}#STATE_PREFIX#/ufw-init-functions" | ||
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
118 changes: 0 additions & 118 deletions
118
meta-networking/recipes-connectivity/ufw/ufw/0002-lp1044361.patch
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
meta-networking/recipes-connectivity/ufw/ufw/0003-fix-typeerror-on-error.patch
This file was deleted.
Oops, something went wrong.
73 changes: 73 additions & 0 deletions
73
meta-networking/recipes-connectivity/ufw/ufw/0003-only-make-one-reference-to-env.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
From 42170d379eddc12bd2d1fe84dc268882d8eb4d64 Mon Sep 17 00:00:00 2001 | ||
From: Silcet <camorga1@gmail.com> | ||
Date: Mon, 3 May 2021 08:59:28 +0000 | ||
Subject: [PATCH] setup: only make one reference to env | ||
|
||
If sys.executable happens to be '/usr/bin/env python' or something | ||
similar, the setup script will result in 'ufw' getting /usr/bin/env | ||
repeated on the top line. This causes an error at runtime. Perform a | ||
quick sanity check on sys.executable before doing the substitution. | ||
|
||
While we're at it, change the default value of 'exe' to the one we either | ||
detected or specified on the build line. | ||
|
||
Upstream-Status: Inappropriate [ embedded specific ] | ||
|
||
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com> | ||
|
||
The patch was imported from the OpenEmbedded git server | ||
(git://git.openembedded.org/openembedded) as of commit id | ||
2cc1bd9dd060f5002c2fde7aacba86fe230c12af. | ||
|
||
A previous change had modified the way the python shebang was updated to | ||
follow the same version as the one used to call setup.py. However, it | ||
used a regex that was not matching anymore. To fix this, the regex | ||
condition is removed so the shebang line is substituted with the sys.executable | ||
value. Later in the installation distutils finds the string with the path | ||
of sys.executable and replaces it with "#! /usr/bin/env python3". | ||
|
||
Signed-off-by: Silcet <camorga1@gmail.com> | ||
--- | ||
setup.py | 12 ++++++++++-- | ||
1 file changed, 10 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/setup.py b/setup.py | ||
index 2343bc9..f8a638b 100644 | ||
--- a/setup.py | ||
+++ b/setup.py | ||
@@ -64,7 +64,7 @@ class Install(_install, object): | ||
real_sharedir = os.path.join(real_prefix, 'share', 'ufw') | ||
|
||
# Update the modules' paths | ||
- for fn in [ 'common.py' ]: | ||
+ for fn in [ 'common.py', 'util.py' ]: | ||
# 'staging' is used with just 'install' but build_lib is used when | ||
# using 'build'. We could probably override 'def build()' but this | ||
# at least works | ||
@@ -97,6 +97,12 @@ class Install(_install, object): | ||
"-i", | ||
"s%#SHARE_DIR#%" + real_sharedir + "%g", | ||
f]) | ||
+ | ||
+ subprocess.call(["sed", | ||
+ "-i.jjm", | ||
+ "s%/sbin/iptables%" + iptables_exe + "%g", | ||
+ f]) | ||
+ | ||
|
||
if fn == 'common.py' and 'UFW_SKIP_CHECKS' in os.environ and \ | ||
os.environ['UFW_SKIP_CHECKS'] != '': | ||
@@ -123,10 +129,12 @@ class Install(_install, object): | ||
self.mkpath(os.path.dirname(f)) | ||
|
||
# update the interpreter to that of the one the user specified for setup | ||
+ # Distutils searches for the string of sys.executable and replaces it | ||
+ # with the "#! /usr/bin/env pythonX" shebang on a later step | ||
print("Updating staging/ufw to use %s" % (sys.executable)) | ||
subprocess.call(["sed", | ||
"-i", | ||
- "1s%^#.*python.*%#! /usr/bin/env " + sys.executable + "%g", | ||
+ "1s%/.*python.*%" + sys.executable + "%g", | ||
'staging/ufw']) | ||
self.copy_file('staging/ufw', script) | ||
self.copy_file('doc/ufw.8', manpage) |
40 changes: 0 additions & 40 deletions
40
meta-networking/recipes-connectivity/ufw/ufw/0004-lp1039729.patch
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.