chore: Consolidate mount-generator for HostOS and GuestOS#9324
Open
shilingwang wants to merge 1 commit intomasterfrom
Open
chore: Consolidate mount-generator for HostOS and GuestOS#9324shilingwang wants to merge 1 commit intomasterfrom
shilingwang wants to merge 1 commit intomasterfrom
Conversation
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.
#NODE-1412
Consolidate mount-generator for HostOS and GuestOS
The mount-generator systemd generator script was maintained as two nearly identical copies:
upgrade/systemd-generators/hostos/mount-generatorupgrade/systemd-generators/guestos/mount-generatorBoth shared the same structure, boilerplate, and /boot mount logic. Only two things differed:
Boot device: HostOS uses LVM volumes (/dev/hostlvm/A_boot), GuestOS uses partition UUIDs (/dev/disk/by-partuuid/...)
/var setup: HostOS uses a plain ext4 LVM-backed mount (var-setup.service + var.mount), GuestOS uses LUKS encryption (systemd-cryptsetup@var_crypt.service)
Changes
upgrade/systemd-generators/mount-generatorHow the identity is passed
component_files in
hostos.bzl/guestos.bzlalready maps source files to destination paths inside the image. The twoos-type-*files are both installed to/etc/ic/os-typein their respective images, but with different content (hostos or guestos). This is the same pattern already used elsewhere (e.g. setup-ssh-user-keys-hostos.sh / setup-ssh-user-keys-guestos.sh → same destination path).