-
Notifications
You must be signed in to change notification settings - Fork 54
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
Add mount command #1837
Add mount command #1837
Conversation
Pushing this as a rough draft for now, still missing the following pieces:
|
73ea150
to
cff705a
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1837 +/- ##
==========================================
- Coverage 75.78% 71.34% -4.44%
==========================================
Files 63 65 +2
Lines 5789 6251 +462
==========================================
+ Hits 4387 4460 +73
- Misses 1092 1459 +367
- Partials 310 332 +22
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks so promising 😉
...atures/embedded/elemental-rootfs/usr/lib/dracut/modules.d/30elemental-rootfs/module-setup.sh
Show resolved
Hide resolved
cbecf85
to
e907c00
Compare
8fd30fc
to
648a0c9
Compare
a95411a
to
96d38b4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice! LGTM
66bd2a8
to
01616ce
Compare
@davidcassany I ended up bumping go to 1.21 as well since I needed it for the |
return err | ||
} | ||
|
||
for _, path := range overlay.Paths { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a small issue we encountered was bind paths not being ordered, so something like this mistake in the layout file:
/usr/share/pki/trust/anchors
/usr/share/pki/trust
would shadow the first bind with the second! Just a heads up as we encountered this :) Patch looks awesome 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Itxaka thanks for the heads up! I will add a commit to sort these in correct order! 👍
The mount command mounts the system and is meant to run in an initrd to actually mount the root filesystem and use systemd to switch-root into it. It also optionally writes an /etc/fstab file to the newly mounted system so that systemd will mount the system after switching root. The command is used in the new dracut module elemental-rootfs, which will coexist with immutable-rootfs (they are functionally the same) until immutable-rootfs can be deprecated. Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
Mounts a tmpfs to /run/elemental/overlay with size= flag set Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
Persistent mounts use the /run/elemental/persistent/.state directory to store upper and work dirs. Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
Write sentinel file (active_mode, passive_mode, recovery_mode) to /run/cos or /run/elemental based on which kernel cmdline is used (cos-img/filename or elemental.image) Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
This commit adds capabilities to the mount command to read configuration from the kernel cmdline. The supported parameters are: * elemental.disable + rd.cos.disable * elemental.image + cos-img/filename * elemental.oemlabel + rd.cos.oemlabel In the new elemental.image parameter we can specify active|passive|recovery instead of the path to the image. Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
Currently supported: * OVERLAY * RW_PATHS * PERSISTENT_STATE_PATHS * PERSISTENT_STATE_BIND Loaded from files (if they exist): * /run/elemental/layout.env * /run/cos/cos-layout.env Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
Since the rootfs stage should be run between mounting the image and mounting the rest of the system I added a call to RunStage that takes care of this and then uses godotenv dependency to actually load /run/elemental/layout.env and /run/cos/cos-layout.env. This means the old way of generating layout files will still work with the new mount-command. The caveat here is that in the current implementation the rootfs stage will run twice, once from the elemental-setup-rootfs service and once from this command. I would say the easiest way forward is to remove the elemental-setup-rootfs when switching to elemental-rootfs as the default mounting module. Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
The elemental-setup and rootfs features are heavily dependent on each other. This commit copies the elemental-setup feature into elemental-rootfs, and changes the mount-command to actually start the elemental-setup-rootfs service during mount to not run the yip rootfs stage twice. Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
Closing in favor of #1866 |
The mount command mounts the system and is meant to run in an initrd to actually mount the root filesystem and use systemd to switch-root into it.
It also optionally writes an /etc/fstab file to the newly mounted system so that systemd will mount the system after switching root.
The command is used in the new dracut module elemental-rootfs, which will coexist with immutable-rootfs (they are functionally the same) until immutable-rootfs can be deprecated.
Fixes #1781, #1830