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>

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 "${rootdir}#STATE_PREFIX#/ufw-init-functions" ]; then
     . "${rootdir}#STATE_PREFIX#/ufw-init-functions"
 else
