[openwrt/openwrt] x86/efi: add FAT32 esp mounting support

LEDE Commits lede-commits at lists.infradead.org
Sun Jan 3 18:49:01 EST 2021


aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/927b9df938803d409d6b3a47d6834a6c10f68c3d

commit 927b9df938803d409d6b3a47d6834a6c10f68c3d
Author: Kagurazaka Kotori <kagurazakakotori at gmail.com>
AuthorDate: Tue Sep 8 16:00:02 2020 +0800

    x86/efi: add FAT32 esp mounting support
    
    Adds a new function get_magic_fat32() in base-files to read FAT32 magic.
    Now FAT32 EFI system partition can be handled in the same way as FAT12/FAT16.
    
    Signed-off-by: Kagurazaka Kotori <kagurazakakotori at gmail.com>
    [replace '-o' with '] || [' to satisfy shellsheck]
    Signed-off-by: Paul Spooren <mail at aparcar.org>
---
 package/base-files/files/lib/upgrade/common.sh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh
index b44a5998f4..e8a28f4138 100644
--- a/package/base-files/files/lib/upgrade/common.sh
+++ b/package/base-files/files/lib/upgrade/common.sh
@@ -133,6 +133,10 @@ get_magic_vfat() {
 	(get_image "$@" | dd bs=1 count=3 skip=54) 2>/dev/null
 }
 
+get_magic_fat32() {
+	(get_image "$@" | dd bs=1 count=5 skip=82) 2>/dev/null
+}
+
 part_magic_efi() {
 	local magic=$(get_magic_gpt "$@")
 	[ "$magic" = "EFI PART" ]
@@ -140,7 +144,8 @@ part_magic_efi() {
 
 part_magic_fat() {
 	local magic=$(get_magic_vfat "$@")
-	[ "$magic" = "FAT" ]
+	local magic_fat32=$(get_magic_fat32 "$@")
+	[ "$magic" = "FAT" ] || [ "$magic_fat32" = "FAT32" ]
 }
 
 export_bootdevice() {



More information about the lede-commits mailing list