part2: Allow installing into /config#119
Merged
crogers1 merged 2 commits intoOpenXT:masterfrom Sep 29, 2022
Merged
Conversation
Contributor
Author
|
This breaks on fresh install - config is left mounted by: installer/part2/stages/Functions/install-main Lines 243 to 248 in 29bf935 A subsequent mount_config call fails. "mount_config: config partition is already mapped, mounting" and "mount: /mnt/part2/dom0/config: /dev/mapper/config already mounted on /mnt/part2/dom0/config." |
crogers1
reviewed
Sep 14, 2022
|
|
||
| return 0 | ||
| if [ "$config_mounted" = "1" ] ; then | ||
| do_umount "$DOM0_MOUNT/config" |
Contributor
There was a problem hiding this comment.
${DOM0_MOUNT}
with the braces for consistency.
Currently, /config is not mounted under mount_dom0. This means files cannot be installed there while the installer runs. However, /config is an encrypted partition, so it is the convenient place to store files needing offline protection. The installer already has permission to mount /config. mount_config already exists to mount /config, but it's current use is limited to specific locations where access is needed. It's not clear if not mounting /config was a design decision, or if it was simply never needed before. Maybe it was done done to protect against stray writes. However there is no actual restriction on accessing /config. While mount_dom0 could be expanded to always mount /config, take a more conservative approach and just extended install_file() and commit_file() to only mount /config if and when needed by checking for a destination of "/config/". /config will always be available for mounting - however, there is and always has been, and implicit need for install_dom0()/upgrade_dom() to run before other steps. For install, install_dom0 created and luksOpen-ed /dev/mapper/config. For OTA, /config is already mounted in the host. For offline upgrade, the config recovery password is verified before proceeding. Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
A fresh install trying to place files in /config fails in
mount_config():
mount_config: config partition is already mapped, mounting
...
mount: /mnt/part2/dom0/config: /dev/mapper/config already mounted on /mnt/part2/dom0/config.
install_dom0 leaves /config already mounted on ${DOM0_MOUNT}/config, so
the second call fails.
Allow an already mounted ${DOM0_MOUNT}/config just return success so
installation continues.
Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
95349d3 to
2a60993
Compare
Contributor
Author
|
Fixup per @crogers1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
From the 8/18 call. Only tested on OTA. WIP since fresh and offline upgrade need testing.
Currently, /config is not mounted under mount_dom0. This means files
cannot be installed there while the installer runs. However, /config is
an encrypted partition, so it is the convenient place to store files
needing offline protection.
The installer already has permission to mount /config. mount_config
already exists to mount /config, but it's current use is limited to
specific locations where access is needed. It's not clear if not
mounting /config was a design decision, or if it was simply never needed
before. Maybe it was done done to protect against stray writes.
However there is no actual restriction on accessing /config.
While mount_dom0 could be expanded to always mount /config, take a more
conservative approach and just extended install_file() and commit_file()
to only mount /config if and when needed by checking for a destination
of "/config/".
/config will always be available for mounting - however, there is and
always has been, and implicit need for install_dom0()/upgrade_dom() to
run before other steps.
For install, install_dom0 created and luksOpen-ed /dev/mapper/config.
For OTA, /config is already mounted in the host.
For offline upgrade, the config recovery password is verified before
proceeding.
Signed-off-by: Jason Andryuk jandryuk@gmail.com