[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Rescatux 0.41b1 released with UEFI rescue options



  Hi Debian-efi list,


  * Rescatux introduction

  A bit of introduction about Rescatux
(http://www.supergrubdisk.org/rescatux/ ) . Rescatux is a GNU/Linux
rescue cd (and eventually also Windows) but it is not like other rescue
disks. Rescatux comes with Rescapp. Rescapp is a nice wizard that will
guide you through your rescue tasks.

  What the former statement means that when you boot up Rescatux, its
main program, the Rescapp wizard appears where some options can be
triggered.

  E.g., you can trigger the 'Restore Grub' which will ask you for your
Gnu/Linux distribution, hard disk to install to, and which it's the boot
order of your disk in your BIOS. Once you have provided those inputs
then Rescapp restores grub thanks to the chroot method for you.

  * Rescatux 0.41b1 released

  Last week I released Rescatux 0.41b1 with a bunch of new UEFI rescue
options. I just wanted to share with you some technical details about
those options so that I can get some feedback from you.

  Well, basically, you will be getting the commands you would have typed
on in a shell if you did the same work as the option by hand. There's
some other stuff like backing up EFI directory (inside esp partition) on
some options that will omit.

  * How to get and boot Rescatux 0.41b1 iso

  So the ISO can be downloaded from teh Rescatux 0.41b1 release piece of
news:
http://www.supergrubdisk.org/2017/04/18/rescatux-0-41-beta-1-released/ .

  If you want to test it in real hardware please make sure you put into
your usb device with the DD method (or equivalent method). The iso has
been designed so that it boots from either hard disk or cdrom. And at
the same time it should boot from BIOS-only systems, 32bit EFI-only
systems and 64bit EFI-only systems.

  Obviously as you are testing UEFI option you need to make sure that it
boots in UEFI mode.

  If you use an alternate tool such as Yumi, Rufus in a non DD
equivalent mode this 'Boot from UEFI' support might not be available.

  Please be warned that using the DD method wipes all the information on
your USB device.

  * About your feedback

  I'm not going to release a Rescatux stable version any time soon. So
you've got time to give me feedback back. What I mean it's don't be
discouraged because of my long email. As you can read most of it it's
just introduction. You can opt to just comment about one option if you
would like to. Any feedback is welcome.

  Hopefully the command shell simulation will encourage your useful
feedback :) .


  Note: I choosed MokManager EFI file in most of the examples. The final
user would choose the debian grub efi file in most of the cases instead.

  * UEFI options video

  I almost forgot to tell you that I have recorded a video on these UEFI
options. The Youtube description box has links to the exact times where
those options are shown. The video is rather large because it was
unscripted and live. So feel free to skip some parts if you get bored ;) .
  You can find the Rescatux UEFI options video at:
  https://www.youtube.com/watch?v=rhAg_ojj3VQ

  (*) Change UEFI Boot order

  # Use efibootmgr to get all the current UEFI options, present to the
user and let him to order them

  efibootmgr -o 0004,0000,0001,0002,0009

  (*) Check UEFI mode

  '[' -d /sys/firmware/efi ']'

  # Tell the user if Rescatux was boot in UEFI mode or depending on
former command result

  (*) Create UEFI Boot Entry

  # Let the user choose the ESP partition

  find /mnt/rescatux/efi_partition -iname '*\.efi'

  # The user chooses the desired efi file

  efibootmgr -c -d /dev/sda -p 2 \
  -L '(Rescapp added) \EFI\ubuntu\MokManager.efi' \
  -l '\EFI\ubuntu\MokManager.efi'

  (*) Check UEFI partition status

  # The user is presented all the partitions on its system.
  # He selects what he believes it's the EFI system partition.

  # 1st check: EFI disk by fdisk

  fdisk -lu | \
    grep /dev/sda | \
    grep '^/dev/sda2\+[[:space:]]\+' | \
    grep 'EFI System$'

  # 2nd check: EFI partition has an esp flag (pyparted coded...
equivalent to using parted and checking esp flag manually).

  # 3rd check: EFI partition has a boot flag (pyparted coded...
equivalent to using parted and checking boot flag manually).

  # 4rd check: EFI partition has a valid uefi filesystem (pyparted
coded... equivalent to using parted and checking filesystem. If either
fat12, fat16 or fat32 filesystem is found then it's ok.).

  # 5th check: EFI partition can be mount

  # 6th check: Given the EFI partition lookup its hard disk. Then check
hard disk type. If its partition table type is either msdos or gpt then
it's ok.

  (*) Fake Microsoft Windows UEFI.
Description: Some wrong implementations of UEFI firmware requires the
default boot entry to be 'Windows Boot Entry' and that the filename has
precisely the same filename as the default Microsoft Windows UEFI boot
filenames. Let's trick them into thinking that they are booting into
them even if they are booting on our desired EFI file.

  # Let the user choose the ESP partition

  find /mnt/rescatux/efi_partition -iname '*\.efi'

  # The user chooses the desired efi file

  mkdir /mnt/rescatux/sda2
  mount -t auto /dev/sda2 /mnt/rescatux/sda2

  # Backup EFI directory into EFI_PRE_RESCATUX_2017-04-18-21-50-51

  cp /mnt/rescatux/sda2/EFI/ubuntu/MokManager.efi \
     /mnt/rescatux/sda2/EFI/Boot/bootx64.efi

  cp /mnt/rescatux/sda2/EFI/ubuntu/MokManager.efi \
     /mnt/rescatux/sda2/EFI/Microsoft/Boot/bootmgfw.efi

  cp /mnt/rescatux/sda2/EFI/ubuntu/MokManager.efi \
     /mnt/rescatux/sda2/EFI/Microsoft/Boot/bootmgr.efi

  umount /dev/sda2


  efibootmgr -c \
    -d /dev/sda \
    -p 2 \
    -L 'Windows Boot Manager' \
    -l '\EFI\Microsoft\Boot\bootmgfw.efi'

  (*) Hide Microsoft Windows UEFI
Description: Some wrong implementations of UEFI firmware requires the
default boot entry to be 'Windows Boot Entry' and that the filename has
precisely the same filename as the default Microsoft Windows UEFI boot
filenames. Let's trick them into thinking that they are booting into
them even if they are booting on our desired EFI file.

In addition to the former some other UEFI firmware if they find the
default Microsoft Windows UEFI boot filenames then they overwrite them
with the correct ones. So we need to move those options out of the way.

Note: If the user wants to EFI-chainload Windows from the grub menu it's
up to them to do so. Usually having a Microsoft.orig directory is what
most people do.

  # Let the user choose the ESP partition

  find /mnt/rescatux/efi_partition -iname '*\.efi'

  # The user chooses the desired efi file

  mkdir /mnt/rescatux/sda2
  mount -t auto /dev/sda2 /mnt/rescatux/sda2

  # Backup EFI directory into EFI_PRE_RESCATUX_2017-04-18-21-50-51

  cp /mnt/rescatux/sda2/EFI/ubuntu/MokManager.efi \
     /mnt/rescatux/sda2/EFI/Boot/bootx64.efi

  rm -rf /mnt/rescatux/sda2/EFI/Microsoft

  umount /dev/sda2


  efibootmgr -c \
    -d /dev/sda \
    -p 2 \
    -L 'Windows Boot Manager' \
    -l '\EFI\Boot\bootx64.efi'

  (*) Reinstall Microsoft Windows UEFI boot entries
This option tries to recreate Microsoft Windows UEFI files from a
Microsoft Windows installation. Unfortunately I was unable to recreate a
BCD file.

  # Let the user choose the ESP partition

  # Let the user choose the Microsoft Windows partition

  mkdir /mnt/rescatux/sda2
  mount -t auto /dev/sda2 /mnt/rescatux/sda2

  mkdir /mnt/rescatux/sda4
  mount -t auto /dev/sda4 /mnt/rescatux/sda4

  cp /mnt/rescatux/sda4/Windows/Boot/EFI/bootmgfw.efi \
     /mnt/rescatux/sda2/EFI/Microsoft/Boot/bootmgfw.efi

  cp /mnt/rescatux/sda4/Windows/Boot/EFI/bootmgr.efi \
     /mnt/rescatux/sda2/EFI/Microsoft/Boot/bootmgr.efi

  umount /dev/sda2
  umount /dev/sda4

  efibootmgr -c \
    -d /dev/sda \
    -p 2 \
    -L 'Windows Boot Manager' \
    -l '\EFI\Microsoft\Boot\bootmgfw.efi'





Thank you for any feedback you can give me back!



adrian15
-- 
Support free software. Donate to Super Grub Disk. Apoya el software
libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/


Reply to: