Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib/vfscore: Introduce ukopts, a new vfs.fstab option and mkmp, a ukopts option #1145

Merged

Conversation

mogasergiu
Copy link
Member

@mogasergiu mogasergiu commented Oct 23, 2023

Prerequisite checklist

  • Read the contribution guidelines regarding submitting new changes to the project;
  • Tested your changes against relevant architectures and platforms;
  • Ran the checkpatch.uk on your commit series before opening this PR;
  • Updated relevant documentation.

Base target

  • Architecture(s): [N/A]
  • Platform(s): [N/A]
  • Application(s): [N/A]

Additional configuration

Description of changes

Allow the vfs.fstab option arguments to receive an additional
option that is Unikraft specific and that enables one to change
a volume's mount behavior depending on the passed option.

Thus, now the vfs.fstab syntax is as follows:

vfs.fstab=[                                                              
      "<src_dev>:<mntpoint>:<fsdriver>[:<flags>:<opts>:<ukopts>]"                                                                                           
       "<src_dev>:<mntpoint>:<fsdriver>[:<flags>:<opts>:<ukopts>]"                                                                                           
      ...                                                              
]                             

The ukopts options will have the same separator as fstab, that
being :.

Furthermore, in case someone may want to mount a filesystem to a directory
that does not currently exist in the rootfs, allow them to do so
without having to rebuild the rootfs by exposing a ukopts
option called mkpath. This option will let fstab know that
it must ensure that the mount path exists before attempting to
mount.

@mogasergiu mogasergiu requested a review from a team as a code owner October 23, 2023 13:52
mogasergiu added a commit to mogasergiu/unikraft that referenced this pull request Oct 23, 2023
Copy link
Member

@nderjung nderjung left a comment

Choose a reason for hiding this comment

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

Tested my side, this works. :) Thanks!

Reviewed-by: Alexander Jung alex@unikraft.io

@skuenzer skuenzer self-assigned this Oct 23, 2023
lib/vfscore/automount.c Outdated Show resolved Hide resolved
lib/vfscore/automount.c Outdated Show resolved Hide resolved
lib/vfscore/automount.c Outdated Show resolved Hide resolved
lib/vfscore/automount.c Outdated Show resolved Hide resolved
lib/vfscore/automount.c Outdated Show resolved Hide resolved
lib/vfscore/automount.c Outdated Show resolved Hide resolved
lib/vfscore/automount.c Outdated Show resolved Hide resolved
lib/vfscore/automount.c Outdated Show resolved Hide resolved
lib/vfscore/automount.c Outdated Show resolved Hide resolved
lib/vfscore/automount.c Outdated Show resolved Hide resolved
lib/vfscore/automount.c Show resolved Hide resolved
mogasergiu added a commit to mogasergiu/unikraft that referenced this pull request Oct 27, 2023
@mogasergiu mogasergiu force-pushed the smoga/fstab_ukopts_mkpath branch 4 times, most recently from a0a8f2d to 19c4e54 Compare October 27, 2023 11:53
@mogasergiu
Copy link
Member Author

Sorry, I know, lots of pushes, I messed up some rebasing 🙃

@mogasergiu mogasergiu force-pushed the smoga/fstab_ukopts_mkpath branch 2 times, most recently from 198bf42 to 8f42060 Compare October 27, 2023 12:24
@mogasergiu mogasergiu changed the title lib/vfscore: Introduce ukopts, a new vfs.fstab option and mkpath, a ukopts option lib/vfscore: Introduce ukopts, a new vfs.fstab option and mkmp, a ukopts option Oct 27, 2023
mogasergiu added a commit to mogasergiu/unikraft that referenced this pull request Oct 27, 2023
mogasergiu added a commit to mogasergiu/unikraft that referenced this pull request Oct 27, 2023
@mogasergiu mogasergiu force-pushed the smoga/fstab_ukopts_mkpath branch 2 times, most recently from ee07fe8 to 71f9074 Compare October 27, 2023 13:46
Copy link
Member

@skuenzer skuenzer left a comment

Choose a reason for hiding this comment

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

Hi @mogasergiu, thanks a lot for your work. I just noticed some little things with the update but overall looks very good already!

lib/vfscore/automount.c Outdated Show resolved Hide resolved
lib/vfscore/automount.c Outdated Show resolved Hide resolved
lib/vfscore/automount.c Outdated Show resolved Hide resolved
lib/vfscore/automount.c Show resolved Hide resolved
lib/vfscore/automount.c Show resolved Hide resolved
lib/vfscore/automount.c Outdated Show resolved Hide resolved
nderjung added a commit to nderjung/kraftkit that referenced this pull request Nov 1, 2023
The Unikraft Core supports, following the merge of [0], the ability to
specify Unikraft-specific options as part of the `vfstab` list of
options.  This commit accommodates for that basic change.

[0]: unikraft/unikraft#1145

Signed-off-by: Alexander Jung <alex@unikraft.io>
Allow the `vfs.fstab` option arguments to receive an additional
option that is Unikraft specific and that enables one to change
a volume's mount behavior depending on the passed option.

Thus, now the `vfs.fstab` syntax is as follows:
```
 	vfs.fstab=[
 		"<src_dev>:<mntpoint>:<fsdriver>[:<flags>:<opts>:<ukopts>]"
 		"<src_dev>:<mntpoint>:<fsdriver>[:<flags>:<opts>:<ukopts>]"
 		...
 	]
```

The `ukopts` options will have the same separator as `fstab`, that
being `:`.

Signed-off-by: Sergiu Moga <sergiu@unikraft.io>
In case someone may want to mount a filesystem to a directory
that does not currently exist in the rootfs, allow them to do so
without having to rebuild the rootfs by exposing a `ukopts`
option called `mkmp`. This option will let `fstab` know that
it must ensure that the mount path exists before attempting to
mount.

Signed-off-by: Sergiu Moga <sergiu@unikraft.io>
@razvand razvand added the lib/vfscore VFS Core Interface label Nov 28, 2023
@razvand razvand added this to the v0.16.0 (Telesto) milestone Nov 28, 2023
@razvand razvand added kind/enhancement New feature or request lang/c Issues or PRs to do with C/C++ labels Nov 28, 2023
Copy link
Member

@skuenzer skuenzer left a comment

Choose a reason for hiding this comment

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

Thanks a lot for your work and updates!

Reviewed-by: Simon Kuenzer simon@unikraft.io
Approved-by: Simon Kuenzer simon@unikraft.io

@skuenzer skuenzer changed the base branch from staging to staging-1145 December 9, 2023 00:01
@skuenzer skuenzer merged commit 2965775 into unikraft:staging-1145 Dec 9, 2023
8 of 9 checks passed
skuenzer pushed a commit to skuenzer/unikraft that referenced this pull request Dec 9, 2023
Allow the `vfs.fstab` option arguments to receive an additional
option that is Unikraft specific and that enables one to change
a volume's mount behavior depending on the passed option.

Thus, now the `vfs.fstab` syntax is as follows:
```
 	vfs.fstab=[
 		"<src_dev>:<mntpoint>:<fsdriver>[:<flags>:<opts>:<ukopts>]"
 		"<src_dev>:<mntpoint>:<fsdriver>[:<flags>:<opts>:<ukopts>]"
 		...
 	]
```

The `ukopts` options will have the same separator as `fstab`, that
being `:`.

Signed-off-by: Sergiu Moga <sergiu@unikraft.io>
Reviewed-by: Simon Kuenzer <simon@unikraft.io>
Approved-by: Simon Kuenzer <simon@unikraft.io>
GitHub-Closes: unikraft#1145
skuenzer pushed a commit to skuenzer/unikraft that referenced this pull request Dec 9, 2023
In case someone may want to mount a filesystem to a directory
that does not currently exist in the rootfs, allow them to do so
without having to rebuild the rootfs by exposing a `ukopts`
option called `mkmp`. This option will let `fstab` know that
it must ensure that the mount path exists before attempting to
mount.

Signed-off-by: Sergiu Moga <sergiu@unikraft.io>
Reviewed-by: Simon Kuenzer <simon@unikraft.io>
Approved-by: Simon Kuenzer <simon@unikraft.io>
GitHub-Closes: unikraft#1145
nderjung added a commit to nderjung/kraftkit that referenced this pull request Dec 9, 2023
Following the merge of [0], the name of the Unikraft-specific
VFSTAB cli option for creating a non-existing directory is called
`mkmp` and not `mkpath`.  The latter was the original name which
was changed during the review process of [0].

[0]: unikraft/unikraft#1145

Signed-off-by: Alexander Jung <alex@unikraft.io>
eduardvintila pushed a commit to eduardvintila/unikraft_riscv64 that referenced this pull request Dec 10, 2023
Allow the `vfs.fstab` option arguments to receive an additional
option that is Unikraft specific and that enables one to change
a volume's mount behavior depending on the passed option.

Thus, now the `vfs.fstab` syntax is as follows:
```
 	vfs.fstab=[
 		"<src_dev>:<mntpoint>:<fsdriver>[:<flags>:<opts>:<ukopts>]"
 		"<src_dev>:<mntpoint>:<fsdriver>[:<flags>:<opts>:<ukopts>]"
 		...
 	]
```

The `ukopts` options will have the same separator as `fstab`, that
being `:`.

Signed-off-by: Sergiu Moga <sergiu@unikraft.io>
Reviewed-by: Simon Kuenzer <simon@unikraft.io>
Approved-by: Simon Kuenzer <simon@unikraft.io>
GitHub-Closes: unikraft#1145
eduardvintila pushed a commit to eduardvintila/unikraft_riscv64 that referenced this pull request Dec 10, 2023
In case someone may want to mount a filesystem to a directory
that does not currently exist in the rootfs, allow them to do so
without having to rebuild the rootfs by exposing a `ukopts`
option called `mkmp`. This option will let `fstab` know that
it must ensure that the mount path exists before attempting to
mount.

Signed-off-by: Sergiu Moga <sergiu@unikraft.io>
Reviewed-by: Simon Kuenzer <simon@unikraft.io>
Approved-by: Simon Kuenzer <simon@unikraft.io>
GitHub-Closes: unikraft#1145
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request lang/c Issues or PRs to do with C/C++ lib/vfscore VFS Core Interface
Projects
Status: Done!
Development

Successfully merging this pull request may close these issues.

None yet

4 participants