Skip to content

Commit

Permalink
Provide error with guestmount's disk-mount directory is NFS
Browse files Browse the repository at this point in the history
guestmount does not support this
  • Loading branch information
jerryz123 committed Jul 14, 2024
1 parent f98c80b commit 4e75b13
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions wlutil/wlutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,10 @@ def mountImg(imgPath, mntPath):
finally:
run_with_retries(sudoCmd + [fsimUnmountCmd, mntPath])
else:
# guestmount does not support NFS filesystems
fstype = sp.run(["df", mntPath, "--output=fstype"], capture_output=True, text=True).stdout.strip().splitlines()[-1]
assert "nfs" not in fstype, f"Guestmount does not support {fstype} filesystems, change mount-dir to a non-NFS filesystem"

pidPath = './guestmount.pid'
run(['guestmount', '--pid-file', pidPath, '-o', f'uid={uid}', '-o', f'gid={gid}', '-a', imgPath, '-m', '/dev/sda', mntPath])
try:
Expand Down

0 comments on commit 4e75b13

Please sign in to comment.