[lxc-devel] [distrobuilder/master] ubuntu-core: Only symlink existing seeded snaps

stgraber on Github lxc-bot at linuxcontainers.org
Tue Jul 9 04:37:05 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 363 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190708/5806df12/attachment.bin>
-------------- next part --------------
From 8dc6479a786409a1ecb594a00f15a4763dfa2e67 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Tue, 9 Jul 2019 00:33:54 -0400
Subject: [PATCH] ubuntu-core: Only symlink existing seeded snaps
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 data/ubuntu-core/init | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/data/ubuntu-core/init b/data/ubuntu-core/init
index bef8634..03ad341 100755
--- a/data/ubuntu-core/init
+++ b/data/ubuntu-core/init
@@ -40,8 +40,13 @@ else
 fi
 
 # Make sure the snap symlinks exist
-ln -fs ../seed/snaps/${SNAP_KERNEL} /writable/system-data/var/lib/snapd/snaps/${SNAP_KERNEL}
-ln -fs ../seed/snaps/${SNAP_CORE} /writable/system-data/var/lib/snapd/snaps/${SNAP_CORE}
+if [ -e "../seed/snaps/${SNAP_KERNEL}" ]; then
+    ln -fs ../seed/snaps/${SNAP_KERNEL} /writable/system-data/var/lib/snapd/snaps/${SNAP_KERNEL}
+fi
+
+if [ -e "../seed/snaps/${SNAP_CORE}" ]; then
+    ln -fs ../seed/snaps/${SNAP_CORE} /writable/system-data/var/lib/snapd/snaps/${SNAP_CORE}
+fi
 
 # Extract initramfs
 mkdir -p /mnt /initrd


More information about the lxc-devel mailing list