Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rear recover fails to create UEFI boot entry for eMMC device #2103

Closed
fabz5 opened this issue Mar 29, 2019 · 3 comments
Closed

rear recover fails to create UEFI boot entry for eMMC device #2103

fabz5 opened this issue Mar 29, 2019 · 3 comments
Assignees
Labels
enhancement Adaptions and new features fixed / solved / done
Milestone

Comments

@fabz5
Copy link
Contributor

fabz5 commented Mar 29, 2019

Relax-and-Recover (ReaR) Issue Template

Fill in the following items before submitting a new issue
(quick response is not guaranteed with free support):

  • ReaR version ("/usr/sbin/rear -V"):
    Relax-and-Recover 2.4 / Git current master (commit f6a36de)

  • OS version ("cat /etc/rear/os.conf" or "lsb_release -a" or "cat /etc/os-release"):
    Debian 9.8

  • ReaR configuration files ("cat /etc/rear/site.conf" and/or "cat /etc/rear/local.conf"):

site.conf contains:

OUTPUT=ISO
OUTPUT_URL=nfs://mynfsserver/backupdir
BACKUP=NETFS
BACKUP_URL=nfs://mynfsserver/backupdir
  • Hardware (PC or PowerNV BareMetal or ARM) or virtual machine (KVM guest or PoverVM LPAR):
    PC (Minis Forum Z83-F)

  • System architecture (x86 compatible or PPC64/PPC64LE or what exact ARM device):
    x86-64 (amd64)

  • Firmware (BIOS or UEFI or Open Firmware) and bootloader (GRUB or ELILO or Petitboot):
    UEFI, GRUB (2.02~beta3-5+deb9u1)

  • Storage (lokal disk or SSD) and/or SAN (FC or iSCSI or FCoE) and/or multipath (DM or NVMe):
    local disk (eMMC)

  • Description of the issue (ideally so that others can reproduce it):
    Running

rear recover

fails to create an UEFI boot entry, since efibootmgr is called with a wrong disk device name (/dev/mmcblk0p). The trailing "p" for "partition" is not being removed.

  • Workaround, if any:
    Manually call efibootmgr with the correct disk device name.

  • Attachments, as applicable ("rear -D mkrescue/mkbackup/recover" debug log files):
    rear-testvm02.log

@jsmeix jsmeix self-assigned this Apr 1, 2019
@jsmeix jsmeix added the enhancement Adaptions and new features label Apr 1, 2019
@jsmeix jsmeix added this to the ReaR v2.5 milestone Apr 1, 2019
@jsmeix
Copy link
Member

jsmeix commented Apr 1, 2019

This is some kind of follow up of #2087
towards full support of mmcblk disk types in ReaR.

@fabz5
many thanks for your continuous testing and your contributions
towards full support of mmcblk disk types in ReaR.

@jsmeix
Copy link
Member

jsmeix commented Apr 1, 2019

Excerpt from https://github.com/rear/rear/files/3024025/rear-testvm02.log
that shows how the wrong $Disk value /dev/mmcblk0p instead of /dev/mmcblk0p
for the efibootmgr --create --gpt --disk ${Disk} call happens:

+ source /usr/share/rear/finalize/Linux-i386/670_run_efibootmgr.sh
++ is_true 1
++ case "$1" in
++ return 0
++ is_true no
++ case "$1" in
++ return 1
++ test -f /mnt/local//boot/efi/EFI/debian/grubx64.efi
+++ df -P /mnt/local//boot/efi/EFI/debian/grubx64.efi
+++ tail -1
+++ awk '{print $6}'
++ esp_mountpoint=/mnt/local/boot/efi
++ test /mnt/local/boot/efi
++ test -d /mnt/local/boot/efi
+++ mount
+++ grep /mnt/local/boot/efi
+++ awk '{print $1}'
++ BootEfiDev=/dev/mmcblk0p1
+++ get_device_name /dev/mmcblk0p1
+++ local name=mmcblk0p1
+++ name=mmcblk0p1
+++ contains_visible_char mmcblk0p1
++++ tr -d -c '[:graph:]'
+++ test mmcblk0p1
+++ [[ mmcblk0p1 =~ ^mapper/ ]]
+++ [[ -L /dev/mmcblk0p1 ]]
+++ [[ mmcblk0p1 =~ ^dm- ]]
+++ name=mmcblk0p1
+++ echo /dev/mmcblk0p1
+++ [[ -r /dev/mmcblk0p1 ]]
+++ return 0
++ Dev=/dev/mmcblk0p1
+++ get_partition_number /dev/mmcblk0p1
+++ local partition=/dev/mmcblk0p1
++++ echo /dev/mmcblk0p1
++++ grep -o -E '[0-9]+$'
+++ local number=1
+++ '[' 1 -gt 0 ']'
+++ StopIfError 'Partition number '\''1'\'' of partition /dev/mmcblk0p1 is not a valid number.'
+++ ((  0 != 0  ))
+++ ((  1 <= 128  ))
+++ StopIfError 'Partition /dev/mmcblk0p1 is numbered '\''1'\''. More than 128 partitions is not supported.'
+++ ((  0 != 0  ))
+++ echo 1
++ ParNr=1
+++ echo /dev/mmcblk0p
++ Disk=/dev/mmcblk0p

jsmeix added a commit that referenced this issue Apr 3, 2019
Fixed disk device name in efibootmgr call for eMMC devices:
For eMMC devices the trailing "p" in the disk device name
(as in /dev/mmcblk0p that is derived from /dev/mmcblk0p1)
needs to be stripped (to get /dev/mmcblk0), otherwise the
efibootmgr call fails because of a wrong disk device name.
See also #2103
@jsmeix
Copy link
Member

jsmeix commented Apr 3, 2019

With #2104 merged
this issue should be fixed.

@jsmeix jsmeix closed this as completed Apr 3, 2019
@gdha gdha mentioned this issue Jul 4, 2019
gdha added a commit that referenced this issue Jul 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Adaptions and new features fixed / solved / done
Projects
None yet
Development

No branches or pull requests

2 participants