[lxc-devel] [lxd-pkg-ubuntu/dpm-focal] Proper handling for WSL upgrade

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


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

Signed-off-by: Jinming Wu, Patrick <me at patrickwu.space>
---
 debian/lxd.preinst | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/debian/lxd.preinst b/debian/lxd.preinst
index aede3e04..20aa071b 100644
--- a/debian/lxd.preinst
+++ b/debian/lxd.preinst
@@ -23,6 +23,12 @@ case "$1" in
         COUNT=0
         SKIP=false
         while :; do
+            if [ -f /proc/sys/fs/binfmt_misc/WSLInterop ]; then
+                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