distro/rhel84: use a random uuid for XFS partition

Imagine this situation: You have a RHEL system booted from an image produced
by osbuild-composer. On this system, you want to use osbuild-composer to
create another image of RHEL.

However, there's currently something funny with partitions:

All RHEL images built by osbuild-composer contain a root xfs partition. The
interesting bit is that they all share the same xfs partition UUID. This might
sound like a good thing for reproducibility but it has a quirk.

The issue appears when osbuild runs the qemu assembler: it needs to mount all
partitions of the future image to copy the OS tree into it.

Imagine that osbuild-composer is running on a system booted from an imaged
produced by osbuild-composer. This means that its root xfs partition has this
uuid:

efe8afea-c0a8-45dc-8e6e-499279f6fa5d

When osbuild-composer builds an image on this system, it runs osbuild that
runs the qemu assembler at some point. As I said previously, it will mount
all partitions of the future image. That means that it will also try to
mount the root xfs partition with this uuid:

efe8afea-c0a8-45dc-8e6e-499279f6fa5d

Do you remember this one? Yeah, it's the same one as before. However, the xfs
kernel driver doesn't like that. It contains a global table[1] of all xfs
partitions that forbids to mount 2 xfs partitions with the same uuid.

I mean... uuids are meant to be unique, right?

This commit changes the way we build RHEL 8.4 images: Each one now has a
unique uuid. It's now literally a unique universally unique identifier. haha

[1]: a349e4c659/fs/xfs/xfs_mount.c (L51)
This commit is contained in:
Ondřej Budai 2020-12-14 22:52:12 +01:00 committed by Ondřej Budai
parent ae0d1b8663
commit 973639d372
23 changed files with 150 additions and 114 deletions

View file

@ -3065,7 +3065,7 @@
"options": {
"filesystems": [
{
"uuid": "efe8afea-c0a8-45dc-8e6e-499279f6fa5d",
"uuid": "0194fdc2-fa2f-4cc0-81d3-ff12045b73c8",
"vfs_type": "xfs",
"path": "/",
"options": "defaults"
@ -3083,7 +3083,7 @@
{
"name": "org.osbuild.grub2",
"options": {
"root_fs_uuid": "efe8afea-c0a8-45dc-8e6e-499279f6fa5d",
"root_fs_uuid": "0194fdc2-fa2f-4cc0-81d3-ff12045b73c8",
"kernel_opts": "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 crashkernel=auto",
"legacy": "i386-pc",
"uefi": {
@ -3140,7 +3140,7 @@
"uuid": "6264D520-3FB9-423F-8AB8-7A0A8E3D3562",
"filesystem": {
"type": "xfs",
"uuid": "efe8afea-c0a8-45dc-8e6e-499279f6fa5d",
"uuid": "0194fdc2-fa2f-4cc0-81d3-ff12045b73c8",
"label": "root",
"mountpoint": "/"
}
@ -8589,7 +8589,7 @@
},
"image-info": {
"boot-environment": {
"kernelopts": "root=UUID=efe8afea-c0a8-45dc-8e6e-499279f6fa5d console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 crashkernel=auto"
"kernelopts": "root=UUID=0194fdc2-fa2f-4cc0-81d3-ff12045b73c8 console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 crashkernel=auto"
},
"bootloader": "grub",
"bootmenu": [
@ -8606,6 +8606,14 @@
}
],
"fstab": [
[
"UUID=0194fdc2-fa2f-4cc0-81d3-ff12045b73c8",
"/",
"xfs",
"defaults",
"0",
"0"
],
[
"UUID=7B77-95E7",
"/boot/efi",
@ -8613,14 +8621,6 @@
"defaults,uid=0,gid=0,umask=077,shortname=winnt",
"0",
"2"
],
[
"UUID=efe8afea-c0a8-45dc-8e6e-499279f6fa5d",
"/",
"xfs",
"defaults",
"0",
"0"
]
],
"groups": [
@ -9106,7 +9106,7 @@
"size": 6335479296,
"start": 106954752,
"type": "0FC63DAF-8483-4772-8E79-3D69D8477DE4",
"uuid": "efe8afea-c0a8-45dc-8e6e-499279f6fa5d"
"uuid": "0194fdc2-fa2f-4cc0-81d3-ff12045b73c8"
}
],
"passwd": [
@ -9218,4 +9218,4 @@
],
"timezone": "UTC"
}
}
}

View file

@ -3304,7 +3304,7 @@
"options": {
"filesystems": [
{
"uuid": "efe8afea-c0a8-45dc-8e6e-499279f6fa5d",
"uuid": "0194fdc2-fa2f-4cc0-81d3-ff12045b73c8",
"vfs_type": "xfs",
"path": "/",
"options": "defaults"
@ -3322,7 +3322,7 @@
{
"name": "org.osbuild.grub2",
"options": {
"root_fs_uuid": "efe8afea-c0a8-45dc-8e6e-499279f6fa5d",
"root_fs_uuid": "0194fdc2-fa2f-4cc0-81d3-ff12045b73c8",
"kernel_opts": "ro net.ifnames=0",
"legacy": "i386-pc",
"uefi": {
@ -3389,7 +3389,7 @@
"uuid": "6264D520-3FB9-423F-8AB8-7A0A8E3D3562",
"filesystem": {
"type": "xfs",
"uuid": "efe8afea-c0a8-45dc-8e6e-499279f6fa5d",
"uuid": "0194fdc2-fa2f-4cc0-81d3-ff12045b73c8",
"label": "root",
"mountpoint": "/"
}
@ -9171,7 +9171,7 @@
},
"image-info": {
"boot-environment": {
"kernelopts": "root=UUID=efe8afea-c0a8-45dc-8e6e-499279f6fa5d ro net.ifnames=0"
"kernelopts": "root=UUID=0194fdc2-fa2f-4cc0-81d3-ff12045b73c8 ro net.ifnames=0"
},
"bootloader": "grub",
"bootmenu": [
@ -9193,6 +9193,14 @@
"cockpit"
],
"fstab": [
[
"UUID=0194fdc2-fa2f-4cc0-81d3-ff12045b73c8",
"/",
"xfs",
"defaults",
"0",
"0"
],
[
"UUID=7B77-95E7",
"/boot/efi",
@ -9200,14 +9208,6 @@
"defaults,uid=0,gid=0,umask=077,shortname=winnt",
"0",
"2"
],
[
"UUID=efe8afea-c0a8-45dc-8e6e-499279f6fa5d",
"/",
"xfs",
"defaults",
"0",
"0"
]
],
"groups": [
@ -9730,7 +9730,7 @@
"size": 4187995648,
"start": 106954752,
"type": "0FC63DAF-8483-4772-8E79-3D69D8477DE4",
"uuid": "efe8afea-c0a8-45dc-8e6e-499279f6fa5d"
"uuid": "0194fdc2-fa2f-4cc0-81d3-ff12045b73c8"
}
],
"passwd": [
@ -9846,4 +9846,4 @@
],
"timezone": "UTC"
}
}
}

View file

@ -3433,7 +3433,7 @@
"options": {
"filesystems": [
{
"uuid": "efe8afea-c0a8-45dc-8e6e-499279f6fa5d",
"uuid": "0194fdc2-fa2f-4cc0-81d3-ff12045b73c8",
"vfs_type": "xfs",
"path": "/",
"options": "defaults"
@ -3451,7 +3451,7 @@
{
"name": "org.osbuild.grub2",
"options": {
"root_fs_uuid": "efe8afea-c0a8-45dc-8e6e-499279f6fa5d",
"root_fs_uuid": "0194fdc2-fa2f-4cc0-81d3-ff12045b73c8",
"kernel_opts": "console=tty0 console=ttyS0,115200n8 no_timer_check net.ifnames=0 crashkernel=auto",
"legacy": "i386-pc",
"uefi": {
@ -3518,7 +3518,7 @@
"uuid": "6264D520-3FB9-423F-8AB8-7A0A8E3D3562",
"filesystem": {
"type": "xfs",
"uuid": "efe8afea-c0a8-45dc-8e6e-499279f6fa5d",
"uuid": "0194fdc2-fa2f-4cc0-81d3-ff12045b73c8",
"label": "root",
"mountpoint": "/"
}
@ -9507,7 +9507,7 @@
},
"image-info": {
"boot-environment": {
"kernelopts": "root=UUID=efe8afea-c0a8-45dc-8e6e-499279f6fa5d console=tty0 console=ttyS0,115200n8 no_timer_check net.ifnames=0 crashkernel=auto"
"kernelopts": "root=UUID=0194fdc2-fa2f-4cc0-81d3-ff12045b73c8 console=tty0 console=ttyS0,115200n8 no_timer_check net.ifnames=0 crashkernel=auto"
},
"bootloader": "grub",
"bootmenu": [
@ -9524,6 +9524,14 @@
}
],
"fstab": [
[
"UUID=0194fdc2-fa2f-4cc0-81d3-ff12045b73c8",
"/",
"xfs",
"defaults",
"0",
"0"
],
[
"UUID=7B77-95E7",
"/boot/efi",
@ -9531,14 +9539,6 @@
"defaults,uid=0,gid=0,umask=077,shortname=winnt",
"0",
"2"
],
[
"UUID=efe8afea-c0a8-45dc-8e6e-499279f6fa5d",
"/",
"xfs",
"defaults",
"0",
"0"
]
],
"groups": [
@ -10091,7 +10091,7 @@
"size": 10630446592,
"start": 106954752,
"type": "0FC63DAF-8483-4772-8E79-3D69D8477DE4",
"uuid": "efe8afea-c0a8-45dc-8e6e-499279f6fa5d"
"uuid": "0194fdc2-fa2f-4cc0-81d3-ff12045b73c8"
}
],
"passwd": [
@ -10219,4 +10219,4 @@
],
"timezone": "UTC"
}
}
}

View file

@ -3485,7 +3485,7 @@
"options": {
"filesystems": [
{
"uuid": "efe8afea-c0a8-45dc-8e6e-499279f6fa5d",
"uuid": "0194fdc2-fa2f-4cc0-81d3-ff12045b73c8",
"vfs_type": "xfs",
"path": "/",
"options": "defaults"
@ -3503,7 +3503,7 @@
{
"name": "org.osbuild.grub2",
"options": {
"root_fs_uuid": "efe8afea-c0a8-45dc-8e6e-499279f6fa5d",
"root_fs_uuid": "0194fdc2-fa2f-4cc0-81d3-ff12045b73c8",
"kernel_opts": "console=tty0 console=ttyS0,115200n8 no_timer_check net.ifnames=0 crashkernel=auto debug",
"legacy": "i386-pc",
"uefi": {
@ -3628,7 +3628,7 @@
"uuid": "6264D520-3FB9-423F-8AB8-7A0A8E3D3562",
"filesystem": {
"type": "xfs",
"uuid": "efe8afea-c0a8-45dc-8e6e-499279f6fa5d",
"uuid": "0194fdc2-fa2f-4cc0-81d3-ff12045b73c8",
"label": "root",
"mountpoint": "/"
}
@ -9617,7 +9617,7 @@
},
"image-info": {
"boot-environment": {
"kernelopts": "root=UUID=efe8afea-c0a8-45dc-8e6e-499279f6fa5d console=tty0 console=ttyS0,115200n8 no_timer_check net.ifnames=0 crashkernel=auto debug"
"kernelopts": "root=UUID=0194fdc2-fa2f-4cc0-81d3-ff12045b73c8 console=tty0 console=ttyS0,115200n8 no_timer_check net.ifnames=0 crashkernel=auto debug"
},
"bootloader": "grub",
"bootmenu": [
@ -9634,6 +9634,14 @@
}
],
"fstab": [
[
"UUID=0194fdc2-fa2f-4cc0-81d3-ff12045b73c8",
"/",
"xfs",
"defaults",
"0",
"0"
],
[
"UUID=7B77-95E7",
"/boot/efi",
@ -9641,14 +9649,6 @@
"defaults,uid=0,gid=0,umask=077,shortname=winnt",
"0",
"2"
],
[
"UUID=efe8afea-c0a8-45dc-8e6e-499279f6fa5d",
"/",
"xfs",
"defaults",
"0",
"0"
]
],
"groups": [
@ -10203,7 +10203,7 @@
"size": 10630446592,
"start": 106954752,
"type": "0FC63DAF-8483-4772-8E79-3D69D8477DE4",
"uuid": "efe8afea-c0a8-45dc-8e6e-499279f6fa5d"
"uuid": "0194fdc2-fa2f-4cc0-81d3-ff12045b73c8"
}
],
"passwd": [
@ -10333,4 +10333,4 @@
],
"timezone": "London"
}
}
}

View file

@ -3259,7 +3259,7 @@
"options": {
"filesystems": [
{
"uuid": "efe8afea-c0a8-45dc-8e6e-499279f6fa5d",
"uuid": "0194fdc2-fa2f-4cc0-81d3-ff12045b73c8",
"vfs_type": "xfs",
"path": "/",
"options": "defaults"
@ -3277,7 +3277,7 @@
{
"name": "org.osbuild.grub2",
"options": {
"root_fs_uuid": "efe8afea-c0a8-45dc-8e6e-499279f6fa5d",
"root_fs_uuid": "0194fdc2-fa2f-4cc0-81d3-ff12045b73c8",
"kernel_opts": "ro biosdevname=0 rootdelay=300 console=ttyS0 earlyprintk=ttyS0 net.ifnames=0",
"legacy": "i386-pc",
"uefi": {
@ -3354,7 +3354,7 @@
"uuid": "6264D520-3FB9-423F-8AB8-7A0A8E3D3562",
"filesystem": {
"type": "xfs",
"uuid": "efe8afea-c0a8-45dc-8e6e-499279f6fa5d",
"uuid": "0194fdc2-fa2f-4cc0-81d3-ff12045b73c8",
"label": "root",
"mountpoint": "/"
}
@ -9082,7 +9082,7 @@
},
"image-info": {
"boot-environment": {
"kernelopts": "root=UUID=efe8afea-c0a8-45dc-8e6e-499279f6fa5d ro biosdevname=0 rootdelay=300 console=ttyS0 earlyprintk=ttyS0 net.ifnames=0"
"kernelopts": "root=UUID=0194fdc2-fa2f-4cc0-81d3-ff12045b73c8 ro biosdevname=0 rootdelay=300 console=ttyS0 earlyprintk=ttyS0 net.ifnames=0"
},
"bootloader": "grub",
"bootmenu": [
@ -9104,6 +9104,14 @@
"cockpit"
],
"fstab": [
[
"UUID=0194fdc2-fa2f-4cc0-81d3-ff12045b73c8",
"/",
"xfs",
"defaults",
"0",
"0"
],
[
"UUID=7B77-95E7",
"/boot/efi",
@ -9111,14 +9119,6 @@
"defaults,uid=0,gid=0,umask=077,shortname=winnt",
"0",
"2"
],
[
"UUID=efe8afea-c0a8-45dc-8e6e-499279f6fa5d",
"/",
"xfs",
"defaults",
"0",
"0"
]
],
"groups": [
@ -9636,7 +9636,7 @@
"size": 4187995648,
"start": 106954752,
"type": "0FC63DAF-8483-4772-8E79-3D69D8477DE4",
"uuid": "efe8afea-c0a8-45dc-8e6e-499279f6fa5d"
"uuid": "0194fdc2-fa2f-4cc0-81d3-ff12045b73c8"
}
],
"passwd": [
@ -9756,4 +9756,4 @@
],
"timezone": "UTC"
}
}
}

View file

@ -3121,7 +3121,7 @@
"options": {
"filesystems": [
{
"uuid": "efe8afea-c0a8-45dc-8e6e-499279f6fa5d",
"uuid": "0194fdc2-fa2f-4cc0-81d3-ff12045b73c8",
"vfs_type": "xfs",
"path": "/",
"options": "defaults"
@ -3139,7 +3139,7 @@
{
"name": "org.osbuild.grub2",
"options": {
"root_fs_uuid": "efe8afea-c0a8-45dc-8e6e-499279f6fa5d",
"root_fs_uuid": "0194fdc2-fa2f-4cc0-81d3-ff12045b73c8",
"kernel_opts": "ro net.ifnames=0",
"legacy": "i386-pc",
"uefi": {
@ -3206,7 +3206,7 @@
"uuid": "6264D520-3FB9-423F-8AB8-7A0A8E3D3562",
"filesystem": {
"type": "xfs",
"uuid": "efe8afea-c0a8-45dc-8e6e-499279f6fa5d",
"uuid": "0194fdc2-fa2f-4cc0-81d3-ff12045b73c8",
"label": "root",
"mountpoint": "/"
}
@ -8718,7 +8718,7 @@
},
"image-info": {
"boot-environment": {
"kernelopts": "root=UUID=efe8afea-c0a8-45dc-8e6e-499279f6fa5d ro net.ifnames=0"
"kernelopts": "root=UUID=0194fdc2-fa2f-4cc0-81d3-ff12045b73c8 ro net.ifnames=0"
},
"bootloader": "grub",
"bootmenu": [
@ -8740,6 +8740,14 @@
"cockpit"
],
"fstab": [
[
"UUID=0194fdc2-fa2f-4cc0-81d3-ff12045b73c8",
"/",
"xfs",
"defaults",
"0",
"0"
],
[
"UUID=7B77-95E7",
"/boot/efi",
@ -8747,14 +8755,6 @@
"defaults,uid=0,gid=0,umask=077,shortname=winnt",
"0",
"2"
],
[
"UUID=efe8afea-c0a8-45dc-8e6e-499279f6fa5d",
"/",
"xfs",
"defaults",
"0",
"0"
]
],
"groups": [
@ -9248,7 +9248,7 @@
"size": 4187995648,
"start": 106954752,
"type": "0FC63DAF-8483-4772-8E79-3D69D8477DE4",
"uuid": "efe8afea-c0a8-45dc-8e6e-499279f6fa5d"
"uuid": "0194fdc2-fa2f-4cc0-81d3-ff12045b73c8"
}
],
"passwd": [
@ -9365,4 +9365,4 @@
],
"timezone": "UTC"
}
}
}