From 1de6de975a8a07d916bec9159ec931f5e93367b7 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Thu, 21 Nov 2024 20:38:50 +0200 Subject: [PATCH] Kernel: Rename cmdline UUID= to PARTUUID= This makes more sense and behaves more like existing software. --- kernel/kernel/FS/VirtualFileSystem.cpp | 6 +++--- script/install-bootloader.sh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/kernel/FS/VirtualFileSystem.cpp b/kernel/kernel/FS/VirtualFileSystem.cpp index c7b40f49..d90b5e1f 100644 --- a/kernel/kernel/FS/VirtualFileSystem.cpp +++ b/kernel/kernel/FS/VirtualFileSystem.cpp @@ -59,14 +59,14 @@ namespace Kernel BAN::StringView entry; RootType type; - if (root_path.size() >= 5 && root_path.substring(0, 5) == "UUID="_sv) + if (root_path.starts_with("PARTUUID="_sv)) { - entry = root_path.substring(5); + entry = root_path.substring(9); if (entry.size() != 36) panic("Invalid UUID '{}'", entry); type = RootType::PartitionUUID; } - else if (root_path.size() >= 5 && root_path.substring(0, 5) == "/dev/"_sv) + else if (root_path.starts_with("/dev/"_sv)) { entry = root_path.substring(5); if (entry.empty() || entry.contains('/')) diff --git a/script/install-bootloader.sh b/script/install-bootloader.sh index 12fd153e..af43d95a 100755 --- a/script/install-bootloader.sh +++ b/script/install-bootloader.sh @@ -110,7 +110,7 @@ if [ $BANAN_BOOTLOADER = "GRUB" ]; then root_part_uuid=${root_part_uuid:10:36} cp "$BANAN_TOOLCHAIN_DIR"/grub-*.cfg "$BANAN_BUILD_DIR/" - sed -i "s//UUID=$root_part_uuid/" "$BANAN_BUILD_DIR"/grub-*.cfg + sed -i "s//PARTUUID=$root_part_uuid/" "$BANAN_BUILD_DIR"/grub-*.cfg sed -i "s//$root_fs_uuid/" "$BANAN_BUILD_DIR"/grub-*.cfg if (($BANAN_UEFI_BOOT)); then