Ubuntu Pastebin

Paste from morphis at Wed, 5 Apr 2017 14:15:44 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
diff --git a/overlord/snapstate/snapstate.go b/overlord/snapstate/snapstate.go
index 306ef7c..e595b62 100644
--- a/overlord/snapstate/snapstate.go
+++ b/overlord/snapstate/snapstate.go
@@ -55,8 +55,12 @@ func needsMaybeCore(typ snap.Type) int {
 }
 
 func doInstall(st *state.State, snapst *SnapState, snapsup *SnapSetup, flags int) (*state.TaskSet, error) {
-       if snapsup.Flags.Classic && !release.OnClassic {
-               return nil, fmt.Errorf("classic confinement is only supported on classic systems")
+       if snapsup.Flags.Classic {
+               if !release.OnClassic {
+                       return nil, fmt.Errorf("classic confinement is only supported on classic systems")
+               } else if !release.ClassicSnapSupported {
+                       return nil, fmt.Errorf("classic confinement is not supported on your distribution")
+               }
        }
        if !snapst.HasCurrent() { // install?
                // check that the snap command namespace doesn't conflict with an enabled alias
diff --git a/release/release.go b/release/release.go
index d72953a..8feed0d 100644
--- a/release/release.go
+++ b/release/release.go
@@ -123,6 +123,7 @@ func readOSRelease() OS {
 // OnClassic states whether the process is running inside a
 // classic Ubuntu system or a native Ubuntu Core image.
 var OnClassic bool
+var ClassicSnapSupported bool = true
 
 // ReleaseInfo contains data loaded from /etc/os-release on startup.
 var ReleaseInfo OS
@@ -131,6 +132,11 @@ func init() {
        ReleaseInfo = readOSRelease()
 
        OnClassic = (ReleaseInfo.ID != "ubuntu-core")
+
+       switch release.ReleaseInfo.ID {
+       case "fedora", "rhel", "centos", "suse":
+               ClassicSnapSupported = false
+       }
 }
 
 // MockOnClassic forces the process to appear inside a classic
Download as text