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

Add Phase 2 COSI Support #85

Merged
merged 1 commit into from
Jan 23, 2025
Merged

Add Phase 2 COSI Support #85

merged 1 commit into from
Jan 23, 2025

Conversation

elainezhao1
Copy link
Contributor

@elainezhao1 elainezhao1 commented Jan 14, 2025

PR summary:

This is a phase 2 COSI support, we should now be able to generate cosi file from a non-verity base image with a verity config, and the verity information will be included in the cosi metadata file, so it will align with expected sample format

local test:
tested with command sudo ./imagecustomizer --log-level debug --build-dir ./build --image-file core-3.0.20241220.vhdx --output-image-file ./output-image-test.cosi --output-image-format cosi --config-file ../pkg/imagecustomizerlib/testdata/verity-config.yaml
unpacked the .cosi file
image
and obtained output/metadata.json

{
  "version": "1.0",
  "osArch": "amd64",
  "images": [
    {
      "image": {
        "path": "images/output-image-test_1.raw.zst",
        "compressedSize": 988946,
        "uncompressedSize": 8388608,
        "sha384": "6c2a78a9bc84624d90fdf2b0be7e33dd4abd305f8ae2467a4868bdf3ed8114cbe72c8512e5836e0a806e932732f79585"
      },
      "mountPoint": "",
      "fsType": "vfat",
      "fsUuid": "1163-42B5",
      "partType": "c12a7328-f81f-11d2-ba4b-00a0c93ec93b",
      "verity": null
    },
    {
      "image": {
        "path": "images/output-image-test_2.raw.zst",
        "compressedSize": 51437979,
        "uncompressedSize": 1064304640,
        "sha384": "f6594fa455d3feffd002dddd32afc843856e09bb850c6a3a6ec84366a00c8dde92e28f68a464ca62e8160bb5ad6a50e2"
      },
      "mountPoint": "",
      "fsType": "ext4",
      "fsUuid": "14e039a8-61d2-4d43-85b2-f26c92326c03",
      "partType": "0fc63daf-8483-4772-8e79-3d69d8477de4",
      "verity": null
    },
    {
      "image": {
        "path": "images/output-image-test_3.raw.zst",
        "compressedSize": 115309290,
        "uncompressedSize": 2147483648,
        "sha384": "29d8663dbd8f320ad9bba8169173837213eb973842f52ec774af8840f130c596b118cef88c2a4c38bc8820cfba482637"
      },
      "mountPoint": "",
      "fsType": "ext4",
      "fsUuid": "393703a2-b8a9-4574-8fd0-d961674c3efa",
      "partType": "0fc63daf-8483-4772-8e79-3d69d8477de4",
      "verity": {
        "image": {
          "path": "images/output-image-test_4.raw.zst",
          "compressedSize": 2908417,
          "uncompressedSize": 134217728,
          "sha384": "d4c8dd1357868b9aab271af8f74c52f05c8e4378d53637644cec43fc7a20adbb0aa1f0b01d701555cfda0490205d11ab"
        },
        "hash": "d5ff43f8d03a738b1e25f4eeb1b1f71441fa456daf60a664f64a2e95316ec65f"
      }
    },
    {
      "image": {
        "path": "images/output-image-test_5.raw.zst",
        "compressedSize": 28775661,
        "uncompressedSize": 2012217344,
        "sha384": "9a69d82c2e1c0b6681191cbcc6847ba8db2b54f15671b0b9a00e1649ce753038a8f2cb2b6d7e1bc36bdcc9cc8d0dbbf1"
      },
      "mountPoint": "",
      "fsType": "ext4",
      "fsUuid": "8fee3677-b8ba-432b-8add-3f336d11575f",
      "partType": "0fc63daf-8483-4772-8e79-3d69d8477de4",
      "verity": null
    }
  ],
  "osRelease": "",
  "id": "85e18600-1160-1b53-bcea-d93a3f0d848b"

Note:
A verity base image currently is not supported, will wait customizations on verity images to be enabled. Also, will have a follow-up pr to fix the missing mountpoints.


Checklist

  • Tests added/updated
  • Documentation updated (if needed)
  • Code conforms to style guidelines

@elainezhao1 elainezhao1 marked this pull request as ready for review January 16, 2025 11:30
@elainezhao1 elainezhao1 requested a review from a team as a code owner January 16, 2025 11:30
@elainezhao1 elainezhao1 force-pushed the user/elaine/verity-cosi branch from bcdd5c4 to 19c9008 Compare January 23, 2025 22:55
@elainezhao1 elainezhao1 force-pushed the user/elaine/verity-cosi branch from 19c9008 to 73469b0 Compare January 23, 2025 23:39
@elainezhao1 elainezhao1 merged commit 1188074 into main Jan 23, 2025
7 checks passed
@elainezhao1 elainezhao1 deleted the user/elaine/verity-cosi branch January 23, 2025 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants