[lxc-devel] [lxd-pkg-ubuntu/dpm-focal] properly handling cases for WSL

patrick330602 on Github lxc-bot at linuxcontainers.org
Fri Apr 17 01:29:38 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 677 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200416/99bf71e3/attachment.bin>
-------------- next part --------------
From 71e53b76d32d70c0f1a39369d9d7b48fd6dfb4d7 Mon Sep 17 00:00:00 2001
From: "Jinming Wu, Patrick" <me at patrickwu.space>
Date: Fri, 17 Apr 2020 09:12:40 +0800
Subject: [PATCH] properly handling cases for WSL

---
 debian/lxd.preinst | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/debian/lxd.preinst b/debian/lxd.preinst
index aede3e04..5eda2fc8 100644
--- a/debian/lxd.preinst
+++ b/debian/lxd.preinst
@@ -23,6 +23,16 @@ case "$1" in
         COUNT=0
         SKIP=false
         while :; do
+            if [ -f /proc/sys/fs/binfmt_misc/WSLInterop ]; then
+                # The reason for doing this is that WSL do not support snap, and:
+                # 1. to reduce the confusion for WSL users who tries to update; and
+                # 2. to prevent the issue of broken dependencies during nthe upgrade 
+                #    from Ubuntu 16.04 LTS to Ubuntu 20.04 LTS on WSL
+                echo "===> WSL detected; Skipping migration"
+                SKIP=true
+                break
+            fi
+
             snap info lxd >/dev/null 2>&1 && break
 
             db_fset lxd/snap-no-connectivity seen false


More information about the lxc-devel mailing list