Skip to content

Image Customizer: Implement fallback partition customization.#6747

Merged
cwize1 merged 5 commits intomicrosoft:mainfrom
cwize1:user/chrisgun/ImageCustomizerFallbackPartitions
Nov 29, 2023
Merged

Image Customizer: Implement fallback partition customization.#6747
cwize1 merged 5 commits intomicrosoft:mainfrom
cwize1:user/chrisgun/ImageCustomizerFallbackPartitions

Conversation

@cwize1
Copy link
Copy Markdown
Contributor

@cwize1 cwize1 commented Nov 13, 2023

Merge Checklist

All boxes should be checked before merging the PR (just tick any boxes which don't apply to this PR)

  • The toolchain has been rebuilt successfully (or no changes were made to it)
  • The toolchain/worker package manifests are up-to-date
  • Any updated packages successfully build (or no packages were changed)
  • Packages depending on static components modified in this PR (Golang, *-static subpackages, etc.) have had their Release tag incremented.
  • Package tests (%check section) have been verified with RUN_CHECK=y for existing SPEC files, or added to new SPEC files
  • All package sources are available
  • cgmanifest files are up-to-date and sorted (./cgmanifest.json, ./toolkit/scripts/toolchain/cgmanifest.json, .github/workflows/cgmanifest.json)
  • LICENSE-MAP files are up-to-date (./SPECS/LICENSES-AND-NOTICES/data/licenses.json, ./SPECS/LICENSES-AND-NOTICES/LICENSES-MAP.md, ./SPECS/LICENSES-AND-NOTICES/LICENSE-EXCEPTIONS.PHOTON)
  • All source files have up-to-date hashes in the *.signatures.json files
  • sudo make go-tidy-all and sudo make go-test-coverage pass
  • Documentation has been updated to match any changes to the build system
  • Ready to merge

Summary

This change implements the default/fallback logic for partition customization. This will be used when the partition layout changes are too complex for modifying the partitions directly.

The fallback logic creates the desired partition layout and then does a file copy from the base image to the new image. After that, some minor fix-ups are done (e.g. configuring the boot-loader).

The Image Customizer partition config schema mostly mirrors that of the new-image config. Some features were not included (e.g. dm-verity, encryption, overlays) to avoid making a large change even larger. In addition, a lot of additional config validity checks were added to try to limit it to only things that are known to work.

Change Log
  • Image Customizer: Implement fallback partition customization.
Does this affect the toolchain?

NO

Test Methodology
  • Added UTs.
  • Manually ran image customizer tool.

@cwize1 cwize1 requested a review from a team as a code owner November 13, 2023 22:06
@microsoft-github-policy-service microsoft-github-policy-service Bot added the main PR Destined for main label Nov 13, 2023
Comment thread toolkit/tools/imagecustomizerapi/config.go
Comment thread toolkit/tools/imagecustomizerapi/disk.go
Comment thread toolkit/tools/imagecustomizerapi/mountidentifier.go
Comment thread toolkit/tools/pkg/imagecustomizerlib/imageutils.go
Comment thread toolkit/tools/pkg/imagecustomizerlib/customizepartitionsfilecopy.go
Comment thread toolkit/tools/imagecustomizerapi/config.go
Comment thread toolkit/tools/imagecustomizerapi/disk_test.go
Comment thread toolkit/tools/pkg/imagecustomizerlib/imageConnection.go
Comment thread toolkit/tools/pkg/imagecustomizerlib/customizepartitionsfilecopy.go
@romoh
Copy link
Copy Markdown
Contributor

romoh commented Nov 27, 2023

😎👍 awesome job on test coverage & unit tests

Comment thread toolkit/tools/imagecustomizerapi/partition.go
This change implements the default/fallback logic for partition
customization. This will be used when the partition layout changes are
too complex for modifying the partitions directly.

The fallback logic creates the desired partition layout and then does a
file copy from the base image to the new image. After that, some minor
fix-ups are done (e.g. configuring the boot-loader).

The Image Customizer partition config schema mostly mirrors that of the
new-image config. Some features were not included (e.g. dm-verity,
encryption, overlays) to avoid making a large change even larger.
In addition, a lot of additional config validity checks were added to
try to limit it to only things that are known to work.
@cwize1 cwize1 force-pushed the user/chrisgun/ImageCustomizerFallbackPartitions branch from e332f62 to 6314b16 Compare November 28, 2023 22:45
@cwize1 cwize1 merged commit e48b93d into microsoft:main Nov 29, 2023
dmcilvaney pushed a commit to dmcilvaney/CBL-Mariner that referenced this pull request Dec 14, 2023
dmcilvaney pushed a commit to dmcilvaney/CBL-Mariner that referenced this pull request Dec 14, 2023
dmcilvaney pushed a commit to dmcilvaney/CBL-Mariner that referenced this pull request Dec 14, 2023
dmcilvaney pushed a commit to dmcilvaney/CBL-Mariner that referenced this pull request Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

main PR Destined for main

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants