Skip to content

bin/flatcar-install: randomize OEM filesystem UUID if mounting fails#47

Merged
pothos merged 3 commits intoflatcar-masterfrom
kai/btrfs-oem-install
Aug 31, 2021
Merged

bin/flatcar-install: randomize OEM filesystem UUID if mounting fails#47
pothos merged 3 commits intoflatcar-masterfrom
kai/btrfs-oem-install

Conversation

@pothos
Copy link
Copy Markdown
Member

@pothos pothos commented Aug 30, 2021

  • bin/flatcar-install: randomize OEM filesystem UUID if mounting fails
    When an identical BTRFS filesystem is already mounted because the
    installing system has the same OEM partition version, the mounting
    of the installed OEM partition fails because identical UUIDs are
    only allowed to be used for btrfs multi device setups.
    Randomize the filesystem UUID in case mounting fails and try again.
  • bin/flatcar-install: do not try to use qemu OEM image
    The QEMU OEM image is qcow2 and can't be written to disk as is.
    Use the generic image and not the QEMU image when installing from QEMU.
  • bin/flatcar-install: explain OEM flag

How to use

Testing done

  1. Using the QEMU OEM image it does not show qemu as default OEM value in the -h ouput
  2. Using sudo ./flatcar-install -d /dev/vdb -i test.ign on the Alpha release generic image, installing the generic image, btrfstuneis invoked:
$ sudo ./flatcar-install -d /dev/vdb -i test.ign
Downloading the signature for https://alpha.release.flatcar-linux.net/amd64-usr/2969.0.0/flatcar_production_image.bin.bz2...
2021-08-31 12:12:36 URL:https://alpha.release.flatcar-linux.net/amd64-usr/2969.0.0/flatcar_production_image.bin.bz2.sig [594/594] -> "/tmp/flatcar-install.a2he5sYwpI/flatcar_production_image.bin.bz2.sig" [1]
Downloading, writing and verifying flatcar_production_image.bin.bz2...
2021-08-31 12:13:45 URL:https://alpha.release.flatcar-linux.net/amd64-usr/2969.0.0/flatcar_production_image.bin.bz2 [375637282/375637282] -> "-" [1]
gpg: Signature made Wed Aug 18 03:22:07 2021 UTC
gpg:                using RSA key 782B3BC9F10CF638A5DCF5105B2910CBFCBEAB91
gpg:                issuer "buildbot@flatcar-linux.org"
gpg: key E25D9AED0593B34A marked as ultimately trusted
gpg: checking the trustdb
gpg: marginals needed: 3  completes needed: 1  trust model: pgp
gpg: depth: 0  valid:   1  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 1u
gpg: Good signature from "Flatcar Buildbot (Official Builds) <buildbot@flatcar-linux.org>" [ultimate]
gpg: Note: This key has expired!
Primary key fingerprint: F88C FEDE FF29 A5B4 D952  3864 E25D 9AED 0593 B34A
     Subkey fingerprint: 782B 3BC9 F10C F638 A5DC  F510 5B29 10CB FCBE AB91
mount: /tmp/flatcar-install.a2he5sYwpI/oemfs: mount(2) system call failed: File exists.
Current fsid: 4281468d-2f64-468e-8af1-a722492b8bf9
New fsid: f7533d32-7ced-4e7c-a547-52ac86e8b747
Set superblock flag CHANGING_FSID
Change fsid in extents
Change fsid on devices
Clear superblock flag CHANGING_FSID
Fsid change finished
Installing Ignition config test...
Success! Flatcar Container Linux alpha 2969.0.0 is installed on /dev/vdb

@pothos
Copy link
Copy Markdown
Member Author

pothos commented Aug 31, 2021

Have to change this again because the qemu image is qcow2 and writing it to the disk without converting doesn't work of course.

The QEMU OEM image is qcow2 and can't be written to disk as is.

Use the generic image and not the QEMU image when installing from QEMU.
@pothos pothos force-pushed the kai/btrfs-oem-install branch from a2b60f8 to ef5846c Compare August 31, 2021 12:08
When an identical BTRFS filesystem is already mounted because the
installing system has the same OEM partition version, the mounting
of the installed OEM partition fails because identical UUIDs are
only allowed to be used for btrfs multi device setups.
Randomize the filesystem UUID in case mounting fails and try again.
@pothos pothos force-pushed the kai/btrfs-oem-install branch from ef5846c to 6371236 Compare August 31, 2021 12:12
@pothos pothos marked this pull request as ready for review August 31, 2021 12:13
@pothos pothos requested a review from a team August 31, 2021 12:13
Copy link
Copy Markdown
Member

@sayanchowdhury sayanchowdhury left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but would be good to have someone else to have a look as well 👁️ 👁️

@pothos pothos merged commit 36c9ebb into flatcar-master Aug 31, 2021
@pothos pothos deleted the kai/btrfs-oem-install branch August 31, 2021 12:22
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Aug 31, 2021
This pulls in
flatcar/init#47
to randomize OEM filesystem UUID if mounting fails, and to avoid trying
to install the QEMU qcow2 images.
sayanchowdhury pushed a commit to flatcar-archive/coreos-overlay that referenced this pull request Aug 31, 2021
This pulls in
flatcar/init#47
to randomize OEM filesystem UUID if mounting fails, and to avoid trying
to install the QEMU qcow2 images.
t-lo pushed a commit to flatcar/scripts that referenced this pull request Apr 17, 2023
This pulls in
flatcar/init#47
to randomize OEM filesystem UUID if mounting fails, and to avoid trying
to install the QEMU qcow2 images.
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.

3 participants