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

Partition table helper functions for adding root filesystem and boot partition #1009

Merged
merged 6 commits into from
Nov 6, 2024

Commits on Nov 5, 2024

  1. disk: EnsureRootFilesystem() helper function

    Add a function that takes a partition table and adds a root filesystem,
    but only if one does not already exist.  A root filesystem is any
    mountable where the mountpoint is `/`.
    
    The function decides whether to create a plain partition, a logical
    volume, or a btrfs subvolume based on existing partitions and volumes in
    the partition table.
    
    This function is not currently used because our base partition tables
    always have root filesystems, but it will be part of the new custom
    partition table generator.
    achilleas-k committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    0397f8a View commit details
    Browse the repository at this point in the history

Commits on Nov 6, 2024

  1. Configuration menu
    Copy the full SHA
    5357ca2 View commit details
    Browse the repository at this point in the history
  2. disk: EnsureBootPartition() helper function

    Add a function that takes a partition table and adds a boot partition,
    but only if one does not already exist.  A boot partition is any
    mountable where the mountpoint is `/boot`.  Although the /boot
    mountpoint must always be on a plain partition, this is not validated.
    
    This function is not currently used because the NewPartitionTable()
    function handles this automatically during layout conversions (in
    ensureLVM() and ensureBtrfs()), but it will be part of the new custom
    partition table generator.
    achilleas-k committed Nov 6, 2024
    Configuration menu
    Copy the full SHA
    c88ba0d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b3fd257 View commit details
    Browse the repository at this point in the history
  4. disk: set the root and boot partition type correctly for dos

    Define a new const string: DosLinuxTypeID, which is used for Linux
    filesystems on dos/mbr partition tables.
    
    In the new helper functions, use the partition table type to determine
    which ID to use.  This means that the functions will return an error
    when the partition table type is not set (or is set to an unknown
    value).
    
    Update the tests to match the new behaviour and to test the correct ID
    selection.
    achilleas-k committed Nov 6, 2024
    Configuration menu
    Copy the full SHA
    4123bd5 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    88d6a6a View commit details
    Browse the repository at this point in the history