From ea4f3b45c0a1380b362af42634a62fd179b324be Mon Sep 17 00:00:00 2001
From: Dimitri Papadopoulos
 <3234522+DimitriPapadopoulos@users.noreply.github.com>
Date: Sun, 3 May 2020 22:51:07 +0200
Subject: [PATCH] Attempt to fix name resolution (#4)

Back to option 2: Embark resolvconf from openresolv. Does not work.
/sbin/resolvconf fails at execution with:
mkdir: cannot create directory '/run/resolvconf': Permission denied
Failed to create needed directory /run/resolvconf
---
 snap/snapcraft.yaml | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml
index d5332f3..5e5fa5a 100644
--- a/snap/snapcraft.yaml
+++ b/snap/snapcraft.yaml
@@ -7,7 +7,7 @@ description: |
     the gateway and this process.
 license: GPL-3.0
 adopt-info: openfortivpn
-base: core
+base: core18
 confinement: strict
 grade: stable
 
@@ -17,6 +17,10 @@ architectures:
     - build-on: amd64
 
 layout:
+    /usr/sbin/pppd:
+        bind-file: $SNAP/usr/sbin/pppd
+    /sbin/resolvconf:
+        bind-file: $SNAP/sbin/resolvconf
     /etc/openfortivpn:
         bind: $SNAP_COMMON
 
@@ -41,9 +45,20 @@ parts:
             - pkg-config
             - libssl-dev
             - libsystemd-dev
+        stage-packages:
+            - ppp
+            - resolvconf
         stage:
             - bin/openfortivpn
+            - etc/network/*
+            - etc/ppp/*
+            - etc/resolvconf/*
+            - lib/resolvconf/list-records
+            - sbin/resolvconf
             - share/*
+            - usr/sbin/pppd
+            - usr/lib
+            - usr/share/ppp
         # Infer version from Git tags:
         # * Remove the leading "v" from openfortivpn Git tags.
         # * We propose specific Git tags for openfortivpn snaps, if needed.
-- 
GitLab