Skip to content

Commit

Permalink
ensure that the new mount method takes precedence
Browse files Browse the repository at this point in the history
  • Loading branch information
bcumming committed Oct 16, 2023
1 parent 2ead76a commit 8168ef9
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions uenv-impl
Original file line number Diff line number Diff line change
Expand Up @@ -140,18 +140,8 @@ class environment:

self._uenvs = []

# test for the original mount method
if ("UENV_MOUNT_FILE" in os.environ) and ("UENV_MOUNT_POINT" in os.environ):
mnt = os.environ.get("UENV_MOUNT_POINT")

# TODO: check whether an image has been mounted at UENV_MOUNT_POINT?
# findmnt -n --mountpoint /user-environment
# should return something like:
# /user-environment /dev/loop12 squashfs ro,nosuid,nodev,relatime
self._uenvs = [uenv(pathlib.Path(mnt))]

# test for the multi-mount method
elif "UENV_MOUNT_LIST" in os.environ:
if "UENV_MOUNT_LIST" in os.environ:
# take care to strip white space and trailing commas
raw = os.environ.get("UENV_MOUNT_LIST").strip().strip(',')
mounts = raw.split(',')
Expand All @@ -161,6 +151,17 @@ class environment:
img, mnt = m.split(":")
self._uenvs.append(uenv(pathlib.Path(mnt)))

# test for the original mount method
elif ("UENV_MOUNT_FILE" in os.environ) and ("UENV_MOUNT_POINT" in os.environ):
mnt = os.environ.get("UENV_MOUNT_POINT")

# TODO: check whether an image has been mounted at UENV_MOUNT_POINT?
# findmnt -n --mountpoint /user-environment
# should return something like:
# /user-environment /dev/loop12 squashfs ro,nosuid,nodev,relatime
self._uenvs = [uenv(pathlib.Path(mnt))]


# TODO: these need to parse env variables for multi-mount points
def load_status(self):
modules = None
Expand Down

0 comments on commit 8168ef9

Please sign in to comment.