• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

Unable to set a GRUB password on a Raspberry Pi 3 system

by admin

The Problem

grub-rpi3.efi is built on RPI3 image build stage, and it is missing a crucial module for password prompt:

# efibootmgr -v -v 
Could not read variable 'BootNext': No such file or directory 
error trace: 
 vars.c:332 vars_get_variable(): open(/sys/firmware/efi/vars/BootNext-8be4df61-93ca-11d2-aa0d-00e098032b8c/raw_var, O_RDONLY) failed: No such file or directory 
 lib.c:139 efi_get_variable(): ops->get_variable failed: No such file or directory 
Could not read variable 'BootCurrent': No such file or directory 
error trace: 
 vars.c:332 vars_get_variable(): 
open(/sys/firmware/efi/vars/BootCurrent-8be4df61-93ca-11d2-aa0d-00e098032b8c/raw_var, O_RDONLY) failed: No such file or directory 
 lib.c:139 efi_get_variable(): ops->get_variable failed: No such file or directory 
Could not read variable 'Timeout': No such file or directory 
error trace: 
 vars.c:332 vars_get_variable(): 
open(/sys/firmware/efi/vars/Timeout-8be4df61-93ca-11d2-aa0d-00e098032b8c/raw_var, O_RDONLY) failed: No such file or directory lib.c:139 efi_get_variable(): ops->get_variable failed: No such file or directory 
Could not read variable 'BootOrder': No such file or directory 
error trace: 
 vars.c:332 vars_get_variable(): 
open(/sys/firmware/efi/vars/BootOrder-8be4df61-93ca-11d2-aa0d-00e098032b8c/raw_var, O_RDONLY) failed: No such file or directory lib.c:139 efi_get_variable(): ops->get_variable failed: No such file or directory 
 efibootmgr.c:372 read_order(): efi_get_variable failed: No such file or directory 
No BootOrder is set; firmware will attempt recovery 
Could not read variable 'MirrorCurrent': No such file or directory 
error trace: 
 vars.c:332 vars_get_variable(): 
open(/sys/firmware/efi/vars/MirrorCurrent-7b9be2e0-e28a-4197-ad3e-32f062f9462c/raw_var, O_RDONLY) failed: No such file or directory 
 lib.c:139 efi_get_variable(): ops->get_variable failed: No such file or directory 
Could not read variable 'MirrorRequest': No such file or directory 
error trace: 
 vars.c:332 vars_get_variable(): 
open(/sys/firmware/efi/vars/MirrorRequest-7b9be2e0-e28a-4197-ad3e-32f062f9462c/raw_var, O_RDONLY) failed: No such file or directory 
 lib.c:139 efi_get_variable(): ops->get_variable failed: No such file or directory

The Solution

Follow the steps outlined below to fix the issue:

1. Verify that file is in place:

# file grub-rpi3.efi

2. Install package grub2-efi-aa64-modules.

3. Set the default boot device:

# echo "set root=(hd0,msdos2)" > grub2-early.cfg

4. Review grub-early.cfg to verify there is exactly one “set root” string.

5. Build the image:

# grub2-mkimage -c grub-early.cfg -O arm64-efi -o grub-rpi3.efi -p "(hd0,msdos1)/efi/redhat" all_video boot btrfs cat chain echo efifwsetup efinet ext2 fat font gfxmenu gfxterm gzio halt hfsplus iso9660 jpeg loadenv loopback lvm mdraid09 mdraid1x minicmd normal part_apple part_msdos part_gpt password_pbkdf2 png reboot regexp search search_fs_uuid search_fs_file search_label serial sleep syslinuxcfg test tftp video xfs http linux configfile

6. Verify the new file in the local directory:

# file grub-rpi3.efi

7. Add a copy of the file to /boot/efi/EFI/redhat/ directory.

# cp grub-rpi3.efi /boot/efi/EFI/redhat/

This should also produce a warning about replacing an existing file.

8. Flush the I/O buffers out to media:

# sync; sync; sync

9. Gracefully reboot.

Filed Under: Linux, Raspberry Pi

Some more articles you might also be interested in …

  1. Command line parameters in shell scripts
  2. gnome-software: command not found
  3. pacman –database Command Examples in Arch Linux
  4. btrfs rescue Command Examples in Linux
  5. CentOS / RHEL 7 : Tips on Troubleshooting NTP / chrony Issues
  6. How to Trace Python Scripts using trace.py
  7. CentOS/RHEL: /tmp mount point not automatically mounting when added in /etc/fstab
  8. fprintd-verify: command not found
  9. How to Configure Multiple MySQL Servers On One System Using mysqld_multi
  10. How to Execute Scripts/Commands using /etc/rc.d/rc.local in CentOS/RHEL 7

You May Also Like

Primary Sidebar

Recent Posts

  • pw-cat Command Examples in Linux
  • pvs: command not found
  • pulseaudio: command not found
  • pulseaudio Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright