Pages : 1
#1 Le 31/12/2023, à 12:07
- RICO21
Problème de boot
Bonjour et joyeuses fetes
J'ai monté Kubuntu leger
Je voudrai monter Ubuntu
mais depuis la première instalation je n'ai plus acces ni au cd, ni aux port USB
alors que je les retrouve monté dans kubuntu
Si joint boot info
Veuillez écrire sur un papier l'URL suivante :
https://paste.ubuntu.com/p/JYWbsK65QD/
Je vous remercie par avance
cordialement
Didier (modéré)
Dernière modification par Nuliel (Le 31/12/2023, à 12:20)
Hors ligne
#2 Le 31/12/2023, à 12:11
- xubu1957
Re : Problème de boot
Bonjour,
Collage du Boot-info, pour les spécialistes :
boot-info-4ppa2075 [20231231_1048]
============================== Boot Info Summary ===============================
=> Grub2 (v2.00) is installed in the MBR of /dev/sda and looks at sector 1 of
the same hard drive for core.img. core.img is at this location and looks
for (,msdos6)/boot/grub. It also embeds following components:
modules
---------------------------------------------------------------------------
fshelp ext2 part_msdos biosdisk
---------------------------------------------------------------------------
=> Grub2 (v2.00) is installed in the MBR of /dev/sdc and looks at sector 1 of
the same hard drive for core.img. core.img is at this location and looks
for (hd0,msdos1)/boot/grub. It also embeds following components:
modules
---------------------------------------------------------------------------
biosdisk fshelp fat exfat ext2 ntfs ntfscomp part_msdos
---------------------------------------------------------------------------
sda1: __________________________________________________________________________
File system: vfat
Boot sector type: FAT32
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files:
sda2: __________________________________________________________________________
File system: Extended Partition
Boot sector type: Unknown
Boot sector info:
sda5: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 22.04.3 LTS
Boot files: /boot/grub/grub.cfg /etc/fstab /etc/default/grub
sda6: __________________________________________________________________________
File system: ext3
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 22.04.3 LTS
Boot files: /boot/grub/grub.cfg /etc/fstab /etc/default/grub
/boot/grub/i386-pc/core.img
sda7: __________________________________________________________________________
File system: vfat
Boot sector type: FAT32
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files:
sda8: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 22.04.3 LTS
Boot files: /boot/grub/grub.cfg /etc/fstab /etc/default/grub
/boot/grub/i386-pc/core.img
sdc1: __________________________________________________________________________
File system: vfat
Boot sector type: MSWIN4.1: FAT32
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files: /boot/grub/grub.cfg /efi/boot/bootx64.efi
/efi/boot/grubx64.efi /efi/boot/mmx64.efi
sdb: ___________________________________________________________________________
File system: iso9660
Boot sector type: Grub2 (v1.99-2.00)
Boot sector info: Grub2 (v1.99-2.00) is installed in the boot sector of
sdb and looks at sector 0 of the same hard drive for
core.img, but core.img can not be found at this
location.
Mounting failed: mount: /mnt/BootInfo/FD/sdb: /dev/sdb déjà monté ou point de montage actif.
================================ 3 OS detected =================================
OS#1: L'OS actuellement utilisé - Ubuntu 22.04.3 LTS on sda6
OS#2: Ubuntu 22.04.3 LTS on sda5
OS#3: Ubuntu 22.04.3 LTS on sda8
================================ Host/Hardware =================================
CPU architecture: 64-bit
Video: 2nd Generation Core Processor Family Integrated Graphics Controller from Intel Corporation
BOOT_IMAGE of the installed session in use:
/boot/vmlinuz-5.15.0-91-generic root=/dev/sda6 ro quiet splash vt.handoff=7
df -Th / : /dev/sda6 ext3 430G 24G 384G 6% /
===================================== UEFI =====================================
BIOS/UEFI firmware: 03OV(0.1) from SAMSUNG ELECTRONICS CO.,LTD
This installed-session is in Legacy/BIOS/CSM mode (not in EFI mode).
64349b3622c65f495a99dbf6102496e3 sdc1/boot/bootx64.efi
dbb73486aa1fffa648f99f31f209f545 sdc1/boot/grubx64.efi
a660182adef313615746a665966d2ccc sdc1/boot/mmx64.efi
============================= Drive/Partition Info =============================
Disks info: ____________________________________________________________________
sda : notGPT, no-BIOSboot, has---ESP, not-usb, not-mmc, has-os, no-wind, 2048 sectors * 512 bytes
sdc : notGPT, no-BIOSboot, has---ESP, liveusb, not-mmc, no-os, no-wind, 2048 sectors * 512 bytes
Partitions info (1/3): _________________________________________________________
sda6 : is-os, 64, apt-get, grub-pc , grub2, grub-install, grubenv-ok, update-grub, end-after-100GB
sdc1 : no-os, 64, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, not-far
sda7 : no-os, 64, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, end-after-100GB
sda5 : is-os, 64, apt-get, signed grub-pc grub-efi , grub2, grub-install, grubenv-ok, update-grub, end-after-100GB
sda1 : no-os, 64, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, not-far
sda8 : is-os, 64, apt-get, grub-pc , grub2, grub-install, grubenv-ok, update-grub, end-after-100GB
Partitions info (2/3): _________________________________________________________
sda6 : isnotESP, fstab-without-efi, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
sdc1 : is---ESP, part-has-no-fstab, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
sda7 : isnotESP, part-has-no-fstab, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
sda5 : isnotESP, fstab-without-efi, 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
sda8 : isnotESP, fstab-has-goodEFI, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
Partitions info (3/3): _________________________________________________________
sda6 : not--sepboot, with-boot, fstab-without-boot, not-sep-usr, with--usr, fstab-without-usr, customized, sda
sdc1 : not--sepboot, no-kernel, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, no--grub.d, sdc
sda7 : not--sepboot, no---boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, no--grub.d, sda
sda5 : 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, no--grub.d, sda
sda8 : not--sepboot, with-boot, fstab-without-boot, not-sep-usr, with--usr, fstab-without-usr, customized, sda
fdisk -l (filtered): ___________________________________________________________
Disk sda: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk identifier: 0x5fca773f
Boot Start End Sectors Size Id Type
sda1 * 2048 1050623 1048576 512M ef EFI (FAT-12/16/32)
sda2 1052670 1953523711 1952471042 931G 5 Extended
sda5 1052672 533109222 532056551 253.7G 83 Linux
sda6 1037115392 1953523711 916408320 437G 83 Linux
sda7 533110784 534159359 1048576 512M b W95 FAT32
sda8 534161408 1037113343 502951936 239.8G 83 Linux
Partition table entries are not in disk order.
Disk sdb: 15.03 GiB, 16134438912 bytes, 31512576 sectors
Disk identifier: 7470663F-A222-4F6F-BF34-D8646D4D7AC5
Start End Sectors Size Type
sdb1 64 7309027 7308964 3.5G Microsoft basic data
sdb2 7309028 7319095 10068 4.9M EFI System
sdb3 7319096 7319695 600 300K Microsoft basic data
Disk sdc: 7.5 GiB, 8054112256 bytes, 15730688 sectors
Disk identifier: 0x000f1554
Boot Start End Sectors Size Id Type
sdc1 * 2048 15730687 15728640 7.5G c W95 FAT32 (LBA)
parted -lm (filtered): _________________________________________________________
sda:1000GB:scsi:512:512:msdos:ATA SAMSUNG HD103SJ:;
1:1049kB:538MB:537MB:fat32::boot, esp;
2:539MB:1000GB:1000GB:::;
5:539MB:273GB:272GB:ext4::;
7:273GB:273GB:537MB:fat32::;
8:273GB:531GB:258GB:ext4::;
6:531GB:1000GB:469GB:ext3::;
sdb:16.1GB:scsi:512:512:gpt:Generic STORAGE DEVICE:;
1:32.8kB:3742MB:3742MB::ISO9660:hidden, msftdata;
2:3742MB:3747MB:5155kB::Appended2:boot, esp;
3:3747MB:3748MB:307kB::Gap1:hidden, msftdata;
sdc:8054MB:scsi:512:512:msdos: USB DISK:;
1:1049kB:8054MB:8053MB:fat32::boot, lba;
Free space >10MiB: ______________________________________________________________
sdb: 3574MiB:15387MiB:11813MiB
blkid (filtered): ______________________________________________________________
NAME FSTYPE UUID PARTUUID LABEL PARTLABEL
sda
├─sda1 vfat 66ED-D9A6 5fca773f-01
├─sda2 5fca773f-02
├─sda5 ext4 2b3b889e-3907-42ca-9c4d-69f17f40fff9 5fca773f-05
├─sda6 ext3 c553e607-41ed-4b6c-9b01-e421a747f175 5fca773f-06
├─sda7 vfat 5292-364F 5fca773f-07
└─sda8 ext4 993c5bf5-7126-4218-9190-ca55eebb0214 5fca773f-08
sdb iso9660 2023-08-07-15-56-55-00 Ubuntu-MATE 22.04.3 LTS amd64
├─sdb1 iso9660 2023-08-07-15-56-55-00 7470663f-a222-4f6f-bf35-d8646d4d7ac5 Ubuntu-MATE 22.04.3 LTS amd64 ISO9660
├─sdb2 vfat F7DB-4D56 7470663f-a222-4f6f-bf36-d8646d4d7ac5 ESP Appended2
└─sdb3 7470663f-a222-4f6f-bf37-d8646d4d7ac5 Gap1
sdc
└─sdc1 vfat F06B-A3AB 000f1554-01 UBUNTU-MATE
Mount points (filtered): _______________________________________________________
Avail Use% Mounted on
/dev/sda1 511M 0% /mnt/boot-sav/sda1
/dev/sda5 196.9G 16% /media/rico/2b3b889e-3907-42ca-9c4d-69f17f40fff9
/dev/sda6 383.9G 5% /
/dev/sda7 511M 0% /media/rico/5292-364F
/dev/sda8 140.2G 35% /media/rico/993c5bf5-7126-4218-9190-ca55eebb0214
/dev/sdb1 0 100% /media/rico/Ubuntu-MATE 22.04.3 LTS amd64
/dev/sdc1 4G 47% /media/rico/UBUNTU-MATE
Mount options (filtered): ______________________________________________________
/dev/sda1 vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro
/dev/sda5 ext4 rw,nosuid,nodev,relatime,errors=remount-ro
/dev/sda6 ext3 rw,relatime,errors=remount-ro
/dev/sda7 vfat rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro
/dev/sda8 ext4 rw,nosuid,nodev,relatime,errors=remount-ro
/dev/sdb1 iso9660 ro,nosuid,nodev,relatime,nojoliet,check=s,map=n,blocksize=2048,uid=1000,gid=1000,dmode=500,fmode=400,iocharset=utf8
/dev/sdc1 vfat rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro
====================== sda5/boot/grub/grub.cfg (filtered) ======================
Ubuntu 2b3b889e-3907-42ca-9c4d-69f17f40fff9
Ubuntu 22.04.3 LTS (22.04) (on sda6) c553e607-41ed-4b6c-9b01-e421a747f175
Ubuntu 22.04.3 LTS (22.04) (on sda8) 993c5bf5-7126-4218-9190-ca55eebb0214
### END /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_uefi-firmware ###
========================== sda5/etc/fstab (filtered) ===========================
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda5 during installation
UUID=2b3b889e-3907-42ca-9c4d-69f17f40fff9 / ext4 errors=remount-ro 0 1
/swapfile none swap sw 0 0
======================= sda5/etc/default/grub (filtered) =======================
GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
==================== sda5: Location of files loaded by Grub ====================
GiB - GB File Fragment(s)
22,707092285 = 24,381554688 boot/grub/grub.cfg 1
222,093326569 = 238,470893568 boot/vmlinuz 2
251,950267792 = 270,529540096 boot/vmlinuz-5.15.0-91-generic 1
32,397613525 = 34,786672640 boot/vmlinuz-6.2.0-39-generic 1
222,093326569 = 238,470893568 boot/vmlinuz-6.5.0-14-generic 2
32,397613525 = 34,786672640 boot/vmlinuz.old 1
224,909717560 = 241,494970368 boot/initrd.img 2
223,316867828 = 239,784660992 boot/initrd.img-5.15.0-91-generic 6
221,712730408 = 238,062231552 boot/initrd.img-6.2.0-39-generic 1
224,909717560 = 241,494970368 boot/initrd.img-6.5.0-14-generic 2
221,712730408 = 238,062231552 boot/initrd.img.old 1
===================== sda5: ls -l /etc/grub.d/ (filtered) ======================
-rwxr-xr-x 1 root root 18683 Dec 18 2022 10_linux
-rwxr-xr-x 1 root root 43031 Dec 18 2022 10_linux_zfs
-rwxr-xr-x 1 root root 14387 Dec 18 2022 20_linux_xen
-rwxr-xr-x 1 root root 13369 Dec 18 2022 30_os-prober
-rwxr-xr-x 1 root root 1372 Dec 18 2022 30_uefi-firmware
-rwxr-xr-x 1 root root 700 Jul 3 2022 35_fwupd
-rwxr-xr-x 1 root root 214 Jan 13 2021 40_custom
-rwxr-xr-x 1 root root 215 Dec 18 2022 41_custom
====================== sda6/boot/grub/grub.cfg (filtered) ======================
Ubuntu c553e607-41ed-4b6c-9b01-e421a747f175
Ubuntu 22.04.3 LTS (22.04) (on sda5) 2b3b889e-3907-42ca-9c4d-69f17f40fff9
Ubuntu 22.04.3 LTS (22.04) (on sda8) 993c5bf5-7126-4218-9190-ca55eebb0214
### END /etc/grub.d/30_os-prober_proxy ###
### END /etc/grub.d/30_uefi-firmware ###
========================== sda6/etc/fstab (filtered) ===========================
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda6 during installation
UUID=c553e607-41ed-4b6c-9b01-e421a747f175 / ext3 errors=remount-ro 0 1
/swapfile none swap sw 0 0
/dev/disk/by-id/ata-MATSHITADVD-RAM_UJ8A7AS_UL87_065320 /mnt/ata-MATSHITADVD-RAM_UJ8A7AS_UL87_065320 auto nosuid,nodev,nofail,noauto,x-gvfs-show 0 0
======================= sda6/etc/default/grub (filtered) =======================
GRUB_DEFAULT="Ubuntu"
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=""
GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
GRUB_TERMINAL="console"
GRUB_GFXMODE="640x480"
GRUB_DISABLE_LINUX_UUID="true"
GRUB_DISABLE_RECOVERY="true"
GRUB_INIT_TUNE="480 440 1"
GRUB_DISABLE_OS_PROBER="false"
GRUB_SAVEDEFAULT="false"
GRUB_DISABLE_LINUX_RECOVERY="true"
==================== sda6: Location of files loaded by Grub ====================
GiB - GB File Fragment(s)
646,451309204 = 694,121807872 boot/grub/grub.cfg 1
647,788349152 = 695,557443584 boot/grub/i386-pc/core.img 1
540,072158813 = 579,898064896 boot/vmlinuz 5
540,072158813 = 579,898064896 boot/vmlinuz-5.15.0-91-generic 5
540,072158813 = 579,898064896 boot/vmlinuz.old 5
646,107925415 = 693,753102336 boot/initrd.img 9
646,107925415 = 693,753102336 boot/initrd.img-5.15.0-91-generic 9
646,107925415 = 693,753102336 boot/initrd.img.old 9
===================== sda6: ls -l /etc/grub.d/ (filtered) ======================
-rwxr-xr-x 1 root root 18683 Dec 18 2022 10_linux
-rwxr-xr-x 1 root root 43031 Dec 18 2022 10_linux_zfs
-rwxr-xr-x 1 root root 14387 Dec 18 2022 20_linux_xen
-rwxr-xr-x 1 root root 7175 Dec 30 17:26 30_os-prober_proxy
-rwxr-xr-x 1 root root 1372 Dec 18 2022 30_uefi-firmware
-rwxr-xr-x 1 root root 700 May 11 2023 35_fwupd
-rwxr-xr-x 1 root root 214 Jan 13 2021 40_custom
-rwxr-xr-x 1 root root 215 Dec 18 2022 41_custom
drwxr-xr-x 4 root root 4096 Dec 28 18:27 backup
drwxr-xr-x 2 root root 4096 Dec 28 18:27 bin
drwxr-xr-x 2 root root 4096 Dec 30 17:26 proxifiedScripts
====================== sda8/boot/grub/grub.cfg (filtered) ======================
Ubuntu 993c5bf5-7126-4218-9190-ca55eebb0214
Ubuntu 20.04.2 LTS (20.04) (on sda5) 2b3b889e-3907-42ca-9c4d-69f17f40fff9
Ubuntu 20.04.2 LTS (20.04) (on sda6) 301aca02-850e-4f93-9185-7f2c0ded60ab
### END /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_uefi-firmware ###
Ubuntu, with Linux 5.8.0-55-generic (on sda6) 301aca02-850e-4f93-9185-7f2c0ded60ab
========================== sda8/etc/fstab (filtered) ===========================
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda8 during installation
UUID=993c5bf5-7126-4218-9190-ca55eebb0214 / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda7 during installation
UUID=5292-364F /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0
======================= sda8/etc/default/grub (filtered) =======================
GRUB_DEFAULT="0"
GRUB_TIMEOUT_STYLE="hidden"
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR="`lsb_release -i -s 2> /dev/null || echo Debian`"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
==================== sda8: Location of files loaded by Grub ====================
GiB - GB File Fragment(s)
355,350620270 = 381,554823168 boot/grub/grub.cfg 1
418,854316711 = 449,741398016 boot/grub/i386-pc/core.img 1
328,978668213 = 353,238155264 boot/vmlinuz 2
258,883007050 = 277,973512192 boot/vmlinuz-5.11.0-46-generic 1
266,601562500 = 286,261248000 boot/vmlinuz-5.15.0-50-generic 1
294,497066498 = 316,213817344 boot/vmlinuz-5.15.0-74-generic 2
388,671947479 = 417,333325824 boot/vmlinuz-5.15.0-79-generic 2
426,679759979 = 458,143903744 boot/vmlinuz-5.15.0-83-generic 1
425,171951294 = 456,524906496 boot/vmlinuz-5.15.0-88-generic 1
420,297515869 = 451,291021312 boot/vmlinuz-5.19.0-44-generic 2
389,610012054 = 418,340564992 boot/vmlinuz-5.19.0-46-generic 1
427,306789398 = 458,817171456 boot/vmlinuz-6.2.0-32-generic 1
388,298980713 = 416,932855808 boot/vmlinuz-6.2.0-34-generic 1
328,978668213 = 353,238155264 boot/vmlinuz-6.2.0-36-generic 2
425,171951294 = 456,524906496 boot/vmlinuz.old 1
453,757202148 = 487,218085888 boot/initrd.img 3
322,458763123 = 346,237460480 boot/initrd.img-5.11.0-46-generic 1
322,333003998 = 346,102427648 boot/initrd.img-5.15.0-50-generic 4
452,575115204 = 485,948829696 boot/initrd.img-5.15.0-74-generic 1
452,293880463 = 485,646856192 boot/initrd.img-5.15.0-79-generic 1
454,026981354 = 487,507759104 boot/initrd.img-5.15.0-83-generic 1
453,458003998 = 486,896824320 boot/initrd.img-5.15.0-88-generic 2
453,174919128 = 486,592864256 boot/initrd.img-5.19.0-44-generic 1
454,370235443 = 487,876325376 boot/initrd.img-5.19.0-46-generic 2
452,014991760 = 485,347401728 boot/initrd.img-6.2.0-32-generic 3
451,632190704 = 484,936372224 boot/initrd.img-6.2.0-34-generic 3
453,757202148 = 487,218085888 boot/initrd.img-6.2.0-36-generic 3
453,458003998 = 486,896824320 boot/initrd.img.old 2
===================== sda8: ls -l /etc/grub.d/ (filtered) ======================
-rwxr-xr-x 1 root root 18683 Apr 15 2022 10_linux
-rwxr-xr-x 1 root root 936 Feb 2 2022 10_linux_proxy
-rwxr-xr-x 1 root root 43031 Apr 15 2022 10_linux_zfs
-rwxr-xr-x 1 root root 1330 Feb 2 2022 11_linux_proxy
-rwxr-xr-x 1 root root 14387 Dec 18 2022 20_linux_xen
-rwxr-xr-x 1 root root 13369 Apr 15 2022 30_os-prober
-rwxr-xr-x 1 root root 1372 Apr 15 2022 30_uefi-firmware
-rwxr-xr-x 1 root root 700 Feb 21 2022 35_fwupd
-rwxr-xr-x 1 root root 579 Feb 2 2022 40_custom_proxy
-rwxr-xr-x 1 root root 215 Apr 15 2022 41_custom
-rwxr-xr-x 1 root root 2876 Feb 2 2022 41_linux_proxy
-rwxr-xr-x 1 root root 42359 Jan 13 2021 42_linux_zfs
-rwxr-xr-x 1 root root 12894 Jan 13 2021 43_linux_xen
-rwxr-xr-x 1 root root 265 Feb 2 2022 44_memtest86+_proxy
-rwxr-xr-x 1 root root 7099 Feb 2 2022 47_os-prober_proxy
-rwxr-xr-x 1 root root 1424 Jan 13 2021 48_uefi-firmware
-rwxr-xr-x 1 root root 579 Feb 2 2022 49_custom_proxy
-rwxr-xr-x 1 root root 216 Jan 13 2021 50_custom
drwxr-xr-x 4 root root 4096 Jun 23 2021 backup
drwxr-xr-x 2 root root 4096 Jun 23 2021 bin
drwxr-xr-x 2 root root 4096 Feb 2 2022 proxifiedScripts
================== sda8/etc/grub.d/11_linux_proxy (filtered) ===================
#!/bin/sh
#THIS IS A GRUB PROXY SCRIPT
sh -c 'echo "### BEGIN /etc/grub.d/proxifiedScripts/linux ###";
"/etc/grub.d/proxifiedScripts/linux";
echo "### END /etc/grub.d/proxifiedScripts/linux ###";
echo "### BEGIN /etc/grub.d/proxifiedScripts/custom ###";
"/etc/grub.d/proxifiedScripts/custom";
echo "### END /etc/grub.d/proxifiedScripts/custom ###";' | /etc/grub.d/bin/grubcfg_proxy "-*
-#text
-'Ubuntu'~6bbbad78a4f187a7740b203d620d6ef1~
+'SUBMENU' as 'Options avancées pour Ubuntu'{+'Options avancées pour Ubuntu'/*, +'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.13.0-27-generic'~e249c6dbe4ade262ef558fd27a67ba8b~, +'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.13.0-27-generic (recovery mode)'~1d9ecedc6834eb3a3e4cc42a7d6eb698~, -'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.13.0-25-generic'~c5d654aecd61875cdf8efee371414190~, -'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.13.0-25-generic (recovery mode)'~60d123d4413ff3064518a96bc0a9a9b5~, -'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.11.0-46-generic'~2b3407d6239873956191061fb4f94cca~, -'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.11.0-46-generic (recovery mode)'~4325840d0c4b0adc1b5cc9320a6b559e~, -'Ubuntu Version 2 (sur /dev/sda5)'~29df3a42d5c4d438ddcc3d7ee97dc9b6~ from '/etc/grub.d/proxifiedScripts/custom'}
" multi
================== sda8/etc/grub.d/40_custom_proxy (filtered) ==================
#!/bin/sh
#THIS IS A GRUB PROXY SCRIPT
'/etc/grub.d/proxifiedScripts/custom' | /etc/grub.d/bin/grubcfg_proxy "-'Kubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'~768e446bcb4366d4184c7520146ae71f~ as 'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'
-'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~1233d6cf7bad2da39039d5ee7f33cefb~
-'Ubuntu Version 2 (sur /dev/sda5)'~29df3a42d5c4d438ddcc3d7ee97dc9b6~
+*
+#text
-'Kubuntu, with Linux 5.8.0-55-generic (recovery mode) (sur /dev/sda6)'~f913ae8a4baae33406385b4b06b2cecd~ as 'Ubuntu, with Linux 5.8.0-55-generic (recovery mode) (sur /dev/sda6)'
"
================== sda8/etc/grub.d/41_linux_proxy (filtered) ===================
#!/bin/sh
#THIS IS A GRUB PROXY SCRIPT
sh -c 'echo "### BEGIN /etc/grub.d/proxifiedScripts/linux ###";
"/etc/grub.d/proxifiedScripts/linux";
echo "### END /etc/grub.d/proxifiedScripts/linux ###";
echo "### BEGIN /etc/grub.d/proxifiedScripts/custom ###";
"/etc/grub.d/proxifiedScripts/custom";
echo "### END /etc/grub.d/proxifiedScripts/custom ###";
echo "### BEGIN /etc/grub.d/proxifiedScripts/os-prober ###";
"/etc/grub.d/proxifiedScripts/os-prober";
echo "### END /etc/grub.d/proxifiedScripts/os-prober ###";' | /etc/grub.d/bin/grubcfg_proxy "-*
-#text
-'Ubuntu'~6bbbad78a4f187a7740b203d620d6ef1~
-'SUBMENU' as 'Options avancées pour Ubuntu'{-'Options avancées pour Ubuntu'/*, -'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.13.0-27-generic'~e249c6dbe4ade262ef558fd27a67ba8b~, -'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.13.0-27-generic (recovery mode)'~1d9ecedc6834eb3a3e4cc42a7d6eb698~, -'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.13.0-25-generic'~c5d654aecd61875cdf8efee371414190~, -'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.13.0-25-generic (recovery mode)'~60d123d4413ff3064518a96bc0a9a9b5~, -'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.11.0-46-generic'~2b3407d6239873956191061fb4f94cca~, -'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.11.0-46-generic (recovery mode)'~4325840d0c4b0adc1b5cc9320a6b559e~}
+'SUBMENU' as 'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'{+'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'/* from '/etc/grub.d/proxifiedScripts/os-prober', +'Kubuntu, with Linux 5.8.0-55-generic (recovery mode) (sur /dev/sda6)'~f913ae8a4baae33406385b4b06b2cecd~ from '/etc/grub.d/proxifiedScripts/custom', +'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'/'Ubuntu, with Linux 5.8.0-55-generic (recovery mode) (sur /dev/sda6)'~f913ae8a4baae33406385b4b06b2cecd~ from '/etc/grub.d/proxifiedScripts/os-prober', -'Kubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'~768e446bcb4366d4184c7520146ae71f~ from '/etc/grub.d/proxifiedScripts/custom', -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'/'Ubuntu (sur /dev/sda6)'~f07656a1c31925ac00537e6e977a73f9~ from '/etc/grub.d/proxifiedScripts/os-prober', -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'/'Ubuntu, with Linux 5.8.0-55-generic (sur /dev/sda6)'~f07656a1c31925ac00537e6e977a73f9~ from '/etc/grub.d/proxifiedScripts/os-prober', -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'/'Ubuntu, with Linux 5.8.0-43-generic (sur /dev/sda6)'~da6523b68aac80f70b41c8fd2f4f1492~ from '/etc/grub.d/proxifiedScripts/os-prober', -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'/'Ubuntu, with Linux 5.8.0-43-generic (recovery mode) (sur /dev/sda6)'~7386609929d50a35d4d2204be0cc504c~ from '/etc/grub.d/proxifiedScripts/os-prober'}
" multi
=================== sda8/etc/grub.d/42_linux_zfs (filtered) ====================
#! /bin/sh
set -e
# grub-mkconfig helper script.
# Copyright (C) 2019 Canonical Ltd.
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see <http://www.gnu.org/licenses/>.
prefix="/usr"
datarootdir="/usr/share"
ubuntu_recovery="1"
quiet_boot="1"
quick_boot="1"
gfxpayload_dynamic="1"
vt_handoff="1"
. "${pkgdatadir}/grub-mkconfig_lib"
export TEXTDOMAIN=grub
export TEXTDOMAINDIR="${datarootdir}/locale"
set -u
## Skip early if zfs utils isn't installed (instead of failing on first zpool list)
if ! `which zfs >/dev/null 2>&1`; then
exit 0
fi
imported_pools=""
MNTDIR="$(mktemp -d ${TMPDIR:-/tmp}/zfsmnt.XXXXXX)"
ZFSTMP="$(mktemp -d ${TMPDIR:-/tmp}/zfstmp.XXXXXX)"
machine="$(uname -m)"
case "${machine}" in
i?86) GENKERNEL_ARCH="x86" ;;
mips|mips64) GENKERNEL_ARCH="mips" ;;
mipsel|mips64el) GENKERNEL_ARCH="mipsel" ;;
arm*) GENKERNEL_ARCH="arm" ;;
*) GENKERNEL_ARCH="${machine}" ;;
esac
RC=0
on_exit() {
# Restore initial zpool import state
for pool in ${imported_pools}; do
zpool export "${pool}"
done
mountpoint -q "${MNTDIR}" && umount "${MNTDIR}" || true
rmdir "${MNTDIR}"
rm -rf "${ZFSTMP}"
exit "${RC}"
}
trap on_exit EXIT INT QUIT ABRT PIPE TERM
# List ONLINE and DEGRADED pools
import_pools() {
# We have to ignore zpool import output, as potentially multiple / will be available,
# and we need to autodetect all zpools this way with their real mountpoints.
local initial_pools="$(zpool list | awk '{if (NR>1) print $1}')"
local all_pools=""
local imported_pools=""
local err=""
set +e
err="$(zpool import -f -a -o cachefile=none -o readonly=on -N 2>&1)"
# Only print stderr if the command returned an error
# (it can echo "No zpool to import" with success, which we don't want)
if [ $? -ne 0 ]; then
echo "Some pools couldn't be imported and will be ignored:\n${err}" >&2
fi
set -e
all_pools="$(zpool list | awk '{if (NR>1) print $1}')"
for pool in ${all_pools}; do
if echo "${initial_pools}" | grep -wq "${pool}"; then
continue
fi
imported_pools="${imported_pools} ${pool}"
done
echo "${imported_pools}"
}
# List all the dataset with a root mountpoint
get_root_datasets() {
local pools="$(zpool list | awk '{if (NR>1) print $1}')"
for p in ${pools}; do
local rel_pool_root=$(zpool get -H altroot ${p} | awk '{print $3}')
if [ "${rel_pool_root}" = "-" ]; then
rel_pool_root="/"
fi
zfs list -H -o name,canmount,mountpoint -t filesystem | grep -E '^'"${p}"'(\s|/[[:print:]]*\s)(on|noauto)\s'"${rel_pool_root}"'$' | awk '{print $1}'
done
}
# find if given datasets can be mounted for directory and return its path (snapshot or real path)
# $1 is our current dataset name
# $2 directory path we look for (cannot contains /)
# $3 is the temporary mount directory to use
# $4 is the optional snapshot name
# return path for directory (which can be a mountpoint)
validate_system_dataset() {
local dataset="$1"
local directory="$2"
local mntdir="$3"
local snapshot_name="$4"
local mount_path="${mntdir}/${directory}"
if ! zfs list "${dataset}" >/dev/null 2>&1; then
return
fi
if ! mount -o noatime,zfsutil -t zfs "${dataset}" "${mount_path}"; then
grub_warn "Failed to find a valid directory '${directory}' for dataset '${dataset}@${snapshot_name}'. Ignoring"
return
fi
local candidate_path="${mount_path}"
if [ -n "${snapshot_name}" ]; then
# WORKAROUND a bug https://github.com/zfsonlinux/zfs/issues/9958
# Reading the content of a snapshot fails if it is not the first mount
# for a given dataset
first_mntdir=$(awk '{if ($1 == "'${dataset}'") {print $2; exit;}}' /proc/mounts)
if [ "${first_mntdir}" = "/" ]; then
# prevents // on candidate_path
first_mntdir=""
fi
candidate_path="${first_mntdir}/.zfs/snapshot/${snapshot_name}"
fi
if [ -n "$(ls ${candidate_path} 2>/dev/null)" ]; then
echo "${candidate_path}"
return
else
mountpoint -q "${mount_path}" && umount "${mount_path}" || true
fi
}
# Detect system directory relevant to the other, trying to find the ones associated on the current dataset or snapshot/
# System directory should be at most a direct child dataset of main datasets (no recursivity)
# We can fallback trying other zfs pools if no match has been found.
# $1 is our current dataset name (which can have @snapshot name)
# $2 directory path we look for (cannot contains /)
# $3 restrict_to_same_pool (true|false) force looking for dataset with the same basename in the current dataset pool only
# $4 is the temporary mount directory to use
# $5 is the optional etc directory (if not $2 is not etc itself)
# return path for directory (which can be a mountpoint)
get_system_directory() {
local dataset_path="$1"
local directory="$2"
local restrict_to_same_pool="$3"
local mntdir="$4"
local etc_dir="$5"
if [ -z "${etc_dir}" ]; then
etc_dir="${mntdir}/etc"
fi
local candidate_path="${mntdir}/${directory}"
# 1. Look for /etc/fstab first (which will mount even on top of non empty $directory)
local mounted_fstab_entry="false"
if [ -f "${etc_dir}/fstab" ]; then
mount_args=$(awk '/^[^#].*[ \t]\/'"${directory}"'[ \t]/ {print "-t", $3, $1}' "${etc_dir}/fstab")
if [ -n "${mount_args}" ]; then
mounted_fstab_entry="true"
mount -o noatime ${mount_args} "${candidate_path}" || mounted_fstab_entry="false"
fi
fi
# If directory isn't empty. Only count if coming from /etc/fstab. Will be
# handled below otherwise as we are interested in potential snapshots.
if [ "${mounted_fstab_entry}" = "true" -a -n "$(ls ${candidate_path} 2>/dev/null)" ]; then
echo "${candidate_path}"
return
fi
# 2. Handle zfs case, which can be a snapshots.
local base_dataset_path="${dataset_path}"
local snapshot_name=""
# For snapshots we extract the parent dataset
if echo "${dataset_path}" | grep -q '@'; then
base_dataset_path=$(echo "${dataset_path}" | cut -d '@' -f1)
snapshot_name=$(echo "${dataset_path}" | cut -d '@' -f2)
fi
base_dataset_name="${base_dataset_path##*/}"
base_pool="$(echo "${base_dataset_path}" | cut -d'/' -f1)"
# 2.a) Look for child dataset included in base dataset, which needs to hold same snapshot if any
candidate_path=$(validate_system_dataset "${base_dataset_path}/${directory}" "${directory}" "${mntdir}" "${snapshot_name}")
if [ -n "${candidate_path}" ]; then
echo "${candidate_path}"
return
fi
# 2.b) Look for current dataset (which is already mounted as /)
candidate_path="${mntdir}/${directory}"
if [ -n "${snapshot_name}" ]; then
# WORKAROUND a bug https://github.com/zfsonlinux/zfs/issues/9958
# Reading the content of a snapshot fails if it is not the first mount
# for a given dataset
first_mntdir=$(awk '{if ($1 == "'${base_dataset_path}'") {print $2; exit;}}' /proc/mounts)
if [ "${first_mntdir}" = "/" ]; then
# prevents // on candidate_path
first_mntdir=""
fi
candidate_path="${first_mntdir}/.zfs/snapshot/${snapshot_name}/${directory}"
fi
if [ -n "$(ls ${candidate_path} 2>/dev/null)" ]; then
echo "${candidate_path}"
return
fi
# 2.c) Look for every datasets in every pool which isn't the current dataset which holds:
# - the same dataset name (last section) than our base_dataset_name
# - mountpoint=directory
# - canmount!=off
all_same_base_dataset_name="$(zfs list -H -t filesystem -o name,canmount | awk '/^[^ ]+\/'"${base_dataset_name}"'[ \t](on|noauto)/ {print $1}') "
# order by local pool datasets first
current_pool_same_base_datasets=""
other_pools_same_base_datasets=""
root_pool=$(echo "${dataset_path%%/*}")
for d in ${all_same_base_dataset_name}; do
cur_dataset_pool=$(echo "${d%%/*}")
if echo "${cur_dataset_pool}" | grep -wq "${root_pool}" 2>/dev/null ; then
current_pool_same_base_datasets="${current_pool_same_base_datasets} ${d}"
else
other_pools_same_base_datasets="${other_pools_same_base_datasets} ${d}"
fi
done
ordered_same_base_datasets="${current_pool_same_base_datasets} ${other_pools_same_base_datasets}"
if [ "${restrict_to_same_pool}" = "true" ]; then
ordered_same_base_datasets="${current_pool_same_base_datasets}"
fi
# now, loop over them
for d in ${ordered_same_base_datasets}; do
cur_dataset_pool=$(echo "${d%%/*}")
rel_pool_root=$(zpool get -H altroot ${cur_dataset_pool} | awk '{print $3}')
if [ "${rel_pool_root}" = "-" ]; then
rel_pool_root=""
fi
# check mountpoint match
candidate_dataset=$(zfs get -H mountpoint ${d} | grep -E "mountpoint\s${rel_pool_root}/${directory}\s" | awk '{print $1}')
if [ -z "${candidate_dataset}" ]; then
continue
fi
candidate_path=$(validate_system_dataset "${candidate_dataset}" "${directory}" "${mntdir}" "${snapshot_name}")
if [ -n "${candidate_path}" ]; then
echo "${candidate_path}"
return
fi
done
# 2.d) If we didn't find anything yet: check for persistent datasets corresponding to our mountpoint, with canmount=on without any snapshot associated:
# Note: we go over previous datasets as well, but this is ok, as we didn't include them before.
all_mountable_datasets="$(zfs list -t filesystem -o name,canmount | awk '/^[^ ]+[ \t]+on/ {print $1}')"
# order by local pool datasets first
current_pool_datasets=""
other_pools_datasets=""
root_pool=$(echo "${dataset_path%%/*}")
for d in ${all_mountable_datasets}; do
cur_dataset_pool=$(echo "${d%%/*}")
if echo "${cur_dataset_pool}" | grep -wq "${root_pool}" 2>/dev/null ; then
current_pool_datasets="${current_pool_datasets} ${d}"
else
other_pools_datasets="${other_pools_datasets} ${d}"
fi
done
ordered_datasets="${current_pool_datasets} ${other_pools_datasets}"
if [ "${restrict_to_same_pool}" = "true" ]; then
ordered_datasets="${current_pool_datasets}"
fi
for d in ${ordered_datasets}; do
cur_dataset_pool=$(echo "${d%%/*}")
rel_pool_root=$(zpool get -H altroot ${cur_dataset_pool} | awk '{print $3}')
if [ "${rel_pool_root}" = "-" ]; then
rel_pool_root=""
fi
# check mountpoint match
candidate_dataset=$(zfs get -H mountpoint ${d} | grep -E "mountpoint\s${rel_pool_root}/${directory}\s" | awk '{print $1}')
if [ -z "${candidate_dataset}" ]; then
continue
fi
candidate_path=$(validate_system_dataset "${d}" "${directory}" "${mntdir}" "")
if [ -n "${candidate_path}" ]; then
echo "${candidate_path}"
return
fi
done
grub_warn "Failed to find a valid directory '${directory}' for dataset '${dataset_path}'. Ignoring"
return
}
# Try our default layout bpool as a prefered layout (fast path)
# This is get_system_directory for boot optimized for our default installation layout
# $1 is our current dataset name (which can have @snapshot name)
# $2 is the temporary mount directory to use
# return path for directory (which can be a mountpoint) if found
try_default_layout_bpool() {
local root_dataset_path="$1"
local mntdir="$2"
dataset_basename="${root_dataset_path##*/}"
candidate_dataset="bpool/BOOT/${dataset_basename}"
dataset_properties="$(zfs get -H mountpoint,canmount ${candidate_dataset} | cut -f3 | paste -sd ' ')"
if [ -z "${dataset_properties}" ]; then
return
fi
rel_pool_root=$(zpool get -H altroot bpool | awk '{print $3}')
if [ "${rel_pool_root}" = "-" ]; then
rel_pool_root=""
fi
snapshot_name="${dataset_basename##*@}"
[ "${snapshot_name}" = "${dataset_basename}" ] && snapshot_name=""
if [ -z "${snapshot_name}" ]; then
if ! echo "${dataset_properties}" | grep -Eq "${rel_pool_root}/boot (on|noauto)"; then
return
fi
else
candidate_dataset=$(echo "${candidate_dataset}" | cut -d '@' -f1)
fi
validate_system_dataset "${candidate_dataset}" "boot" "${mntdir}" "${snapshot_name}"
}
# Return if secure boot is enabled on that system
is_secure_boot_enabled() {
if LANG=C mokutil --sb-state 2>/dev/null | grep -qi enabled; then
echo "true"
return
fi
echo "false"
return
}
# Given a filesystem or snapshot dataset, returns dataset|machine id|pretty name|last used
# $1 is dataset we want information from
# $2 is the temporary mount directory to use
get_dataset_info() {
local dataset="$1"
local mntdir="$2"
local base_dataset="${dataset}"
local etc_dir="${mntdir}/etc"
local is_snapshot="false"
# For snapshot we extract the parent dataset
if echo "${dataset}" | grep -q '@'; then
base_dataset=$(echo "${dataset}" | cut -d '@' -f1)
is_snapshot="true"
fi
mount -o noatime,zfsutil -t zfs "${base_dataset}" "${mntdir}"
# read machine-id/os-release from /etc
etc_dir=$(get_system_directory "${dataset}" "etc" "true" "${mntdir}" "")
if [ -z "${etc_dir}" ]; then
grub_warn "Ignoring ${dataset}"
mountpoint -q "${mntdir}/etc" && umount "${mntdir}/etc" || true
umount "${mntdir}"
return
fi
machine_id=""
if [ -f "${etc_dir}/machine-id" ]; then
machine_id=$(cat "${etc_dir}/machine-id")
fi
# We have to use a random temporary id if we don't have any machine-id file or if this one is empty
# (mostly the case of new installations before first boot).
# Let's use the dataset name directly for this.
# Consequence is that all datasets are then separated.
if [ -z "${machine_id}" ]; then
machine_id="${dataset}"
fi
pretty_name=$(. "${etc_dir}/os-release" && echo "${PRETTY_NAME}")
mountpoint -q "${mntdir}/etc" && umount "${mntdir}/etc" || true
# read available kernels from /boot
boot_dir="$(try_default_layout_bpool "${dataset}" "${mntdir}")"
if [ -z "${boot_dir}" ]; then
boot_dir=$(get_system_directory "${dataset}" "boot" "false" "${mntdir}" "${etc_dir}")
fi
if [ -z "${boot_dir}" ]; then
grub_warn "Ignoring ${dataset}"
mountpoint -q "${mntdir}/boot" && umount "${mntdir}/boot" || true
umount "${mntdir}"
return
fi
initrd_list=""
kernel_list=""
list=$(find "${boot_dir}" -maxdepth 1 -type f -regex '.*/\(vmlinuz\|vmlinux\|kernel\)-.*')
while [ "x$list" != "x" ] ; do
linux=`version_find_latest $list`
list=`echo $list | tr ' ' '\n' | fgrep -vx "$linux" | tr '\n' ' '`
if ! grub_file_is_not_garbage "${linux}" ; then
continue
fi
# Filters entry if efi/non efi.
# Note that for now we allow kernel without .efi.signed as those are signed kernel
# on ubuntu, loaded by the shim.
case "${linux}" in
*.efi.signed)
if [ "$(is_secure_boot_enabled)" = "false" ]; then
continue
fi
;;
esac
linux_basename=$(basename "${linux}")
linux_dirname=$(dirname "${linux}")
version=$(echo "${linux_basename}" | sed -e "s,^[^0-9]*-,,g")
alt_version=$(echo "${version}" | sed -e "s,\.old$,,g")
gettext_printf "Found linux image: %s in %s\n" "${linux_basename}" "${dataset}" >&2
initrd=""
for i in "initrd.img-${version}" "initrd-${version}.img" "initrd-${version}.gz" \
"initrd-${version}" "initramfs-${version}.img" \
"initrd.img-${alt_version}" "initrd-${alt_version}.img" \
"initrd-${alt_version}" "initramfs-${alt_version}.img" \
"initramfs-genkernel-${version}" \
"initramfs-genkernel-${alt_version}" \
"initramfs-genkernel-${GENKERNEL_ARCH}-${version}" \
"initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}"; do
if test -e "${linux_dirname}/${i}" ; then
initrd="$i"
break
fi
done
if test -z "${initrd}" ; then
grub_warn "Couldn't find any valid initrd for dataset ${dataset}."
continue
fi
gettext_printf "Found initrd image: %s in %s\n" "${initrd}" "${dataset}" >&2
rel_linux_dirname=$(make_system_path_relative_to_its_root "${linux_dirname}")
initrd_list="${initrd_list}|${rel_linux_dirname}/${initrd}"
kernel_list="${kernel_list}|${rel_linux_dirname}/${linux_basename}"
done
initrd_list="${initrd_list#|}"
kernel_list="${kernel_list#|}"
initrd_device=$(${grub_probe} --target=device "${boot_dir}" | head -1)
mountpoint -q "${mntdir}/boot" && umount "${mntdir}/boot" || true
# We needed to look in / for snapshots on root dataset, umount there before zfs lazily unmount it
case "${boot_dir}" in /boot/.zfs/snapshot/*)
umount "${boot_dir}" || true
;;
esac
# for zsys snapshots: we want to know which kernel we successful last booted with
last_booted_kernel=$(zfs get -H com.ubuntu.zsys:last-booted-kernel "${dataset}" | awk '{print $3}')
# snapshot: last_used is dataset creation time
if [ "${is_snapshot}" = "true" ]; then
last_used="$(zfs get -pH creation "${dataset}" | awk -F '\t' '{print $3}')"
# otherwise, last_used is manually marked at boot/shutdown on a root dataset for zsys
else
# if current system, take current time
if zfs mount | awk '/[ \t]+\/$/ {print $1}' | grep -q ${dataset}; then
last_used=$(date +%s)
else
last_used=$(zfs get -H com.ubuntu.zsys:last-used "${dataset}" | awk '{print $3}')
# case of non zsys, or zsys without annotation, take /etc/machine-id stat (as we mounted with noatime).
# However, as systems can be relatime, if system is current mounted one, set current time (case of clone + reboot
# within the same d).
if [ "${last_used}" = "-" ]; then
last_used=$(stat --printf="%X" "${mntdir}/etc/os-release")
if [ -f "${mntdir}/etc/machine-id" ]; then
last_used=$(stat --printf="%X" "${mntdir}/etc/machine-id")
fi
fi
fi
fi
is_zsys=$(zfs get -H com.ubuntu.zsys:bootfs "${base_dataset}" | awk '{print $3}')
if [ -n "${initrd_list}" -a -n "${kernel_list}" ]; then
echo "${dataset}\t${is_zsys}\t${machine_id}\t${pretty_name}\t${last_used}\t${initrd_device}\t${initrd_list}\t${kernel_list}\t${last_booted_kernel}"
else
grub_warn "didn't find any valid initrd or kernel."
fi
umount "${mntdir}" || true
# We needed to look in / for snapshots on root dataset, umount the snapshot for etc before zfs lazily unmount it
case "${etc_dir}" in /.zfs/snapshot/*/etc)
snapshot_path="$(findmnt -n -o TARGET -T ${etc_dir})"
umount "${snapshot_path}" || true
;;
esac
}
# Scan available boot options and returns in a formatted list
# $1 is the temporary mount directory to use
bootlist() {
local mntdir="$1"
local boot_list=""
for dataset in $(get_root_datasets); do
# get information from current root dataset
boot_list="${boot_list}$(get_dataset_info ${dataset} ${mntdir})\n"
# get information from snapshots of this root dataset
for snapshot_dataset in $(zfs list -H -o name -t snapshot "${dataset}"); do
boot_list="${boot_list}$(get_dataset_info ${snapshot_dataset} ${mntdir})\n"
done
done
echo "${boot_list}"
}
# Order machine ids by last_used from their main entry
get_machines_sorted() {
local bootlist="$1"
local machineids="$(echo "${bootlist}" | awk '{print $3}' | sort -u)"
for machineid in ${machineids}; do
echo "${bootlist}" | awk 'BEGIN{FS="\t"} $1 !~ /.*@.*/ {print $5, $3}' | sort -nr | grep -E "[^^]\b${machineid}\b" | head -1
done | sort -nr | awk '{print $2}'
}
# Sort entries by last_used for a given machineid
sort_entries_for_machineid() {
local bootlist="$1"
local machineid="$2"
tab="$(printf '\t')"
echo "${bootlist}" | grep -E "[^^]\b${machineid}\b" | sort -k5,5r -k1,1 -t "${tab}"
}
# Return main entry index
get_main_entry() {
local entries="$1"
echo "${entries}" | awk 'BEGIN{FS="\t"} $1 !~ /.*@.*/ {print}' | head -1
}
# Return specific field at index from entry
get_field_from_entry() {
local entry="$1"
local index="$2"
echo "${entry}" | awk "BEGIN{FS=\"\t\"} {print \$$index}"
}
# Get the main entry metadata
main_entry_meta() {
local main_entry="$1"
initrd=$(get_field_from_entry "${main_entry}" 7 | cut -d'|' -f1)
kernel=$(get_field_from_entry "${main_entry}" 8 | cut -d'|' -f1)
# Take first element (most recent entry) which is not a snapshot
echo "${main_entry}" | awk "BEGIN{ FS=\"\t\"; OFS=\"\t\"} {print \$3, \$2, \"main\", \$4, \$1, \$6, \"$initrd\", \"$kernel\"}"
}
# Get advanced entries metadata
advanced_entries_meta() {
local main_entry="$1"
last_used_kernel="$(get_field_from_entry "${main_entry}" 9 )"
# We must align initrds with kernels.
# Adds initrds to the stack then pop them 1 by 1 as we process the kernels
set -- $(get_field_from_entry "${main_entry}" 7 | tr "|" " ")
for kernel in $(get_field_from_entry "${main_entry}" 8 | tr "|" " "); do
# get initrd and pop to the next one
initrd="$1"; shift
was_last_used_kernel="false"
kernel_basename=$(basename "${kernel}")
if [ "${kernel_basename}" = "${last_used_kernel}" ]; then
was_last_used_kernel="true"
fi
echo "${main_entry}" | awk "BEGIN{ FS=\"\t\"; OFS=\"\t\"} {print \$3, \$2, \"advanced\", \$4, \$1, \$6, \"$initrd\", \"$kernel\", \"$was_last_used_kernel\"}"
done
}
# Get history metadata
history_entries_meta() {
local entries="$1"
local main_dataset_name="$2"
local main_dataset_releasename="$3"
if [ -z "${entries}" ]; then
return
fi
# Traverse snapshots and clones
echo "${entries}" | while read entry; do
name=""
# Compute snapshot/filesystem dataset name
snap_dataset_name="$(get_field_from_entry "${entry}" 1)"
snapname="${snap_dataset_name##*@}"
# If, this is a clone, take what is after main_dataset_name
if [ "${snapname}" = "${snap_dataset_name}" ]; then
snapname="${snap_dataset_name##${main_dataset_name}_}"
# Handle manual user clone (not prefixed by "main_dataset_name")
snapname="${snapname##*/}"
fi
# We keep the snapname only if it is not only a zsys auto snapshot
if echo "${snapname}" | grep -q "^autozsys_"; then
snapname=""
fi
# We store the release only if it different from main dataset release (snapshot before a release upgrade)
releasename=$(get_field_from_entry "${entry}" 4)
if [ "${releasename}" = "${main_dataset_releasename}" ]; then
releasename=""
fi
# Snapshot date
foo="$(get_field_from_entry "${entry}" 5)"
snapdate="$(date -d @$(get_field_from_entry "${entry}" 5) "+%x @ %H:%M")"
# For snapshots/clones the name can have the following formats:
# <DATE>: autozsys, same release
# <OLD_RELEASE> on <DATE>: autozsys, different release
# <SNAPNAME> on <DATE>: Manual snapshot, same release
# <SNAPNAME>, <OLD_RELEASE> on <DATE>: Manual snapshot, different release
if [ "${snapname}" = "" -a "${releasename}" = "" ]; then
name="${snapdate}"
elif [ "${snapname}" = "" -a "${releasename}" != "" ]; then
name=$(gettext_printf "%s on %s" "${releasename}" "${snapdate}")
elif [ "${snapname}" != "" -a "${releasename}" = "" ]; then
name=$(gettext_printf "%s on %s" "${snapname}" "${snapdate}")
else # snapname != "" && releasename != ""
name=$(gettext_printf "%s, %s on %s" "${snapname}" "${releasename}" "${snapdate}")
fi
# Choose kernel and initrd if the snapshot was booted successfully on a specific kernel before
# Take latest by default if no match
initrd=$(get_field_from_entry "${entry}" 7 | cut -d'|' -f1)
kernel=$(get_field_from_entry "${entry}" 8 | cut -d'|' -f1)
last_used_kernel="$(get_field_from_entry "${entry}" 9)"
# We must align initrds with kernels.
# Adds initrds to the stack then pop them 1 by 1 as we process the kernels
set -- $(get_field_from_entry "${entry}" 7 | tr "|" " ")
for k in $(get_field_from_entry "${entry}" 8|tr "|" " "); do
# get initrd and pop to the next one
candidate_initrd="$1"; shift
kernel_basename=$(basename "${k}")
if [ "${kernel_basename}" = "${last_used_kernel}" ]; then
kernel="${k}"
initrd="${candidate_initrd}"
break
fi
done
echo "${entry}" | awk "BEGIN{ FS=\"\t\"; OFS=\"\t\"} {print \$3, \$2, \"history\", \"$name\", \$1, \$6, \"$initrd\", \"$kernel\"}"
done
}
# Generate metadata from a BOOTLIST that will subsequently used to generate
# the final grub menu entries
generate_grub_menu_metadata() {
local bootlist="$1"
# Sort machineids by last_used from their main entry
for machineid in $(get_machines_sorted "${bootlist}"); do
entries="$(sort_entries_for_machineid "${bootlist}" ${machineid})"
main_entry="$(get_main_entry "${entries}")"
if [ -z "$main_entry" ]; then
continue
fi
main_entry_meta "${main_entry}"
advanced_entries_meta "${main_entry}"
main_dataset_name="$(get_field_from_entry "${main_entry}" 1)"
main_dataset_releasename="$(get_field_from_entry "${main_entry}" 4)"
# grep -v errcode != 0 if there is no match. || true to not fail with -e
other_entries="$(echo "${entries}" | grep -v "${main_entry}" || true)"
history_entries_meta "${other_entries}" "${main_dataset_name}" "${main_dataset_releasename}"
done
}
# Print the configuration part common to all sections
# Note:
# If 10_linux runs these part will be defined twice in grub configuration
print_menu_prologue() {
cat << 'EOF'
function gfxmode {
set gfxpayload="${1}"
EOF
if [ "${vt_handoff}" = 1 ]; then
cat << 'EOF'
if [ "${1}" = "keep" ]; then
set vt_handoff=vt.handoff=1
else
set vt_handoff=
fi
EOF
fi
cat << EOF
}
EOF
# Use ELILO's generic "efifb" when it's known to be available.
# FIXME: We need an interface to select vesafb in case efifb can't be used.
GRUB_GFXPAYLOAD_LINUX="${GRUB_GFXPAYLOAD_LINUX:-}"
if [ "${GRUB_GFXPAYLOAD_LINUX}" != "" ] || [ "${gfxpayload_dynamic}" = 0 ]; then
echo "set linux_gfx_mode=${GRUB_GFXPAYLOAD_LINUX}"
else
cat << EOF
if [ "\${recordfail}" != 1 ]; then
if [ -e \${prefix}/gfxblacklist.txt ]; then
if hwmatch \${prefix}/gfxblacklist.txt 3; then
if [ \${match} = 0 ]; then
set linux_gfx_mode=keep
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=keep
fi
else
set linux_gfx_mode=text
fi
EOF
fi
cat << EOF
export linux_gfx_mode
EOF
}
# Cache for prepare_grub_to_access_device call
# $1: boot_device
# $2: submenu_level
prepare_grub_to_access_device_cached() {
local boot_device="$1"
local submenu_level="$2"
local boot_device_idx="$(echo ${boot_device} | tr '/' '_')"
cache_file="${ZFSTMP}/$(echo boot_device${boot_device_idx})"
if [ ! -f "${cache_file}" ]; then
set +u
echo "$(prepare_grub_to_access_device "${boot_device}")" > "${cache_file}"
set -u
for i in 0 1 2; do
submenu_indentation="$(printf %${i}s | tr " " "${grub_tab}")"
sed "s/^/${submenu_indentation} /" "${cache_file}" > "${cache_file}--${i}"
done
fi
cat "${cache_file}--${submenu_level}"
}
# Print a grub menu entry
zfs_linux_entry () {
submenu_level="$1"
title="$2"
type="$3"
dataset="$4"
boot_device="$5"
initrd="$6"
kernel="$7"
kernel_version="$8"
kernel_additional_args="${9:-}"
boot_devices="${10:-}"
submenu_indentation="$(printf %${submenu_level}s | tr " " "${grub_tab}")"
echo "${submenu_indentation}menuentry '$(echo "${title}" | grub_quote)' ${CLASS} \${menuentry_id_option} 'gnulinux-${dataset}-${kernel_version}' {"
if [ "${quick_boot}" = 1 ]; then
echo "${submenu_indentation} recordfail"
fi
if [ "${type}" != "recovery" ] ; then
GRUB_SAVEDEFAULT=${GRUB_SAVEDEFAULT:-}
default_entry="$(save_default_entry)"
if [ -n "${default_entry}" ]; then
echo "${submenu_indentation} ${default_entry}"
fi
fi
# Use ELILO's generic "efifb" when it's known to be available.
# FIXME: We need an interface to select vesafb in case efifb can't be used.
if [ "${GRUB_GFXPAYLOAD_LINUX}" = "" ]; then
echo "${submenu_indentation} load_video"
else
if [ "${GRUB_GFXPAYLOAD_LINUX}" != "text" ]; then
echo "${submenu_indentation} load_video"
fi
fi
if ([ "${ubuntu_recovery}" = 0 ] || [ "${type}" != "recovery" ]) && \
([ "${GRUB_GFXPAYLOAD_LINUX}" != "" ] || [ "${gfxpayload_dynamic}" = 1 ]); then
echo "${submenu_indentation} gfxmode \${linux_gfx_mode}"
fi
echo "${submenu_indentation} insmod gzio"
echo "${submenu_indentation} if [ \"\${grub_platform}\" = xen ]; then insmod xzio; insmod lzopio; fi"
if [ -n "$boot_devices" ]; then
for device in ${boot_devices}; do
echo "${submenu_indentation} if [ "${boot_device}" = "${device}" ]; then"
echo "$(prepare_grub_to_access_device_cached "${device}" $(( submenu_level +1 )) )"
echo "${submenu_indentation} fi"
done
else
echo "$(prepare_grub_to_access_device_cached "${boot_device}" "${submenu_level}")"
fi
if [ "${quiet_boot}" = 0 ] || [ "${type}" != simple ]; then
echo "${submenu_indentation} echo $(gettext_printf "Loading Linux %s ..." ${kernel_version} | grub_quote)"
fi
linux_default_args="${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
if [ ${type} = "recovery" ]; then
linux_default_args="${GRUB_CMDLINE_LINUX_RECOVERY} ${GRUB_CMDLINE_LINUX}"
fi
echo "${submenu_indentation} linux ${kernel} root=ZFS=${dataset} ro ${linux_default_args} ${kernel_additional_args}"
if [ "${quiet_boot}" = 0 ] || [ "${type}" != simple ]; then
echo "${submenu_indentation} echo '$(gettext_printf "Loading initial ramdisk ..." | grub_quote)'"
fi
echo "${submenu_indentation} initrd ${initrd}"
echo "${submenu_indentation}}"
}
# Generate a GRUB Menu from menu meta data
# $1 menu metadata
generate_grub_menu() {
local menu_metadata="$1"
local last_section=""
local main_dataset_name=""
local main_dataset=""
local have_zsys=""
if [ -z "${menu_metadata}" ]; then
return
fi
CLASS="--class gnu-linux --class gnu --class os"
if [ "${GRUB_DISTRIBUTOR}" = "" ] ; then
OS=GNU/Linux
else
case ${GRUB_DISTRIBUTOR} in
Ubuntu|Kubuntu)
OS="${GRUB_DISTRIBUTOR}"
;;
*)
OS="${GRUB_DISTRIBUTOR} GNU/Linux"
;;
esac
CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1 | LC_ALL=C sed 's,[^[:alnum:]_],_,g') ${CLASS}"
fi
if [ -x /lib/recovery-mode/recovery-menu ]; then
GRUB_CMDLINE_LINUX_RECOVERY=recovery
else
GRUB_CMDLINE_LINUX_RECOVERY=single
fi
if [ "${ubuntu_recovery}" = 1 ]; then
GRUB_CMDLINE_LINUX_RECOVERY="${GRUB_CMDLINE_LINUX_RECOVERY} nomodeset"
fi
case "$GENKERNEL_ARCH" in
x86*) GRUB_CMDLINE_LINUX_RECOVERY="$GRUB_CMDLINE_LINUX_RECOVERY dis_ucode_ldr";;
esac
if [ "${vt_handoff}" = 1 ]; then
for word in ${GRUB_CMDLINE_LINUX_DEFAULT}; do
if [ "${word}" = splash ]; then
GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_DEFAULT} \${vt_handoff}"
fi
done
fi
print_menu_prologue
cat<<'EOF'
function zsyshistorymenu {
# $1: root dataset (eg rpool/ROOT/ubuntu_2zhm07@autozsys_k56fr6)
# $2: boot device id (eg 411f29ce1557bfed)
# $3: initrd (eg /BOOT/ubuntu_2zhm07@autozsys_k56fr6/initrd.img-5.4.0-21-generic)
# $4: kernel (eg /BOOT/ubuntu_2zhm07@autozsys_k56fr6/vmlinuz-5.4.0-21-generic)
# $5: kernel_version (eg 5.4.0-21-generic)
set root_dataset="${1}"
set boot_device="${2}"
set initrd="${3}"
set kernel="${4}"
set kversion="${5}"
EOF
boot_devices=$(echo "${menu_metadata}" | cut -d"$(printf '\t')" -f6 | sort -u)
title=$(gettext_printf "Revert system only")
zfs_linux_entry 1 "${title}" "simple" '${root_dataset}' '${boot_device}' '${initrd}' '${kernel}' '${kversion}' '' "${boot_devices}"
title="$(gettext_printf "Revert system and user data")"
zfs_linux_entry 1 "${title}" "simple" '${root_dataset}' '${boot_device}' '${initrd}' '${kernel}' '${kversion}' 'zsys-revert=userdata' "${boot_devices}"
GRUB_DISABLE_RECOVERY="${GRUB_DISABLE_RECOVERY:-}"
if [ "${GRUB_DISABLE_RECOVERY}" != "true" ]; then
title="$(gettext_printf "Revert system only (%s)" "$(gettext "${GRUB_RECOVERY_TITLE}")")"
zfs_linux_entry 1 "${title}" "recovery" '${root_dataset}' '${boot_device}' '${initrd}' '${kernel}' '${kversion}' '' "${boot_devices}"
title="$(gettext_printf "Revert system and user data (%s)" "$(gettext "${GRUB_RECOVERY_TITLE}")")"
zfs_linux_entry 1 "${title}" "recovery" '${root_dataset}' '${boot_device}' '${initrd}' '${kernel}' '${kversion}' 'zsys-revert=userdata' "${boot_devices}"
fi
echo "}"
echo
# IFS is set to TAB (ASCII 0x09)
echo "${menu_metadata}" |
{
at_least_one_entry=0
have_zsys="$(which zsysd || true)"
while IFS="$(printf '\t')" read -r machineid iszsys section name dataset device initrd kernel opt; do
# Disable history for non zsys system or if systems is a zsys one and zsys isn't installed.
# In pure zfs systems, we identified multiple issues due to the mount generator
# in upstream zfs which makes it incompatible. Don't show history for now.
if [ "${section}" = "history" ]; then
if [ "${iszsys}" != "yes" ] || [ "${iszsys}" = "yes" -a -z "${have_zsys}" ]; then
continue
fi
fi
if [ "${last_section}" != "${section}" -a -n "${last_section}" ]; then
# Close previous section wrapper
if [ "${last_section}" != "main" ]; then
echo "}" # Add grub_tabs
at_least_one_entry=0
fi
fi
case "${section}" in
main)
title="${name}"
main_dataset_name="${name}"
main_dataset="${dataset}"
kernel_version=$(basename "${kernel}" | sed -e "s,^[^0-9]*-,,g")
zfs_linux_entry 0 "${title}" "simple" "${dataset}" "${device}" "${initrd}" "${kernel}" "${kernel_version}"
at_least_one_entry=1
;;
advanced)
# normal and recovery entries for a given kernel
if [ "${last_section}" != "${section}" ]; then
echo "submenu '$(gettext_printf "Advanced options for %s" "${main_dataset_name}" | grub_quote)' \${menuentry_id_option} 'gnulinux-advanced-${main_dataset}' {"
fi
last_booted_kernel_marker=""
if [ "${opt}" = "true" ]; then
last_booted_kernel_marker="* "
fi
kernel_version=$(basename "${kernel}" | sed -e "s,^[^0-9]*-,,g")
title="$(gettext_printf "%s%s, with Linux %s" "${last_booted_kernel_marker}" "${name}" "${kernel_version}")"
zfs_linux_entry 1 "${title}" "advanced" "${dataset}" "${device}" "${initrd}" "${kernel}" "${kernel_version}"
GRUB_DISABLE_RECOVERY=${GRUB_DISABLE_RECOVERY:-}
if [ "${GRUB_DISABLE_RECOVERY}" != "true" ]; then
title="$(gettext_printf "%s%s, with Linux %s (%s)" "${last_booted_kernel_marker}" "${name}" "${kernel_version}" "$(gettext "${GRUB_RECOVERY_TITLE}")")"
zfs_linux_entry 1 "${title}" "recovery" "${dataset}" "${device}" "${initrd}" "${kernel}" "${kernel_version}"
fi
at_least_one_entry=1
;;
history)
# Revert to a snapshot
# revert system, revert system and user data and associated recovery entries
if [ "${last_section}" != "${section}" ]; then
echo "submenu '$(gettext_printf "History for %s" "${main_dataset_name}" | grub_quote)' \${menuentry_id_option} 'gnulinux-history-${main_dataset}' {"
fi
if [ "${iszsys}" = "yes" ]; then
title="$(gettext_printf "Revert to %s" "${name}" | grub_quote)"
else
title="$(gettext_printf "Boot on %s" "${name}" | grub_quote)"
fi
echo " submenu '${title}' \${menuentry_id_option} 'gnulinux-history-${dataset}' {"
kernel_version=$(basename "${kernel}" | sed -e "s,^[^0-9]*-,,g")
# Zsys only: let revert system without destroying snapshots
if [ "${iszsys}" = "yes" ]; then
echo "${grub_tab}${grub_tab}zsyshistorymenu" \"${dataset}\" \"${device}\" \"${initrd}\" \"${kernel}\" \"${kernel_version}\"
# Non-zsys: boot temporarly on snapshots or rollback (destroying intermediate snapshots)
else
title="$(gettext_printf "One time boot")"
zfs_linux_entry 2 "${title}" "simple" "${dataset}" "${device}" "${initrd}" "${kernel}" "${kernel_version}"
GRUB_DISABLE_RECOVERY="${GRUB_DISABLE_RECOVERY:-}"
if [ "${GRUB_DISABLE_RECOVERY}" != "true" ]; then
title="$(gettext_printf "One time boot (%s)" "$(gettext "${GRUB_RECOVERY_TITLE}")")"
zfs_linux_entry 2 "${title}" "recovery" "${dataset}" "${device}" "${initrd}" "${kernel}" "${kernel_version}"
fi
title="$(gettext_printf "Revert system (all intermediate snapshots will be destroyed)")"
zfs_linux_entry 2 "${title}" "simple" "${dataset}" "${device}" "${initrd}" "${kernel}" "${kernel_version}" "rollback=yes"
fi
echo " }"
at_least_one_entry=1
;;
*)
grub_warn "unknown section: ${section}. Ignoring entry ${name} for ${dataset}"
;;
esac
last_section="${section}"
done
if [ "${at_least_one_entry}" -eq 1 ]; then
echo "}"
fi
}
}
# don't add trailing newline of variable is empty
# $1: content to write
# $2: destination file
trailing_newline_if_not_empty() {
content="$1"
dest="$2"
if [ -z "${content}" ]; then
rm -f "${dest}"
touch "${dest}"
return
fi
echo "${content}" > "${dest}"
}
GRUB_LINUX_ZFS_TEST="${GRUB_LINUX_ZFS_TEST:-}"
case "${GRUB_LINUX_ZFS_TEST}" in
bootlist)
# Import all available pools on the system and return imported list
imported_pools=$(import_pools)
boot_list="$(bootlist ${MNTDIR})"
trailing_newline_if_not_empty "${boot_list}" "${GRUB_LINUX_ZFS_TEST_OUTPUT}"
break
;;
metamenu)
boot_list="$(cat ${GRUB_LINUX_ZFS_TEST_INPUT})"
menu_metadata="$(generate_grub_menu_metadata "${boot_list}")"
trailing_newline_if_not_empty "${menu_metadata}" "${GRUB_LINUX_ZFS_TEST_OUTPUT}"
break
;;
grubmenu)
menu_metadata="$(cat ${GRUB_LINUX_ZFS_TEST_INPUT})"
grub_menu=$(generate_grub_menu "${menu_metadata}")
trailing_newline_if_not_empty "${grub_menu}" "${GRUB_LINUX_ZFS_TEST_OUTPUT}"
break
;;
*)
# Import all available pools on the system and return imported list
imported_pools=$(import_pools)
# Generate the complete list of boot entries
boot_list="$(bootlist ${MNTDIR})"
# Create boot menu meta data from the list of boot entries
menu_metadata="$(generate_grub_menu_metadata "${boot_list}")"
# Create boot menu meta data from the list of boot entries
grub_menu="$(generate_grub_menu "${menu_metadata}")"
if [ -n "${grub_menu}" ]; then
# We want the trailing newline as a marker will be added
echo "${grub_menu}"
fi
;;
esac
=================== sda8/etc/grub.d/43_linux_xen (filtered) ====================
#! /bin/sh
set -e
# grub-mkconfig helper script.
# Copyright (C) 2006,2007,2008,2009,2010 Free Software Foundation, Inc.
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see <http://www.gnu.org/licenses/>.
prefix="/usr"
exec_prefix="/usr"
datarootdir="/usr/share"
. "$pkgdatadir/grub-mkconfig_lib"
export TEXTDOMAIN=grub
export TEXTDOMAINDIR="${datarootdir}/locale"
CLASS="--class gnu-linux --class gnu --class os --class xen"
SUPPORTED_INITS="sysvinit:/lib/sysvinit/init systemd:/lib/systemd/systemd upstart:/sbin/upstart"
if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
OS=GNU/Linux
else
OS="${GRUB_DISTRIBUTOR} GNU/Linux"
CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1|LC_ALL=C sed 's,[^[:alnum:]_],_,g') ${CLASS}"
fi
# loop-AES arranges things so that /dev/loop/X can be our root device, but
# the initrds that Linux uses don't like that.
case ${GRUB_DEVICE} in
/dev/loop/*|/dev/loop[0-9])
GRUB_DEVICE=`losetup ${GRUB_DEVICE} | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"`
# We can't cope with devices loop-mounted from files here.
case ${GRUB_DEVICE} in
/dev/*) ;;
*) exit 0 ;;
esac
;;
esac
# Default to disabling partition uuid support to maintian compatibility with
# older kernels.
GRUB_DISABLE_LINUX_PARTUUID=${GRUB_DISABLE_LINUX_PARTUUID-true}
# btrfs may reside on multiple devices. We cannot pass them as value of root= parameter
# and mounting btrfs requires user space scanning, so force UUID in this case.
if ( [ "x${GRUB_DEVICE_UUID}" = "x" ] && [ "x${GRUB_DEVICE_PARTUUID}" = "x" ] ) \
|| ( [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
&& [ "x${GRUB_DISABLE_LINUX_PARTUUID}" = "xtrue" ] ) \
|| ( ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \
&& ! test -e "/dev/disk/by-partuuid/${GRUB_DEVICE_PARTUUID}" ) \
|| ( test -e "${GRUB_DEVICE}" && uses_abstraction "${GRUB_DEVICE}" lvm ); then
LINUX_ROOT_DEVICE=${GRUB_DEVICE}
elif [ "x${GRUB_DEVICE_UUID}" = "x" ] \
|| [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ]; then
LINUX_ROOT_DEVICE=PARTUUID=${GRUB_DEVICE_PARTUUID}
else
LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
fi
# Allow overriding GRUB_CMDLINE_LINUX and GRUB_CMDLINE_LINUX_DEFAULT.
if [ "${GRUB_CMDLINE_LINUX_XEN_REPLACE}" ]; then
GRUB_CMDLINE_LINUX="${GRUB_CMDLINE_LINUX_XEN_REPLACE}"
fi
if [ "${GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT}" ]; then
GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT}"
fi
case x"$GRUB_FS" in
xbtrfs)
rootsubvol="`make_system_path_relative_to_its_root /`"
rootsubvol="${rootsubvol#/}"
if [ "x${rootsubvol}" != x ]; then
GRUB_CMDLINE_LINUX="rootflags=subvol=${rootsubvol} ${GRUB_CMDLINE_LINUX}"
fi;;
xzfs)
rpool=`${grub_probe} --device ${GRUB_DEVICE} --target=fs_label 2>/dev/null || true`
bootfs="`make_system_path_relative_to_its_root / | sed -e "s,@$,,"`"
LINUX_ROOT_DEVICE="ZFS=${rpool}${bootfs%/}"
;;
esac
title_correction_code=
linux_entry ()
{
os="$1"
version="$2"
xen_version="$3"
type="$4"
args="$5"
xen_args="$6"
if [ -z "$boot_device_id" ]; then
boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")"
fi
if [ x$type != xsimple ] ; then
if [ x$type = xrecovery ] ; then
title="$(gettext_printf "%s, with Xen %s and Linux %s (%s)" "${os}" "${xen_version}" "${version}" "$(gettext "${GRUB_RECOVERY_TITLE}")")"
elif [ "${type#init-}" != "$type" ] ; then
title="$(gettext_printf "%s, with Xen %s and Linux %s (%s)" "${os}" "${xen_version}" "${version}" "${type#init-}")"
else
title="$(gettext_printf "%s, with Xen %s and Linux %s" "${os}" "${xen_version}" "${version}")"
fi
replacement_title="$(echo "Advanced options for ${OS}" | sed 's,>,>>,g')>$(echo "$title" | sed 's,>,>>,g')"
if [ x"Xen ${xen_version}>$title" = x"$GRUB_ACTUAL_DEFAULT" ]; then
quoted="$(echo "$GRUB_ACTUAL_DEFAULT" | grub_quote)"
title_correction_code="${title_correction_code}if [ \"x\$default\" = '$quoted' ]; then default='$(echo "$replacement_title" | grub_quote)'; fi;"
grub_warn "$(gettext_printf "Please don't use old title \`%s' for GRUB_DEFAULT, use \`%s' (for versions before 2.00) or \`%s' (for 2.00 or later)" "$GRUB_ACTUAL_DEFAULT" "$replacement_title" "gnulinux-advanced-$boot_device_id>gnulinux-$version-$type-$boot_device_id")"
fi
echo "menuentry '$(echo "$title" | grub_quote)' ${CLASS} \$menuentry_id_option 'xen-gnulinux-$version-$type-$boot_device_id' {" | sed "s/^/$submenu_indentation/"
else
title="$(gettext_printf "%s, with Xen hypervisor" "${os}")"
echo "menuentry '$(echo "$title" | grub_quote)' ${CLASS} \$menuentry_id_option 'xen-gnulinux-simple-$boot_device_id' {" | sed "s/^/$submenu_indentation/"
fi
if [ x$type != xrecovery ] ; then
save_default_entry | grub_add_tab | sed "s/^/$submenu_indentation/"
fi
if [ -z "${prepare_boot_cache}" ]; then
prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | grub_add_tab)"
fi
printf '%s\n' "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/"
xmessage="$(gettext_printf "Loading Xen %s ..." ${xen_version})"
lmessage="$(gettext_printf "Loading Linux %s ..." ${version})"
sed "s/^/$submenu_indentation/" << EOF
echo '$(echo "$xmessage" | grub_quote)'
if [ "\$grub_platform" = "pc" -o "\$grub_platform" = "" ]; then
xen_rm_opts=
else
xen_rm_opts="no-real-mode edd=off"
fi
${xen_loader} ${rel_xen_dirname}/${xen_basename} placeholder ${xen_args} \${xen_rm_opts}
echo '$(echo "$lmessage" | grub_quote)'
${module_loader} ${rel_dirname}/${basename} placeholder root=${linux_root_device_thisversion} ro ${args}
EOF
if test -n "${initrd}" ; then
# TRANSLATORS: ramdisk isn't identifier. Should be translated.
message="$(gettext_printf "Loading initial ramdisk ...")"
initrd_path=
for i in ${initrd}; do
initrd_path="${initrd_path} ${rel_dirname}/${i}"
done
sed "s/^/$submenu_indentation/" << EOF
echo '$(echo "$message" | grub_quote)'
${module_loader} --nounzip $(echo $initrd_path)
EOF
fi
sed "s/^/$submenu_indentation/" << EOF
}
EOF
}
linux_list=
for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* /boot/kernel-*; do
if grub_file_is_not_garbage "$i"; then
basename=$(basename $i)
version=$(echo $basename | sed -e "s,^[^0-9]*-,,g")
dirname=$(dirname $i)
config=
for j in "${dirname}/config-${version}" "${dirname}/config-${alt_version}" "/etc/kernels/kernel-config-${version}" ; do
if test -e "${j}" ; then
config="${j}"
break
fi
done
if (grep -qx "CONFIG_XEN_DOM0=y" "${config}" 2> /dev/null || grep -qx "CONFIG_XEN_PRIVILEGED_GUEST=y" "${config}" 2> /dev/null); then linux_list="$linux_list $i" ; fi
fi
if [ "x${linux_list}" = "x" ] ; then
exit 0
fi
file_is_not_sym () {
case "$1" in
*/xen-syms-*)
return 1;;
*)
return 0;;
esac
}
xen_list=
for i in /boot/xen*; do
if grub_file_is_not_garbage "$i" && file_is_not_sym "$i" ; then xen_list="$xen_list $i" ; fi
prepare_boot_cache=
boot_device_id=
title_correction_code=
machine=`uname -m`
case "$machine" in
i?86) GENKERNEL_ARCH="x86" ;;
mips|mips64) GENKERNEL_ARCH="mips" ;;
mipsel|mips64el) GENKERNEL_ARCH="mipsel" ;;
arm*) GENKERNEL_ARCH="arm" ;;
*) GENKERNEL_ARCH="$machine" ;;
esac
# Extra indentation to add to menu entries in a submenu. We're not in a submenu
# yet, so it's empty. In a submenu it will be equal to '\t' (one tab).
submenu_indentation=""
is_top_level=true
while [ "x${xen_list}" != "x" ] ; do
list="${linux_list}"
current_xen=`version_find_latest $xen_list`
xen_basename=`basename ${current_xen}`
xen_dirname=`dirname ${current_xen}`
rel_xen_dirname=`make_system_path_relative_to_its_root $xen_dirname`
xen_version=`echo $xen_basename | sed -e "s,.gz$,,g;s,^xen-,,g"`
if [ -z "$boot_device_id" ]; then
boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")"
fi
if [ "x$is_top_level" != xtrue ]; then
echo " submenu '$(gettext_printf "Xen hypervisor, version %s" "${xen_version}" | grub_quote)' \$menuentry_id_option 'xen-hypervisor-$xen_version-$boot_device_id' {"
fi
if ($grub_file --is-arm64-efi $current_xen); then
xen_loader="xen_hypervisor"
module_loader="xen_module"
else
if ($grub_file --is-x86-multiboot2 $current_xen); then
xen_loader="multiboot2"
module_loader="module2"
else
xen_loader="multiboot"
module_loader="module"
fi
fi
initrd_early=
for i in ${GRUB_EARLY_INITRD_LINUX_STOCK} \
${GRUB_EARLY_INITRD_LINUX_CUSTOM}; do
if test -e "${xen_dirname}/${i}" ; then
initrd_early="${initrd_early} ${i}"
fi
done
while [ "x$list" != "x" ] ; do
linux=`version_find_latest $list`
gettext_printf "Found linux image: %s\n" "$linux" >&2
basename=`basename $linux`
dirname=`dirname $linux`
rel_dirname=`make_system_path_relative_to_its_root $dirname`
version=`echo $basename | sed -e "s,^[^0-9]*-,,g"`
alt_version=`echo $version | sed -e "s,\.old$,,g"`
linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"
initrd_real=
for i in "initrd.img-${version}" "initrd-${version}.img" "initrd-${version}.gz" \
"initrd-${version}" "initramfs-${version}.img" \
"initrd.img-${alt_version}" "initrd-${alt_version}.img" \
"initrd-${alt_version}" "initramfs-${alt_version}.img" \
"initramfs-genkernel-${version}" \
"initramfs-genkernel-${alt_version}" \
"initramfs-genkernel-${GENKERNEL_ARCH}-${version}" \
"initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}" ; do
if test -e "${dirname}/${i}" ; then
initrd_real="$i"
break
fi
done
initrd=
if test -n "${initrd_early}" || test -n "${initrd_real}"; then
initrd="${initrd_early} ${initrd_real}"
initrd_display=
for i in ${initrd}; do
initrd_display="${initrd_display} ${dirname}/${i}"
done
gettext_printf "Found initrd image: %s\n" "$(echo $initrd_display)" >&2
fi
if test -z "${initrd_real}"; then
# "UUID=" magic is parsed by initrds. Since there's no initrd, it can't work here.
if [ "x${GRUB_DEVICE_PARTUUID}" = "x" ] \
|| [ "x${GRUB_DISABLE_LINUX_PARTUUID}" = "xtrue" ]; then
linux_root_device_thisversion=${GRUB_DEVICE}
else
linux_root_device_thisversion=PARTUUID=${GRUB_DEVICE_PARTUUID}
fi
fi
if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xy ]; then
linux_entry "${OS}" "${version}" "${xen_version}" simple \
"${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" "${GRUB_CMDLINE_XEN} ${GRUB_CMDLINE_XEN_DEFAULT}"
submenu_indentation="$grub_tab$grub_tab"
if [ -z "$boot_device_id" ]; then
boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")"
fi
# TRANSLATORS: %s is replaced with an OS name
echo "submenu '$(gettext_printf "Advanced options for %s (with Xen hypervisor)" "${OS}" | grub_quote)' \$menuentry_id_option 'gnulinux-advanced-$boot_device_id' {"
echo " submenu '$(gettext_printf "Xen hypervisor, version %s" "${xen_version}" | grub_quote)' \$menuentry_id_option 'xen-hypervisor-$xen_version-$boot_device_id' {"
is_top_level=false
fi
linux_entry "${OS}" "${version}" "${xen_version}" advanced \
"${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" "${GRUB_CMDLINE_XEN} ${GRUB_CMDLINE_XEN_DEFAULT}"
for supported_init in ${SUPPORTED_INITS}; do
init_path="${supported_init#*:}"
if [ -x "${init_path}" ] && [ "$(readlink -f /sbin/init)" != "$(readlink -f "${init_path}")" ]; then
linux_entry "${OS}" "${version}" "${xen_version}" "init-${supported_init%%:*}" \
"${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT} init=${init_path}" "${GRUB_CMDLINE_XEN} ${GRUB_CMDLINE_XEN_DEFAULT}"
fi
done
if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then
linux_entry "${OS}" "${version}" "${xen_version}" recovery \
"single ${GRUB_CMDLINE_LINUX}" "${GRUB_CMDLINE_XEN}"
fi
list=`echo $list | tr ' ' '\n' | fgrep -vx "$linux" | tr '\n' ' '`
done
if [ x"$is_top_level" != xtrue ]; then
echo ' }'
fi
xen_list=`echo $xen_list | tr ' ' '\n' | fgrep -vx "$current_xen" | tr '\n' ' '`
# If at least one kernel was found, then we need to
# add a closing '}' for the submenu command.
if [ x"$is_top_level" != xtrue ]; then
echo '}'
fi
echo "$title_correction_code"
================ sda8/etc/grub.d/47_os-prober_proxy (filtered) =================
#!/bin/sh
#THIS IS A GRUB PROXY SCRIPT
sh -c 'echo "### BEGIN /etc/grub.d/proxifiedScripts/os-prober ###";
"/etc/grub.d/proxifiedScripts/os-prober";
echo "### END /etc/grub.d/proxifiedScripts/os-prober ###";
echo "### BEGIN /etc/grub.d/proxifiedScripts/custom ###";
"/etc/grub.d/proxifiedScripts/custom";
echo "### END /etc/grub.d/proxifiedScripts/custom ###";' | /etc/grub.d/bin/grubcfg_proxy "+*
+#text
-'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'~768e446bcb4366d4184c7520146ae71f~
-'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~def9f44788c6a930d79bd7a59a0b3ea1~
-'SUBMENU' as 'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'{-'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'/*, -* from '/etc/grub.d/proxifiedScripts/custom', -'Kubuntu, with Linux 5.8.0-55-generic (recovery mode) (sur /dev/sda6)'~f913ae8a4baae33406385b4b06b2cecd~ from '/etc/grub.d/proxifiedScripts/custom', -#text from '/etc/grub.d/proxifiedScripts/custom', -'Ubuntu Version 2 (sur /dev/sda5)'~29df3a42d5c4d438ddcc3d7ee97dc9b6~ from '/etc/grub.d/proxifiedScripts/custom', -'Kubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'~768e446bcb4366d4184c7520146ae71f~ as 'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)' from '/etc/grub.d/proxifiedScripts/custom', -'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~1233d6cf7bad2da39039d5ee7f33cefb~ from '/etc/grub.d/proxifiedScripts/custom', -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'/'Ubuntu (sur /dev/sda6)'~f07656a1c31925ac00537e6e977a73f9~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'/'Ubuntu, with Linux 5.8.0-55-generic (sur /dev/sda6)'~f07656a1c31925ac00537e6e977a73f9~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'/'Ubuntu, with Linux 5.8.0-55-generic (recovery mode) (sur /dev/sda6)'~f913ae8a4baae33406385b4b06b2cecd~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'/'Ubuntu, with Linux 5.8.0-43-generic (sur /dev/sda6)'~da6523b68aac80f70b41c8fd2f4f1492~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'/'Ubuntu, with Linux 5.8.0-43-generic (recovery mode) (sur /dev/sda6)'~7386609929d50a35d4d2204be0cc504c~}
-'SUBMENU' as 'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'{-'Kubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'~768e446bcb4366d4184c7520146ae71f~ as 'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)' from '/etc/grub.d/proxifiedScripts/custom', -'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~1233d6cf7bad2da39039d5ee7f33cefb~ from '/etc/grub.d/proxifiedScripts/custom', -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/*, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~15b614c0dba27f22188ed7140243eac9~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~15b614c0dba27f22188ed7140243eac9~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~15b614c0dba27f22188ed7140243eac9~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~4340f174b9b7181ec8c36b5edf6f6a33~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~fd14b5878d129e6ba97ff9d4ab34ddc5~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~ad250c844b00e8d7d6ffd656003c9b06~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~ae1f26c10d0549738457b480f0220759~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~15b614c0dba27f22188ed7140243eac9~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~15b614c0dba27f22188ed7140243eac9~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~15b614c0dba27f22188ed7140243eac9~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~4340f174b9b7181ec8c36b5edf6f6a33~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~fd14b5878d129e6ba97ff9d4ab34ddc5~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~ad250c844b00e8d7d6ffd656003c9b06~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~ae1f26c10d0549738457b480f0220759~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~15b614c0dba27f22188ed7140243eac9~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~15b614c0dba27f22188ed7140243eac9~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~4340f174b9b7181ec8c36b5edf6f6a33~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~fd14b5878d129e6ba97ff9d4ab34ddc5~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~ad250c844b00e8d7d6ffd656003c9b06~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~ae1f26c10d0549738457b480f0220759~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~15b614c0dba27f22188ed7140243eac9~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~15b614c0dba27f22188ed7140243eac9~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~4340f174b9b7181ec8c36b5edf6f6a33~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~fd14b5878d129e6ba97ff9d4ab34ddc5~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~ad250c844b00e8d7d6ffd656003c9b06~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~ae1f26c10d0549738457b480f0220759~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~c29d7d9ef6898720dd6851777e4b3e5d~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~8f21d05358acdf109da6b71484fbbe62~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~63866ab370a570e247c9059558d9f5fd~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~6c2877d43293e64797f28201e318d096~}
" multi
================= sda8/etc/grub.d/48_uefi-firmware (filtered) ==================
#! /bin/sh
set -e
# grub-mkconfig helper script.
# Copyright (C) 2012 Free Software Foundation, Inc.
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see <http://www.gnu.org/licenses/>.
prefix="/usr"
exec_prefix="/usr"
datarootdir="/usr/share"
export TEXTDOMAIN=grub
export TEXTDOMAINDIR="${datarootdir}/locale"
. "${datarootdir}/grub/grub-mkconfig_lib"
efi_vars_dir=/sys/firmware/efi/vars
EFI_GLOBAL_VARIABLE=8be4df61-93ca-11d2-aa0d-00e098032b8c
OsIndications="$efi_vars_dir/OsIndicationsSupported-$EFI_GLOBAL_VARIABLE/data"
if [ -e "$OsIndications" ] && \
[ "$(( $(printf 0x%x \'"$(cat $OsIndications | cut -b1)") & 1 ))" = 1 ]; then
LABEL="UEFI Firmware Settings"
gettext_printf "Adding boot menu entry for UEFI Firmware Settings\n" >&2
onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
cat << EOF
menuentry '$LABEL' \$menuentry_id_option 'uefi-firmware' {
fwsetup
}
EOF
fi
================== sda8/etc/grub.d/49_custom_proxy (filtered) ==================
#!/bin/sh
#THIS IS A GRUB PROXY SCRIPT
'/etc/grub.d/proxifiedScripts/custom' | /etc/grub.d/bin/grubcfg_proxy "-*
-'Ubuntu Version 2 (sur /dev/sda5)'~29df3a42d5c4d438ddcc3d7ee97dc9b6~
-'Kubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'~768e446bcb4366d4184c7520146ae71f~ as 'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'
-'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~1233d6cf7bad2da39039d5ee7f33cefb~
+#text
-'Kubuntu, with Linux 5.8.0-55-generic (recovery mode) (sur /dev/sda6)'~f913ae8a4baae33406385b4b06b2cecd~ as 'Ubuntu, with Linux 5.8.0-55-generic (recovery mode) (sur /dev/sda6)'
"
====================== sdc1/boot/grub/grub.cfg (filtered) ======================
Try or Install Ubuntu MATE
Ubuntu MATE (safe graphics)
OEM install (for manufacturers)
Boot from next volume
UEFI Firmware Settings
Test memory
==================== sdc1: Location of files loaded by Grub ====================
GiB - GB File Fragment(s)
?? = ?? boot/grub/grub.cfg 1
Suggested repair: ______________________________________________________________
The default repair of the Boot-Repair utility would purge (in order to fix packages) and reinstall the grub-efi of
sda6,
using the following options: sda1/boot/efi
Additional repair would be performed: unhide-bootmenu-10s use-standard-efi-file
Blockers in case of suggested repair: __________________________________________
The current session is in BIOS-compatibility mode. Please disable BIOS-compatibility/CSM/Legacy mode in your UEFI firmware, and use this software from a live-CD (or live-USB) that is compatible with UEFI booting mode. For example, use a live-USB of Boot-Repair-Disk-64bit (www.sourceforge.net/p/boot-repair-cd), after making sure your BIOS is set up to boot USB in EFI mode. This will enable this feature.
Final advice in case of suggested repair: ______________________________________
Please do not forget to make your UEFI firmware boot on the L'OS actuellement utilisé - Ubuntu 22.04.3 LTS entry (sda1/efi/****/grub****.efi (**** will be updated in the final message) file) !
The boot of your PC is in BIOS-compatibility/CSM/Legacy mode. You may want to retry after changing it to UEFI mode.
Conseils pour les nouveaux demandeurs et pas qu'eux
Important : Pensez à passer vos sujets en [Résolu] lorsque ceux-ci le sont, au début du titre en cliquant sur Modifier sous le premier message, et un bref récapitulatif de la solution à la fin de celui-ci. Merci. Membre de Linux-Azur
Hors ligne
#3 Le 31/12/2023, à 12:17
- RICO21
Re : Problème de boot
Merci,d'avoir prévenu "pour les spécialistes" c'est beau:D
Mais je n'y comprend absolument rien!
Cordialement
Didier
Hors ligne
#4 Le 31/12/2023, à 12:41
- geole
Re : Problème de boot
Bonjour.
Tu dois aller dans bios de ton ordinateur et régler les priorités de boot.
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
#5 Le 31/12/2023, à 19:06
- RICO21
Re : Problème de boot
geole
Oui je le sais, cela fait 5 jours que je fait tous les moyens pour booter autrement que sur le Disque dur
Voila mon problème, depuis une installation de kubuntu
Merci
Cordialement
Didier
Hors ligne
#6 Le 31/12/2023, à 19:36
- geole
Re : Problème de boot
Cela n'a rien a voir avec le logiciel stocké sur le disque dur. C'est une affaire de bios et de matériel.
Es-tu capable de visualiser le bios?
Si ton ordinateur est un portable, donne sa référence commerciale
Si ton ordinateur est une tour, donne la référence de la carte mère
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 01/01/2024, à 11:53
- RICO21
Re : Problème de boot
Bonjour et bonne année 2024
# dmidecode 3.3
Getting SMBIOS data from sysfs.
SMBIOS 2.6 present.
Handle 0x0002, DMI type 2, 15 bytes
Base Board Information
Manufacturer: SAMSUNG ELECTRONICS CO.,LTD
Product Name: SAMSUNG_DT1234567890
Version: SEC_SW_REVISION_1234567890ABCD
Serial Number: 123490EN400015
Asset Tag: Base Board Asset Tag
Features:
Board is a hosting board
Board is replaceable
Location In Chassis: Part Component
Chassis Handle: 0x0000
Type: Motherboard
Contained Object Handles: 0
Hors ligne
#8 Le 01/01/2024, à 12:29
- geole
Re : Problème de boot
Bonjour.
Lire le dernier échange de cette discussion.
Dernière modification par geole (Le 01/01/2024, à 12:30)
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
#9 Le 02/01/2024, à 10:49
- RICO21
Re : Problème de boot
Bonjour
Moi j’atteins mon bios, je je peu choisir tous
mais il ne boot pas
j'ai testé le disque qui tourne mais ne se lance pas et tous mes ports usb
Cordialement
Didier
Hors ligne
#10 Le 02/01/2024, à 11:00
- RICO21
Re : Problème de boot
Hors ligne
#11 Le 02/01/2024, à 11:17
- xubu1957
Re : Problème de boot
Bonjour,
Collage :
boot-repair-4ppa2075 [20240102_0957]
============================== Boot Info Summary ===============================
=> Grub2 (v2.00) is installed in the MBR of /dev/sda and looks at sector 1 of
the same hard drive for core.img. core.img is at this location and looks
for (,msdos6)/boot/grub. It also embeds following components:
modules
---------------------------------------------------------------------------
fshelp ext2 part_msdos biosdisk
---------------------------------------------------------------------------
sda1: __________________________________________________________________________
File system: vfat
Boot sector type: FAT32
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files:
sda2: __________________________________________________________________________
File system: Extended Partition
Boot sector type: Unknown
Boot sector info:
sda5: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 22.04.3 LTS
Boot files: /boot/grub/grub.cfg /etc/fstab /etc/default/grub
sda6: __________________________________________________________________________
File system: ext3
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 22.04.3 LTS
Boot files: /boot/grub/grub.cfg /etc/fstab /etc/default/grub
/boot/grub/i386-pc/core.img
sda7: __________________________________________________________________________
File system: vfat
Boot sector type: FAT32
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files:
sda8: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 22.04.3 LTS
Boot files: /boot/grub/grub.cfg /etc/fstab /etc/default/grub
/boot/grub/i386-pc/core.img
================================ 3 OS detected =================================
OS#1: L'OS actuellement utilisé - Ubuntu 22.04.3 LTS on sda6
OS#2: Ubuntu 22.04.3 LTS on sda5
OS#3: Ubuntu 22.04.3 LTS on sda8
================================ Host/Hardware =================================
CPU architecture: 64-bit
Video: 2nd Generation Core Processor Family Integrated Graphics Controller from Intel Corporation
BOOT_IMAGE of the installed session in use:
/boot/vmlinuz-5.15.0-91-generic root=/dev/sda6 ro quiet splash vt.handoff=7
df -Th / : /dev/sda6 ext3 430G 27G 382G 7% /
===================================== UEFI =====================================
BIOS/UEFI firmware: 03OV(0.1) from SAMSUNG ELECTRONICS CO.,LTD
This installed-session is in Legacy/BIOS/CSM mode (not in EFI mode).
============================= Drive/Partition Info =============================
Disks info: ____________________________________________________________________
sda : notGPT, no-BIOSboot, has---ESP, not-usb, not-mmc, has-os, no-wind, 2048 sectors * 512 bytes
Partitions info (1/3): _________________________________________________________
sda6 : is-os, 64, apt-get, grub-pc , grub2, grub-install, grubenv-ok, update-grub, end-after-100GB
sda7 : no-os, 64, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, end-after-100GB
sda5 : is-os, 64, apt-get, signed grub-pc grub-efi , grub2, grub-install, grubenv-ok, update-grub, end-after-100GB
sda1 : no-os, 64, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, not-far
sda8 : is-os, 64, apt-get, grub-pc , grub2, grub-install, grubenv-ok, update-grub, end-after-100GB
Partitions info (2/3): _________________________________________________________
sda6 : isnotESP, fstab-without-efi, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
sda7 : isnotESP, part-has-no-fstab, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
sda5 : isnotESP, fstab-without-efi, 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
sda8 : isnotESP, fstab-has-goodEFI, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
Partitions info (3/3): _________________________________________________________
sda6 : not--sepboot, with-boot, fstab-without-boot, not-sep-usr, with--usr, fstab-without-usr, customized, sda
sda7 : not--sepboot, no---boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, no--grub.d, sda
sda5 : 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, no--grub.d, sda
sda8 : not--sepboot, with-boot, fstab-without-boot, not-sep-usr, with--usr, fstab-without-usr, customized, sda
fdisk -l (filtered): ___________________________________________________________
Disk sda: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk identifier: 0x5fca773f
Boot Start End Sectors Size Id Type
sda1 * 2048 1050623 1048576 512M ef EFI (FAT-12/16/32)
sda2 1052670 1953523711 1952471042 931G 5 Extended
sda5 1052672 533109222 532056551 253.7G 83 Linux
sda6 1037115392 1953523711 916408320 437G 83 Linux
sda7 533110784 534159359 1048576 512M b W95 FAT32
sda8 534161408 1037113343 502951936 239.8G 83 Linux
Partition table entries are not in disk order.
parted -lm (filtered): _________________________________________________________
sda:1000GB:scsi:512:512:msdos:ATA SAMSUNG HD103SJ:;
1:1049kB:538MB:537MB:fat32::boot, esp;
2:539MB:1000GB:1000GB:::;
5:539MB:273GB:272GB:ext4::;
7:273GB:273GB:537MB:fat32::;
8:273GB:531GB:258GB:ext4::;
6:531GB:1000GB:469GB:ext3::;
blkid (filtered): ______________________________________________________________
NAME FSTYPE UUID PARTUUID LABEL PARTLABEL
sda
├─sda1 vfat 66ED-D9A6 5fca773f-01
├─sda2 5fca773f-02
├─sda5 ext4 2b3b889e-3907-42ca-9c4d-69f17f40fff9 5fca773f-05
├─sda6 ext3 c553e607-41ed-4b6c-9b01-e421a747f175 5fca773f-06
├─sda7 vfat 5292-364F 5fca773f-07
└─sda8 ext4 993c5bf5-7126-4218-9190-ca55eebb0214 5fca773f-08
Mount points (filtered): _______________________________________________________
Avail Use% Mounted on
/dev/sda1 511M 0% /mnt/boot-sav/sda1
/dev/sda5 196.9G 16% /media/rico/2b3b889e-3907-42ca-9c4d-69f17f40fff9
/dev/sda6 381.1G 6% /
/dev/sda7 511M 0% /media/rico/5292-364F
/dev/sda8 140.2G 35% /media/rico/993c5bf5-7126-4218-9190-ca55eebb0214
Mount options (filtered): ______________________________________________________
/dev/sda1 vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro
/dev/sda5 ext4 rw,nosuid,nodev,relatime,errors=remount-ro
/dev/sda6 ext3 rw,relatime,errors=remount-ro
/dev/sda7 vfat rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro
/dev/sda8 ext4 rw,nosuid,nodev,relatime,errors=remount-ro
====================== sda5/boot/grub/grub.cfg (filtered) ======================
Ubuntu 2b3b889e-3907-42ca-9c4d-69f17f40fff9
Ubuntu 22.04.3 LTS (22.04) (on sda6) c553e607-41ed-4b6c-9b01-e421a747f175
Ubuntu 22.04.3 LTS (22.04) (on sda8) 993c5bf5-7126-4218-9190-ca55eebb0214
### END /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_uefi-firmware ###
========================== sda5/etc/fstab (filtered) ===========================
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda5 during installation
UUID=2b3b889e-3907-42ca-9c4d-69f17f40fff9 / ext4 errors=remount-ro 0 1
/swapfile none swap sw 0 0
======================= sda5/etc/default/grub (filtered) =======================
GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
==================== sda5: Location of files loaded by Grub ====================
GiB - GB File Fragment(s)
22,707092285 = 24,381554688 boot/grub/grub.cfg 1
222,093326569 = 238,470893568 boot/vmlinuz 2
251,950267792 = 270,529540096 boot/vmlinuz-5.15.0-91-generic 1
32,397613525 = 34,786672640 boot/vmlinuz-6.2.0-39-generic 1
222,093326569 = 238,470893568 boot/vmlinuz-6.5.0-14-generic 2
32,397613525 = 34,786672640 boot/vmlinuz.old 1
224,909717560 = 241,494970368 boot/initrd.img 2
223,316867828 = 239,784660992 boot/initrd.img-5.15.0-91-generic 6
221,712730408 = 238,062231552 boot/initrd.img-6.2.0-39-generic 1
224,909717560 = 241,494970368 boot/initrd.img-6.5.0-14-generic 2
221,712730408 = 238,062231552 boot/initrd.img.old 1
===================== sda5: ls -l /etc/grub.d/ (filtered) ======================
-rwxr-xr-x 1 root root 18683 Dec 18 2022 10_linux
-rwxr-xr-x 1 root root 43031 Dec 18 2022 10_linux_zfs
-rwxr-xr-x 1 root root 14387 Dec 18 2022 20_linux_xen
-rwxr-xr-x 1 root root 13369 Dec 18 2022 30_os-prober
-rwxr-xr-x 1 root root 1372 Dec 18 2022 30_uefi-firmware
-rwxr-xr-x 1 root root 700 Jul 3 2022 35_fwupd
-rwxr-xr-x 1 root root 214 Jan 13 2021 40_custom
-rwxr-xr-x 1 root root 215 Dec 18 2022 41_custom
====================== sda6/boot/grub/grub.cfg (filtered) ======================
Ubuntu c553e607-41ed-4b6c-9b01-e421a747f175
Ubuntu 22.04.3 LTS (22.04) (on sda5) 2b3b889e-3907-42ca-9c4d-69f17f40fff9
Ubuntu 22.04.3 LTS (22.04) (on sda8) 993c5bf5-7126-4218-9190-ca55eebb0214
### END /etc/grub.d/30_os-prober_proxy ###
### END /etc/grub.d/30_uefi-firmware ###
========================== sda6/etc/fstab (filtered) ===========================
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda6 during installation
UUID=c553e607-41ed-4b6c-9b01-e421a747f175 / ext3 errors=remount-ro 0 1
/swapfile none swap sw 0 0
/dev/disk/by-id/ata-MATSHITADVD-RAM_UJ8A7AS_UL87_065320 /mnt/ata-MATSHITADVD-RAM_UJ8A7AS_UL87_065320 auto nosuid,nodev,nofail,noauto,x-gvfs-show 0 0
======================= sda6/etc/default/grub (filtered) =======================
GRUB_DEFAULT="Ubuntu"
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=""
GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
GRUB_TERMINAL="console"
GRUB_GFXMODE="640x480"
GRUB_DISABLE_LINUX_UUID="true"
GRUB_DISABLE_RECOVERY="true"
GRUB_INIT_TUNE="480 440 1"
GRUB_DISABLE_OS_PROBER="false"
GRUB_SAVEDEFAULT="false"
GRUB_DISABLE_LINUX_RECOVERY="true"
==================== sda6: Location of files loaded by Grub ====================
GiB - GB File Fragment(s)
646,451309204 = 694,121807872 boot/grub/grub.cfg 1
647,788349152 = 695,557443584 boot/grub/i386-pc/core.img 1
540,072158813 = 579,898064896 boot/vmlinuz 5
540,072158813 = 579,898064896 boot/vmlinuz-5.15.0-91-generic 5
540,072158813 = 579,898064896 boot/vmlinuz.old 5
646,107925415 = 693,753102336 boot/initrd.img 9
646,107925415 = 693,753102336 boot/initrd.img-5.15.0-91-generic 9
646,107925415 = 693,753102336 boot/initrd.img.old 9
===================== sda6: ls -l /etc/grub.d/ (filtered) ======================
-rwxr-xr-x 1 root root 18683 Dec 18 2022 10_linux
-rwxr-xr-x 1 root root 43031 Dec 18 2022 10_linux_zfs
-rwxr-xr-x 1 root root 14387 Dec 18 2022 20_linux_xen
-rwxr-xr-x 1 root root 7175 Dec 30 17:26 30_os-prober_proxy
-rwxr-xr-x 1 root root 1372 Dec 18 2022 30_uefi-firmware
-rwxr-xr-x 1 root root 700 May 11 2023 35_fwupd
-rwxr-xr-x 1 root root 214 Jan 13 2021 40_custom
-rwxr-xr-x 1 root root 215 Dec 18 2022 41_custom
drwxr-xr-x 4 root root 4096 Dec 28 18:27 backup
drwxr-xr-x 2 root root 4096 Dec 28 18:27 bin
drwxr-xr-x 2 root root 4096 Dec 30 17:26 proxifiedScripts
====================== sda8/boot/grub/grub.cfg (filtered) ======================
Ubuntu 993c5bf5-7126-4218-9190-ca55eebb0214
Ubuntu 20.04.2 LTS (20.04) (on sda5) 2b3b889e-3907-42ca-9c4d-69f17f40fff9
Ubuntu 20.04.2 LTS (20.04) (on sda6) 301aca02-850e-4f93-9185-7f2c0ded60ab
### END /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_uefi-firmware ###
Ubuntu, with Linux 5.8.0-55-generic (on sda6) 301aca02-850e-4f93-9185-7f2c0ded60ab
========================== sda8/etc/fstab (filtered) ===========================
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda8 during installation
UUID=993c5bf5-7126-4218-9190-ca55eebb0214 / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda7 during installation
UUID=5292-364F /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0
======================= sda8/etc/default/grub (filtered) =======================
GRUB_DEFAULT="0"
GRUB_TIMEOUT_STYLE="hidden"
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR="`lsb_release -i -s 2> /dev/null || echo Debian`"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
==================== sda8: Location of files loaded by Grub ====================
GiB - GB File Fragment(s)
355,350620270 = 381,554823168 boot/grub/grub.cfg 1
418,854316711 = 449,741398016 boot/grub/i386-pc/core.img 1
328,978668213 = 353,238155264 boot/vmlinuz 2
258,883007050 = 277,973512192 boot/vmlinuz-5.11.0-46-generic 1
266,601562500 = 286,261248000 boot/vmlinuz-5.15.0-50-generic 1
294,497066498 = 316,213817344 boot/vmlinuz-5.15.0-74-generic 2
388,671947479 = 417,333325824 boot/vmlinuz-5.15.0-79-generic 2
426,679759979 = 458,143903744 boot/vmlinuz-5.15.0-83-generic 1
425,171951294 = 456,524906496 boot/vmlinuz-5.15.0-88-generic 1
420,297515869 = 451,291021312 boot/vmlinuz-5.19.0-44-generic 2
389,610012054 = 418,340564992 boot/vmlinuz-5.19.0-46-generic 1
427,306789398 = 458,817171456 boot/vmlinuz-6.2.0-32-generic 1
388,298980713 = 416,932855808 boot/vmlinuz-6.2.0-34-generic 1
328,978668213 = 353,238155264 boot/vmlinuz-6.2.0-36-generic 2
425,171951294 = 456,524906496 boot/vmlinuz.old 1
453,757202148 = 487,218085888 boot/initrd.img 3
322,458763123 = 346,237460480 boot/initrd.img-5.11.0-46-generic 1
322,333003998 = 346,102427648 boot/initrd.img-5.15.0-50-generic 4
452,575115204 = 485,948829696 boot/initrd.img-5.15.0-74-generic 1
452,293880463 = 485,646856192 boot/initrd.img-5.15.0-79-generic 1
454,026981354 = 487,507759104 boot/initrd.img-5.15.0-83-generic 1
453,458003998 = 486,896824320 boot/initrd.img-5.15.0-88-generic 2
453,174919128 = 486,592864256 boot/initrd.img-5.19.0-44-generic 1
454,370235443 = 487,876325376 boot/initrd.img-5.19.0-46-generic 2
452,014991760 = 485,347401728 boot/initrd.img-6.2.0-32-generic 3
451,632190704 = 484,936372224 boot/initrd.img-6.2.0-34-generic 3
453,757202148 = 487,218085888 boot/initrd.img-6.2.0-36-generic 3
453,458003998 = 486,896824320 boot/initrd.img.old 2
===================== sda8: ls -l /etc/grub.d/ (filtered) ======================
-rwxr-xr-x 1 root root 18683 Apr 15 2022 10_linux
-rwxr-xr-x 1 root root 936 Feb 2 2022 10_linux_proxy
-rwxr-xr-x 1 root root 43031 Apr 15 2022 10_linux_zfs
-rwxr-xr-x 1 root root 1330 Feb 2 2022 11_linux_proxy
-rwxr-xr-x 1 root root 14387 Dec 18 2022 20_linux_xen
-rwxr-xr-x 1 root root 13369 Apr 15 2022 30_os-prober
-rwxr-xr-x 1 root root 1372 Apr 15 2022 30_uefi-firmware
-rwxr-xr-x 1 root root 700 Feb 21 2022 35_fwupd
-rwxr-xr-x 1 root root 579 Feb 2 2022 40_custom_proxy
-rwxr-xr-x 1 root root 215 Apr 15 2022 41_custom
-rwxr-xr-x 1 root root 2876 Feb 2 2022 41_linux_proxy
-rwxr-xr-x 1 root root 42359 Jan 13 2021 42_linux_zfs
-rwxr-xr-x 1 root root 12894 Jan 13 2021 43_linux_xen
-rwxr-xr-x 1 root root 265 Feb 2 2022 44_memtest86+_proxy
-rwxr-xr-x 1 root root 7099 Feb 2 2022 47_os-prober_proxy
-rwxr-xr-x 1 root root 1424 Jan 13 2021 48_uefi-firmware
-rwxr-xr-x 1 root root 579 Feb 2 2022 49_custom_proxy
-rwxr-xr-x 1 root root 216 Jan 13 2021 50_custom
drwxr-xr-x 4 root root 4096 Jun 23 2021 backup
drwxr-xr-x 2 root root 4096 Jun 23 2021 bin
drwxr-xr-x 2 root root 4096 Feb 2 2022 proxifiedScripts
================== sda8/etc/grub.d/11_linux_proxy (filtered) ===================
#!/bin/sh
#THIS IS A GRUB PROXY SCRIPT
sh -c 'echo "### BEGIN /etc/grub.d/proxifiedScripts/linux ###";
"/etc/grub.d/proxifiedScripts/linux";
echo "### END /etc/grub.d/proxifiedScripts/linux ###";
echo "### BEGIN /etc/grub.d/proxifiedScripts/custom ###";
"/etc/grub.d/proxifiedScripts/custom";
echo "### END /etc/grub.d/proxifiedScripts/custom ###";' | /etc/grub.d/bin/grubcfg_proxy "-*
-#text
-'Ubuntu'~6bbbad78a4f187a7740b203d620d6ef1~
+'SUBMENU' as 'Options avancées pour Ubuntu'{+'Options avancées pour Ubuntu'/*, +'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.13.0-27-generic'~e249c6dbe4ade262ef558fd27a67ba8b~, +'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.13.0-27-generic (recovery mode)'~1d9ecedc6834eb3a3e4cc42a7d6eb698~, -'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.13.0-25-generic'~c5d654aecd61875cdf8efee371414190~, -'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.13.0-25-generic (recovery mode)'~60d123d4413ff3064518a96bc0a9a9b5~, -'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.11.0-46-generic'~2b3407d6239873956191061fb4f94cca~, -'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.11.0-46-generic (recovery mode)'~4325840d0c4b0adc1b5cc9320a6b559e~, -'Ubuntu Version 2 (sur /dev/sda5)'~29df3a42d5c4d438ddcc3d7ee97dc9b6~ from '/etc/grub.d/proxifiedScripts/custom'}
" multi
================== sda8/etc/grub.d/40_custom_proxy (filtered) ==================
#!/bin/sh
#THIS IS A GRUB PROXY SCRIPT
'/etc/grub.d/proxifiedScripts/custom' | /etc/grub.d/bin/grubcfg_proxy "-'Kubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'~768e446bcb4366d4184c7520146ae71f~ as 'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'
-'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~1233d6cf7bad2da39039d5ee7f33cefb~
-'Ubuntu Version 2 (sur /dev/sda5)'~29df3a42d5c4d438ddcc3d7ee97dc9b6~
+*
+#text
-'Kubuntu, with Linux 5.8.0-55-generic (recovery mode) (sur /dev/sda6)'~f913ae8a4baae33406385b4b06b2cecd~ as 'Ubuntu, with Linux 5.8.0-55-generic (recovery mode) (sur /dev/sda6)'
"
================== sda8/etc/grub.d/41_linux_proxy (filtered) ===================
#!/bin/sh
#THIS IS A GRUB PROXY SCRIPT
sh -c 'echo "### BEGIN /etc/grub.d/proxifiedScripts/linux ###";
"/etc/grub.d/proxifiedScripts/linux";
echo "### END /etc/grub.d/proxifiedScripts/linux ###";
echo "### BEGIN /etc/grub.d/proxifiedScripts/custom ###";
"/etc/grub.d/proxifiedScripts/custom";
echo "### END /etc/grub.d/proxifiedScripts/custom ###";
echo "### BEGIN /etc/grub.d/proxifiedScripts/os-prober ###";
"/etc/grub.d/proxifiedScripts/os-prober";
echo "### END /etc/grub.d/proxifiedScripts/os-prober ###";' | /etc/grub.d/bin/grubcfg_proxy "-*
-#text
-'Ubuntu'~6bbbad78a4f187a7740b203d620d6ef1~
-'SUBMENU' as 'Options avancées pour Ubuntu'{-'Options avancées pour Ubuntu'/*, -'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.13.0-27-generic'~e249c6dbe4ade262ef558fd27a67ba8b~, -'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.13.0-27-generic (recovery mode)'~1d9ecedc6834eb3a3e4cc42a7d6eb698~, -'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.13.0-25-generic'~c5d654aecd61875cdf8efee371414190~, -'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.13.0-25-generic (recovery mode)'~60d123d4413ff3064518a96bc0a9a9b5~, -'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.11.0-46-generic'~2b3407d6239873956191061fb4f94cca~, -'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.11.0-46-generic (recovery mode)'~4325840d0c4b0adc1b5cc9320a6b559e~}
+'SUBMENU' as 'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'{+'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'/* from '/etc/grub.d/proxifiedScripts/os-prober', +'Kubuntu, with Linux 5.8.0-55-generic (recovery mode) (sur /dev/sda6)'~f913ae8a4baae33406385b4b06b2cecd~ from '/etc/grub.d/proxifiedScripts/custom', +'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'/'Ubuntu, with Linux 5.8.0-55-generic (recovery mode) (sur /dev/sda6)'~f913ae8a4baae33406385b4b06b2cecd~ from '/etc/grub.d/proxifiedScripts/os-prober', -'Kubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'~768e446bcb4366d4184c7520146ae71f~ from '/etc/grub.d/proxifiedScripts/custom', -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'/'Ubuntu (sur /dev/sda6)'~f07656a1c31925ac00537e6e977a73f9~ from '/etc/grub.d/proxifiedScripts/os-prober', -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'/'Ubuntu, with Linux 5.8.0-55-generic (sur /dev/sda6)'~f07656a1c31925ac00537e6e977a73f9~ from '/etc/grub.d/proxifiedScripts/os-prober', -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'/'Ubuntu, with Linux 5.8.0-43-generic (sur /dev/sda6)'~da6523b68aac80f70b41c8fd2f4f1492~ from '/etc/grub.d/proxifiedScripts/os-prober', -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'/'Ubuntu, with Linux 5.8.0-43-generic (recovery mode) (sur /dev/sda6)'~7386609929d50a35d4d2204be0cc504c~ from '/etc/grub.d/proxifiedScripts/os-prober'}
" multi
=================== sda8/etc/grub.d/42_linux_zfs (filtered) ====================
#! /bin/sh
set -e
# grub-mkconfig helper script.
# Copyright (C) 2019 Canonical Ltd.
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see <http://www.gnu.org/licenses/>.
prefix="/usr"
datarootdir="/usr/share"
ubuntu_recovery="1"
quiet_boot="1"
quick_boot="1"
gfxpayload_dynamic="1"
vt_handoff="1"
. "${pkgdatadir}/grub-mkconfig_lib"
export TEXTDOMAIN=grub
export TEXTDOMAINDIR="${datarootdir}/locale"
set -u
## Skip early if zfs utils isn't installed (instead of failing on first zpool list)
if ! `which zfs >/dev/null 2>&1`; then
exit 0
fi
imported_pools=""
MNTDIR="$(mktemp -d ${TMPDIR:-/tmp}/zfsmnt.XXXXXX)"
ZFSTMP="$(mktemp -d ${TMPDIR:-/tmp}/zfstmp.XXXXXX)"
machine="$(uname -m)"
case "${machine}" in
i?86) GENKERNEL_ARCH="x86" ;;
mips|mips64) GENKERNEL_ARCH="mips" ;;
mipsel|mips64el) GENKERNEL_ARCH="mipsel" ;;
arm*) GENKERNEL_ARCH="arm" ;;
*) GENKERNEL_ARCH="${machine}" ;;
esac
RC=0
on_exit() {
# Restore initial zpool import state
for pool in ${imported_pools}; do
zpool export "${pool}"
done
mountpoint -q "${MNTDIR}" && umount "${MNTDIR}" || true
rmdir "${MNTDIR}"
rm -rf "${ZFSTMP}"
exit "${RC}"
}
trap on_exit EXIT INT QUIT ABRT PIPE TERM
# List ONLINE and DEGRADED pools
import_pools() {
# We have to ignore zpool import output, as potentially multiple / will be available,
# and we need to autodetect all zpools this way with their real mountpoints.
local initial_pools="$(zpool list | awk '{if (NR>1) print $1}')"
local all_pools=""
local imported_pools=""
local err=""
set +e
err="$(zpool import -f -a -o cachefile=none -o readonly=on -N 2>&1)"
# Only print stderr if the command returned an error
# (it can echo "No zpool to import" with success, which we don't want)
if [ $? -ne 0 ]; then
echo "Some pools couldn't be imported and will be ignored:\n${err}" >&2
fi
set -e
all_pools="$(zpool list | awk '{if (NR>1) print $1}')"
for pool in ${all_pools}; do
if echo "${initial_pools}" | grep -wq "${pool}"; then
continue
fi
imported_pools="${imported_pools} ${pool}"
done
echo "${imported_pools}"
}
# List all the dataset with a root mountpoint
get_root_datasets() {
local pools="$(zpool list | awk '{if (NR>1) print $1}')"
for p in ${pools}; do
local rel_pool_root=$(zpool get -H altroot ${p} | awk '{print $3}')
if [ "${rel_pool_root}" = "-" ]; then
rel_pool_root="/"
fi
zfs list -H -o name,canmount,mountpoint -t filesystem | grep -E '^'"${p}"'(\s|/[[:print:]]*\s)(on|noauto)\s'"${rel_pool_root}"'$' | awk '{print $1}'
done
}
# find if given datasets can be mounted for directory and return its path (snapshot or real path)
# $1 is our current dataset name
# $2 directory path we look for (cannot contains /)
# $3 is the temporary mount directory to use
# $4 is the optional snapshot name
# return path for directory (which can be a mountpoint)
validate_system_dataset() {
local dataset="$1"
local directory="$2"
local mntdir="$3"
local snapshot_name="$4"
local mount_path="${mntdir}/${directory}"
if ! zfs list "${dataset}" >/dev/null 2>&1; then
return
fi
if ! mount -o noatime,zfsutil -t zfs "${dataset}" "${mount_path}"; then
grub_warn "Failed to find a valid directory '${directory}' for dataset '${dataset}@${snapshot_name}'. Ignoring"
return
fi
local candidate_path="${mount_path}"
if [ -n "${snapshot_name}" ]; then
# WORKAROUND a bug https://github.com/zfsonlinux/zfs/issues/9958
# Reading the content of a snapshot fails if it is not the first mount
# for a given dataset
first_mntdir=$(awk '{if ($1 == "'${dataset}'") {print $2; exit;}}' /proc/mounts)
if [ "${first_mntdir}" = "/" ]; then
# prevents // on candidate_path
first_mntdir=""
fi
candidate_path="${first_mntdir}/.zfs/snapshot/${snapshot_name}"
fi
if [ -n "$(ls ${candidate_path} 2>/dev/null)" ]; then
echo "${candidate_path}"
return
else
mountpoint -q "${mount_path}" && umount "${mount_path}" || true
fi
}
# Detect system directory relevant to the other, trying to find the ones associated on the current dataset or snapshot/
# System directory should be at most a direct child dataset of main datasets (no recursivity)
# We can fallback trying other zfs pools if no match has been found.
# $1 is our current dataset name (which can have @snapshot name)
# $2 directory path we look for (cannot contains /)
# $3 restrict_to_same_pool (true|false) force looking for dataset with the same basename in the current dataset pool only
# $4 is the temporary mount directory to use
# $5 is the optional etc directory (if not $2 is not etc itself)
# return path for directory (which can be a mountpoint)
get_system_directory() {
local dataset_path="$1"
local directory="$2"
local restrict_to_same_pool="$3"
local mntdir="$4"
local etc_dir="$5"
if [ -z "${etc_dir}" ]; then
etc_dir="${mntdir}/etc"
fi
local candidate_path="${mntdir}/${directory}"
# 1. Look for /etc/fstab first (which will mount even on top of non empty $directory)
local mounted_fstab_entry="false"
if [ -f "${etc_dir}/fstab" ]; then
mount_args=$(awk '/^[^#].*[ \t]\/'"${directory}"'[ \t]/ {print "-t", $3, $1}' "${etc_dir}/fstab")
if [ -n "${mount_args}" ]; then
mounted_fstab_entry="true"
mount -o noatime ${mount_args} "${candidate_path}" || mounted_fstab_entry="false"
fi
fi
# If directory isn't empty. Only count if coming from /etc/fstab. Will be
# handled below otherwise as we are interested in potential snapshots.
if [ "${mounted_fstab_entry}" = "true" -a -n "$(ls ${candidate_path} 2>/dev/null)" ]; then
echo "${candidate_path}"
return
fi
# 2. Handle zfs case, which can be a snapshots.
local base_dataset_path="${dataset_path}"
local snapshot_name=""
# For snapshots we extract the parent dataset
if echo "${dataset_path}" | grep -q '@'; then
base_dataset_path=$(echo "${dataset_path}" | cut -d '@' -f1)
snapshot_name=$(echo "${dataset_path}" | cut -d '@' -f2)
fi
base_dataset_name="${base_dataset_path##*/}"
base_pool="$(echo "${base_dataset_path}" | cut -d'/' -f1)"
# 2.a) Look for child dataset included in base dataset, which needs to hold same snapshot if any
candidate_path=$(validate_system_dataset "${base_dataset_path}/${directory}" "${directory}" "${mntdir}" "${snapshot_name}")
if [ -n "${candidate_path}" ]; then
echo "${candidate_path}"
return
fi
# 2.b) Look for current dataset (which is already mounted as /)
candidate_path="${mntdir}/${directory}"
if [ -n "${snapshot_name}" ]; then
# WORKAROUND a bug https://github.com/zfsonlinux/zfs/issues/9958
# Reading the content of a snapshot fails if it is not the first mount
# for a given dataset
first_mntdir=$(awk '{if ($1 == "'${base_dataset_path}'") {print $2; exit;}}' /proc/mounts)
if [ "${first_mntdir}" = "/" ]; then
# prevents // on candidate_path
first_mntdir=""
fi
candidate_path="${first_mntdir}/.zfs/snapshot/${snapshot_name}/${directory}"
fi
if [ -n "$(ls ${candidate_path} 2>/dev/null)" ]; then
echo "${candidate_path}"
return
fi
# 2.c) Look for every datasets in every pool which isn't the current dataset which holds:
# - the same dataset name (last section) than our base_dataset_name
# - mountpoint=directory
# - canmount!=off
all_same_base_dataset_name="$(zfs list -H -t filesystem -o name,canmount | awk '/^[^ ]+\/'"${base_dataset_name}"'[ \t](on|noauto)/ {print $1}') "
# order by local pool datasets first
current_pool_same_base_datasets=""
other_pools_same_base_datasets=""
root_pool=$(echo "${dataset_path%%/*}")
for d in ${all_same_base_dataset_name}; do
cur_dataset_pool=$(echo "${d%%/*}")
if echo "${cur_dataset_pool}" | grep -wq "${root_pool}" 2>/dev/null ; then
current_pool_same_base_datasets="${current_pool_same_base_datasets} ${d}"
else
other_pools_same_base_datasets="${other_pools_same_base_datasets} ${d}"
fi
done
ordered_same_base_datasets="${current_pool_same_base_datasets} ${other_pools_same_base_datasets}"
if [ "${restrict_to_same_pool}" = "true" ]; then
ordered_same_base_datasets="${current_pool_same_base_datasets}"
fi
# now, loop over them
for d in ${ordered_same_base_datasets}; do
cur_dataset_pool=$(echo "${d%%/*}")
rel_pool_root=$(zpool get -H altroot ${cur_dataset_pool} | awk '{print $3}')
if [ "${rel_pool_root}" = "-" ]; then
rel_pool_root=""
fi
# check mountpoint match
candidate_dataset=$(zfs get -H mountpoint ${d} | grep -E "mountpoint\s${rel_pool_root}/${directory}\s" | awk '{print $1}')
if [ -z "${candidate_dataset}" ]; then
continue
fi
candidate_path=$(validate_system_dataset "${candidate_dataset}" "${directory}" "${mntdir}" "${snapshot_name}")
if [ -n "${candidate_path}" ]; then
echo "${candidate_path}"
return
fi
done
# 2.d) If we didn't find anything yet: check for persistent datasets corresponding to our mountpoint, with canmount=on without any snapshot associated:
# Note: we go over previous datasets as well, but this is ok, as we didn't include them before.
all_mountable_datasets="$(zfs list -t filesystem -o name,canmount | awk '/^[^ ]+[ \t]+on/ {print $1}')"
# order by local pool datasets first
current_pool_datasets=""
other_pools_datasets=""
root_pool=$(echo "${dataset_path%%/*}")
for d in ${all_mountable_datasets}; do
cur_dataset_pool=$(echo "${d%%/*}")
if echo "${cur_dataset_pool}" | grep -wq "${root_pool}" 2>/dev/null ; then
current_pool_datasets="${current_pool_datasets} ${d}"
else
other_pools_datasets="${other_pools_datasets} ${d}"
fi
done
ordered_datasets="${current_pool_datasets} ${other_pools_datasets}"
if [ "${restrict_to_same_pool}" = "true" ]; then
ordered_datasets="${current_pool_datasets}"
fi
for d in ${ordered_datasets}; do
cur_dataset_pool=$(echo "${d%%/*}")
rel_pool_root=$(zpool get -H altroot ${cur_dataset_pool} | awk '{print $3}')
if [ "${rel_pool_root}" = "-" ]; then
rel_pool_root=""
fi
# check mountpoint match
candidate_dataset=$(zfs get -H mountpoint ${d} | grep -E "mountpoint\s${rel_pool_root}/${directory}\s" | awk '{print $1}')
if [ -z "${candidate_dataset}" ]; then
continue
fi
candidate_path=$(validate_system_dataset "${d}" "${directory}" "${mntdir}" "")
if [ -n "${candidate_path}" ]; then
echo "${candidate_path}"
return
fi
done
grub_warn "Failed to find a valid directory '${directory}' for dataset '${dataset_path}'. Ignoring"
return
}
# Try our default layout bpool as a prefered layout (fast path)
# This is get_system_directory for boot optimized for our default installation layout
# $1 is our current dataset name (which can have @snapshot name)
# $2 is the temporary mount directory to use
# return path for directory (which can be a mountpoint) if found
try_default_layout_bpool() {
local root_dataset_path="$1"
local mntdir="$2"
dataset_basename="${root_dataset_path##*/}"
candidate_dataset="bpool/BOOT/${dataset_basename}"
dataset_properties="$(zfs get -H mountpoint,canmount ${candidate_dataset} | cut -f3 | paste -sd ' ')"
if [ -z "${dataset_properties}" ]; then
return
fi
rel_pool_root=$(zpool get -H altroot bpool | awk '{print $3}')
if [ "${rel_pool_root}" = "-" ]; then
rel_pool_root=""
fi
snapshot_name="${dataset_basename##*@}"
[ "${snapshot_name}" = "${dataset_basename}" ] && snapshot_name=""
if [ -z "${snapshot_name}" ]; then
if ! echo "${dataset_properties}" | grep -Eq "${rel_pool_root}/boot (on|noauto)"; then
return
fi
else
candidate_dataset=$(echo "${candidate_dataset}" | cut -d '@' -f1)
fi
validate_system_dataset "${candidate_dataset}" "boot" "${mntdir}" "${snapshot_name}"
}
# Return if secure boot is enabled on that system
is_secure_boot_enabled() {
if LANG=C mokutil --sb-state 2>/dev/null | grep -qi enabled; then
echo "true"
return
fi
echo "false"
return
}
# Given a filesystem or snapshot dataset, returns dataset|machine id|pretty name|last used
# $1 is dataset we want information from
# $2 is the temporary mount directory to use
get_dataset_info() {
local dataset="$1"
local mntdir="$2"
local base_dataset="${dataset}"
local etc_dir="${mntdir}/etc"
local is_snapshot="false"
# For snapshot we extract the parent dataset
if echo "${dataset}" | grep -q '@'; then
base_dataset=$(echo "${dataset}" | cut -d '@' -f1)
is_snapshot="true"
fi
mount -o noatime,zfsutil -t zfs "${base_dataset}" "${mntdir}"
# read machine-id/os-release from /etc
etc_dir=$(get_system_directory "${dataset}" "etc" "true" "${mntdir}" "")
if [ -z "${etc_dir}" ]; then
grub_warn "Ignoring ${dataset}"
mountpoint -q "${mntdir}/etc" && umount "${mntdir}/etc" || true
umount "${mntdir}"
return
fi
machine_id=""
if [ -f "${etc_dir}/machine-id" ]; then
machine_id=$(cat "${etc_dir}/machine-id")
fi
# We have to use a random temporary id if we don't have any machine-id file or if this one is empty
# (mostly the case of new installations before first boot).
# Let's use the dataset name directly for this.
# Consequence is that all datasets are then separated.
if [ -z "${machine_id}" ]; then
machine_id="${dataset}"
fi
pretty_name=$(. "${etc_dir}/os-release" && echo "${PRETTY_NAME}")
mountpoint -q "${mntdir}/etc" && umount "${mntdir}/etc" || true
# read available kernels from /boot
boot_dir="$(try_default_layout_bpool "${dataset}" "${mntdir}")"
if [ -z "${boot_dir}" ]; then
boot_dir=$(get_system_directory "${dataset}" "boot" "false" "${mntdir}" "${etc_dir}")
fi
if [ -z "${boot_dir}" ]; then
grub_warn "Ignoring ${dataset}"
mountpoint -q "${mntdir}/boot" && umount "${mntdir}/boot" || true
umount "${mntdir}"
return
fi
initrd_list=""
kernel_list=""
list=$(find "${boot_dir}" -maxdepth 1 -type f -regex '.*/\(vmlinuz\|vmlinux\|kernel\)-.*')
while [ "x$list" != "x" ] ; do
linux=`version_find_latest $list`
list=`echo $list | tr ' ' '\n' | fgrep -vx "$linux" | tr '\n' ' '`
if ! grub_file_is_not_garbage "${linux}" ; then
continue
fi
# Filters entry if efi/non efi.
# Note that for now we allow kernel without .efi.signed as those are signed kernel
# on ubuntu, loaded by the shim.
case "${linux}" in
*.efi.signed)
if [ "$(is_secure_boot_enabled)" = "false" ]; then
continue
fi
;;
esac
linux_basename=$(basename "${linux}")
linux_dirname=$(dirname "${linux}")
version=$(echo "${linux_basename}" | sed -e "s,^[^0-9]*-,,g")
alt_version=$(echo "${version}" | sed -e "s,\.old$,,g")
gettext_printf "Found linux image: %s in %s\n" "${linux_basename}" "${dataset}" >&2
initrd=""
for i in "initrd.img-${version}" "initrd-${version}.img" "initrd-${version}.gz" \
"initrd-${version}" "initramfs-${version}.img" \
"initrd.img-${alt_version}" "initrd-${alt_version}.img" \
"initrd-${alt_version}" "initramfs-${alt_version}.img" \
"initramfs-genkernel-${version}" \
"initramfs-genkernel-${alt_version}" \
"initramfs-genkernel-${GENKERNEL_ARCH}-${version}" \
"initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}"; do
if test -e "${linux_dirname}/${i}" ; then
initrd="$i"
break
fi
done
if test -z "${initrd}" ; then
grub_warn "Couldn't find any valid initrd for dataset ${dataset}."
continue
fi
gettext_printf "Found initrd image: %s in %s\n" "${initrd}" "${dataset}" >&2
rel_linux_dirname=$(make_system_path_relative_to_its_root "${linux_dirname}")
initrd_list="${initrd_list}|${rel_linux_dirname}/${initrd}"
kernel_list="${kernel_list}|${rel_linux_dirname}/${linux_basename}"
done
initrd_list="${initrd_list#|}"
kernel_list="${kernel_list#|}"
initrd_device=$(${grub_probe} --target=device "${boot_dir}" | head -1)
mountpoint -q "${mntdir}/boot" && umount "${mntdir}/boot" || true
# We needed to look in / for snapshots on root dataset, umount there before zfs lazily unmount it
case "${boot_dir}" in /boot/.zfs/snapshot/*)
umount "${boot_dir}" || true
;;
esac
# for zsys snapshots: we want to know which kernel we successful last booted with
last_booted_kernel=$(zfs get -H com.ubuntu.zsys:last-booted-kernel "${dataset}" | awk '{print $3}')
# snapshot: last_used is dataset creation time
if [ "${is_snapshot}" = "true" ]; then
last_used="$(zfs get -pH creation "${dataset}" | awk -F '\t' '{print $3}')"
# otherwise, last_used is manually marked at boot/shutdown on a root dataset for zsys
else
# if current system, take current time
if zfs mount | awk '/[ \t]+\/$/ {print $1}' | grep -q ${dataset}; then
last_used=$(date +%s)
else
last_used=$(zfs get -H com.ubuntu.zsys:last-used "${dataset}" | awk '{print $3}')
# case of non zsys, or zsys without annotation, take /etc/machine-id stat (as we mounted with noatime).
# However, as systems can be relatime, if system is current mounted one, set current time (case of clone + reboot
# within the same d).
if [ "${last_used}" = "-" ]; then
last_used=$(stat --printf="%X" "${mntdir}/etc/os-release")
if [ -f "${mntdir}/etc/machine-id" ]; then
last_used=$(stat --printf="%X" "${mntdir}/etc/machine-id")
fi
fi
fi
fi
is_zsys=$(zfs get -H com.ubuntu.zsys:bootfs "${base_dataset}" | awk '{print $3}')
if [ -n "${initrd_list}" -a -n "${kernel_list}" ]; then
echo "${dataset}\t${is_zsys}\t${machine_id}\t${pretty_name}\t${last_used}\t${initrd_device}\t${initrd_list}\t${kernel_list}\t${last_booted_kernel}"
else
grub_warn "didn't find any valid initrd or kernel."
fi
umount "${mntdir}" || true
# We needed to look in / for snapshots on root dataset, umount the snapshot for etc before zfs lazily unmount it
case "${etc_dir}" in /.zfs/snapshot/*/etc)
snapshot_path="$(findmnt -n -o TARGET -T ${etc_dir})"
umount "${snapshot_path}" || true
;;
esac
}
# Scan available boot options and returns in a formatted list
# $1 is the temporary mount directory to use
bootlist() {
local mntdir="$1"
local boot_list=""
for dataset in $(get_root_datasets); do
# get information from current root dataset
boot_list="${boot_list}$(get_dataset_info ${dataset} ${mntdir})\n"
# get information from snapshots of this root dataset
for snapshot_dataset in $(zfs list -H -o name -t snapshot "${dataset}"); do
boot_list="${boot_list}$(get_dataset_info ${snapshot_dataset} ${mntdir})\n"
done
done
echo "${boot_list}"
}
# Order machine ids by last_used from their main entry
get_machines_sorted() {
local bootlist="$1"
local machineids="$(echo "${bootlist}" | awk '{print $3}' | sort -u)"
for machineid in ${machineids}; do
echo "${bootlist}" | awk 'BEGIN{FS="\t"} $1 !~ /.*@.*/ {print $5, $3}' | sort -nr | grep -E "[^^]\b${machineid}\b" | head -1
done | sort -nr | awk '{print $2}'
}
# Sort entries by last_used for a given machineid
sort_entries_for_machineid() {
local bootlist="$1"
local machineid="$2"
tab="$(printf '\t')"
echo "${bootlist}" | grep -E "[^^]\b${machineid}\b" | sort -k5,5r -k1,1 -t "${tab}"
}
# Return main entry index
get_main_entry() {
local entries="$1"
echo "${entries}" | awk 'BEGIN{FS="\t"} $1 !~ /.*@.*/ {print}' | head -1
}
# Return specific field at index from entry
get_field_from_entry() {
local entry="$1"
local index="$2"
echo "${entry}" | awk "BEGIN{FS=\"\t\"} {print \$$index}"
}
# Get the main entry metadata
main_entry_meta() {
local main_entry="$1"
initrd=$(get_field_from_entry "${main_entry}" 7 | cut -d'|' -f1)
kernel=$(get_field_from_entry "${main_entry}" 8 | cut -d'|' -f1)
# Take first element (most recent entry) which is not a snapshot
echo "${main_entry}" | awk "BEGIN{ FS=\"\t\"; OFS=\"\t\"} {print \$3, \$2, \"main\", \$4, \$1, \$6, \"$initrd\", \"$kernel\"}"
}
# Get advanced entries metadata
advanced_entries_meta() {
local main_entry="$1"
last_used_kernel="$(get_field_from_entry "${main_entry}" 9 )"
# We must align initrds with kernels.
# Adds initrds to the stack then pop them 1 by 1 as we process the kernels
set -- $(get_field_from_entry "${main_entry}" 7 | tr "|" " ")
for kernel in $(get_field_from_entry "${main_entry}" 8 | tr "|" " "); do
# get initrd and pop to the next one
initrd="$1"; shift
was_last_used_kernel="false"
kernel_basename=$(basename "${kernel}")
if [ "${kernel_basename}" = "${last_used_kernel}" ]; then
was_last_used_kernel="true"
fi
echo "${main_entry}" | awk "BEGIN{ FS=\"\t\"; OFS=\"\t\"} {print \$3, \$2, \"advanced\", \$4, \$1, \$6, \"$initrd\", \"$kernel\", \"$was_last_used_kernel\"}"
done
}
# Get history metadata
history_entries_meta() {
local entries="$1"
local main_dataset_name="$2"
local main_dataset_releasename="$3"
if [ -z "${entries}" ]; then
return
fi
# Traverse snapshots and clones
echo "${entries}" | while read entry; do
name=""
# Compute snapshot/filesystem dataset name
snap_dataset_name="$(get_field_from_entry "${entry}" 1)"
snapname="${snap_dataset_name##*@}"
# If, this is a clone, take what is after main_dataset_name
if [ "${snapname}" = "${snap_dataset_name}" ]; then
snapname="${snap_dataset_name##${main_dataset_name}_}"
# Handle manual user clone (not prefixed by "main_dataset_name")
snapname="${snapname##*/}"
fi
# We keep the snapname only if it is not only a zsys auto snapshot
if echo "${snapname}" | grep -q "^autozsys_"; then
snapname=""
fi
# We store the release only if it different from main dataset release (snapshot before a release upgrade)
releasename=$(get_field_from_entry "${entry}" 4)
if [ "${releasename}" = "${main_dataset_releasename}" ]; then
releasename=""
fi
# Snapshot date
foo="$(get_field_from_entry "${entry}" 5)"
snapdate="$(date -d @$(get_field_from_entry "${entry}" 5) "+%x @ %H:%M")"
# For snapshots/clones the name can have the following formats:
# <DATE>: autozsys, same release
# <OLD_RELEASE> on <DATE>: autozsys, different release
# <SNAPNAME> on <DATE>: Manual snapshot, same release
# <SNAPNAME>, <OLD_RELEASE> on <DATE>: Manual snapshot, different release
if [ "${snapname}" = "" -a "${releasename}" = "" ]; then
name="${snapdate}"
elif [ "${snapname}" = "" -a "${releasename}" != "" ]; then
name=$(gettext_printf "%s on %s" "${releasename}" "${snapdate}")
elif [ "${snapname}" != "" -a "${releasename}" = "" ]; then
name=$(gettext_printf "%s on %s" "${snapname}" "${snapdate}")
else # snapname != "" && releasename != ""
name=$(gettext_printf "%s, %s on %s" "${snapname}" "${releasename}" "${snapdate}")
fi
# Choose kernel and initrd if the snapshot was booted successfully on a specific kernel before
# Take latest by default if no match
initrd=$(get_field_from_entry "${entry}" 7 | cut -d'|' -f1)
kernel=$(get_field_from_entry "${entry}" 8 | cut -d'|' -f1)
last_used_kernel="$(get_field_from_entry "${entry}" 9)"
# We must align initrds with kernels.
# Adds initrds to the stack then pop them 1 by 1 as we process the kernels
set -- $(get_field_from_entry "${entry}" 7 | tr "|" " ")
for k in $(get_field_from_entry "${entry}" 8|tr "|" " "); do
# get initrd and pop to the next one
candidate_initrd="$1"; shift
kernel_basename=$(basename "${k}")
if [ "${kernel_basename}" = "${last_used_kernel}" ]; then
kernel="${k}"
initrd="${candidate_initrd}"
break
fi
done
echo "${entry}" | awk "BEGIN{ FS=\"\t\"; OFS=\"\t\"} {print \$3, \$2, \"history\", \"$name\", \$1, \$6, \"$initrd\", \"$kernel\"}"
done
}
# Generate metadata from a BOOTLIST that will subsequently used to generate
# the final grub menu entries
generate_grub_menu_metadata() {
local bootlist="$1"
# Sort machineids by last_used from their main entry
for machineid in $(get_machines_sorted "${bootlist}"); do
entries="$(sort_entries_for_machineid "${bootlist}" ${machineid})"
main_entry="$(get_main_entry "${entries}")"
if [ -z "$main_entry" ]; then
continue
fi
main_entry_meta "${main_entry}"
advanced_entries_meta "${main_entry}"
main_dataset_name="$(get_field_from_entry "${main_entry}" 1)"
main_dataset_releasename="$(get_field_from_entry "${main_entry}" 4)"
# grep -v errcode != 0 if there is no match. || true to not fail with -e
other_entries="$(echo "${entries}" | grep -v "${main_entry}" || true)"
history_entries_meta "${other_entries}" "${main_dataset_name}" "${main_dataset_releasename}"
done
}
# Print the configuration part common to all sections
# Note:
# If 10_linux runs these part will be defined twice in grub configuration
print_menu_prologue() {
cat << 'EOF'
function gfxmode {
set gfxpayload="${1}"
EOF
if [ "${vt_handoff}" = 1 ]; then
cat << 'EOF'
if [ "${1}" = "keep" ]; then
set vt_handoff=vt.handoff=1
else
set vt_handoff=
fi
EOF
fi
cat << EOF
}
EOF
# Use ELILO's generic "efifb" when it's known to be available.
# FIXME: We need an interface to select vesafb in case efifb can't be used.
GRUB_GFXPAYLOAD_LINUX="${GRUB_GFXPAYLOAD_LINUX:-}"
if [ "${GRUB_GFXPAYLOAD_LINUX}" != "" ] || [ "${gfxpayload_dynamic}" = 0 ]; then
echo "set linux_gfx_mode=${GRUB_GFXPAYLOAD_LINUX}"
else
cat << EOF
if [ "\${recordfail}" != 1 ]; then
if [ -e \${prefix}/gfxblacklist.txt ]; then
if hwmatch \${prefix}/gfxblacklist.txt 3; then
if [ \${match} = 0 ]; then
set linux_gfx_mode=keep
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=keep
fi
else
set linux_gfx_mode=text
fi
EOF
fi
cat << EOF
export linux_gfx_mode
EOF
}
# Cache for prepare_grub_to_access_device call
# $1: boot_device
# $2: submenu_level
prepare_grub_to_access_device_cached() {
local boot_device="$1"
local submenu_level="$2"
local boot_device_idx="$(echo ${boot_device} | tr '/' '_')"
cache_file="${ZFSTMP}/$(echo boot_device${boot_device_idx})"
if [ ! -f "${cache_file}" ]; then
set +u
echo "$(prepare_grub_to_access_device "${boot_device}")" > "${cache_file}"
set -u
for i in 0 1 2; do
submenu_indentation="$(printf %${i}s | tr " " "${grub_tab}")"
sed "s/^/${submenu_indentation} /" "${cache_file}" > "${cache_file}--${i}"
done
fi
cat "${cache_file}--${submenu_level}"
}
# Print a grub menu entry
zfs_linux_entry () {
submenu_level="$1"
title="$2"
type="$3"
dataset="$4"
boot_device="$5"
initrd="$6"
kernel="$7"
kernel_version="$8"
kernel_additional_args="${9:-}"
boot_devices="${10:-}"
submenu_indentation="$(printf %${submenu_level}s | tr " " "${grub_tab}")"
echo "${submenu_indentation}menuentry '$(echo "${title}" | grub_quote)' ${CLASS} \${menuentry_id_option} 'gnulinux-${dataset}-${kernel_version}' {"
if [ "${quick_boot}" = 1 ]; then
echo "${submenu_indentation} recordfail"
fi
if [ "${type}" != "recovery" ] ; then
GRUB_SAVEDEFAULT=${GRUB_SAVEDEFAULT:-}
default_entry="$(save_default_entry)"
if [ -n "${default_entry}" ]; then
echo "${submenu_indentation} ${default_entry}"
fi
fi
# Use ELILO's generic "efifb" when it's known to be available.
# FIXME: We need an interface to select vesafb in case efifb can't be used.
if [ "${GRUB_GFXPAYLOAD_LINUX}" = "" ]; then
echo "${submenu_indentation} load_video"
else
if [ "${GRUB_GFXPAYLOAD_LINUX}" != "text" ]; then
echo "${submenu_indentation} load_video"
fi
fi
if ([ "${ubuntu_recovery}" = 0 ] || [ "${type}" != "recovery" ]) && \
([ "${GRUB_GFXPAYLOAD_LINUX}" != "" ] || [ "${gfxpayload_dynamic}" = 1 ]); then
echo "${submenu_indentation} gfxmode \${linux_gfx_mode}"
fi
echo "${submenu_indentation} insmod gzio"
echo "${submenu_indentation} if [ \"\${grub_platform}\" = xen ]; then insmod xzio; insmod lzopio; fi"
if [ -n "$boot_devices" ]; then
for device in ${boot_devices}; do
echo "${submenu_indentation} if [ "${boot_device}" = "${device}" ]; then"
echo "$(prepare_grub_to_access_device_cached "${device}" $(( submenu_level +1 )) )"
echo "${submenu_indentation} fi"
done
else
echo "$(prepare_grub_to_access_device_cached "${boot_device}" "${submenu_level}")"
fi
if [ "${quiet_boot}" = 0 ] || [ "${type}" != simple ]; then
echo "${submenu_indentation} echo $(gettext_printf "Loading Linux %s ..." ${kernel_version} | grub_quote)"
fi
linux_default_args="${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
if [ ${type} = "recovery" ]; then
linux_default_args="${GRUB_CMDLINE_LINUX_RECOVERY} ${GRUB_CMDLINE_LINUX}"
fi
echo "${submenu_indentation} linux ${kernel} root=ZFS=${dataset} ro ${linux_default_args} ${kernel_additional_args}"
if [ "${quiet_boot}" = 0 ] || [ "${type}" != simple ]; then
echo "${submenu_indentation} echo '$(gettext_printf "Loading initial ramdisk ..." | grub_quote)'"
fi
echo "${submenu_indentation} initrd ${initrd}"
echo "${submenu_indentation}}"
}
# Generate a GRUB Menu from menu meta data
# $1 menu metadata
generate_grub_menu() {
local menu_metadata="$1"
local last_section=""
local main_dataset_name=""
local main_dataset=""
local have_zsys=""
if [ -z "${menu_metadata}" ]; then
return
fi
CLASS="--class gnu-linux --class gnu --class os"
if [ "${GRUB_DISTRIBUTOR}" = "" ] ; then
OS=GNU/Linux
else
case ${GRUB_DISTRIBUTOR} in
Ubuntu|Kubuntu)
OS="${GRUB_DISTRIBUTOR}"
;;
*)
OS="${GRUB_DISTRIBUTOR} GNU/Linux"
;;
esac
CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1 | LC_ALL=C sed 's,[^[:alnum:]_],_,g') ${CLASS}"
fi
if [ -x /lib/recovery-mode/recovery-menu ]; then
GRUB_CMDLINE_LINUX_RECOVERY=recovery
else
GRUB_CMDLINE_LINUX_RECOVERY=single
fi
if [ "${ubuntu_recovery}" = 1 ]; then
GRUB_CMDLINE_LINUX_RECOVERY="${GRUB_CMDLINE_LINUX_RECOVERY} nomodeset"
fi
case "$GENKERNEL_ARCH" in
x86*) GRUB_CMDLINE_LINUX_RECOVERY="$GRUB_CMDLINE_LINUX_RECOVERY dis_ucode_ldr";;
esac
if [ "${vt_handoff}" = 1 ]; then
for word in ${GRUB_CMDLINE_LINUX_DEFAULT}; do
if [ "${word}" = splash ]; then
GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_DEFAULT} \${vt_handoff}"
fi
done
fi
print_menu_prologue
cat<<'EOF'
function zsyshistorymenu {
# $1: root dataset (eg rpool/ROOT/ubuntu_2zhm07@autozsys_k56fr6)
# $2: boot device id (eg 411f29ce1557bfed)
# $3: initrd (eg /BOOT/ubuntu_2zhm07@autozsys_k56fr6/initrd.img-5.4.0-21-generic)
# $4: kernel (eg /BOOT/ubuntu_2zhm07@autozsys_k56fr6/vmlinuz-5.4.0-21-generic)
# $5: kernel_version (eg 5.4.0-21-generic)
set root_dataset="${1}"
set boot_device="${2}"
set initrd="${3}"
set kernel="${4}"
set kversion="${5}"
EOF
boot_devices=$(echo "${menu_metadata}" | cut -d"$(printf '\t')" -f6 | sort -u)
title=$(gettext_printf "Revert system only")
zfs_linux_entry 1 "${title}" "simple" '${root_dataset}' '${boot_device}' '${initrd}' '${kernel}' '${kversion}' '' "${boot_devices}"
title="$(gettext_printf "Revert system and user data")"
zfs_linux_entry 1 "${title}" "simple" '${root_dataset}' '${boot_device}' '${initrd}' '${kernel}' '${kversion}' 'zsys-revert=userdata' "${boot_devices}"
GRUB_DISABLE_RECOVERY="${GRUB_DISABLE_RECOVERY:-}"
if [ "${GRUB_DISABLE_RECOVERY}" != "true" ]; then
title="$(gettext_printf "Revert system only (%s)" "$(gettext "${GRUB_RECOVERY_TITLE}")")"
zfs_linux_entry 1 "${title}" "recovery" '${root_dataset}' '${boot_device}' '${initrd}' '${kernel}' '${kversion}' '' "${boot_devices}"
title="$(gettext_printf "Revert system and user data (%s)" "$(gettext "${GRUB_RECOVERY_TITLE}")")"
zfs_linux_entry 1 "${title}" "recovery" '${root_dataset}' '${boot_device}' '${initrd}' '${kernel}' '${kversion}' 'zsys-revert=userdata' "${boot_devices}"
fi
echo "}"
echo
# IFS is set to TAB (ASCII 0x09)
echo "${menu_metadata}" |
{
at_least_one_entry=0
have_zsys="$(which zsysd || true)"
while IFS="$(printf '\t')" read -r machineid iszsys section name dataset device initrd kernel opt; do
# Disable history for non zsys system or if systems is a zsys one and zsys isn't installed.
# In pure zfs systems, we identified multiple issues due to the mount generator
# in upstream zfs which makes it incompatible. Don't show history for now.
if [ "${section}" = "history" ]; then
if [ "${iszsys}" != "yes" ] || [ "${iszsys}" = "yes" -a -z "${have_zsys}" ]; then
continue
fi
fi
if [ "${last_section}" != "${section}" -a -n "${last_section}" ]; then
# Close previous section wrapper
if [ "${last_section}" != "main" ]; then
echo "}" # Add grub_tabs
at_least_one_entry=0
fi
fi
case "${section}" in
main)
title="${name}"
main_dataset_name="${name}"
main_dataset="${dataset}"
kernel_version=$(basename "${kernel}" | sed -e "s,^[^0-9]*-,,g")
zfs_linux_entry 0 "${title}" "simple" "${dataset}" "${device}" "${initrd}" "${kernel}" "${kernel_version}"
at_least_one_entry=1
;;
advanced)
# normal and recovery entries for a given kernel
if [ "${last_section}" != "${section}" ]; then
echo "submenu '$(gettext_printf "Advanced options for %s" "${main_dataset_name}" | grub_quote)' \${menuentry_id_option} 'gnulinux-advanced-${main_dataset}' {"
fi
last_booted_kernel_marker=""
if [ "${opt}" = "true" ]; then
last_booted_kernel_marker="* "
fi
kernel_version=$(basename "${kernel}" | sed -e "s,^[^0-9]*-,,g")
title="$(gettext_printf "%s%s, with Linux %s" "${last_booted_kernel_marker}" "${name}" "${kernel_version}")"
zfs_linux_entry 1 "${title}" "advanced" "${dataset}" "${device}" "${initrd}" "${kernel}" "${kernel_version}"
GRUB_DISABLE_RECOVERY=${GRUB_DISABLE_RECOVERY:-}
if [ "${GRUB_DISABLE_RECOVERY}" != "true" ]; then
title="$(gettext_printf "%s%s, with Linux %s (%s)" "${last_booted_kernel_marker}" "${name}" "${kernel_version}" "$(gettext "${GRUB_RECOVERY_TITLE}")")"
zfs_linux_entry 1 "${title}" "recovery" "${dataset}" "${device}" "${initrd}" "${kernel}" "${kernel_version}"
fi
at_least_one_entry=1
;;
history)
# Revert to a snapshot
# revert system, revert system and user data and associated recovery entries
if [ "${last_section}" != "${section}" ]; then
echo "submenu '$(gettext_printf "History for %s" "${main_dataset_name}" | grub_quote)' \${menuentry_id_option} 'gnulinux-history-${main_dataset}' {"
fi
if [ "${iszsys}" = "yes" ]; then
title="$(gettext_printf "Revert to %s" "${name}" | grub_quote)"
else
title="$(gettext_printf "Boot on %s" "${name}" | grub_quote)"
fi
echo " submenu '${title}' \${menuentry_id_option} 'gnulinux-history-${dataset}' {"
kernel_version=$(basename "${kernel}" | sed -e "s,^[^0-9]*-,,g")
# Zsys only: let revert system without destroying snapshots
if [ "${iszsys}" = "yes" ]; then
echo "${grub_tab}${grub_tab}zsyshistorymenu" \"${dataset}\" \"${device}\" \"${initrd}\" \"${kernel}\" \"${kernel_version}\"
# Non-zsys: boot temporarly on snapshots or rollback (destroying intermediate snapshots)
else
title="$(gettext_printf "One time boot")"
zfs_linux_entry 2 "${title}" "simple" "${dataset}" "${device}" "${initrd}" "${kernel}" "${kernel_version}"
GRUB_DISABLE_RECOVERY="${GRUB_DISABLE_RECOVERY:-}"
if [ "${GRUB_DISABLE_RECOVERY}" != "true" ]; then
title="$(gettext_printf "One time boot (%s)" "$(gettext "${GRUB_RECOVERY_TITLE}")")"
zfs_linux_entry 2 "${title}" "recovery" "${dataset}" "${device}" "${initrd}" "${kernel}" "${kernel_version}"
fi
title="$(gettext_printf "Revert system (all intermediate snapshots will be destroyed)")"
zfs_linux_entry 2 "${title}" "simple" "${dataset}" "${device}" "${initrd}" "${kernel}" "${kernel_version}" "rollback=yes"
fi
echo " }"
at_least_one_entry=1
;;
*)
grub_warn "unknown section: ${section}. Ignoring entry ${name} for ${dataset}"
;;
esac
last_section="${section}"
done
if [ "${at_least_one_entry}" -eq 1 ]; then
echo "}"
fi
}
}
# don't add trailing newline of variable is empty
# $1: content to write
# $2: destination file
trailing_newline_if_not_empty() {
content="$1"
dest="$2"
if [ -z "${content}" ]; then
rm -f "${dest}"
touch "${dest}"
return
fi
echo "${content}" > "${dest}"
}
GRUB_LINUX_ZFS_TEST="${GRUB_LINUX_ZFS_TEST:-}"
case "${GRUB_LINUX_ZFS_TEST}" in
bootlist)
# Import all available pools on the system and return imported list
imported_pools=$(import_pools)
boot_list="$(bootlist ${MNTDIR})"
trailing_newline_if_not_empty "${boot_list}" "${GRUB_LINUX_ZFS_TEST_OUTPUT}"
break
;;
metamenu)
boot_list="$(cat ${GRUB_LINUX_ZFS_TEST_INPUT})"
menu_metadata="$(generate_grub_menu_metadata "${boot_list}")"
trailing_newline_if_not_empty "${menu_metadata}" "${GRUB_LINUX_ZFS_TEST_OUTPUT}"
break
;;
grubmenu)
menu_metadata="$(cat ${GRUB_LINUX_ZFS_TEST_INPUT})"
grub_menu=$(generate_grub_menu "${menu_metadata}")
trailing_newline_if_not_empty "${grub_menu}" "${GRUB_LINUX_ZFS_TEST_OUTPUT}"
break
;;
*)
# Import all available pools on the system and return imported list
imported_pools=$(import_pools)
# Generate the complete list of boot entries
boot_list="$(bootlist ${MNTDIR})"
# Create boot menu meta data from the list of boot entries
menu_metadata="$(generate_grub_menu_metadata "${boot_list}")"
# Create boot menu meta data from the list of boot entries
grub_menu="$(generate_grub_menu "${menu_metadata}")"
if [ -n "${grub_menu}" ]; then
# We want the trailing newline as a marker will be added
echo "${grub_menu}"
fi
;;
esac
=================== sda8/etc/grub.d/43_linux_xen (filtered) ====================
#! /bin/sh
set -e
# grub-mkconfig helper script.
# Copyright (C) 2006,2007,2008,2009,2010 Free Software Foundation, Inc.
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see <http://www.gnu.org/licenses/>.
prefix="/usr"
exec_prefix="/usr"
datarootdir="/usr/share"
. "$pkgdatadir/grub-mkconfig_lib"
export TEXTDOMAIN=grub
export TEXTDOMAINDIR="${datarootdir}/locale"
CLASS="--class gnu-linux --class gnu --class os --class xen"
SUPPORTED_INITS="sysvinit:/lib/sysvinit/init systemd:/lib/systemd/systemd upstart:/sbin/upstart"
if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
OS=GNU/Linux
else
OS="${GRUB_DISTRIBUTOR} GNU/Linux"
CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1|LC_ALL=C sed 's,[^[:alnum:]_],_,g') ${CLASS}"
fi
# loop-AES arranges things so that /dev/loop/X can be our root device, but
# the initrds that Linux uses don't like that.
case ${GRUB_DEVICE} in
/dev/loop/*|/dev/loop[0-9])
GRUB_DEVICE=`losetup ${GRUB_DEVICE} | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"`
# We can't cope with devices loop-mounted from files here.
case ${GRUB_DEVICE} in
/dev/*) ;;
*) exit 0 ;;
esac
;;
esac
# Default to disabling partition uuid support to maintian compatibility with
# older kernels.
GRUB_DISABLE_LINUX_PARTUUID=${GRUB_DISABLE_LINUX_PARTUUID-true}
# btrfs may reside on multiple devices. We cannot pass them as value of root= parameter
# and mounting btrfs requires user space scanning, so force UUID in this case.
if ( [ "x${GRUB_DEVICE_UUID}" = "x" ] && [ "x${GRUB_DEVICE_PARTUUID}" = "x" ] ) \
|| ( [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
&& [ "x${GRUB_DISABLE_LINUX_PARTUUID}" = "xtrue" ] ) \
|| ( ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \
&& ! test -e "/dev/disk/by-partuuid/${GRUB_DEVICE_PARTUUID}" ) \
|| ( test -e "${GRUB_DEVICE}" && uses_abstraction "${GRUB_DEVICE}" lvm ); then
LINUX_ROOT_DEVICE=${GRUB_DEVICE}
elif [ "x${GRUB_DEVICE_UUID}" = "x" ] \
|| [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ]; then
LINUX_ROOT_DEVICE=PARTUUID=${GRUB_DEVICE_PARTUUID}
else
LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
fi
# Allow overriding GRUB_CMDLINE_LINUX and GRUB_CMDLINE_LINUX_DEFAULT.
if [ "${GRUB_CMDLINE_LINUX_XEN_REPLACE}" ]; then
GRUB_CMDLINE_LINUX="${GRUB_CMDLINE_LINUX_XEN_REPLACE}"
fi
if [ "${GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT}" ]; then
GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT}"
fi
case x"$GRUB_FS" in
xbtrfs)
rootsubvol="`make_system_path_relative_to_its_root /`"
rootsubvol="${rootsubvol#/}"
if [ "x${rootsubvol}" != x ]; then
GRUB_CMDLINE_LINUX="rootflags=subvol=${rootsubvol} ${GRUB_CMDLINE_LINUX}"
fi;;
xzfs)
rpool=`${grub_probe} --device ${GRUB_DEVICE} --target=fs_label 2>/dev/null || true`
bootfs="`make_system_path_relative_to_its_root / | sed -e "s,@$,,"`"
LINUX_ROOT_DEVICE="ZFS=${rpool}${bootfs%/}"
;;
esac
title_correction_code=
linux_entry ()
{
os="$1"
version="$2"
xen_version="$3"
type="$4"
args="$5"
xen_args="$6"
if [ -z "$boot_device_id" ]; then
boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")"
fi
if [ x$type != xsimple ] ; then
if [ x$type = xrecovery ] ; then
title="$(gettext_printf "%s, with Xen %s and Linux %s (%s)" "${os}" "${xen_version}" "${version}" "$(gettext "${GRUB_RECOVERY_TITLE}")")"
elif [ "${type#init-}" != "$type" ] ; then
title="$(gettext_printf "%s, with Xen %s and Linux %s (%s)" "${os}" "${xen_version}" "${version}" "${type#init-}")"
else
title="$(gettext_printf "%s, with Xen %s and Linux %s" "${os}" "${xen_version}" "${version}")"
fi
replacement_title="$(echo "Advanced options for ${OS}" | sed 's,>,>>,g')>$(echo "$title" | sed 's,>,>>,g')"
if [ x"Xen ${xen_version}>$title" = x"$GRUB_ACTUAL_DEFAULT" ]; then
quoted="$(echo "$GRUB_ACTUAL_DEFAULT" | grub_quote)"
title_correction_code="${title_correction_code}if [ \"x\$default\" = '$quoted' ]; then default='$(echo "$replacement_title" | grub_quote)'; fi;"
grub_warn "$(gettext_printf "Please don't use old title \`%s' for GRUB_DEFAULT, use \`%s' (for versions before 2.00) or \`%s' (for 2.00 or later)" "$GRUB_ACTUAL_DEFAULT" "$replacement_title" "gnulinux-advanced-$boot_device_id>gnulinux-$version-$type-$boot_device_id")"
fi
echo "menuentry '$(echo "$title" | grub_quote)' ${CLASS} \$menuentry_id_option 'xen-gnulinux-$version-$type-$boot_device_id' {" | sed "s/^/$submenu_indentation/"
else
title="$(gettext_printf "%s, with Xen hypervisor" "${os}")"
echo "menuentry '$(echo "$title" | grub_quote)' ${CLASS} \$menuentry_id_option 'xen-gnulinux-simple-$boot_device_id' {" | sed "s/^/$submenu_indentation/"
fi
if [ x$type != xrecovery ] ; then
save_default_entry | grub_add_tab | sed "s/^/$submenu_indentation/"
fi
if [ -z "${prepare_boot_cache}" ]; then
prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | grub_add_tab)"
fi
printf '%s\n' "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/"
xmessage="$(gettext_printf "Loading Xen %s ..." ${xen_version})"
lmessage="$(gettext_printf "Loading Linux %s ..." ${version})"
sed "s/^/$submenu_indentation/" << EOF
echo '$(echo "$xmessage" | grub_quote)'
if [ "\$grub_platform" = "pc" -o "\$grub_platform" = "" ]; then
xen_rm_opts=
else
xen_rm_opts="no-real-mode edd=off"
fi
${xen_loader} ${rel_xen_dirname}/${xen_basename} placeholder ${xen_args} \${xen_rm_opts}
echo '$(echo "$lmessage" | grub_quote)'
${module_loader} ${rel_dirname}/${basename} placeholder root=${linux_root_device_thisversion} ro ${args}
EOF
if test -n "${initrd}" ; then
# TRANSLATORS: ramdisk isn't identifier. Should be translated.
message="$(gettext_printf "Loading initial ramdisk ...")"
initrd_path=
for i in ${initrd}; do
initrd_path="${initrd_path} ${rel_dirname}/${i}"
done
sed "s/^/$submenu_indentation/" << EOF
echo '$(echo "$message" | grub_quote)'
${module_loader} --nounzip $(echo $initrd_path)
EOF
fi
sed "s/^/$submenu_indentation/" << EOF
}
EOF
}
linux_list=
for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* /boot/kernel-*; do
if grub_file_is_not_garbage "$i"; then
basename=$(basename $i)
version=$(echo $basename | sed -e "s,^[^0-9]*-,,g")
dirname=$(dirname $i)
config=
for j in "${dirname}/config-${version}" "${dirname}/config-${alt_version}" "/etc/kernels/kernel-config-${version}" ; do
if test -e "${j}" ; then
config="${j}"
break
fi
done
if (grep -qx "CONFIG_XEN_DOM0=y" "${config}" 2> /dev/null || grep -qx "CONFIG_XEN_PRIVILEGED_GUEST=y" "${config}" 2> /dev/null); then linux_list="$linux_list $i" ; fi
fi
if [ "x${linux_list}" = "x" ] ; then
exit 0
fi
file_is_not_sym () {
case "$1" in
*/xen-syms-*)
return 1;;
*)
return 0;;
esac
}
xen_list=
for i in /boot/xen*; do
if grub_file_is_not_garbage "$i" && file_is_not_sym "$i" ; then xen_list="$xen_list $i" ; fi
prepare_boot_cache=
boot_device_id=
title_correction_code=
machine=`uname -m`
case "$machine" in
i?86) GENKERNEL_ARCH="x86" ;;
mips|mips64) GENKERNEL_ARCH="mips" ;;
mipsel|mips64el) GENKERNEL_ARCH="mipsel" ;;
arm*) GENKERNEL_ARCH="arm" ;;
*) GENKERNEL_ARCH="$machine" ;;
esac
# Extra indentation to add to menu entries in a submenu. We're not in a submenu
# yet, so it's empty. In a submenu it will be equal to '\t' (one tab).
submenu_indentation=""
is_top_level=true
while [ "x${xen_list}" != "x" ] ; do
list="${linux_list}"
current_xen=`version_find_latest $xen_list`
xen_basename=`basename ${current_xen}`
xen_dirname=`dirname ${current_xen}`
rel_xen_dirname=`make_system_path_relative_to_its_root $xen_dirname`
xen_version=`echo $xen_basename | sed -e "s,.gz$,,g;s,^xen-,,g"`
if [ -z "$boot_device_id" ]; then
boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")"
fi
if [ "x$is_top_level" != xtrue ]; then
echo " submenu '$(gettext_printf "Xen hypervisor, version %s" "${xen_version}" | grub_quote)' \$menuentry_id_option 'xen-hypervisor-$xen_version-$boot_device_id' {"
fi
if ($grub_file --is-arm64-efi $current_xen); then
xen_loader="xen_hypervisor"
module_loader="xen_module"
else
if ($grub_file --is-x86-multiboot2 $current_xen); then
xen_loader="multiboot2"
module_loader="module2"
else
xen_loader="multiboot"
module_loader="module"
fi
fi
initrd_early=
for i in ${GRUB_EARLY_INITRD_LINUX_STOCK} \
${GRUB_EARLY_INITRD_LINUX_CUSTOM}; do
if test -e "${xen_dirname}/${i}" ; then
initrd_early="${initrd_early} ${i}"
fi
done
while [ "x$list" != "x" ] ; do
linux=`version_find_latest $list`
gettext_printf "Found linux image: %s\n" "$linux" >&2
basename=`basename $linux`
dirname=`dirname $linux`
rel_dirname=`make_system_path_relative_to_its_root $dirname`
version=`echo $basename | sed -e "s,^[^0-9]*-,,g"`
alt_version=`echo $version | sed -e "s,\.old$,,g"`
linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"
initrd_real=
for i in "initrd.img-${version}" "initrd-${version}.img" "initrd-${version}.gz" \
"initrd-${version}" "initramfs-${version}.img" \
"initrd.img-${alt_version}" "initrd-${alt_version}.img" \
"initrd-${alt_version}" "initramfs-${alt_version}.img" \
"initramfs-genkernel-${version}" \
"initramfs-genkernel-${alt_version}" \
"initramfs-genkernel-${GENKERNEL_ARCH}-${version}" \
"initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}" ; do
if test -e "${dirname}/${i}" ; then
initrd_real="$i"
break
fi
done
initrd=
if test -n "${initrd_early}" || test -n "${initrd_real}"; then
initrd="${initrd_early} ${initrd_real}"
initrd_display=
for i in ${initrd}; do
initrd_display="${initrd_display} ${dirname}/${i}"
done
gettext_printf "Found initrd image: %s\n" "$(echo $initrd_display)" >&2
fi
if test -z "${initrd_real}"; then
# "UUID=" magic is parsed by initrds. Since there's no initrd, it can't work here.
if [ "x${GRUB_DEVICE_PARTUUID}" = "x" ] \
|| [ "x${GRUB_DISABLE_LINUX_PARTUUID}" = "xtrue" ]; then
linux_root_device_thisversion=${GRUB_DEVICE}
else
linux_root_device_thisversion=PARTUUID=${GRUB_DEVICE_PARTUUID}
fi
fi
if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xy ]; then
linux_entry "${OS}" "${version}" "${xen_version}" simple \
"${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" "${GRUB_CMDLINE_XEN} ${GRUB_CMDLINE_XEN_DEFAULT}"
submenu_indentation="$grub_tab$grub_tab"
if [ -z "$boot_device_id" ]; then
boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")"
fi
# TRANSLATORS: %s is replaced with an OS name
echo "submenu '$(gettext_printf "Advanced options for %s (with Xen hypervisor)" "${OS}" | grub_quote)' \$menuentry_id_option 'gnulinux-advanced-$boot_device_id' {"
echo " submenu '$(gettext_printf "Xen hypervisor, version %s" "${xen_version}" | grub_quote)' \$menuentry_id_option 'xen-hypervisor-$xen_version-$boot_device_id' {"
is_top_level=false
fi
linux_entry "${OS}" "${version}" "${xen_version}" advanced \
"${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" "${GRUB_CMDLINE_XEN} ${GRUB_CMDLINE_XEN_DEFAULT}"
for supported_init in ${SUPPORTED_INITS}; do
init_path="${supported_init#*:}"
if [ -x "${init_path}" ] && [ "$(readlink -f /sbin/init)" != "$(readlink -f "${init_path}")" ]; then
linux_entry "${OS}" "${version}" "${xen_version}" "init-${supported_init%%:*}" \
"${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT} init=${init_path}" "${GRUB_CMDLINE_XEN} ${GRUB_CMDLINE_XEN_DEFAULT}"
fi
done
if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then
linux_entry "${OS}" "${version}" "${xen_version}" recovery \
"single ${GRUB_CMDLINE_LINUX}" "${GRUB_CMDLINE_XEN}"
fi
list=`echo $list | tr ' ' '\n' | fgrep -vx "$linux" | tr '\n' ' '`
done
if [ x"$is_top_level" != xtrue ]; then
echo ' }'
fi
xen_list=`echo $xen_list | tr ' ' '\n' | fgrep -vx "$current_xen" | tr '\n' ' '`
# If at least one kernel was found, then we need to
# add a closing '}' for the submenu command.
if [ x"$is_top_level" != xtrue ]; then
echo '}'
fi
echo "$title_correction_code"
================ sda8/etc/grub.d/47_os-prober_proxy (filtered) =================
#!/bin/sh
#THIS IS A GRUB PROXY SCRIPT
sh -c 'echo "### BEGIN /etc/grub.d/proxifiedScripts/os-prober ###";
"/etc/grub.d/proxifiedScripts/os-prober";
echo "### END /etc/grub.d/proxifiedScripts/os-prober ###";
echo "### BEGIN /etc/grub.d/proxifiedScripts/custom ###";
"/etc/grub.d/proxifiedScripts/custom";
echo "### END /etc/grub.d/proxifiedScripts/custom ###";' | /etc/grub.d/bin/grubcfg_proxy "+*
+#text
-'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'~768e446bcb4366d4184c7520146ae71f~
-'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~def9f44788c6a930d79bd7a59a0b3ea1~
-'SUBMENU' as 'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'{-'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'/*, -* from '/etc/grub.d/proxifiedScripts/custom', -'Kubuntu, with Linux 5.8.0-55-generic (recovery mode) (sur /dev/sda6)'~f913ae8a4baae33406385b4b06b2cecd~ from '/etc/grub.d/proxifiedScripts/custom', -#text from '/etc/grub.d/proxifiedScripts/custom', -'Ubuntu Version 2 (sur /dev/sda5)'~29df3a42d5c4d438ddcc3d7ee97dc9b6~ from '/etc/grub.d/proxifiedScripts/custom', -'Kubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'~768e446bcb4366d4184c7520146ae71f~ as 'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)' from '/etc/grub.d/proxifiedScripts/custom', -'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~1233d6cf7bad2da39039d5ee7f33cefb~ from '/etc/grub.d/proxifiedScripts/custom', -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'/'Ubuntu (sur /dev/sda6)'~f07656a1c31925ac00537e6e977a73f9~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'/'Ubuntu, with Linux 5.8.0-55-generic (sur /dev/sda6)'~f07656a1c31925ac00537e6e977a73f9~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'/'Ubuntu, with Linux 5.8.0-55-generic (recovery mode) (sur /dev/sda6)'~f913ae8a4baae33406385b4b06b2cecd~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'/'Ubuntu, with Linux 5.8.0-43-generic (sur /dev/sda6)'~da6523b68aac80f70b41c8fd2f4f1492~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'/'Ubuntu, with Linux 5.8.0-43-generic (recovery mode) (sur /dev/sda6)'~7386609929d50a35d4d2204be0cc504c~}
-'SUBMENU' as 'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'{-'Kubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'~768e446bcb4366d4184c7520146ae71f~ as 'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)' from '/etc/grub.d/proxifiedScripts/custom', -'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~1233d6cf7bad2da39039d5ee7f33cefb~ from '/etc/grub.d/proxifiedScripts/custom', -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/*, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~15b614c0dba27f22188ed7140243eac9~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~15b614c0dba27f22188ed7140243eac9~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~15b614c0dba27f22188ed7140243eac9~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~4340f174b9b7181ec8c36b5edf6f6a33~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~fd14b5878d129e6ba97ff9d4ab34ddc5~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~ad250c844b00e8d7d6ffd656003c9b06~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~ae1f26c10d0549738457b480f0220759~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~15b614c0dba27f22188ed7140243eac9~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~15b614c0dba27f22188ed7140243eac9~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~15b614c0dba27f22188ed7140243eac9~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~4340f174b9b7181ec8c36b5edf6f6a33~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~fd14b5878d129e6ba97ff9d4ab34ddc5~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~ad250c844b00e8d7d6ffd656003c9b06~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~ae1f26c10d0549738457b480f0220759~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~15b614c0dba27f22188ed7140243eac9~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~15b614c0dba27f22188ed7140243eac9~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~4340f174b9b7181ec8c36b5edf6f6a33~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~fd14b5878d129e6ba97ff9d4ab34ddc5~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~ad250c844b00e8d7d6ffd656003c9b06~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~ae1f26c10d0549738457b480f0220759~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~15b614c0dba27f22188ed7140243eac9~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~15b614c0dba27f22188ed7140243eac9~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~4340f174b9b7181ec8c36b5edf6f6a33~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~fd14b5878d129e6ba97ff9d4ab34ddc5~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~ad250c844b00e8d7d6ffd656003c9b06~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~ae1f26c10d0549738457b480f0220759~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~c29d7d9ef6898720dd6851777e4b3e5d~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~8f21d05358acdf109da6b71484fbbe62~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~63866ab370a570e247c9059558d9f5fd~, -'Options avancées pour Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'/'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~6c2877d43293e64797f28201e318d096~}
" multi
================= sda8/etc/grub.d/48_uefi-firmware (filtered) ==================
#! /bin/sh
set -e
# grub-mkconfig helper script.
# Copyright (C) 2012 Free Software Foundation, Inc.
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see <http://www.gnu.org/licenses/>.
prefix="/usr"
exec_prefix="/usr"
datarootdir="/usr/share"
export TEXTDOMAIN=grub
export TEXTDOMAINDIR="${datarootdir}/locale"
. "${datarootdir}/grub/grub-mkconfig_lib"
efi_vars_dir=/sys/firmware/efi/vars
EFI_GLOBAL_VARIABLE=8be4df61-93ca-11d2-aa0d-00e098032b8c
OsIndications="$efi_vars_dir/OsIndicationsSupported-$EFI_GLOBAL_VARIABLE/data"
if [ -e "$OsIndications" ] && \
[ "$(( $(printf 0x%x \'"$(cat $OsIndications | cut -b1)") & 1 ))" = 1 ]; then
LABEL="UEFI Firmware Settings"
gettext_printf "Adding boot menu entry for UEFI Firmware Settings\n" >&2
onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
cat << EOF
menuentry '$LABEL' \$menuentry_id_option 'uefi-firmware' {
fwsetup
}
EOF
fi
================== sda8/etc/grub.d/49_custom_proxy (filtered) ==================
#!/bin/sh
#THIS IS A GRUB PROXY SCRIPT
'/etc/grub.d/proxifiedScripts/custom' | /etc/grub.d/bin/grubcfg_proxy "-*
-'Ubuntu Version 2 (sur /dev/sda5)'~29df3a42d5c4d438ddcc3d7ee97dc9b6~
-'Kubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'~768e446bcb4366d4184c7520146ae71f~ as 'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda6)'
-'Ubuntu 20.04.2 LTS (20.04) (sur /dev/sda5)'~1233d6cf7bad2da39039d5ee7f33cefb~
+#text
-'Kubuntu, with Linux 5.8.0-55-generic (recovery mode) (sur /dev/sda6)'~f913ae8a4baae33406385b4b06b2cecd~ as 'Ubuntu, with Linux 5.8.0-55-generic (recovery mode) (sur /dev/sda6)'
"
Suggested repair: ______________________________________________________________
The default repair of the Boot-Repair utility would purge (in order to fix packages) and reinstall the grub-efi of
sda6,
using the following options: sda1/boot/efi
Additional repair would be performed: unhide-bootmenu-10s use-standard-efi-file
Blockers in case of suggested repair: __________________________________________
The current session is in BIOS-compatibility mode. Please disable BIOS-compatibility/CSM/Legacy mode in your UEFI firmware, and use this software from a live-CD (or live-USB) that is compatible with UEFI booting mode. For example, use a live-USB of Boot-Repair-Disk-64bit (www.sourceforge.net/p/boot-repair-cd), after making sure your BIOS is set up to boot USB in EFI mode. This will enable this feature.
Final advice in case of suggested repair: ______________________________________
Please do not forget to make your UEFI firmware boot on the L'OS actuellement utilisé - Ubuntu 22.04.3 LTS entry (sda1/efi/****/grub****.efi (**** will be updated in the final message) file) !
The boot of your PC is in BIOS-compatibility/CSM/Legacy mode. You may want to retry after changing it to UEFI mode.
Conseils pour les nouveaux demandeurs et pas qu'eux
Important : Pensez à passer vos sujets en [Résolu] lorsque ceux-ci le sont, au début du titre en cliquant sur Modifier sous le premier message, et un bref récapitulatif de la solution à la fin de celui-ci. Merci. Membre de Linux-Azur
Hors ligne
#12 Le 02/01/2024, à 11:21
- geole
Re : Problème de boot
Bonjour.
Si tu avais branché ta clé USB de boot au moment de faire ce boot-info, elle n'est pas visible. Cela voudrait alors dire que les ports sont en panne ou que le logiciel ubuntu a un sacré problème.
Remarque. Tu aurais pu penser à fabriquer une partition de données indépendante et à installer tes ubuntu dans des partitions de 60 Go. http://mezigoo.free.fr/ps/index.html
Dernière modification par geole (Le 02/01/2024, à 11:30)
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
#13 Le 02/01/2024, à 20:40
- RICO21
Re : Problème de boot
Bonjour
J'ai pu retrouvé mes us mais je n'arrive pas à refaire le grup
Donc il ne se lance pas.
Je crois que je me mélange entre BIOS et EFI
Même avec boot repaire ça ne fait rien
Mon PC date de 2015
Cordialement Didier
Hors ligne
#14 Le 02/01/2024, à 21:45
- geole
Re : Problème de boot
Je ne comprends pas ce que tu veux faire.
Le boot-info que tu as fais montre que tu es bien dans un ubuntu installé.
df -Th / : /dev/sda6 ext3 430G 27G 382G 7% /
This installed-session is in Legacy/BIOS/CSM mode (not in EFI mode).
qui sait accéder aux autres.
===================== sda6/boot/grub/grub.cfg (filtered) ======================
Ubuntu c553e607-41ed-4b6c-9b01-e421a747f175
Ubuntu 22.04.3 LTS (22.04) (on sda5) 2b3b889e-3907-42ca-9c4d-69f17f40fff9
Ubuntu 22.04.3 LTS (22.04) (on sda8) 993c5bf5-7126-4218-9190-ca55eebb0214
### END /etc/grub.d/3
Dernière modification par geole (Le 02/01/2024, à 21:47)
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
#15 Le 02/01/2024, à 23:28
- alh54
Re : Problème de boot
Tu as 3 Ubuntu sur ton disque:
/dev/sda5
/dev/sda6
/dev/sda8
/dev/sda8 est installée en EFI, elle ne peut pas booter car il n'a pas de partition bios-boot dans ton disque. J'imagine que la priorité de boot est réglée sur EFI.
Entre dans les réglages du bios et désactive le boot en EFI il y a des chances que tu puisses booter sur les ubuntu installées en legacy.
----------------
Edit: si dans les réglages du bios tu as 3 choix dans les options de boot [leagacy - csm (mode compatibilité) - EFI] choisis legacy.
Dernière modification par alh54 (Le 02/01/2024, à 23:39)
En ligne
#16 Le 03/01/2024, à 11:48
- RICO21
Re : Problème de boot
bonjour alh54
oui j'ai 3 versions d'ubuntu
KDE, UBUNTU, MATE
Je voulais installer MINT a la place d'UNBUNTU car cette dernière ne voulai plus se mettre à jour
Maintenant je n'est plus acces a aucun OS car j'ai du faire une erreur en mettant MINT en EFI
J'essai donc de réinstaller, mais avec se viel ordi, je ne sais si je dois le faire en bios ou en EFI
Merci
Cordialement Didier
Hors ligne
#17 Le 03/01/2024, à 13:12
- FrancisFDZ
Re : Problème de boot
Bonjour,
Comme @alh54 l'a signalé en #15, il y a des installations en uefi et en legacy : il va falloir choisir une fois pour toute soit l'un soit l'autre. Pour ma part, je donnerais la préférence à UEFI, je pense que les installations en legacy vont progressivement disparaitre.Donc il faudrait repasser les OS actuellement en legacy en UEFI et rectifier les fichiers de boot en conséquence (peut-être avec l'aide de boot-repair et des conseils prodigués par les spécialistes du présent forum (perso je ne suis pas spécialiste de UEFI, mon PC est ancien et tout y est monté en legacy))
Quel que soit le mode choisi (tout en legacy ou tout en UEFI), il faut absolument éviter le mélange, source de problèmes.
A voir également le partitionnement (MBR ou GPT)
NB : je sais que "MBR" n'est pas vraiment une norme de partitionnent, considérez ça comme un "abus de langage" SVP
-- On peut avoir des raisons de se plaindre et n'avoir pas raison de se plaindre --
[Victor Hugo]
Hors ligne
#18 Le 03/01/2024, à 14:04
- geole
Re : Problème de boot
Bonjour.
Il y a eu pas mal d'installations en EFI.
Aucune n'a abouti!
La partition de boot EFI est désesperement vide!
A mon avis reste legacy.
Quelques extraits du boot-info.
Avail Use% Mounted on
/dev/sda1 511M 0% /mnt/boot-sav/sda1
/dev/sda7 511M 0% /media/rico/5292-364F
sda1: __________________________________________________________________________
File system: vfat
Boot sector type: FAT32
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files:
sda2
sda7 __________________________________________________________________________
File system: vfat
Boot sector type: FAT32
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files:
sda8
sda5 : is-os, 64, apt-get, signed grub-pc grub-efi , grub2, grub-install, grubenv-ok, update-grub, end-after-100GB
sda8 : isnotESP, fstab-has-goodEFI, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
Dernière modification par geole (Le 03/01/2024, à 14:24)
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
#19 Le 03/01/2024, à 17:45
- alh54
Re : Problème de boot
je pense que les installations en legacy vont progressivement disparaitre
Certains constructeurs ont déjà franchi le pas. Mon dernier laptop (Dell latitude 5440) sorti en Avril 2023 boote uniquement en EFI.
Dernière modification par alh54 (Le 03/01/2024, à 17:45)
En ligne
#20 Le 03/01/2024, à 19:33
- RICO21
Re : Problème de boot
bonsoir
J'ai monté linux MATE en EFI, il fallait juste créer une partition EFI, certainement pour le démarrage car elle fait 500mo
Maintenant je vais essayer de monter MATE
Cordialement
Didier
Hors ligne
#21 Le 04/01/2024, à 12:03
- RICO21
Re : Problème de boot
Merci à tous
Problème semble résolu
Cordialement
Didier
Hors ligne
Pages : 1