Permalink
Please sign in to comment.
Browse files
packaging: update arch packaging for 2.27 snapshot
This patch updates arch packaging a little bit: - switch to 2.27 master snapshot (bugfixes) - drop build-dependency on bzr - add dependency on libseccomp - build and install snapctl, snap-update-ns, snap-seccomp - link snap-seccomp to libseccomp dynamically - apply some fixes from master as patches - generate version earlier so that snapd sees it - pass packaging version to mkversion.sh (no guessing) - skip static analysis checks (wrong moment to run) - merge snap-confine into the snapd package - don't show arch release as "unknown" - ship the bash tab completion files Signed-off-by: Zygmunt Krynicki <me@zygoon.pl>
- Loading branch information...
Showing
with
254 additions
and 29 deletions.
- +32 −0 packaging/arch/0001-cmd-fix-tests-that-assume-snap-mount.patch
- +45 −0 packaging/arch/0001-cmd-mark-arch-as-non-reexecing-distro.patch
- +36 −0 packaging/arch/0001-gitignore-ignore-more-build-artefacts.patch
- +43 −0 packaging/arch/0001-release-remove-default-from-VERSION_ID.patch
- +36 −0 packaging/arch/0001-snap-snapenv-always-expect-snap-for-SNAP.patch
- +62 −29 packaging/arch/PKGBUILD
| @@ -0,0 +1,32 @@ | ||
| +From 0c1d6a8fa9f50f09c33abe45ba0b579c08ebcd0d Mon Sep 17 00:00:00 2001 | ||
| +From: Zygmunt Krynicki <me@zygoon.pl> | ||
| +Date: Wed, 2 Aug 2017 17:40:40 +0200 | ||
| +Subject: [PATCH] cmd: fix tests that assume /snap mount | ||
| + | ||
| +This patch fixes tests on Arch where snaps are mounted on | ||
| +/var/lib/snapd/snap and tests are not mocking that aspect. The fix is | ||
| +universal and just switches to the variable directly. | ||
| + | ||
| +Signed-off-by: Zygmunt Krynicki <me@zygoon.pl> | ||
| +--- | ||
| + cmd/cmd_test.go | 4 ++-- | ||
| + 1 file changed, 2 insertions(+), 2 deletions(-) | ||
| + | ||
| +diff --git a/cmd/cmd_test.go b/cmd/cmd_test.go | ||
| +index e95969eba..d6768bbf8 100644 | ||
| +--- a/cmd/cmd_test.go | ||
| ++++ b/cmd/cmd_test.go | ||
| +@@ -57,8 +57,8 @@ func (s *cmdSuite) SetUpTest(c *C) { | ||
| + s.lastExecEnvv = nil | ||
| + s.fakeroot = c.MkDir() | ||
| + dirs.SetRootDir(s.fakeroot) | ||
| +- s.newCore = filepath.Join(s.fakeroot, "/snap/core/42") | ||
| +- s.oldCore = filepath.Join(s.fakeroot, "/snap/ubuntu-core/21") | ||
| ++ s.newCore = filepath.Join(dirs.SnapMountDir, "/core/42") | ||
| ++ s.oldCore = filepath.Join(dirs.SnapMountDir, "/ubuntu-core/21") | ||
| + c.Assert(os.MkdirAll(filepath.Join(s.fakeroot, "proc/self"), 0755), IsNil) | ||
| + } | ||
| + | ||
| +-- | ||
| +2.13.3 | ||
| + |
| @@ -0,0 +1,45 @@ | ||
| +From bf9bef189dc898c0f98f31aba4aa15736f1f29bf Mon Sep 17 00:00:00 2001 | ||
| +From: Zygmunt Krynicki <me@zygoon.pl> | ||
| +Date: Wed, 2 Aug 2017 17:43:47 +0200 | ||
| +Subject: [PATCH] cmd: mark arch as non-reexecing distro | ||
| + | ||
| +Arch doesn't re-execute because snap-confine has incompatible snap mount | ||
| +directory compiled in and we cannot use the binary from core. This can | ||
| +be fixed by building a communication channel from snapd to snap-confine | ||
| +but earlier attempts were stuck on design. | ||
| + | ||
| +Signed-off-by: Zygmunt Krynicki <me@zygoon.pl> | ||
| +--- | ||
| + cmd/cmd.go | 2 +- | ||
| + cmd/cmd_test.go | 2 +- | ||
| + 2 files changed, 2 insertions(+), 2 deletions(-) | ||
| + | ||
| +diff --git a/cmd/cmd.go b/cmd/cmd.go | ||
| +index bad50f6f0..ed7554d2a 100644 | ||
| +--- a/cmd/cmd.go | ||
| ++++ b/cmd/cmd.go | ||
| +@@ -67,7 +67,7 @@ func distroSupportsReExec() bool { | ||
| + return false | ||
| + } | ||
| + switch release.ReleaseInfo.ID { | ||
| +- case "fedora", "centos", "rhel", "opensuse", "suse", "poky": | ||
| ++ case "fedora", "centos", "rhel", "opensuse", "suse", "poky", "arch": | ||
| + logger.Debugf("re-exec not supported on distro %q yet", release.ReleaseInfo.ID) | ||
| + return false | ||
| + } | ||
| +diff --git a/cmd/cmd_test.go b/cmd/cmd_test.go | ||
| +index e95969eba..7e8d3277a 100644 | ||
| +--- a/cmd/cmd_test.go | ||
| ++++ b/cmd/cmd_test.go | ||
| +@@ -145,7 +145,7 @@ func (s *cmdSuite) TestNonClassicDistroNoSupportsReExec(c *C) { | ||
| + // no distro supports re-exec when not on classic :-) | ||
| + for _, id := range []string{ | ||
| + "fedora", "centos", "rhel", "opensuse", "suse", "poky", | ||
| +- "debian", "ubuntu", | ||
| ++ "debian", "ubuntu", "arch", | ||
| + } { | ||
| + restore = release.MockReleaseInfo(&release.OS{ID: id}) | ||
| + defer restore() | ||
| +-- | ||
| +2.13.3 | ||
| + |
| @@ -0,0 +1,36 @@ | ||
| +From 3d405ac9a83666281e726275fe7f2962c56b7cd9 Mon Sep 17 00:00:00 2001 | ||
| +From: Zygmunt Krynicki <me@zygoon.pl> | ||
| +Date: Wed, 2 Aug 2017 19:57:53 +0200 | ||
| +Subject: [PATCH] gitignore: ignore more build artefacts | ||
| + | ||
| +Those files are made during the build but are reported by run-checks as | ||
| +unknown junk. We can fix this by just marking them as ignored. | ||
| + | ||
| +Signed-off-by: Zygmunt Krynicki <me@zygoon.pl> | ||
| +--- | ||
| + .gitignore | 2 ++ | ||
| + 1 file changed, 2 insertions(+) | ||
| + | ||
| +diff --git a/.gitignore b/.gitignore | ||
| +index 0afd0c6cb..b9f8c3fdb 100644 | ||
| +--- a/.gitignore | ||
| ++++ b/.gitignore | ||
| +@@ -19,6 +19,7 @@ po/snappy.pot | ||
| + cmd/decode-mount-opts/decode-mount-opts | ||
| + cmd/libsnap-confine-private/unit-tests | ||
| + cmd/snap-confine/snap-confine | ||
| ++cmd/snap-confine/snap-confine-debug | ||
| + cmd/snap-confine/snap-confine.apparmor | ||
| + cmd/snap-confine/unit-tests | ||
| + cmd/snap-discard-ns/snap-discard-ns | ||
| +@@ -32,6 +33,7 @@ cmd/*/*.[1-9] | ||
| + | ||
| + # auto-generated systemd units | ||
| + data/systemd/*.service | ||
| ++data/info | ||
| + | ||
| + # test-driver | ||
| + *.log | ||
| +-- | ||
| +2.13.3 | ||
| + |
| @@ -0,0 +1,43 @@ | ||
| +From 81bd7656d3c2fbdc082931511f0b202e426dbe27 Mon Sep 17 00:00:00 2001 | ||
| +From: Zygmunt Krynicki <me@zygoon.pl> | ||
| +Date: Wed, 2 Aug 2017 20:30:27 +0200 | ||
| +Subject: [PATCH] release: remove default from VERSION_ID | ||
| + | ||
| +According to os-release(5) there is no default value for this field so | ||
| +we should not provide one. This also removes the unexpected "unknown" | ||
| +element from "snap version" on rolling releases, such as Arch. | ||
| + | ||
| +Signed-off-by: Zygmunt Krynicki <me@zygoon.pl> | ||
| +--- | ||
| + release/release.go | 1 - | ||
| + release/release_test.go | 2 +- | ||
| + 2 files changed, 1 insertion(+), 2 deletions(-) | ||
| + | ||
| +diff --git a/release/release.go b/release/release.go | ||
| +index d72953a0b..a9172469c 100644 | ||
| +--- a/release/release.go | ||
| ++++ b/release/release.go | ||
| +@@ -76,7 +76,6 @@ var ( | ||
| + func readOSRelease() OS { | ||
| + // TODO: separate this out into its own thing maybe (if made more general) | ||
| + osRelease := OS{ | ||
| +- VersionID: "unknown", | ||
| + // from os-release(5): If not set, defaults to "ID=linux". | ||
| + ID: "linux", | ||
| + } | ||
| +diff --git a/release/release_test.go b/release/release_test.go | ||
| +index d1ed64af7..701272410 100644 | ||
| +--- a/release/release_test.go | ||
| ++++ b/release/release_test.go | ||
| +@@ -98,7 +98,7 @@ func (s *ReleaseTestSuite) TestReadOSReleaseNotFound(c *C) { | ||
| + defer reset() | ||
| + | ||
| + os := release.ReadOSRelease() | ||
| +- c.Assert(os, DeepEquals, release.OS{ID: "linux", VersionID: "unknown"}) | ||
| ++ c.Assert(os, DeepEquals, release.OS{ID: "linux"}) | ||
| + } | ||
| + | ||
| + func (s *ReleaseTestSuite) TestOnClassic(c *C) { | ||
| +-- | ||
| +2.13.3 | ||
| + |
| @@ -0,0 +1,36 @@ | ||
| +From 60d61a74c58d3ae4b67eae5089771ab1fbe7e6fb Mon Sep 17 00:00:00 2001 | ||
| +From: Zygmunt Krynicki <me@zygoon.pl> | ||
| +Date: Wed, 2 Aug 2017 19:43:06 +0200 | ||
| +Subject: [PATCH] snap/snapenv: always expect /snap for $SNAP | ||
| + | ||
| +On the "inside" of the snap execution environment we can always(1) rely on | ||
| +the /snap directory to be present. On distributions where the /snap | ||
| +directory on the host is redirected to /var/lib/snapd/snap this fact | ||
| +should not leak into the runtime environment. | ||
| + | ||
| +This was already done correctly but one of the tests was stale. | ||
| + | ||
| +(1): Snaps with classic confinement don't work there anyway so that's a | ||
| +non-issue. | ||
| + | ||
| +Signed-off-by: Zygmunt Krynicki <me@zygoon.pl> | ||
| +--- | ||
| + snap/snapenv/snapenv_test.go | 2 +- | ||
| + 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| + | ||
| +diff --git a/snap/snapenv/snapenv_test.go b/snap/snapenv/snapenv_test.go | ||
| +index 5b1053c43..fb594897a 100644 | ||
| +--- a/snap/snapenv/snapenv_test.go | ||
| ++++ b/snap/snapenv/snapenv_test.go | ||
| +@@ -121,7 +121,7 @@ func (s *HTestSuite) TestSnapRunSnapExecEnv(c *C) { | ||
| + env := snapEnv(info) | ||
| + c.Check(env, DeepEquals, map[string]string{ | ||
| + "HOME": fmt.Sprintf("%s/snap/snapname/42", usr.HomeDir), | ||
| +- "SNAP": fmt.Sprintf("%s/snapname/42", dirs.SnapMountDir), | ||
| ++ "SNAP": fmt.Sprintf("%s/snapname/42", dirs.CoreSnapMountDir), | ||
| + "SNAP_ARCH": arch.UbuntuArchitecture(), | ||
| + "SNAP_COMMON": "/var/snap/snapname/common", | ||
| + "SNAP_DATA": "/var/snap/snapname/42", | ||
| +-- | ||
| +2.13.3 | ||
| + |
0 comments on commit
4bf43f3