Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions tools/lkl/lklfuse.c
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,15 @@ static int start_lkl(void)
ret = lkl_mount_dev(lklfuse.disk_id, lklfuse.part, lklfuse.type,
mount_flags, remaining_mopts,
mpoint, sizeof(mpoint));
if (ret == -LKL_EACCES && !(mount_flags & LKL_MS_RDONLY)) {
Copy link
Member

@tavip tavip Feb 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we also want to drop to readonly if we don't have write access to lklfuse.file bellow?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question, I don't know :). For mount read-only fallback we have precedence in the existing util-linux behaviour, but open(lklfuse.file, O_RDONLY) fallback could certainly be considered related.

ret = lkl_mount_dev(lklfuse.disk_id, lklfuse.part, lklfuse.type,
mount_flags | LKL_MS_RDONLY,
remaining_mopts, mpoint, sizeof(mpoint));
if (!ret)
fprintf(stderr,
"device write-protected, mounted read-only\n");
}

if (ret) {
fprintf(stderr, "can't mount disk: %s\n", lkl_strerror(ret));
goto out_halt;
Expand Down
2 changes: 1 addition & 1 deletion tools/lkl/systemd/61-lklfuse.rules
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ACTION=="remove", TAG+="lklfuse-dbg-got-remove", \

# only support a subset of filesystems on USB devices for now. Btrfs omitted
# from the default set, as lklfuse lacks multi-device support.
ENV{ID_FS_TYPE}!="vfat|exfat|xfs|ext4|ext3|ext2", GOTO="lklfuse_end"
ENV{ID_FS_TYPE}!="vfat|exfat|iso9660|udf|xfs|ext4|ext3|ext2", GOTO="lklfuse_end"
#TAG+="lklfuse-dbg-fs-filter"

ACTION=="add", TAG+="systemd", \
Expand Down
Loading