Skip to content

Commit

Permalink
x86/efi: add FAT32 esp mounting support
Browse files Browse the repository at this point in the history
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@gmail.com>
[replace '-o' with '] || [' to satisfy shellsheck]
Signed-off-by: Paul Spooren <mail@aparcar.org>
  • Loading branch information
kagurazakakotori authored and aparcar committed Jan 3, 2021
1 parent 7937c1f commit 927b9df
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion package/base-files/files/lib/upgrade/common.sh
Expand Up @@ -133,14 +133,19 @@ 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" ]
}

part_magic_fat() {
local magic=$(get_magic_vfat "$@")
[ "$magic" = "FAT" ]
local magic_fat32=$(get_magic_fat32 "$@")
[ "$magic" = "FAT" ] || [ "$magic_fat32" = "FAT32" ]
}

export_bootdevice() {
Expand Down

0 comments on commit 927b9df

Please sign in to comment.