Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 29/12/2020, à 21:33

malbo

[Résolu] démarrage verrouillé sur EFI Hard Drive

Dans ce post, je présente une solution possible pour les ordis dont le démarrage a été verrouillé (par le constructeur) sur "EFI Hard Drive". On peut voir un cas récent d'ordi verrouillé dans ce fil et dans le rapport de bug #1747889 (le commentaire #2 de ce rapport donne des détails sur le mécanisme). Cette solution n'est pas un lapin de l'année : j'ai retrouvé un ancien post de 2014 dans lequel je l'avais proposée : https://forum.ubuntu-fr.org/viewtopic.p … #p16918581
J'ai étudié cette solution dans une machine virtuelle VirtualBox donc dans un système sain. Il est possible que certaines opérations que j'ai pu faire ne soient pas réalisables dans tous les cas. Bien que je détaille la solution dans le cas de Ubuntu 20.10, j'ai vérifié que cette solution est applicable et fonctionne aussi pour Ubuntu 20.04.1 (EDIT le 31-12-2020 : elle fonctionne également pour Ubuntu 18.04)

1) ÉTAT DE DÉPART : installation toute neuve de Ubuntu 20.10 depuis laquelle je fais ce Boot-info :
Ne pas tenir compte de la présence de sdb ni de sdb1 : tout se passe dans sda

boot-info-4ppa125                                              [20201229_1744]

============================== Boot Info Summary ===============================

 => No boot loader is installed in the MBR of /dev/sda.
 => libparted MBR boot code is installed in the MBR of /dev/sdb.

sda1: __________________________________________________________________________

    File system:       vfat
    Boot sector type:  FAT32
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        /efi/BOOT/fbx64.efi /efi/BOOT/mmx64.efi 
                       /efi/ubuntu/grubx64.efi /efi/ubuntu/mmx64.efi 
                       /efi/ubuntu/shimx64.efi /efi/ubuntu/grub.cfg

sda2: __________________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info: 
    Operating System:  Ubuntu 20.10
    Boot files:        /boot/grub/grub.cfg /etc/fstab /etc/default/grub

sdb1: __________________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info: 
    Operating System:  
    Boot files:        


================================ 1 OS detected =================================

OS#1:   L'OS actuellement utilisé - Ubuntu 20.10 CurrentSession on sda2

============================ Architecture/Host Info ============================

CPU architecture: 64-bit
BOOT_IMAGE of the installed session in use:
/boot/vmlinuz-5.8.0-33-generic root=UUID=7e8fa5a1-1858-4cb7-9efa-541a7a65743d ro quiet splash vt.handoff=7


===================================== UEFI =====================================

BIOS is EFI-compatible, and is setup in EFI-mode for this installed-session.

efibootmgr -v
BootCurrent: 0004
BootOrder: 0004,0001,0000,0002,0003
Boot0000* EFI DVD/CDROM	PciRoot(0x0)/Pci(0xd,0x0)/Sata(1,0,0)
Boot0001* EFI Hard Drive	PciRoot(0x0)/Pci(0xd,0x0)/Sata(0,0,0)
Boot0002* EFI Hard Drive 1	PciRoot(0x0)/Pci(0xd,0x0)/Sata(2,0,0)
Boot0003* EFI Internal Shell	MemoryMapped(11,0x2100000,0x28fffff)/FvFile(7c04a583-9e3e-4f1c-ad65-e05268d0b4d1)
Boot0004* ubuntu	HD(1,GPT,20408d85-e14e-4140-b8b1-1ad25d5b03a0,0x800,0x100000)/File(\EFI\ubuntu\shimx64.efi)

2895d47544fd587b26c7e29be1295c27   sda1/BOOT/fbx64.efi
dc3c47be2f78a78e5e57d097ae6c5c84   sda1/BOOT/mmx64.efi
951288adcc81d2d86508f3f18d9753e0   sda1/ubuntu/grubx64.efi
dc3c47be2f78a78e5e57d097ae6c5c84   sda1/ubuntu/mmx64.efi
78415fb8fb9b909f8029858113f1335f   sda1/ubuntu/shimx64.efi
78415fb8fb9b909f8029858113f1335f   sda1/BOOT/BOOTX64.efi


============================= Drive/Partition Info =============================

Disks info: ____________________________________________________________________

sda	: is-GPT,	no-BIOSboot,	has---ESP, 	not-usb,	not-mmc, has-os,	2048 sectors * 512 bytes
sdb	: notGPT,	no-BIOSboot,	has-noESP, 	not-usb,	not-mmc, no-os,	2048 sectors * 512 bytes

Partitions info (1/3): _________________________________________________________

sda2	: is-os,	64, apt-get,	signed grub-pc grub-efi ,	grub2,	grub-install,	grubenv-ok,	update-grub,	not-far
sda1	: no-os,	32, nopakmgr,	no-docgrub,	nogrub,	nogrubinstall,	no-grubenv,	noupdategrub,	not-far
sdb1	: no-os,	32, nopakmgr,	no-docgrub,	nogrub,	nogrubinstall,	no-grubenv,	noupdategrub,	not-far

Partitions info (2/3): _________________________________________________________

sda2	: isnotESP,	fstab-has-goodEFI,	no-nt,	no-winload,	no-recov-nor-hid,	no-bmgr,	notwinboot
sda1	: is---ESP,	part-has-no-fstab,	no-nt,	no-winload,	no-recov-nor-hid,	no-bmgr,	notwinboot
sdb1	: isnotESP,	part-has-no-fstab,	no-nt,	no-winload,	no-recov-nor-hid,	no-bmgr,	notwinboot

Partitions info (3/3): _________________________________________________________

sda2	: not-sepboot,	with-boot,	fstab-without-boot,	not-sep-usr,	with--usr,	fstab-without-usr,	std-grub.d,	sda
sda1	: not-sepboot,	no-boot,	part-has-no-fstab,	not-sep-usr,	no---usr,	part-has-no-fstab,	std-grub.d,	sda
sdb1	: maybesepboot,	no-boot,	part-has-no-fstab,	not-sep-usr,	no---usr,	part-has-no-fstab,	std-grub.d,	sdb

fdisk -l (filtered): ___________________________________________________________

Disk sda: 32 GiB, 34359738368 bytes, 67108864 sectors
Disk identifier: C667978B-83C7-4166-93FB-96C83A4F54F4
        Start      End  Sectors  Size Type
sda1     2048  1050623  1048576  512M EFI System
sda2  1050624 67106815 66056192 31.5G Linux filesystem
Disk sdb: 20.13 GiB, 21613379584 bytes, 42213632 sectors
Disk identifier: 0x972b5d6e
      Boot Start      End  Sectors  Size Id Type
sdb1        2048 42213375 42211328 20.1G 83 Linux

parted -lm (filtered): _________________________________________________________

sda:34.4GB:scsi:512:512:gpt:ATA VBOX HARDDISK:;
1:1049kB:538MB:537MB:fat32:EFI System Partition:boot, esp;
2:538MB:34.4GB:33.8GB:ext4::;
sdb:21.6GB:scsi:512:512:msdos:ATA VBOX HARDDISK:;
1:1049kB:21.6GB:21.6GB:ext4::;

blkid (filtered): ______________________________________________________________

NAME   FSTYPE   UUID                                 PARTUUID                             LABEL            PARTLABEL
sda                                                                                                        
├─sda1 vfat     9D88-AE6C                            20408d85-e14e-4140-b8b1-1ad25d5b03a0                  EFI System Partition
└─sda2 ext4     7e8fa5a1-1858-4cb7-9efa-541a7a65743d dac2eaba-904f-4227-b6cc-972fd4c6ebd0                  
sdb                                                                                                        
└─sdb1 ext4     b5202220-c509-4fb1-8791-95b709bf3f9e 972b5d6e-01                          clonezilla_image 

df (filtered): _________________________________________________________________

       Avail Use% Mounted on
sda2    21.8G  24% /
sdb1     3.3G  78% /mnt/boot-sav/sdb1

Mount options: __________________________________________________________________

sda2   rw,relatime,errors=remount-ro
sdb1   rw,relatime

===================== sda1/efi/ubuntu/grub.cfg (filtered) ======================

search.fs_uuid 7e8fa5a1-1858-4cb7-9efa-541a7a65743d root hd0,gpt2 
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg

====================== sda2/boot/grub/grub.cfg (filtered) ======================

Ubuntu   7e8fa5a1-1858-4cb7-9efa-541a7a65743d
Ubuntu, avec Linux 5.8.0-33-generic   7e8fa5a1-1858-4cb7-9efa-541a7a65743d
Ubuntu, avec Linux 5.8.0-25-generic   7e8fa5a1-1858-4cb7-9efa-541a7a65743d
### END /etc/grub.d/30_os-prober ###
UEFI Firmware Settings   uefi-firmware
### END /etc/grub.d/30_uefi-firmware ###

========================== sda2/etc/fstab (filtered) ===========================

# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda2 during installation
UUID=7e8fa5a1-1858-4cb7-9efa-541a7a65743d /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
UUID=9D88-AE6C  /boot/efi       vfat    umask=0077      0       1
/swapfile                                 none            swap    sw              0       0

======================= sda2/etc/default/grub (filtered) =======================

GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=menu
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

==================== sda2: Location of files loaded by Grub ====================

           GiB - GB             File                                 Fragment(s)
  10,735347748 = 11,526991872   boot/grub/grub.cfg                             1
   7,412185669 = 7,958773760    boot/vmlinuz                                   1
   5,240306854 = 5,626736640    boot/vmlinuz-5.8.0-25-generic                  1
   7,412185669 = 7,958773760    boot/vmlinuz-5.8.0-33-generic                  1
   5,240306854 = 5,626736640    boot/vmlinuz.old                               1
  27,086582184 = 29,083996160   boot/initrd.img                                2
  27,026035309 = 29,018984448   boot/initrd.img-5.8.0-25-generic               1
  27,086582184 = 29,083996160   boot/initrd.img-5.8.0-33-generic               2
  27,026035309 = 29,018984448   boot/initrd.img.old                            1

===================== sda2: ls -l /etc/grub.d/ (filtered) ======================

-rwxr-xr-x 1 root root 17622 oct.   1 16:59 10_linux
-rwxr-xr-x 1 root root 42359 oct.   1 16:59 10_linux_zfs
-rwxr-xr-x 1 root root 12894 oct.   1 16:59 20_linux_xen
-rwxr-xr-x 1 root root 12059 oct.   1 16:59 30_os-prober
-rwxr-xr-x 1 root root  1424 oct.   1 16:59 30_uefi-firmware
-rwxr-xr-x 1 root root   214 oct.   1 16:59 40_custom
-rwxr-xr-x 1 root root   216 oct.   1 16:59 41_custom


Suggested repair: ______________________________________________________________

The default repair of the Boot-Repair utility would reinstall the grub-efi-amd64-signed of
sda2,
using the following options:        sda1/boot/efi,
Additional repair would be performed: unhide-bootmenu-10s  use-standard-efi-file    

Final advice in case of suggested repair: ______________________________________


Please do not forget to make your UEFI firmware boot on the L'OS actuellement utilisé - Ubuntu 20.10 CurrentSession entry (sda1/efi/****/shim****.efi (**** will be updated in the final message) file) !

2) Remplacement du BOOTX64.EFI d'origine par grubx64.efi renommé BOOTX64.EFI

L'opération se fait depuis une session du Ubuntu 20.10 installé. Je détaille ci-dessous toutes les commandes passées dans un terminal.

Examen du contenu de "BOOT" pour y vérifier la présence du fichier "BOOTX64.EFI" :

sudo dir /boot/efi/EFI/BOOT
BOOTX64.EFI  fbx64.efi	mmx64.efi

Renommage du fichier "BOOTX64.EFI" en "BOOTX64_EFI" afin qu'il ne soit plus reconnu par Ubuntu :

sudo mv /boot/efi/EFI/BOOT/BOOTX64.EFI /boot/efi/EFI/BOOT/BOOTX64_EFI

Examen du contenu de "ubuntu" pour y vérifier la présence de grubx64.efi :

sudo dir /boot/efi/EFI/ubuntu
BOOTX64.CSV  grub.cfg  grubx64.efi  mmx64.efi  shimx64.efi

Déplacement et renommage (en "BOOTX64.EFI") du fichier grubx64.efi :

sudo mv /boot/efi/EFI/ubuntu/grubx64.efi /boot/efi/EFI/BOOT/BOOTX64.EFI

Vérif du contenu de "BOOT" après cette manip :

sudo dir /boot/efi/EFI/BOOT
BOOTX64.EFI  BOOTX64_EFI  fbx64.efi  mmx64.efi

On y voit BOOTX64.EFI qui est en fait le fichier grubx64.efi "déguisé" en fichier  BOOTX64.EFI
Et on y voit BOOTX64_EFI qui est le fichier d'origine qui a été renommé pour qu'il ne soit plus pris en compte.


3) ETAT FINAL :

boot-info-4ppa125                                              [20201229_1857]

============================== Boot Info Summary ===============================

 => No boot loader is installed in the MBR of /dev/sda.
 => libparted MBR boot code is installed in the MBR of /dev/sdb.

sda1: __________________________________________________________________________

    File system:       vfat
    Boot sector type:  FAT32
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        /efi/BOOT/fbx64.efi /efi/BOOT/mmx64.efi 
                       /efi/ubuntu/mmx64.efi /efi/ubuntu/shimx64.efi 
                       /efi/ubuntu/grub.cfg

sda2: __________________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info: 
    Operating System:  Ubuntu 20.10
    Boot files:        /boot/grub/grub.cfg /etc/fstab /etc/default/grub

sdb1: __________________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info: 
    Operating System:  
    Boot files:        


================================ 1 OS detected =================================

OS#1:   L'OS actuellement utilisé - Ubuntu 20.10 CurrentSession on sda2

============================ Architecture/Host Info ============================

CPU architecture: 64-bit
BOOT_IMAGE of the installed session in use:
/boot/vmlinuz-5.8.0-33-generic root=UUID=7e8fa5a1-1858-4cb7-9efa-541a7a65743d ro quiet splash vt.handoff=7


===================================== UEFI =====================================

BIOS is EFI-compatible, and is setup in EFI-mode for this installed-session.

efibootmgr -v
BootCurrent: 0001
BootOrder: 0000,0001,0002,0003
Boot0000* EFI DVD/CDROM	PciRoot(0x0)/Pci(0xd,0x0)/Sata(1,0,0)
Boot0001* EFI Hard Drive	PciRoot(0x0)/Pci(0xd,0x0)/Sata(0,0,0)
Boot0002* EFI Hard Drive 1	PciRoot(0x0)/Pci(0xd,0x0)/Sata(2,0,0)
Boot0003* EFI Internal Shell	MemoryMapped(11,0x2100000,0x28fffff)/FvFile(7c04a583-9e3e-4f1c-ad65-e05268d0b4d1)

2895d47544fd587b26c7e29be1295c27   sda1/BOOT/fbx64.efi
dc3c47be2f78a78e5e57d097ae6c5c84   sda1/BOOT/mmx64.efi
dc3c47be2f78a78e5e57d097ae6c5c84   sda1/ubuntu/mmx64.efi
78415fb8fb9b909f8029858113f1335f   sda1/ubuntu/shimx64.efi
951288adcc81d2d86508f3f18d9753e0   sda1/BOOT/BOOTX64.efi


============================= Drive/Partition Info =============================

Disks info: ____________________________________________________________________

sda	: is-GPT,	no-BIOSboot,	has---ESP, 	not-usb,	not-mmc, has-os,	2048 sectors * 512 bytes
sdb	: notGPT,	no-BIOSboot,	has-noESP, 	not-usb,	not-mmc, no-os,	2048 sectors * 512 bytes

Partitions info (1/3): _________________________________________________________

sda2	: is-os,	64, apt-get,	signed grub-pc grub-efi ,	grub2,	grub-install,	grubenv-ok,	update-grub,	not-far
sda1	: no-os,	32, nopakmgr,	no-docgrub,	nogrub,	nogrubinstall,	no-grubenv,	noupdategrub,	not-far
sdb1	: no-os,	32, nopakmgr,	no-docgrub,	nogrub,	nogrubinstall,	no-grubenv,	noupdategrub,	not-far

Partitions info (2/3): _________________________________________________________

sda2	: isnotESP,	fstab-has-goodEFI,	no-nt,	no-winload,	no-recov-nor-hid,	no-bmgr,	notwinboot
sda1	: is---ESP,	part-has-no-fstab,	no-nt,	no-winload,	no-recov-nor-hid,	no-bmgr,	notwinboot
sdb1	: isnotESP,	part-has-no-fstab,	no-nt,	no-winload,	no-recov-nor-hid,	no-bmgr,	notwinboot

Partitions info (3/3): _________________________________________________________

sda2	: not-sepboot,	with-boot,	fstab-without-boot,	not-sep-usr,	with--usr,	fstab-without-usr,	std-grub.d,	sda
sda1	: not-sepboot,	no-boot,	part-has-no-fstab,	not-sep-usr,	no---usr,	part-has-no-fstab,	std-grub.d,	sda
sdb1	: maybesepboot,	no-boot,	part-has-no-fstab,	not-sep-usr,	no---usr,	part-has-no-fstab,	std-grub.d,	sdb

fdisk -l (filtered): ___________________________________________________________

Disk sda: 32 GiB, 34359738368 bytes, 67108864 sectors
Disk identifier: C667978B-83C7-4166-93FB-96C83A4F54F4
        Start      End  Sectors  Size Type
sda1     2048  1050623  1048576  512M EFI System
sda2  1050624 67106815 66056192 31.5G Linux filesystem
Disk sdb: 20.13 GiB, 21613379584 bytes, 42213632 sectors
Disk identifier: 0x972b5d6e
      Boot Start      End  Sectors  Size Id Type
sdb1        2048 42213375 42211328 20.1G 83 Linux

parted -lm (filtered): _________________________________________________________

sda:34.4GB:scsi:512:512:gpt:ATA VBOX HARDDISK:;
1:1049kB:538MB:537MB:fat32:EFI System Partition:boot, esp;
2:538MB:34.4GB:33.8GB:ext4::;
sdb:21.6GB:scsi:512:512:msdos:ATA VBOX HARDDISK:;
1:1049kB:21.6GB:21.6GB:ext4::;

blkid (filtered): ______________________________________________________________

NAME   FSTYPE   UUID                                 PARTUUID                             LABEL            PARTLABEL
sda                                                                                                        
├─sda1 vfat     9D88-AE6C                            20408d85-e14e-4140-b8b1-1ad25d5b03a0                  EFI System Partition
└─sda2 ext4     7e8fa5a1-1858-4cb7-9efa-541a7a65743d dac2eaba-904f-4227-b6cc-972fd4c6ebd0                  
sdb                                                                                                        
└─sdb1 ext4     b5202220-c509-4fb1-8791-95b709bf3f9e 972b5d6e-01                          clonezilla_image 

df (filtered): _________________________________________________________________

       Avail Use% Mounted on
sda2    21.6G  25% /
sdb1   454.6M  93% /mnt/boot-sav/sdb1

Mount options: __________________________________________________________________

sda2   rw,relatime,errors=remount-ro
sdb1   rw,relatime

===================== sda1/efi/ubuntu/grub.cfg (filtered) ======================

search.fs_uuid 7e8fa5a1-1858-4cb7-9efa-541a7a65743d root hd0,gpt2 
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg

====================== sda2/boot/grub/grub.cfg (filtered) ======================

Ubuntu   7e8fa5a1-1858-4cb7-9efa-541a7a65743d
Ubuntu, avec Linux 5.8.0-33-generic   7e8fa5a1-1858-4cb7-9efa-541a7a65743d
Ubuntu, avec Linux 5.8.0-25-generic   7e8fa5a1-1858-4cb7-9efa-541a7a65743d
### END /etc/grub.d/30_os-prober ###
UEFI Firmware Settings   uefi-firmware
### END /etc/grub.d/30_uefi-firmware ###

========================== sda2/etc/fstab (filtered) ===========================

# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda2 during installation
UUID=7e8fa5a1-1858-4cb7-9efa-541a7a65743d /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
UUID=9D88-AE6C  /boot/efi       vfat    umask=0077      0       1
/swapfile                                 none            swap    sw              0       0

======================= sda2/etc/default/grub (filtered) =======================

GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=menu
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

==================== sda2: Location of files loaded by Grub ====================

           GiB - GB             File                                 Fragment(s)
  10,735347748 = 11,526991872   boot/grub/grub.cfg                             1
   7,412185669 = 7,958773760    boot/vmlinuz                                   1
   5,240306854 = 5,626736640    boot/vmlinuz-5.8.0-25-generic                  1
   7,412185669 = 7,958773760    boot/vmlinuz-5.8.0-33-generic                  1
   5,240306854 = 5,626736640    boot/vmlinuz.old                               1
  27,086582184 = 29,083996160   boot/initrd.img                                2
  27,026035309 = 29,018984448   boot/initrd.img-5.8.0-25-generic               1
  27,086582184 = 29,083996160   boot/initrd.img-5.8.0-33-generic               2
  27,026035309 = 29,018984448   boot/initrd.img.old                            1

===================== sda2: ls -l /etc/grub.d/ (filtered) ======================

-rwxr-xr-x 1 root root 17622 oct.   1 16:59 10_linux
-rwxr-xr-x 1 root root 42359 oct.   1 16:59 10_linux_zfs
-rwxr-xr-x 1 root root 12894 oct.   1 16:59 20_linux_xen
-rwxr-xr-x 1 root root 12059 oct.   1 16:59 30_os-prober
-rwxr-xr-x 1 root root  1424 oct.   1 16:59 30_uefi-firmware
-rwxr-xr-x 1 root root   214 oct.   1 16:59 40_custom
-rwxr-xr-x 1 root root   216 oct.   1 16:59 41_custom


Suggested repair: ______________________________________________________________

The default repair of the Boot-Repair utility would reinstall the grub-efi-amd64-signed of
sda2,
using the following options:        sda1/boot/efi,
Additional repair would be performed: unhide-bootmenu-10s  use-standard-efi-file    

Final advice in case of suggested repair: ______________________________________


Please do not forget to make your UEFI firmware boot on the L'OS actuellement utilisé - Ubuntu 20.10 CurrentSession entry (sda1/efi/****/shim****.efi (**** will be updated in the final message) file) !

Dans la partie "UEFI" du Boot-info, "BootCurrent: 0001" indique que le démarrage se fait sur l'entrée 0001 du menu UEFI
et l'entrée correspondante "Boot0001* EFI Hard Drive" indique qu'il s'agit de l'entrée EFI Hard Drive, celle qui pointe sur le chargeur d'amorçage BOOTX64.efi
D'autre part, la ligne suivante :

951288adcc81d2d86508f3f18d9753e0   sda1/BOOT/BOOTX64.efi

montre que le fichier BOOTX64.efi dont le md5sum est 951288adcc81d2d86508f3f18d9753e0 est bien le fichier grubx64.efi qui a été renommé "BOOTX64.efi"
Il faut noter également que j'ai supprimé l'entrée "Boot0004* ubuntu" - qu'on peut voir dans l'ETAT de DEPART - pour bien montrer qu'il n'y a pas création automatique de cette entrée lors du démarrage.

Dernière modification par malbo (Le 04/03/2021, à 08:40)

Hors ligne

#2 Le 30/12/2020, à 09:40

malbo

Re : [Résolu] démarrage verrouillé sur EFI Hard Drive

Dans ce post, je vais montrer que la solution du post #1 n'est pas pérenne. Elle ne résiste pas à la commande d'installation de Grub ("sudo grub-install"). Dans le cas présent, je passe volontairement cette commande mais je pense qu'elle peut se produire automatiquement lors de certaines mises à jour du paquet grub.
Je colle ci-dessous la suite des commandes avec au départ un état des lieux de l'UEFI, puis la commande "sudo grub-install" et enfin l'état de l'UEFI après cette commande :

malbo@malbo-desktop:~$ efibootmgr -v
BootCurrent: 0001
BootOrder: 0000,0001,0002,0003
Boot0000* EFI DVD/CDROM	PciRoot(0x0)/Pci(0xd,0x0)/Sata(1,0,0)
Boot0001* EFI Hard Drive	PciRoot(0x0)/Pci(0xd,0x0)/Sata(0,0,0)
Boot0002* EFI Hard Drive 1	PciRoot(0x0)/Pci(0xd,0x0)/Sata(2,0,0)
Boot0003* EFI Internal Shell	MemoryMapped(11,0x2100000,0x28fffff)/FvFile(7c04a583-9e3e-4f1c-ad65-e05268d0b4d1)
malbo@malbo-desktop:~$ sudo grub-install
[sudo] Mot de passe de malbo : 
Installation pour la plate-forme x86_64-efi.
Installation terminée, sans erreur.
malbo@malbo-desktop:~$ efibootmgr -v
BootCurrent: 0001
BootOrder: 0004,0000,0001,0002,0003
Boot0000* EFI DVD/CDROM	PciRoot(0x0)/Pci(0xd,0x0)/Sata(1,0,0)
Boot0001* EFI Hard Drive	PciRoot(0x0)/Pci(0xd,0x0)/Sata(0,0,0)
Boot0002* EFI Hard Drive 1	PciRoot(0x0)/Pci(0xd,0x0)/Sata(2,0,0)
Boot0003* EFI Internal Shell	MemoryMapped(11,0x2100000,0x28fffff)/FvFile(7c04a583-9e3e-4f1c-ad65-e05268d0b4d1)
Boot0004* ubuntu	HD(1,GPT,20408d85-e14e-4140-b8b1-1ad25d5b03a0,0x800,0x100000)/File(\EFI\ubuntu\shimx64.efi)
malbo@malbo-desktop:~$ 

Je redémarre et je fais un Boot-info afin de le comparer avec le Boot-info de la partie "ÉTAT DE DÉPART" du post #1 :

boot-info-4ppa125                                              [20201230_0741]

============================== Boot Info Summary ===============================

 => No boot loader is installed in the MBR of /dev/sda.
 => libparted MBR boot code is installed in the MBR of /dev/sdb.

sda1: __________________________________________________________________________

    File system:       vfat
    Boot sector type:  FAT32
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        /efi/BOOT/fbx64.efi /efi/BOOT/mmx64.efi 
                       /efi/ubuntu/grubx64.efi /efi/ubuntu/mmx64.efi 
                       /efi/ubuntu/shimx64.efi /efi/ubuntu/grub.cfg

sda2: __________________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info: 
    Operating System:  Ubuntu 20.10
    Boot files:        /boot/grub/grub.cfg /etc/fstab /etc/default/grub

sdb1: __________________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info: 
    Operating System:  
    Boot files:        


================================ 1 OS detected =================================

OS#1:   L'OS actuellement utilisé - Ubuntu 20.10 CurrentSession on sda2

============================ Architecture/Host Info ============================

CPU architecture: 64-bit
BOOT_IMAGE of the installed session in use:
/boot/vmlinuz-5.8.0-33-generic root=UUID=7e8fa5a1-1858-4cb7-9efa-541a7a65743d ro quiet splash vt.handoff=7


===================================== UEFI =====================================

BIOS is EFI-compatible, and is setup in EFI-mode for this installed-session.

efibootmgr -v
BootCurrent: 0004
BootOrder: 0004,0000,0001,0002,0003
Boot0000* EFI DVD/CDROM	PciRoot(0x0)/Pci(0xd,0x0)/Sata(1,0,0)
Boot0001* EFI Hard Drive	PciRoot(0x0)/Pci(0xd,0x0)/Sata(0,0,0)
Boot0002* EFI Hard Drive 1	PciRoot(0x0)/Pci(0xd,0x0)/Sata(2,0,0)
Boot0003* EFI Internal Shell	MemoryMapped(11,0x2100000,0x28fffff)/FvFile(7c04a583-9e3e-4f1c-ad65-e05268d0b4d1)
Boot0004* ubuntu	HD(1,GPT,20408d85-e14e-4140-b8b1-1ad25d5b03a0,0x800,0x100000)/File(\EFI\ubuntu\shimx64.efi)

2895d47544fd587b26c7e29be1295c27   sda1/BOOT/fbx64.efi
dc3c47be2f78a78e5e57d097ae6c5c84   sda1/BOOT/mmx64.efi
951288adcc81d2d86508f3f18d9753e0   sda1/ubuntu/grubx64.efi
dc3c47be2f78a78e5e57d097ae6c5c84   sda1/ubuntu/mmx64.efi
78415fb8fb9b909f8029858113f1335f   sda1/ubuntu/shimx64.efi
78415fb8fb9b909f8029858113f1335f   sda1/BOOT/BOOTX64.efi


============================= Drive/Partition Info =============================

Disks info: ____________________________________________________________________

sda	: is-GPT,	no-BIOSboot,	has---ESP, 	not-usb,	not-mmc, has-os,	2048 sectors * 512 bytes
sdb	: notGPT,	no-BIOSboot,	has-noESP, 	not-usb,	not-mmc, no-os,	2048 sectors * 512 bytes

Partitions info (1/3): _________________________________________________________

sda2	: is-os,	64, apt-get,	signed grub-pc grub-efi ,	grub2,	grub-install,	grubenv-ok,	update-grub,	not-far
sda1	: no-os,	32, nopakmgr,	no-docgrub,	nogrub,	nogrubinstall,	no-grubenv,	noupdategrub,	not-far
sdb1	: no-os,	32, nopakmgr,	no-docgrub,	nogrub,	nogrubinstall,	no-grubenv,	noupdategrub,	not-far

Partitions info (2/3): _________________________________________________________

sda2	: isnotESP,	fstab-has-goodEFI,	no-nt,	no-winload,	no-recov-nor-hid,	no-bmgr,	notwinboot
sda1	: is---ESP,	part-has-no-fstab,	no-nt,	no-winload,	no-recov-nor-hid,	no-bmgr,	notwinboot
sdb1	: isnotESP,	part-has-no-fstab,	no-nt,	no-winload,	no-recov-nor-hid,	no-bmgr,	notwinboot

Partitions info (3/3): _________________________________________________________

sda2	: not-sepboot,	with-boot,	fstab-without-boot,	not-sep-usr,	with--usr,	fstab-without-usr,	std-grub.d,	sda
sda1	: not-sepboot,	no-boot,	part-has-no-fstab,	not-sep-usr,	no---usr,	part-has-no-fstab,	std-grub.d,	sda
sdb1	: maybesepboot,	no-boot,	part-has-no-fstab,	not-sep-usr,	no---usr,	part-has-no-fstab,	std-grub.d,	sdb

fdisk -l (filtered): ___________________________________________________________

Disk sda: 32 GiB, 34359738368 bytes, 67108864 sectors
Disk identifier: C667978B-83C7-4166-93FB-96C83A4F54F4
        Start      End  Sectors  Size Type
sda1     2048  1050623  1048576  512M EFI System
sda2  1050624 67106815 66056192 31.5G Linux filesystem
Disk sdb: 20.13 GiB, 21613379584 bytes, 42213632 sectors
Disk identifier: 0x972b5d6e
      Boot Start      End  Sectors  Size Id Type
sdb1        2048 42213375 42211328 20.1G 83 Linux

parted -lm (filtered): _________________________________________________________

sda:34.4GB:scsi:512:512:gpt:ATA VBOX HARDDISK:;
1:1049kB:538MB:537MB:fat32:EFI System Partition:boot, esp;
2:538MB:34.4GB:33.8GB:ext4::;
sdb:21.6GB:scsi:512:512:msdos:ATA VBOX HARDDISK:;
1:1049kB:21.6GB:21.6GB:ext4::;

blkid (filtered): ______________________________________________________________

NAME   FSTYPE   UUID                                 PARTUUID                             LABEL            PARTLABEL
sda                                                                                                        
├─sda1 vfat     9D88-AE6C                            20408d85-e14e-4140-b8b1-1ad25d5b03a0                  EFI System Partition
└─sda2 ext4     7e8fa5a1-1858-4cb7-9efa-541a7a65743d dac2eaba-904f-4227-b6cc-972fd4c6ebd0                  
sdb                                                                                                        
└─sdb1 ext4     b5202220-c509-4fb1-8791-95b709bf3f9e 972b5d6e-01                          clonezilla_image 

df (filtered): _________________________________________________________________

       Avail Use% Mounted on
sda2    21.5G  25% /
sdb1   454.6M  93% /mnt/boot-sav/sdb1

Mount options: __________________________________________________________________

sda2   rw,relatime,errors=remount-ro
sdb1   rw,relatime

===================== sda1/efi/ubuntu/grub.cfg (filtered) ======================

search.fs_uuid 7e8fa5a1-1858-4cb7-9efa-541a7a65743d root hd0,gpt2 
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg

====================== sda2/boot/grub/grub.cfg (filtered) ======================

Ubuntu   7e8fa5a1-1858-4cb7-9efa-541a7a65743d
Ubuntu, avec Linux 5.8.0-33-generic   7e8fa5a1-1858-4cb7-9efa-541a7a65743d
Ubuntu, avec Linux 5.8.0-25-generic   7e8fa5a1-1858-4cb7-9efa-541a7a65743d
### END /etc/grub.d/30_os-prober ###
UEFI Firmware Settings   uefi-firmware
### END /etc/grub.d/30_uefi-firmware ###

========================== sda2/etc/fstab (filtered) ===========================

# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda2 during installation
UUID=7e8fa5a1-1858-4cb7-9efa-541a7a65743d /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
UUID=9D88-AE6C  /boot/efi       vfat    umask=0077      0       1
/swapfile                                 none            swap    sw              0       0

======================= sda2/etc/default/grub (filtered) =======================

GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=menu
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

==================== sda2: Location of files loaded by Grub ====================

           GiB - GB             File                                 Fragment(s)
  10,735347748 = 11,526991872   boot/grub/grub.cfg                             1
   7,412185669 = 7,958773760    boot/vmlinuz                                   1
   5,240306854 = 5,626736640    boot/vmlinuz-5.8.0-25-generic                  1
   7,412185669 = 7,958773760    boot/vmlinuz-5.8.0-33-generic                  1
   5,240306854 = 5,626736640    boot/vmlinuz.old                               1
  27,086582184 = 29,083996160   boot/initrd.img                                2
  27,026035309 = 29,018984448   boot/initrd.img-5.8.0-25-generic               1
  27,086582184 = 29,083996160   boot/initrd.img-5.8.0-33-generic               2
  27,026035309 = 29,018984448   boot/initrd.img.old                            1

===================== sda2: ls -l /etc/grub.d/ (filtered) ======================

-rwxr-xr-x 1 root root 17622 oct.   1 16:59 10_linux
-rwxr-xr-x 1 root root 42359 oct.   1 16:59 10_linux_zfs
-rwxr-xr-x 1 root root 12894 oct.   1 16:59 20_linux_xen
-rwxr-xr-x 1 root root 12059 oct.   1 16:59 30_os-prober
-rwxr-xr-x 1 root root  1424 oct.   1 16:59 30_uefi-firmware
-rwxr-xr-x 1 root root   214 oct.   1 16:59 40_custom
-rwxr-xr-x 1 root root   216 oct.   1 16:59 41_custom


Suggested repair: ______________________________________________________________

The default repair of the Boot-Repair utility would reinstall the grub-efi-amd64-signed of
sda2,
using the following options:        sda1/boot/efi,
Additional repair would be performed: unhide-bootmenu-10s  use-standard-efi-file    

Final advice in case of suggested repair: ______________________________________


Please do not forget to make your UEFI firmware boot on the L'OS actuellement utilisé - Ubuntu 20.10 CurrentSession entry (sda1/efi/****/shim****.efi (**** will be updated in the final message) file) !

A part une petite différence dans la ligne "BootOrder", tout semble revenu à l'état initial, la "solution" a été complètement déconstruite. Dans la cas réel, il faudrait recommencer la procédure que j'ai détaillée dans le post #1 (Remplacement du BOOTX64.EFI d'origine par grubx64.efi renommé BOOTX64.EFI)

Dernière modification par malbo (Le 30/12/2020, à 10:00)

Hors ligne

#3 Le 30/12/2020, à 09:55

ikewdu

Re : [Résolu] démarrage verrouillé sur EFI Hard Drive

Salut,

Une question par rapport à tout cela. Comment as-tu obtenu la situation suivante dans le premier rapport :

efibootmgr -v
BootCurrent: 0004
BootOrder: 0004,0001,0000,0002,0003
Boot0000* EFI DVD/CDROM	PciRoot(0x0)/Pci(0xd,0x0)/Sata(1,0,0)
Boot0001* EFI Hard Drive	PciRoot(0x0)/Pci(0xd,0x0)/Sata(0,0,0)
Boot0002* EFI Hard Drive 1	PciRoot(0x0)/Pci(0xd,0x0)/Sata(2,0,0)
Boot0003* EFI Internal Shell	MemoryMapped(11,0x2100000,0x28fffff)/FvFile(7c04a583-9e3e-4f1c-ad65-e05268d0b4d1)
Boot0004* ubuntu	HD(1,GPT,20408d85-e14e-4140-b8b1-1ad25d5b03a0,0x800,0x100000)/File(\EFI\ubuntu\shimx64.efi)

Cela simule un PC verrouillé sur "EFI hard drive". Est-ce "automatique" à l'installation d'Ubuntu 20.10 ?

Hors ligne

#4 Le 30/12/2020, à 10:09

malbo

Re : [Résolu] démarrage verrouillé sur EFI Hard Drive

Bonjour ikewdu,
Non, ce que tu as collé dans ton post, ça ne simule pas un PC verrouillé sur "EFI hard drive" : c'est l'état normal après installation de Ubuntu 20.10 avec le choix "Effacer le disque et installer Ubuntu" à l'étape "Type d'installation". On y voit la ligne "BootCurrent: 0004" qui indique que le démarrage s'est fait sur l'entrée "Boot0004* ubuntu". Si le démarrage était verrouillé sur "EFI hard drive", on aurait dû trouver "BootCurrent: 0001"

Hors ligne

#5 Le 30/12/2020, à 11:59

ikewdu

Re : [Résolu] démarrage verrouillé sur EFI Hard Drive

OK. C'était pour avoir confirmation.

Hors ligne

#6 Le 30/12/2020, à 14:14

geole

Re : [Résolu] démarrage verrouillé sur EFI Hard Drive

malbo a écrit :

1) ÉTAT DE DÉPART : installation toute neuve de Ubuntu 20.10 depuis laquelle je fais ce Boot-info :
Ne pas tenir compte de la présence de sdb ni de sdb1 : tout se passe dans sda

boot-info-4ppa125                                              [20201229_1744]
.....
==================================== UEFI =====================================
BIOS is EFI-compatible, and is setup in EFI-mode for this installed-session.
2895d47544fd587b26c7e29be1295c27   sda1/BOOT/fbx64.efi
dc3c47be2f78a78e5e57d097ae6c5c84   sda1/BOOT/mmx64.efi
951288adcc81d2d86508f3f18d9753e0   sda1/ubuntu/grubx64.efi
dc3c47be2f78a78e5e57d097ae6c5c84   sda1/ubuntu/mmx64.efi
78415fb8fb9b909f8029858113f1335f   sda1/ubuntu/shimx64.efi
78415fb8fb9b909f8029858113f1335f   sda1/BOOT/BOOTX64.efi

On y voit que le fichier standard de boot a été remplacé  lors de l'installation par le fichier SHIMX64.EFI    alors que souvent le  fichier grubx64.EFi est suffisant lorsque le mode secure n'est pas activé


Les grilles de l'installateur https://doc.ubuntu-fr.org/tutoriel/inst … _subiquity
"gedit admin:///etc/fstab" est proscrit,  utilisez "pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY xdg-open /etc/fstab" Voir  https://doc.ubuntu-fr.org/gedit
Les partitions EXT4 des disques externes => https://forum.ubuntu-fr.org/viewtopic.p … #p22697248

Hors ligne

#7 Le 30/12/2020, à 14:23

malbo

Re : [Résolu] démarrage verrouillé sur EFI Hard Drive

geole a écrit :

On y voit que le fichier standard de boot a été remplacé  lors de l'installation par le fichier SHIMX64.EFI

Bonjour geole,
Tu as raison de le faire remarquer. Mais on est bien d'accord que c'est l'installateur de Ubuntu qui fait ça. C'est déjà le cas pour Ubuntu 20.04 comme on peut voir dans ce post : https://forum.ubuntu-fr.org/viewtopic.p … #p22394810
on y voit :

78415fb8fb9b909f8029858113f1335f   sda1/ubuntu/shimx64.efi
78415fb8fb9b909f8029858113f1335f   sda1/BOOT/BOOTX64.efi

Hors ligne