microsoft / azurelinux

Linux OS for Azure 1P services and edge appliances
MIT License
4.29k stars 543 forks source link

How to ensure using the same UUID and PARTUUID on each build? #10359

Open yockgen opened 1 month ago

yockgen commented 1 month ago

Ask your question or provide your feedback

My Mariner build is intended to have multiple partitions. How can I ensure that, on each build, those partitions use the same PARTUUID and UUID instead of being randomly assigned? I would to use the PARTUUID as identifier for some auotmation

  "Partitions": [
                {
                    "Name": "boot",
                    "ID": "boot",
                    "Flags": [
                        "boot"
                    ],
                    "Start": 1,
                    "End": 400,
                    "FsType": "fat32"
                },
                {
                    "Name": "rootfs",
                    "ID": "rootfs",
                    "Start": 400,
                    "End": 1000,
                    "FsType": "ext4"
                },
                {
                    "Name": "data",
                    "ID": "data",
                    "Start": 1000,
                    "End": 0,
                    "FsType": "ext4"
                }

Thanks!

dmcilvaney commented 1 month ago

I don't believe we support that in the standard build tools, but we have a tool that can customize images rather than build them from scratch, which can modify partitions (https://github.com/microsoft/azurelinux/blob/3.0/toolkit/tools/imagecustomizer/docs/configuration.md#resetpartitionsuuidstype-string) @cwize1