partitioning: Set correct partition type UUID for root filesystem

Previously, only the type "Generic Linux filesystem" was used.
Use the correct type "Linux root ($ARCHITECTURE)" for the root filesystem.
This commit is contained in:
ColorfulRhino
2024-07-09 18:21:53 +02:00
committed by Igor
parent a027c4be37
commit 1092d60d3e
5 changed files with 32 additions and 4 deletions

View File

@@ -12,6 +12,11 @@ declare -g ARCH='amd64' # Debian name $(dpkg-architecture -q
declare -g ARCHITECTURE='x86_64' # "kernel" arch declare -g ARCHITECTURE='x86_64' # "kernel" arch
declare -g KERNEL_SRC_ARCH='x86' # kernel SRC_ARCH; there's two for x86_64 declare -g KERNEL_SRC_ARCH='x86' # kernel SRC_ARCH; there's two for x86_64
declare -g QEMU_BINARY='qemu-x86_64-static' # Hopefully you have this installed. declare -g QEMU_BINARY='qemu-x86_64-static' # Hopefully you have this installed.
# Linux root has a different Type-UUID for every architecture
# See https://uapi-group.org/specifications/specs/discoverable_partitions_specification/
declare -g PARTITION_TYPE_UUID_ROOT="4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709" # "Linux root (x86-64)"
declare -g MAIN_CMDLINE='' # we set it in common, it was not set before declare -g MAIN_CMDLINE='' # we set it in common, it was not set before
declare -g KERNEL_COMPILER=' ' # hack: use single space for host gcc. won't work on arm64 hosts declare -g KERNEL_COMPILER=' ' # hack: use single space for host gcc. won't work on arm64 hosts
declare -g KERNEL_USE_GCC=' ' # more hacks. declare -g KERNEL_USE_GCC=' ' # more hacks.

View File

@@ -13,6 +13,10 @@ declare -g ARCHITECTURE='arm64'
declare -g KERNEL_SRC_ARCH='arm64' declare -g KERNEL_SRC_ARCH='arm64'
declare -g QEMU_BINARY='qemu-aarch64-static' declare -g QEMU_BINARY='qemu-aarch64-static'
# Linux root has a different Type-UUID for every architecture
# See https://uapi-group.org/specifications/specs/discoverable_partitions_specification/
declare -g PARTITION_TYPE_UUID_ROOT="B921B045-1DF0-41C3-AF44-4C6F280D3FAE" # "Linux root (ARM-64)"
# Defaults, if not set by board or family. # Defaults, if not set by board or family.
declare -g KERNEL_IMAGE_TYPE="${KERNEL_IMAGE_TYPE:-"Image"}" declare -g KERNEL_IMAGE_TYPE="${KERNEL_IMAGE_TYPE:-"Image"}"
declare -g KERNEL_INSTALL_TYPE="${KERNEL_INSTALL_TYPE:-"install"}" declare -g KERNEL_INSTALL_TYPE="${KERNEL_INSTALL_TYPE:-"install"}"

View File

@@ -14,6 +14,10 @@ declare -g KERNEL_SRC_ARCH='arm'
declare -g QEMU_BINARY='qemu-arm-static' declare -g QEMU_BINARY='qemu-arm-static'
declare -g INITRD_ARCH='arm' declare -g INITRD_ARCH='arm'
# Linux root has a different Type-UUID for every architecture
# See https://uapi-group.org/specifications/specs/discoverable_partitions_specification/
declare -g PARTITION_TYPE_UUID_ROOT="69DAD710-2CE4-4E3C-B16C-21A1D49ABED3" # "Linux root (ARM)"
# Defaults, if not set by board or family. # Defaults, if not set by board or family.
declare -g KERNEL_IMAGE_TYPE="${KERNEL_IMAGE_TYPE:-"zImage"}" declare -g KERNEL_IMAGE_TYPE="${KERNEL_IMAGE_TYPE:-"zImage"}"
declare -g KERNEL_INSTALL_TYPE="${KERNEL_INSTALL_TYPE:-"zinstall"}" declare -g KERNEL_INSTALL_TYPE="${KERNEL_INSTALL_TYPE:-"zinstall"}"

View File

@@ -15,6 +15,10 @@ declare -g QEMU_BINARY='qemu-riscv64-static'
declare -g IMAGE_PARTITION_TABLE='gpt' declare -g IMAGE_PARTITION_TABLE='gpt'
declare -g SKIP_EXTERNAL_TOOLCHAINS='yes' declare -g SKIP_EXTERNAL_TOOLCHAINS='yes'
# Linux root has a different Type-UUID for every architecture
# See https://uapi-group.org/specifications/specs/discoverable_partitions_specification/
declare -g PARTITION_TYPE_UUID_ROOT="72EC70A6-CF74-40E6-BD49-4BDA08E8F224" # "Linux root (RISC-V-64)"
# Defaults, if not set by board or family. # Defaults, if not set by board or family.
declare -g KERNEL_IMAGE_TYPE="${KERNEL_IMAGE_TYPE:-"Image"}" declare -g KERNEL_IMAGE_TYPE="${KERNEL_IMAGE_TYPE:-"Image"}"
declare -g KERNEL_INSTALL_TYPE="${KERNEL_INSTALL_TYPE:-"install"}" declare -g KERNEL_INSTALL_TYPE="${KERNEL_INSTALL_TYPE:-"install"}"

View File

@@ -214,7 +214,7 @@ function prepare_partitions() {
echo "$bootpart : name=\"bootfs\", start=${next}MiB, size=${BOOTSIZE}MiB, type=${type}" echo "$bootpart : name=\"bootfs\", start=${next}MiB, size=${BOOTSIZE}MiB, type=${type}"
local next=$(($next + $BOOTSIZE)) local next=$(($next + $BOOTSIZE))
else else
# no `size` argument mean "as much as possible" # No 'size' argument means "expand as much as possible"
echo "$bootpart : name=\"bootfs\", start=${next}MiB, type=${type}" echo "$bootpart : name=\"bootfs\", start=${next}MiB, type=${type}"
fi fi
fi fi
@@ -222,9 +222,20 @@ function prepare_partitions() {
# Root filesystem partition # Root filesystem partition
if [[ -n "$rootpart" ]]; then if [[ -n "$rootpart" ]]; then
# dos: Linux # dos: Linux
# gpt: Linux filesystem # gpt: Linux root
[[ "$IMAGE_PARTITION_TABLE" != "gpt" ]] && local type="83" || local type="0FC63DAF-8483-4772-8E79-3D69D8477DE4" if [[ "$IMAGE_PARTITION_TABLE" != "gpt" ]]; then
# no `size` argument mean "as much as possible" local type="83"
else
# Linux root has a different Type-UUID for every architecture
# See https://uapi-group.org/specifications/specs/discoverable_partitions_specification/
# The ${PARTITION_TYPE_UUID_ROOT} variable is defined in each architecture file (e.g. config/sources/arm64.conf)
if [[ -n "${PARTITION_TYPE_UUID_ROOT}" ]]; then
local type="${PARTITION_TYPE_UUID_ROOT}"
else
exit_with_error "Missing 'PARTITION_TYPE_UUID_ROOT' variable while partitioning the root filesystem!"
fi
fi
# No 'size' argument means "expand as much as possible"
echo "$rootpart : name=\"rootfs\", start=${next}MiB, type=${type}" echo "$rootpart : name=\"rootfs\", start=${next}MiB, type=${type}"
fi fi
} }