LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

grub-file

check boot image file type

TLDR

Check if a file is an ARM EFI image
$ grub-file --is-arm-efi [path/to/file]
copy
Check if a file is an i386 EFI image
$ grub-file --is-i386-efi [path/to/file]
copy
Check if a file is an x86_64 EFI image
$ grub-file --is-x86_64-efi [path/to/file]
copy
Check if a file is an ARM Linux kernel
$ grub-file --is-arm-linux [path/to/file]
copy
Check if a file is an x86 Linux kernel (32 or 64-bit)
$ grub-file --is-x86-linux [path/to/file]
copy
Check if a file is an x86 Multiboot2 kernel
$ grub-file --is-x86-multiboot2 [path/to/file]
copy
Check if a file is an x86_64 XNU (macOS) kernel
$ grub-file --is-x86_64-xnu [path/to/file]
copy

SYNOPSIS

grub-file --is-TYPE file

DESCRIPTION

grub-file checks whether a file is a bootable image of a specific type. It examines file headers and signatures to identify kernel images, EFI applications, and other bootable formats.The command returns exit code 0 (success) if the file matches the specified type, or 1 (failure) if it does not. This is useful in scripts for validating boot images or determining the correct boot method.

PARAMETERS

--is-arm-efi

Check for ARM EFI image
--is-arm64-efi
Check for ARM64 EFI image
--is-i386-efi
Check for i386 EFI image
--is-x86_64-efi
Check for x86_64 EFI image
--is-arm-linux
Check for ARM Linux kernel
--is-arm64-linux
Check for ARM64 Linux kernel
--is-x86-linux
Check for x86 Linux kernel (covers both 32 and 64-bit)
--is-x86-linux32
Check for x86 Linux kernel using the 32-bit-only boot protocol
--is-x86_64-xnu
Check for macOS (XNU) x86_64 kernel
--is-x86-multiboot
Check for Multiboot image
--is-x86-multiboot2
Check for Multiboot2 image

INSTALL

sudo apt install grub-common
copy
sudo pacman -S grub
copy
sudo apk add grub
copy

CAVEATS

Only checks file type signatures; doesn't verify if the image is actually bootable or valid. Some specialized or custom kernels may not be recognized correctly.

HISTORY

grub-file is part of GRUB 2, providing a utility for image type detection. This is useful during installation and configuration to ensure the correct bootloader setup for the target architecture.

SEE ALSO

RESOURCES

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid