From 8dd1c18c8beb2a5d597851213f031cd33047c1cc Mon Sep 17 00:00:00 2001 From: Abraham Gonzalez Date: Wed, 28 Aug 2024 17:21:13 -0700 Subject: [PATCH 1/2] Fix mounting for Ubuntu 22.x machines --- wlutil/wlutil.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wlutil/wlutil.py b/wlutil/wlutil.py index 7d30eda6..6c4da219 100644 --- a/wlutil/wlutil.py +++ b/wlutil/wlutil.py @@ -595,7 +595,8 @@ def mountImg(imgPath, mntPath): assert imgPath.is_file(), f"Unable to find {imgPath} to mount" ret = run(["mountpoint", mntPath], check=False).returncode - assert ret == 1, f"{mntPath} already mounted. Somethings wrong" + # mountpoint on Ubuntu 20.* returns 1 (on 22.* it returns 130) for an empty folder + assert ret == 1 or ret == 130, f"{mntPath} already mounted. Somethings wrong" uid = sp.run(['id', '-u'], capture_output=True, text=True).stdout.strip() gid = sp.run(['id', '-g'], capture_output=True, text=True).stdout.strip() From 8cea603201d246be30096ff4561ed2923a05149e Mon Sep 17 00:00:00 2001 From: Abraham Gonzalez Date: Wed, 28 Aug 2024 17:29:47 -0700 Subject: [PATCH 2/2] Change Ubuntu 22.* error code for mountpoint --- wlutil/wlutil.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wlutil/wlutil.py b/wlutil/wlutil.py index 6c4da219..b68631f0 100644 --- a/wlutil/wlutil.py +++ b/wlutil/wlutil.py @@ -595,8 +595,8 @@ def mountImg(imgPath, mntPath): assert imgPath.is_file(), f"Unable to find {imgPath} to mount" ret = run(["mountpoint", mntPath], check=False).returncode - # mountpoint on Ubuntu 20.* returns 1 (on 22.* it returns 130) for an empty folder - assert ret == 1 or ret == 130, f"{mntPath} already mounted. Somethings wrong" + # mountpoint on Ubuntu 20.* returns 1 (on 22.* it returns 32) for an empty folder + assert ret == 1 or ret == 32, f"{mntPath} already mounted. Somethings wrong" uid = sp.run(['id', '-u'], capture_output=True, text=True).stdout.strip() gid = sp.run(['id', '-g'], capture_output=True, text=True).stdout.strip()