diff -Nru boot-repair-4ppa123/debian/changelog boot-repair-4ppa200/debian/changelog --- boot-repair-4ppa123/debian/changelog 2020-03-15 13:14:14.000000000 +0000 +++ boot-repair-4ppa200/debian/changelog 2022-03-06 21:55:00.000000000 +0000 @@ -1,5 +1,325 @@ -boot-repair (4ppa123) bionic; urgency=low +boot-repair (4ppa200) focal; urgency=low - * created source + * hide the redundant Advices in log + * add ${CHROOTCMD}modprobe efivars - -- Yann MRN Sun, 15 Mar 2020 15:14:14 +0200 + -- Yann MRN 6 Mar 2022 23:55:00 +0200 + +boot-repair (4ppa199) focal; urgency=low + + * show only once the errors on mount -r + * display free space only when > 10MiB + + -- Yann MRN 28 Feb 2022 23:55:00 +0200 + +boot-repair (4ppa198) focal; urgency=low + + * fix secure boot display + + -- Yann MRN 27 Feb 2022 23:55:00 +0200 + +boot-repair (4ppa197) focal; urgency=low + + * strenghten secure boot detection via mokutil + * added BIOS version + + -- Yann MRN 27 Feb 2022 22:55:00 +0200 + +boot-repair (4ppa196) focal; urgency=low + + * block repair if zfsutils older than version 2.x + * fix list of OS when / on zfs + * fix luks partition detection/message + + -- Yann MRN 24 Feb 2022 22:55:00 +0200 + +boot-repair (4ppa195) focal; urgency=low + + * just reload + + -- Yann MRN 22 Feb 2022 22:55:00 +0200 + +boot-repair (4ppa194) focal; urgency=low + + * display CHROOTCMD before grub-install in logs + * rm /boot/efi/EFI/ubuntu when error: cannot open /boot/efi/EFI/ubuntu/grubx64.efi: Not a directory. + * $GRUB_is_still_present $Please_try_again (purge grub* packages from ${BLKIDMNT_POINT[$USRPART]}) + + -- Yann MRN 21 Feb 2022 22:55:00 +0200 + +boot-repair (4ppa193) focal; urgency=low + + * hide the " Package linux-xxx is not installed, so not removed " warnings from the logs + * activate zfs pools in installed session when / is not zfs + + -- Yann MRN 16 Feb 2022 6:55:00 +0200 + +boot-repair (4ppa192) focal; urgency=low + + * fix random bug due to double reinstall_grubstageone() line + + -- Yann MRN 11 Feb 2022 18:55:00 +0200 + +boot-repair (4ppa191) focal; urgency=low + + * fix install of cryptsetup and luks blockers + + -- Yann MRN 11 Feb 2022 00:55:00 +0200 + +boot-repair (4ppa190) focal; urgency=low + + * chroot install efibootmgr wen absent during grub-efi purge + + -- Yann MRN 10 Feb 2022 23:55:00 +0200 + +boot-repair (4ppa189) focal; urgency=low + + * don't propose to enable raid on pure lmv (when mapper/vg.. ) + * propose to decrypt when no Linux detected + + -- Yann MRN 10 Feb 2022 23:33:00 +0200 + +boot-repair (4ppa188) focal; urgency=low + + * force grub purge when grub.d missing + * add sid to the list of EFIGRUBFILE detection + + -- Yann MRN 8 Feb 2022 22:33:00 +0200 + +boot-repair (4ppa187) focal; urgency=low + + * propose to remove hidden flag from default esp + + -- Yann MRN 7 Feb 2022 22:35:00 +0200 + +boot-repair (4ppa186) focal; urgency=low + + * fix bug introduced in ppa185 + + -- Yann MRN 7 Feb 2022 20:35:00 +0200 + +boot-repair (4ppa185) focal; urgency=low + + * block and ask to use recent live disc when error on zfs import + * block and ask to use BRD when efibootmgr not installed and grub-efi repair + + -- Yann MRN 7 Feb 2022 18:35:00 +0200 + +boot-repair (4ppa184) focal; urgency=low + + * add -f to final zfs export + * add -lf to unchroot umount (for all: zfs and others) + + -- Yann MRN 3 Feb 2022 23:35:00 +0200 + +boot-repair (4ppa183) focal; urgency=low + + * flag bpool as 'is--zfs-boot' instead of 'is---sepboot' to avoid popup and risk of user mistake + * fix the add of GRUB_CMDLINE_LINUX=root=ZFS= in default/grub update for zfs + + -- Yann MRN 3 Feb 2022 23:35:00 +0200 + +boot-repair (4ppa182) focal; urgency=low + + * removed 'update-initramfs -c -k all' in fix_etc_default_grub_for_zfs() + * ask install pastebinit only when upload + + -- Yann MRN 3 Feb 2022 18:35:00 +0200 + +boot-repair (4ppa181) focal; urgency=low + + * don't create zfs/boot/grub nor /zfs/boot/efi to avoid 'not empty folder' issue when mounting rpool + * export -f -a at finish in live session + * don't add useless fstab boot/efi line when zfs + + -- Yann MRN 2 Feb 2022 18:35:00 +0200 + +boot-repair (4ppa180) focal; urgency=low + + * fix mnt point of rpool + + -- Yann MRN 2 Feb 2022 13:35:00 +0200 + +boot-repair (4ppa179) focal; urgency=low + + * check if zpool list not empty after activation + * fix check_if_live_session() by removing inacurrate space + * Differentiate bppol and rpool + + -- Yann MRN 30 Jan 2022 13:15:00 +0200 + +boot-repair (4ppa178) focal; urgency=low + + * fixed 'bootflag_update : cannot find command' bug + * add display of fstab for zfs partitions + + -- Yann MRN 29 Jan 2022 13:15:00 +0200 + +boot-repair (4ppa177) focal; urgency=low + + * fix mount zfs + added modprobe zfs / efivars + + -- Yann MRN 29 Jan 2022 12:15:00 +0200 + +boot-repair (4ppa176) focal; urgency=low + + * zfs improvements thx to MAF & geole + + -- Yann MRN 29 Jan 2022 00:15:00 +0200 + +boot-repair (4ppa175) focal; urgency=low + + * remove '--no-uefi-secure-boot' to avoid unrecognized option error + * check efi files on liveUSB/MMC containing windows + * purge to remove grub-efi when install grub-pc from EFI session + * Workaround GRUB’s missing zpool-features support + + -- Yann MRN 28 Jan 2022 22:55:00 +0200 + +boot-repair (4ppa174) focal; urgency=low + + * fix wrong parted scan when partition has fallback disk + + -- Yann MRN 25 Jan 2022 22:06:14 +0200 + +boot-repair (4ppa173) focal; urgency=low + + * fixed missing parenthesis l305 bs-cmd-terminal + * -u alternative to --boot-info-url + + -- Yann MRN 24 Jan 2022 18:16:14 +0200 + +boot-repair (4ppa172) focal; urgency=low + + * if installed session, do not activate zfs, but add / source as a partition + * improved zfs activation based on geole and MAF feedback + + -- Yann MRN 24 Jan 2022 18:16:14 +0200 + +boot-repair (4ppa171) focal; urgency=low + + * prevent unmount /mnt/boot-sav/zfs + + -- Yann MRN 23 Jan 2022 00:16:14 +0200 + +boot-repair (4ppa170) focal; urgency=low + + * zfs: improved enabling, mount all zfs_members on /mnt/boot-sav/zfs + + -- Yann MRN 22 Jan 2022 23:16:14 +0200 + +boot-repair (4ppa169) focal; urgency=low + + * improved partition detection for >10 partitions systems + + -- Yann MRN 22 Jan 2022 01:16:14 +0200 + +boot-repair (4ppa168) focal; urgency=low + + * added a translatable string + * remove useless 'Grub-efi WIOULD not be selected by default because' when user forced grub-pc + * fixed 'gui-translations.sh: ligne 303: This_will_mount_=This' error + + -- Yann MRN 22 Jan 2022 00:16:14 +0200 + +boot-repair (4ppa167) focal; urgency=low + + * refined "Warning: NVram was not modified." condition for Mint + * solved GUI delay when clicking Advanced options + * added fat option to os-uninstaller + * removed advanced option to skip report creation + + -- Yann MRN 20 Jan 2022 23:16:14 +0200 + +boot-repair (4ppa166) focal; urgency=low + + * --no-nvram https://forum.ubuntu-fr.org/viewtopic.php?pid=22522049#p22522049 + + -- Yann MRN 20 Jan 2022 01:16:14 +0200 + +boot-repair (4ppa165) focal; urgency=low + + * remove useless Warning grub upgrade from log (keep it as popup when users selects the option) + * when zfs, add partitions from mount + * filter 'Warning: The driver descriptor says' lines from log (unless --no-filter) + * improved EFi section of boot-info + * removed options to install grub on all MBRs and to force in PBR + * improved grub*.efi detection + + -- Yann MRN 19 Jan 2022 01:16:14 +0200 + +boot-repair (4ppa164) focal; urgency=low + + * improve ESP detection on vda + * made df / compatible with zfs + * display blkid when lvm/raid/zfs + + -- Yann MRN 14 Jan 2022 01:16:14 +0200 + +boot-repair (4ppa163) focal; urgency=low + + * in boot-info hide identic consecutive lines of grub.cfg + * hide 'Warning: Unable to open ' + * no more purge when both grub-pc and grub-efi, nor to unsign + * improved filters when zfs + + -- Yann MRN 14 Jan 2022 00:16:14 +0200 + +boot-repair (4ppa162) focal; urgency=low + + * replaced gdisk -l by sgdisk -p + * cleaned pastebinaction + + -- Yann MRN 13 Jan 2022 13:16:14 +0200 + +boot-repair (4ppa161) focal; urgency=low + + * removed gdisk execution after free space section + * hide 'Unable to open /dev/sr0 read-write' from boot-info + + -- Yann MRN 13 Jan 2022 12:16:14 +0200 + +boot-repair (4ppa160) focal; urgency=low + + * stop considering [/usr/sbin/grub-probe: error: failed to get canonical path of `/boot/grub/fonts/UbuntuMono16.pf2'] as 'Error detected in grub_mkconfig' + * display md5 of efi files in EFI section + * in bis, updated Boot sector types and ignore memtest + + -- Yann MRN 12 Jan 2022 19:16:14 +0200 + +boot-repair (4ppa159) focal; urgency=low + + * removed gdisk section to avoid blocking boot-info when gdisk waits answer from user + + -- Yann MRN 12 Jan 2022 18:16:14 +0200 + +boot-repair (4ppa158) focal; urgency=low + + * fixed error: https://forum.ubuntu-fr.org/viewtopic.php?pid=22523320#p22523320 + * skip update when debug + + -- Yann MRN 11 Jan 2022 22:16:14 +0200 + +boot-repair (4ppa157) focal; urgency=low + + * fixed paste2bin to sprunge.us, hide 'error: cannot find a GRUB drive' false-positives, updates efi section after grub-efi install + + -- Yann MRN 6 Jan 2022 17:16:14 +0200 + +boot-repair (4ppa156) focal; urgency=low + + * improved purge commands - extended to other distribs + + -- Yann MRN 6 Jan 2022 13:15:14 +0200 + +boot-repair (4ppa153) focal; urgency=low + + * hide bs-cmd_terminal.sh: line 177: warning: command substitution: ignored null byte in input + + -- Yann MRN 4 Jan 2022 13:15:14 +0200 + +boot-repair (4ppa152) focal; urgency=low + + * fixed gui-actions-grub.sh: line 664: syntax error near unexpected token `}' + + -- Yann MRN Tue, 4 Jan 2022 13:14:14 +0200 diff -Nru boot-repair-4ppa123/debian/compat boot-repair-4ppa200/debian/compat --- boot-repair-4ppa123/debian/compat 2019-08-25 03:03:02.000000000 +0000 +++ boot-repair-4ppa200/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -11 diff -Nru boot-repair-4ppa123/debian/control boot-repair-4ppa200/debian/control --- boot-repair-4ppa123/debian/control 2020-03-15 13:14:14.000000000 +0000 +++ boot-repair-4ppa200/debian/control 2022-03-06 21:55:00.000000000 +0000 @@ -5,24 +5,26 @@ Uploaders: Alessio Treglia Build-Depends: debhelper (>= 11), + debhelper-compat (= 12), python-all Standards-Version: 4.1.1 X-Python-Version: all Homepage: https://launchpad.net/boot-repair Vcs-Git: https://github.com/yannmrn/boot-repair.git Vcs-Browser: https://github.com/yannmrn/boot-repair +Rules-Requires-Root: no Package: boot-repair Architecture: all Depends: - boot-sav, + boot-sav (>=4ppa200), ${misc:Depends} Recommends: ntfsprogs | ntfs-3g (>=1:2011.4.12AR.4), Description: Graphical tool to repair boot problems In some situation, you might loose access to one or several of your operating systems, because of a buggy update, a bootloader - problem, or after installing a new OS (e.g. installing + problem, or after installing a new OS (e.g. installing Windows breaks Linux bootloader). . Boot-Repair is a graphical tool that will repair these problems, @@ -32,14 +34,44 @@ Boot-Repair also has advanced options to reinstall GRUB, add kernel options, or restore a generic MBR. +Package: os-uninstaller +Architecture: all +Depends: + boot-sav (>=4ppa200), + ${misc:Depends} +Homepage: https://launchpad.net/os-uninstaller +Description: Operating System Uninstaller + When you have several operating systems (Windows, MacOS, GNU/Linux ..) + installed on your computer, you may want to remove one of them. + . + OS-Uninstaller is a graphical tool that will let you choose the system + you want to remove, and uninstall it very easily. After your + confirmation, it will format the selected system, and update the + bootloader so that you will still access your other remaining systems. + . + OS-Uninstaller also has advanced options for OS formatting, and + bootloader updating. + +Package: boot-info +Architecture: all +Depends: + boot-sav (>=4ppa200), + ${misc:Depends} +Homepage: https://launchpad.net/boot-info +Description: Diagnose the boot of the computer + Boot-Info creates a report about your boot environment. + This can help diagnose boot issues, and find the best solution. + . + The report can be either opened in a text file, or uploaded + to a pastebin URL for easier sharing with people who help you. + Package: boot-sav Architecture: all Depends: gawk | mawk (>= 1.3.4), gettext-base, - glade2script (>= 3), + glade2script (>= 3.2.4~ppa23), lsb-release, - os-prober, parted, xdg-utils, xz-utils | xz-lzma | lzma, @@ -52,10 +84,15 @@ dmraid, lvm2, mdadm, - os-uninstaller + os-uninstaller, + zfsutils-linux Recommends: boot-sav-extra, efibootmgr, + lshw, + gdisk, + mokutil, + os-prober, pastebinit, syslinux-common | syslinux | mbr, zip @@ -74,34 +111,3 @@ Common files for 2 tools related to boot: OS-Uninstaller, and Boot-Repair - -Package: os-uninstaller -Architecture: all -Depends: - boot-sav, - ${misc:Depends} -Homepage: https://launchpad.net/os-uninstaller -Description: Operating System Uninstaller - When you have several operating systems (Windows, MacOS, GNU/Linux ..) - installed on your computer, you may want to remove one of them. - . - OS-Uninstaller is a graphical tool that will let you choose the system - you want to remove, and uninstall it very easily. After your - confirmation, it will format the selected system, and update the - bootloader so that you will still access your other remaining systems. - . - OS-Uninstaller also has advanced options for OS formatting, and - bootloader updating. - -Package: boot-info -Architecture: all -Depends: - boot-sav, - ${misc:Depends} -Homepage: https://launchpad.net/boot-info -Description: Diagnose the boot of the computer - Boot-Info creates a report about your boot environment. - This can help diagnose boot issues, and find the best solution. - . - The report can be either opened in a text file, or uploaded - to a pastebin URL for easier sharing with people who help you. diff -Nru boot-repair-4ppa123/debian/copyright boot-repair-4ppa200/debian/copyright --- boot-repair-4ppa123/debian/copyright 2019-08-25 03:04:28.000000000 +0000 +++ boot-repair-4ppa200/debian/copyright 2021-12-18 03:07:43.000000000 +0000 @@ -1,14 +1,14 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: boot-repair Source: https://launchpad.net/boot-repair -Upstream-Contact: Yann Mrn +Upstream-Contact: Yann Mrn Files: * -Copyright: 2010-2020 Yann Mrn +Copyright: 2010-2022 Yann Mrn License: GPL-3.0+ Files: usr/share/boot-sav/b-i-s.sh -Copyright: 2011-2012 Gert Hulselmans +Copyright: see file License: MIT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to diff -Nru boot-repair-4ppa123/docs/boot-info.8 boot-repair-4ppa200/docs/boot-info.8 --- boot-repair-4ppa123/docs/boot-info.8 2020-03-15 13:14:14.000000000 +0000 +++ boot-repair-4ppa200/docs/boot-info.8 2022-01-25 16:02:57.000000000 +0000 @@ -12,9 +12,6 @@ .B -b / --bootinfo returns the boot-info report in terminal mode .TP -.B --bootinfo-url -returns pastebin URL leading to the boot-info report -.TP .B --esp returns basic information about ESP on the system .TP @@ -24,6 +21,9 @@ .B -t=XX displays latest XX lines of common logs of linux distributions installed on the system .TP +.B -u / --bootinfo-url +returns pastebin URL leading to the boot-info report +.TP .B -v / --version displays the version .SH ADVANCED OPTIONS diff -Nru boot-repair-4ppa123/docs/boot-repair.8 boot-repair-4ppa200/docs/boot-repair.8 --- boot-repair-4ppa123/docs/boot-repair.8 2020-03-15 13:14:14.000000000 +0000 +++ boot-repair-4ppa200/docs/boot-repair.8 2022-01-25 16:03:23.000000000 +0000 @@ -20,9 +20,6 @@ .B -b / --bootinfo returns the boot-info report in terminal mode .TP -.B --bootinfo-url -returns pastebin URL leading to the boot-info report -.TP .B --esp returns basic information about ESP on the system .TP @@ -32,6 +29,9 @@ .B -t=XX displays latest XX lines of common logs of linux distributions installed on the system .TP +.B -u / --bootinfo-url +returns pastebin URL leading to the boot-info report +.TP .B -v / --version displays the version .SH ADVANCED OPTIONS diff -Nru boot-repair-4ppa123/docs/os-uninstaller.8 boot-repair-4ppa200/docs/os-uninstaller.8 --- boot-repair-4ppa123/docs/os-uninstaller.8 2020-03-15 13:14:14.000000000 +0000 +++ boot-repair-4ppa200/docs/os-uninstaller.8 2022-01-25 16:03:44.000000000 +0000 @@ -19,9 +19,6 @@ .B -b / --bootinfo returns the boot-info report in terminal mode .TP -.B --bootinfo-url -returns pastebin URL leading to the boot-info report -.TP .B --esp returns basic information about ESP on the system .TP @@ -31,6 +28,9 @@ .B -t=XX displays latest XX lines of common logs of linux distributions installed on the system .TP +.B -u / --bootinfo-url +returns pastebin URL leading to the boot-info report +.TP .B -v / --version displays the version .SH ADVANCED OPTIONS diff -Nru boot-repair-4ppa123/po/boot-sav-translations/boot-sav.pot boot-repair-4ppa200/po/boot-sav-translations/boot-sav.pot --- boot-repair-4ppa123/po/boot-sav-translations/boot-sav.pot 2020-03-15 13:14:14.000000000 +0000 +++ boot-repair-4ppa200/po/boot-sav-translations/boot-sav.pot 2022-02-16 11:11:40.000000000 +0000 @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-23 00:53+0200\n" +"POT-Creation-Date: 2022-02-16 12:11+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,7 +18,7 @@ "Content-Transfer-Encoding: 8bit\n" #: boot-repair/usr/share/boot-sav/boot-info-translations.sh:17 -#: boot-repair/usr/share/boot-sav/gui-actions.sh:739 +#: boot-repair/usr/share/boot-sav/gui-actions.sh:758 #, sh-format msgid "Boot-Info" msgstr "" @@ -107,7 +107,7 @@ msgstr "" #: boot-repair/usr/share/boot-sav/boot-repair-translations.sh:28 -#: boot-repair/usr/share/boot-sav/gui-translations.sh:187 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:189 #, sh-format msgid "Whatever the systems installed on your disk," msgstr "" @@ -123,7 +123,7 @@ msgstr "" #: boot-repair/usr/share/boot-sav/boot-repair-translations.sh:31 -#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:40 +#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:41 #, sh-format msgid "Can recover access to Windows (XP, Vista, Windows7, Windows8)." msgstr "" @@ -1091,19 +1091,31 @@ "default boot entry of the Windows bootloader." msgstr "" +#: boot-repair/usr/share/boot-sav/gui-translations.sh:183 +#, sh-format +msgid "Please check the Advanced Options." +msgstr "" + #: boot-repair/usr/share/boot-sav/gui-translations.sh:184 #, sh-format +msgid "" +"ZFS pools already activated. Please retry from a new live-session, without " +"activating the pools." +msgstr "" + +#: boot-repair/usr/share/boot-sav/gui-translations.sh:186 +#, sh-format msgid "Free (GPL open-source license)" msgstr "" #. /// Please do not translate ${APPNAME} -#: boot-repair/usr/share/boot-sav/gui-translations.sh:186 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:188 #, sh-format msgid "GET ${APPNAME}:" msgstr "" #. /// Please do not translate ${APPNAME} -#: boot-repair/usr/share/boot-sav/gui-translations.sh:189 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:191 #, sh-format msgid "" "boot on a Debian (or derivatives: Ubuntu, Linux Mint...) disk, either normal " @@ -1112,39 +1124,39 @@ msgstr "" #. /// Please do not translate ${APPNAME} -#: boot-repair/usr/share/boot-sav/gui-translations.sh:191 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:193 #, sh-format msgid "USE ${APPNAME}:" msgstr "" -#: boot-repair/usr/share/boot-sav/gui-translations.sh:192 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:194 #, sh-format msgid "GET HELP:" msgstr "" -#: boot-repair/usr/share/boot-sav/gui-translations.sh:193 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:195 #, sh-format msgid "by Email (boot.repair@gmail.com)" msgstr "" -#: boot-repair/usr/share/boot-sav/gui-translations.sh:194 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:196 #, sh-format msgid "HELP THE PROJECT:" msgstr "" -#: boot-repair/usr/share/boot-sav/gui-translations.sh:195 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:197 #, sh-format msgid "" "Translate, Propose patches, or Donate (Paypal account: boot.repair@gmail.com)" msgstr "" -#: boot-repair/usr/share/boot-sav/gui-translations.sh:196 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:198 #, sh-format msgid "DISCLAIMER:" msgstr "" #. /// Please do not translate ${APPNAME} -#: boot-repair/usr/share/boot-sav/gui-translations.sh:198 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:200 #, sh-format msgid "" "${APPNAME} is distributed in the hope that it will be useful, but without " @@ -1152,7 +1164,7 @@ msgstr "" #. /// Please do not translate ${APPNAME} -#: boot-repair/usr/share/boot-sav/gui-translations.sh:200 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:202 #, sh-format msgid "" "Please be aware that ${APPNAME} writes logs and backups on disks, collects " @@ -1161,61 +1173,61 @@ "mount points." msgstr "" -#: boot-repair/usr/share/boot-sav/gui-translations.sh:201 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:203 #, sh-format msgid "Just disconnect internet if you want these data remain local." msgstr "" #. /// Please do not translate [${OPTION}] -#: boot-repair/usr/share/boot-sav/gui-translations.sh:212 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:214 #, sh-format msgid "Do you want to activate [${OPTION}]?" msgstr "" #. /// Please do not translate [${PACKAGELIST}] -#: boot-repair/usr/share/boot-sav/gui-translations.sh:214 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:216 #, sh-format msgid "You may want to retry after installing the [${PACKAGELIST}] packages." msgstr "" #. /// Please do not translate FUNCTION. Neutral and singular. -#: boot-repair/usr/share/boot-sav/gui-translations.sh:216 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:218 #, sh-format msgid "${FUNCTION} detected." msgstr "" #. /// Please do not translate [${PACKAGELIST}] -#: boot-repair/usr/share/boot-sav/gui-translations.sh:218 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:220 #, sh-format msgid "This will install the [${PACKAGELIST}] packages." msgstr "" #. /// Please do not translate [${PACKAGELIST}] -#: boot-repair/usr/share/boot-sav/gui-translations.sh:220 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:222 #, sh-format msgid "Do you want to install the [${PACKAGELIST}] packages?" msgstr "" #. /// Please do not translate [${PACKAGELIST}] -#: boot-repair/usr/share/boot-sav/gui-translations.sh:222 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:224 #, sh-format msgid "Please install the [${PACKAGELIST}] packages." msgstr "" #. /// Please do not translate [${NEEDEDREP}] -#: boot-repair/usr/share/boot-sav/gui-translations.sh:224 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:226 #, sh-format msgid "This may require to enable [${NEEDEDREP}] repositories." msgstr "" #. /// Please do not translate ${FILE} -#: boot-repair/usr/share/boot-sav/gui-translations.sh:226 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:228 #, sh-format msgid "Partition tables, MBRs and logs have been saved into ${FILE}" msgstr "" #. /// Please do not translate [${PACKAGELIST}] nor ${DISTRO} -#: boot-repair/usr/share/boot-sav/gui-translations.sh:228 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:230 #, sh-format msgid "" "Please enable a repository containing the [${PACKAGELIST}] packages in the " @@ -1223,32 +1235,32 @@ msgstr "" #. /// Please do not translate ${TYPE3} -#: boot-repair/usr/share/boot-sav/gui-translations.sh:230 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:232 #, sh-format msgid "Separate ${TYPE3} partition:" msgstr "" #. /// Please do not translate [${BUG}] -#: boot-repair/usr/share/boot-sav/gui-translations.sh:232 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:234 #, sh-format msgid "solves the [${BUG}] error" msgstr "" #. /// Please do not translate ${FUNCTION} -#: boot-repair/usr/share/boot-sav/gui-translations.sh:234 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:236 #, sh-format msgid "Enabling ${FUNCTION}" msgstr "" #. /// Please do not translate ${MODE1} nor ${MODE2} -#: boot-repair/usr/share/boot-sav/gui-translations.sh:236 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:238 #, sh-format msgid "" "The boot of your PC is in ${MODE1} mode. Please change it to ${MODE2} mode." msgstr "" #. /// Please do not translate ${MODE1} nor ${MODE2} -#: boot-repair/usr/share/boot-sav/gui-translations.sh:238 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:240 #, sh-format msgid "" "The boot of your PC is in ${MODE1} mode. You may want to retry after " @@ -1256,7 +1268,7 @@ msgstr "" #. /// Please do not translate ${MODE1} nor ${MODE2} -#: boot-repair/usr/share/boot-sav/gui-translations.sh:240 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:242 #, sh-format msgid "" "The boot of your PC is in ${MODE1} mode, but no ${MODE2} partition was " @@ -1264,61 +1276,61 @@ msgstr "" #. /// Please do not translate ${TYP} -#: boot-repair/usr/share/boot-sav/gui-translations.sh:242 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:244 #, sh-format msgid "You may want to retry after creating a ${TYP} partition" msgstr "" #. /// Please do not translate ${TYP} -#: boot-repair/usr/share/boot-sav/gui-translations.sh:244 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:246 #, sh-format msgid "Please create a ${TYP} partition" msgstr "" #. /// Please do not translate ${FILENAME} -#: boot-repair/usr/share/boot-sav/gui-translations.sh:246 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:248 #, sh-format msgid "A new file (${FILENAME}) will open in your text viewer." msgstr "" #. /// Please do not translate ${TOOL1} -#: boot-repair/usr/share/boot-sav/gui-translations.sh:248 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:250 #, sh-format msgid "This can be performed via tools such as ${TOOL1}." msgstr "" #. /// Please do not translate ${TOOL1} nor ${TOOL2} -#: boot-repair/usr/share/boot-sav/gui-translations.sh:250 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:252 #, sh-format msgid "This can be performed via tools such as ${TOOL1} or ${TOOL2}." msgstr "" #. /// Please do not translate ${DISK1} -#: boot-repair/usr/share/boot-sav/gui-translations.sh:252 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:254 #, sh-format msgid "Is ${DISK1} a removable disk?" msgstr "" #. /// Please use lower-case letters for "flag" (not "Flag"), and do not translate FLAGTYP -#: boot-repair/usr/share/boot-sav/gui-translations.sh:254 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:256 #, sh-format msgid "${FLAGTYP} flag" msgstr "" #. /// Please do not translate ${DISK1} -#: boot-repair/usr/share/boot-sav/gui-translations.sh:256 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:258 #, sh-format msgid "Please do not forget to make your BIOS boot on ${DISK1} disk!" msgstr "" #. /// Please do not translate ${FILE1} -#: boot-repair/usr/share/boot-sav/gui-translations.sh:258 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:260 #, sh-format msgid "Please do not forget to make your UEFI firmware boot on ${FILE1} file!" msgstr "" #. /// Please do not translate ${SYSTEM1} nor ${FILE1} -#: boot-repair/usr/share/boot-sav/gui-translations.sh:260 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:262 #, sh-format msgid "" "Please do not forget to make your UEFI firmware boot on the ${SYSTEM1} entry " @@ -1326,19 +1338,19 @@ msgstr "" #. /// Please do not translate [${OPTION}] -#: boot-repair/usr/share/boot-sav/gui-translations.sh:262 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:264 #, sh-format msgid "You may want to retry after activating the [${OPTION}] option." msgstr "" #. /// Please do not translate [${OPTION}] -#: boot-repair/usr/share/boot-sav/gui-translations.sh:264 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:266 #, sh-format msgid "You may want to retry after deactivating the [${OPTION}] option." msgstr "" #. /// Please do not translate [${OPTION}] -#: boot-repair/usr/share/boot-sav/gui-translations.sh:266 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:268 #, sh-format msgid "" "Alternatively, you may want to retry after deactivating the [${OPTION}] " @@ -1346,19 +1358,19 @@ msgstr "" #. /// Please do not translate [${OPTION1}] -#: boot-repair/usr/share/boot-sav/gui-translations.sh:268 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:270 #, sh-format msgid "Alternatively, you can retry after activating the [${OPTION1}] option." msgstr "" #. /// Please do not translate ${SYSTEM1} -#: boot-repair/usr/share/boot-sav/gui-translations.sh:270 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:272 #, sh-format msgid "Repair ${SYSTEM1} boot files" msgstr "" #. /// Please do not translate [${SYSTEM1}] -#: boot-repair/usr/share/boot-sav/gui-translations.sh:272 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:274 #, sh-format msgid "" "The boot files of [${SYSTEM2}] are far from the start of the disk. Your BIOS " @@ -1366,13 +1378,13 @@ msgstr "" #. /// Please do not translate [${OPTION2}] nor [${TOOL3}] -#: boot-repair/usr/share/boot-sav/gui-translations.sh:274 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:276 #, sh-format msgid "Then select this partition via the [${OPTION2}] option of [${TOOL3}]." msgstr "" #. /// Please do not translate ${PARTITION1} -#: boot-repair/usr/share/boot-sav/gui-translations.sh:276 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:278 #, sh-format msgid "" "You have installed on ${PARTITION1} a Linux version which is not EFI-" @@ -1380,7 +1392,7 @@ msgstr "" #. /// Please do not translate ${PARTITION1} -#: boot-repair/usr/share/boot-sav/gui-translations.sh:278 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:280 #, sh-format msgid "" "Your Linux on ${PARTITION1} is 32-bit, so it may be incompatible with your " @@ -1388,13 +1400,13 @@ msgstr "" #. /// Please do not translate ${SYSTEM1} and ${SYSTEM2} -#: boot-repair/usr/share/boot-sav/gui-translations.sh:280 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:282 #, sh-format msgid "For example, ${SYSTEM1} and ${SYSTEM2} are EFI-compatible systems." msgstr "" #. /// Please do not translate ${DISK44} nor ${FUNCTION44} -#: boot-repair/usr/share/boot-sav/gui-translations.sh:282 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:284 #, sh-format msgid "" "Please use ${DISK44} which contains a ${FUNCTION44}-compatible version of " @@ -1402,25 +1414,25 @@ msgstr "" #. /// Please do not translate ${SYSTEM3} -#: boot-repair/usr/share/boot-sav/gui-translations.sh:284 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:286 #, sh-format msgid "${SYSTEM3} is now without GRUB." msgstr "" #. /// Please do not translate ${DISK5} -#: boot-repair/usr/share/boot-sav/gui-translations.sh:286 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:288 #, sh-format msgid "${DISK5} is a removable disk." msgstr "" #. /// Please do not translate ${OPTION5} -#: boot-repair/usr/share/boot-sav/gui-translations.sh:288 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:290 #, sh-format msgid "Please disable ${OPTION5} in the BIOS." msgstr "" #. /// Please do not translate ${DISK5} -#: boot-repair/usr/share/boot-sav/gui-translations.sh:290 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:292 #, sh-format msgid "" "For example, use a live-USB of ${DISK5}, after making sure your BIOS is set " @@ -1428,7 +1440,7 @@ msgstr "" #. /// Please do not translate ${SYSTEM6} nor ${COMMANDTOTYP5} nor ${SYSTEM8} -#: boot-repair/usr/share/boot-sav/gui-translations.sh:292 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:294 #, sh-format msgid "" "Please set your BIOS in Legacy mode in order to start your ${SYSTEM6}, then " @@ -1437,7 +1449,7 @@ msgstr "" #. /// Please do not translate ${PACKAGELIST} nor ${APPNAME} -#: boot-repair/usr/share/boot-sav/gui-translations.sh:294 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:296 #, sh-format msgid "" "If possible, please update the [${PACKAGELIST}] packages, then restart the " @@ -1445,17 +1457,45 @@ msgstr "" #. /// Please do not translate ${PATH1} -#: boot-repair/usr/share/boot-sav/gui-translations.sh:296 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:298 #, sh-format msgid "Do you want to delete old logs and backups located in ${PATH1} ?" msgstr "" #. /// Please do not translate ${SYSTEM2} -#: boot-repair/usr/share/boot-sav/gui-translations.sh:298 +#: boot-repair/usr/share/boot-sav/gui-translations.sh:300 #, sh-format msgid "Please close the ${SYSTEM2} installer, then retry." msgstr "" +#. /// Please do not translate ${HIDDENESP} +#: boot-repair/usr/share/boot-sav/gui-translations.sh:302 +#, sh-format +msgid "" +"You may want to retry after removing the [hidden] flag from the ${HIDDENESP} " +"partition." +msgstr "" + +#. /// Please do not translate ${PART1} +#: boot-repair/usr/share/boot-sav/gui-translations.sh:304 +#, sh-format +msgid "" +"This will modify the mount point of ${PART1} in order to remove spaces and " +"special characters." +msgstr "" + +#. /// Please do not translate ${PARTB} +#: boot-repair/usr/share/boot-sav/gui-translations.sh:306 +#, sh-format +msgid "Do you want to remove the [hidden] flag of ${PARTB} ?" +msgstr "" + +#. /// Please do not translate ${PACK7} +#: boot-repair/usr/share/boot-sav/gui-translations.sh:308 +#, sh-format +msgid "Please retry from a live disc containing a recent version of ${PACK7}." +msgstr "" + #: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:17 #, sh-format msgid "OS-Uninstaller" @@ -1471,85 +1511,86 @@ msgid "Wubi must be uninstalled from Windows." msgstr "" -#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:20 +#. /// Please translate and, if possible, indicate an equivalent link in your language +#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:21 #, sh-format msgid "" "See https://wiki.ubuntu.com/WubiGuide#Uninstallation for more information." msgstr "" -#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:21 +#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:22 #, sh-format msgid "Which operating system do you want to uninstall ?" msgstr "" -#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:22 +#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:23 #, sh-format msgid "We hope you enjoyed it and look forward to read your feedback." msgstr "" -#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:23 +#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:24 #, sh-format msgid "To finish the removal, please do not forget to update your bootloader!" msgstr "" -#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:24 +#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:25 #, sh-format msgid "" "(the Linux distribution installed from this Windows via Wubi will be lost)" msgstr "" -#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:25 +#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:26 #, sh-format msgid "" "This partition will be formatted, please backup your documents before " "proceeding." msgstr "" -#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:26 +#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:27 #, sh-format msgid "" "These partitions will be formatted, please backup your documents before " "proceeding." msgstr "" -#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:27 +#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:28 #, sh-format msgid "An error occurred during the removal." msgstr "" -#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:28 +#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:29 #, sh-format msgid "Then you will need to update your bootloader." msgstr "" -#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:29 +#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:30 #, sh-format msgid "Apply changes?" msgstr "" #. /// Please do not translate ${APPNAME} -#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:32 +#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:33 #, sh-format msgid "${APPNAME}, simple tool to remove an operating system in 1 click." msgstr "" -#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:33 +#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:34 #, sh-format msgid "Easy-to-use (removal in 1 click)" msgstr "" -#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:34 +#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:35 #, sh-format msgid "Can remove any Windows (XP, Vista, Windows7, Windows8)." msgstr "" -#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:35 +#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:36 #, sh-format msgid "" "Can remove any Linux (Debian, Ubuntu, Mint, Fedora, OpenSuse, ArchLinux...)." msgstr "" -#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:36 +#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:37 #, sh-format msgid "" "Remark: if you want to uninstall Wubi (Ubuntu installed inside Windows), " @@ -1557,21 +1598,21 @@ msgstr "" #. /// Please do not translate ${APPNAME} -#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:38 +#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:39 #, sh-format msgid "" "Launch ${APPNAME}, choose the system to remove, then click the \"Apply\" " "button." msgstr "" -#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:39 +#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:40 #, sh-format msgid "" "When the removal is finished, reboot and check that your system has been " "removed." msgstr "" -#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:41 +#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:42 #, sh-format msgid "" "Warning: the default settings of the Advanced Options are the recommended " @@ -1580,7 +1621,7 @@ msgstr "" #. /// Please do not translate ${DISK} and ${APPNAME} -#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:43 +#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:44 #, sh-format msgid "" "or: boot on ${DISK}. A software (Boot-Repair) will be launched " @@ -1588,25 +1629,25 @@ msgstr "" #. /// Please do not translate ${OS_TO_DELETE_NAME} -#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:48 +#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:49 #, sh-format msgid "Removing ${OS_TO_DELETE_NAME} ..." msgstr "" #. /// Please do not translate ${OS_TO_DELETE_NAME} -#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:50 +#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:51 #, sh-format msgid "${OS_TO_DELETE_NAME} has been successfully removed." msgstr "" #. /// Please do not translate ${OS_TO_DELETE_PARTITION} -#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:52 +#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:53 #, sh-format msgid "Format the partition ${OS_TO_DELETE_PARTITION} into :" msgstr "" #. /// Please do not translate ${OS_TO_DELETE_NAME} and ${OS_TO_DELETE_PARTITION} -#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:54 +#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:55 #, sh-format msgid "" "Do you really want to uninstall ${OS_TO_DELETE_NAME} " @@ -1614,13 +1655,13 @@ msgstr "" #. /// Please do not translate ${OS_TO_DELETE_NAME} and ${OS_TO_DELETE_PARTITION} -#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:56 +#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:57 #, sh-format msgid "This will remove ${OS_TO_DELETE_NAME} (${OS_TO_DELETE_PARTITION})." msgstr "" #. /// Please do not translate ${WUBI_TO_DELETE_PARTITION} -#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:58 +#: boot-repair/usr/share/boot-sav/os-uninstaller-translations.sh:59 #, sh-format msgid "" "(the Linux distribution installed into this Windows via Wubi on " diff -Nru boot-repair-4ppa123/usr/share/boot-sav/b-i-s-functions.sh boot-repair-4ppa200/usr/share/boot-sav/b-i-s-functions.sh --- boot-repair-4ppa123/usr/share/boot-sav/b-i-s-functions.sh 2020-03-15 13:14:14.000000000 +0000 +++ boot-repair-4ppa200/usr/share/boot-sav/b-i-s-functions.sh 2022-03-01 01:16:52.000000000 +0000 @@ -4,7 +4,7 @@ # Copyright (c) 2009-2010 Ulrich Meierfrankenfeld # # Copyright (c) 2011-2012 Gert Hulselmans # # Copyright (c) 2013-2018 Andrei Borzenkov # -# Copyright (c) 2019-2020 Yann MRN # +# Copyright (c) 2019-2022 Yann MRN # # # # Permission is hereby granted, free of charge, to any person obtaining a copy # # of this software and associated documentation files (the "Software"), to # @@ -1722,7 +1722,7 @@ case "${Bytes110_to_111}" in 9090) BST='Windows Vista: NTFS';; 2810) BST='Windows 7/2008: NTFS';; - 0a13) BST='Windows 8/2012: NTFS';; + 0a13) BST='Windows 8/10/11/2012: NTFS';; esac;; esac;; 55cd) BST='FAT32';; @@ -1757,7 +1757,7 @@ e2f7) BST='FAT32, Non Bootable';; e879) BST='ISOhybrid (Syslinux 3.74-3.80)';; e9d8) BST='Windows Vista/7: NTFS';; - f6c1) BST='Windows 8/2012: FAT32';; + f6c1) BST='Windows 8/10/11/2012: FAT32';; f6f6) BST='- (cleared BS by FDISK)';; fa33) BST='Windows XP: NTFS';; fbc0) BST='ISOhybrid (Syslinux 3.81)';; @@ -1944,7 +1944,7 @@ # If multiple mount points are found, use the one with the shortest pathname. CheckMount=$(mount | ${AWK} -F "\t" '$0 ~ "^'${part}' " { sub(" on ", "\t", $0); sub(" type ", "\t", $0); print $2 }' | sort | ${AWK} '{ print $0; exit}'); # Check whether partition is already mounted. - if [ x"${CheckMount}" = x'' ] ; then + if [ x"${CheckMount}" = x'' ]; then mountname=/mnt/BootInfo/${mountname} # Directory where the partition will be mounted. mkdir -p "${mountname}"; @@ -1961,6 +1961,38 @@ # Try to mount the partition. if [ x"${CheckMount}" != x'' ] || mount -r -t "${type}" ${part} "${mountname}" 2>> ${Mount_Error} \ || ( [ "${type}" = ntfs ] && ntfs-3g -o ro ${part} "${mountname}" 2>> ${Mount_Error} ) ; then + BIS_Scan_Partition + + # If partition was mounted by the script. + if [ x"${CheckMount}" = x'' ] ; then + umount "${mountname}" || umount -l "${mountname}"; + fi + # If partition failed to mount. + else + printf " Mounting failed: " >> "${Log}"; + cat ${Mount_Error} >> "${Log}"; + fi # End of Mounting "if then else". +elif [ "$type" = zfs_member ];then + if [[ "$(df -Th / | grep zfs )" ]];then + [[ "$(LANG=C fdisk -l | grep "$part " | grep boot)" ]] && mountname=/boot || mountname="" + BIS_Scan_Partition + elif [[ "$( mount | grep /mnt/boot-sav/zfs)" ]];then + [[ "$(LANG=C fdisk -l | grep "$part " | grep boot)" ]] && mountname=/mnt/boot-sav/zfs/boot || mountname=/mnt/boot-sav/zfs + BIS_Scan_Partition + fi +fi # End of Partition Type "if then else". +echo >> "${Log}"; +if [[ -e "${Log}"x ]] ; then + cat "${Log}"x >> "${Log}"; + rm "${Log}"x; +fi +if [[ -e "${Log1}"x ]] ; then + cat "${Log1}"x >> "${Log1}"; + rm "${Log1}"x; +fi +} # End Get_Partition_Info function + +BIS_Scan_Partition() { # If partition is mounted, try to identify the Operating System (OS) by looking for files specific to the OS. OS=''; ls "${mountname}"/{windows,Windows,WINDOWS}/{System32,system32}/{Winload,winload}.exe 1>>$Trash 2>>$Trash && OS='Windows'; @@ -1973,7 +2005,8 @@ grep -q "n.1.0" "${mountname}"/{windows,Windows,WINDOWS}/{System32,system32}/{Winload,winload}.exe 2>> ${Trash} && OS='Windows 7 or 10'; #Win7 also contains n.1.0 but not i.n.1.0 grep -q "n.7" "${mountname}"/{windows,Windows,WINDOWS}/{System32,system32}/{Winload,winload}.exe 2>> ${Trash} && OS='Windows 7'; grep -q "n.8" "${mountname}"/{windows,Windows,WINDOWS}/{System32,system32}/{Winload,winload}.exe 2>> ${Trash} && OS='Windows 8 or 10'; #Win10 in May2020 - grep -q "i.n.1.0" "${mountname}"/{windows,Windows,WINDOWS}/{System32,system32}/{Winload,winload}.exe 2>> ${Trash} && OS='Windows 10'; + grep -q "i.n.1.0" "${mountname}"/{windows,Windows,WINDOWS}/{System32,system32}/{Winload,winload}.exe 2>> ${Trash} && OS='Windows 10 or 11'; #Win11 in Jan2022 + grep -q "n.1.1" "${mountname}"/{windows,Windows,WINDOWS}/{System32,system32}/{Winload,winload}.exe 2>> ${Trash} && OS='Windows 11'; #not seen yet [ -s "${mountname}/ReactOS/system32/config/SecEvent.Evt" ] && OS='ReactOS'; [ -s "${mountname}/etc/issue" ] && OS=$(sed -e 's/\\. //g' -e 's/\\.//g' -e 's/^[ \t]*//' "${mountname}"/etc/issue); [ -s "${mountname}/etc/slackware-version" ] && OS=$(sed -e 's/\\. //g' -e 's/\\.//g' -e 's/^[ \t]*//' "${mountname}"/etc/slackware-version); @@ -2001,8 +2034,9 @@ [[ ! "$line" =~ '#' ]] || [[ "$line" =~ 'was on' ]] || [[ "$line" =~ '> "${Log1}" done < <(sed -e '/^$/d' ${mountname}${file} ) elif [[ "$file" =~ 'grub.cfg' ]];then - while read line; do - if [[ "$line" =~ "menuentry " ]] || [[ "$DEBBUG" ]] || [[ "$line" =~ "### END /etc/grub.d/30_" ]] \ + prevline="" + while read line; do + if [[ "$line" =~ "menuentry " ]] || [[ "$line" =~ "### END /etc/grub.d/30_" ]] \ && [[ ! "$line" =~ memtest ]] && [[ ! "$line" =~ "(recovery mode)" ]];then if [[ "$line" =~ "menuentry " ]];then line="${line#*menuentry \'}"; line="${line#*menuentry \"}"; @@ -2011,9 +2045,11 @@ line2="${line2#*simple-}"; line2="${line2#*anced-}"; line2="${line2#*chain-}" line="${line%%\' *}"; line="${line%%\" *}"; [[ "$line" != "$line2" ]] && line="$line $line2" #displays uuid when possible - echo "$line" | sed 's|/dev/||g' >> "${Log1}" - else - echo "$line" >> "${Log1}" + line="$(echo "$line" | sed 's|/dev/||g' )" + fi + if [[ "$line" != "$prevline" ]];then #avoids consecutive identic lines (e.g. geole) + echo "$line" >> "${Log1}" + prevline="$line" fi fi done < <(sed -e '/^[ ]*# /d' -e '/^$/d' ${mountname}${file} ) #removes empty lines. Remove '# 'lines but keep # lines to see ### BEGIN /etc/grub.d/40_custom ### @@ -2054,14 +2090,14 @@ # Check FAT filesystems for EFI boot files. for file in "${mountname}"/efi/{,*/}*/{*.efi,grub.cfg}; do file="${file#${mountname}}"; # Remove "${mountname}" part of the filename. - if [ -f "${mountname}${file}" ] && [ -s "${mountname}${file}" ] && FileNotMounted "${mountname}${file}" "${mountname}" ; then - BootFiles="${BootFiles} ${file}"; + if [ -f "${mountname}${file}" ] && [ -s "${mountname}${file}" ] && FileNotMounted "${mountname}${file}" "${mountname}"; then + [[ ! "${file}" =~ memtest ]] && BootFiles="${BootFiles} ${file}"; if [ ${file##*/} = 'grub.cfg' ] ; then # display content. title_gen "${name}${file} $FILTERED" >> "${Log1}" # Generates a titlebar above each file listed. if [[ "$FILTERED" ]];then if [[ "$(cat ${mountname}${file} )" =~ menuentry ]];then while read line; do - if [[ "$line" =~ "menuentry " ]] || [[ "$DEBBUG" ]] || [[ "$line" =~ "### END /etc/grub.d/30_" ]] \ + if [[ "$line" =~ "menuentry " ]] || [[ "$line" =~ "### END /etc/grub.d/30_" ]] \ && [[ ! "$line" =~ memtest ]] && [[ ! "$line" =~ "(recovery mode)" ]];then if [[ "$line" =~ "menuentry " ]];then line="${line#*menuentry \'}"; line="${line#*menuentry \"}"; @@ -2215,7 +2251,7 @@ if [[ -d "$temp" ]];then title_gen "${name}: ls -l /etc/grub.d/ $FILTERED" >> "${Log1}" if [[ "$FILTERED" ]];then - ls -l "$temp" | grep -v README | grep -v total | grep -v 00_header | grep -v 05_debian | grep -v 20_memtest >> "${Log1}" + LANG=C ls -l "$temp" | grep -v README | grep -v total | grep -v 00_header | grep -v 05_debian | grep -v 20_memtest >> "${Log1}" for temp3 in $(ls $temp);do if [[ "$(echo $temp3 | grep -v README | grep -v 00_header | grep -v 05_debian | grep -v 10_linux | \ grep -v 20_linux | grep -v memtest | grep -v 30_os-prober | grep -v 30_uefi-firmware)" ]] \ @@ -2228,7 +2264,7 @@ fi done else - ls -l "$temp" >> "${Log1}" + LANG=C ls -l "$temp" >> "${Log1}" for temp3 in $(ls $temp);do if [[ -f "$temp$temp3" ]];then title_gen "${name}/etc/grub.d/$temp3" >> "${Log1}" @@ -2238,24 +2274,4 @@ fi fi - - # If partition was mounted by the script. - if [ x"${CheckMount}" = x'' ] ; then - umount "${mountname}" || umount -l "${mountname}"; - fi - # If partition failed to mount. - else - printf " Mounting failed: " >> "${Log}"; - cat ${Mount_Error} >> "${Log}"; - fi # End of Mounting "if then else". -fi # End of Partition Type "if then else". -echo >> "${Log}"; -if [[ -e "${Log}"x ]] ; then - cat "${Log}"x >> "${Log}"; - rm "${Log}"x; -fi -if [[ -e "${Log1}"x ]] ; then - cat "${Log1}"x >> "${Log1}"; - rm "${Log1}"x; -fi -} # End Get_Partition_Info function +} diff -Nru boot-repair-4ppa123/usr/share/boot-sav/b-i-s.sh boot-repair-4ppa200/usr/share/boot-sav/b-i-s.sh --- boot-repair-4ppa123/usr/share/boot-sav/b-i-s.sh 2020-03-15 13:14:14.000000000 +0000 +++ boot-repair-4ppa200/usr/share/boot-sav/b-i-s.sh 2022-03-01 01:16:50.000000000 +0000 @@ -4,7 +4,7 @@ # Copyright (c) 2009-2010 Ulrich Meierfrankenfeld # # Copyright (c) 2011-2012 Gert Hulselmans # # Copyright (c) 2013-2018 Andrei Borzenkov # -# Copyright (c) 2019-2020 Yann MRN # +# Copyright (c) 2019-2022 Yann MRN # # # # Permission is hereby granted, free of charge, to any person obtaining a copy # # of this software and associated documentation files (the "Software"), to # @@ -39,6 +39,7 @@ umount /boot/efi 2>/dev/null ## Check if all necessary programs are available. ## +[[ "$DEBBUG" ]] && echo "[debug] Check_prg" Programs='basename dirname expr fold pwd tr wc'; Programs_SBIN='filefrag losetup'; Check_Prog=1; for Program in ${Programs} ${Programs_SBIN}; do if [ $(type ${Program} > /dev/null 2>&1 ; echo $?) -ne 0 ] ; then @@ -196,7 +197,8 @@ ## Create temporary filenames. ## cd ${Folder} -Log=${Folder}/Log # File to record the summary. +#Log=${Folder}/Log # File to record the summary. +Log="${TMP_LOG}b" Log1=${Folder}/Log1 # Most of the information which is not part of the summary is recorded in this file. Error_Log=${Folder}/Error_Log # File to catch all unusal Standar Errors. Trash=${Folder}/Trash # File to catch all usual Standard Errors these messagges will not be included in the RESULTS. @@ -221,6 +223,7 @@ ## Add found RAID disks to list of hard drives. ## +[[ "$DEBBUG" ]] && echo "[debug] Add raid if any" if [ $(type dmraid >> ${Trash} 2>> ${Trash} ; echo $?) -eq 0 ] ; then InActiveDMRaid=$(dmraid -si -c); [ x"${InActiveDMRaid}" = x"no raid disks" ] || [ x"${InActiveDMRaid}" = x"no block devices found" ] && InActiveDMRaid='' @@ -255,6 +258,7 @@ # List of mount points for devices: also allow mount points with spaces. +[[ "$DEBBUG" ]] && echo "[debug] List mount" MountPoints=$(mount \ | ${AWK} -F "\t" '{ if ( ($1 ~ "^/dev") && ($3 != "/") ) { sub(" on ", "\t", $0); sub(" type ", "\t", $0); print $2 } }' \ | sort -u); @@ -272,10 +276,12 @@ blkid -g; for drive in ${All_Hard_Drives} ; do + [[ "$DEBBUG" ]] && echo "[debug] for $drive" size=$(fdisks ${drive}); PrintBlkid ${drive}; if [ 0 -lt ${size} 2>> ${Trash} ] ; then if [ x"$(blkid ${drive})" = x'' ] || [ x"$(blkid -p -s USAGE ${drive})" = x'' ] ; then #https://github.com/arvidjaar/bootinfoscript/issues/5 + [[ "$DEBBUG" ]] && echo "[debug] eval $drive" # Drive is not a filesytem. size=$((2*size)); HDName[${HI}]=${drive}; @@ -304,10 +310,11 @@ ## Identify the MBR of each hard drive. ## -[[ "$DEBBUG" ]] && echo 'Identifying MBRs...'; +[[ "$DEBBUG" ]] && echo '[debug] Identifying MBRs...'; for HI in ${!HDName[@]} ; do drive="${HDName[${HI}]}"; + [[ "$DEBBUG" ]] && echo "[debug] identify MBR of $drive" Message="is installed in the MBR of ${drive}"; # Read the whole MBR in hexadecimal format. @@ -405,7 +412,7 @@ # Look at byte 0xF0-F1: different offset for "TCPA" string. case "${MBR_512:480:4}" in fb54) BL='Windows Vista';; - 4350) BL='Windows 7/8/2012';; + 4350) BL='Windows 7/8/10/11/2012';; esac;; esac;; 33c090) BL='DiskCryptor';; @@ -515,14 +522,15 @@ ## Store and Display all the partitions tables. ## +[[ "$DEBBUG" ]] && echo "[debug] Store and display partition tables" for HI in ${!HDName[@]} ; do drive=${HDName[${HI}]}; - [[ "$DEBBUG" ]] && echo "Computing Partition Table of ${drive}..."; + [[ "$DEBBUG" ]] && echo "[debug] Computing Partition Table of ${drive}..."; FP=$((PI+1)); # used if non-MS_DOS partition table is not in use. FirstPartition[${HI}]=${FP}; PTType=${HDPT[${HI}]}; HDPT[${HI}]='MSDos'; - echo "Drive: $(basename ${drive} ) _____________________________________________________________________" >> ${PartitionTable}; + #echo "Drive: $(basename ${drive} ) _____________________________________________________________________" >> ${PartitionTable}; fdisk -lu ${drive} 2>> ${Trash} | sed '/omitting/ d' | sed '6,$ d' >> ${PartitionTable}; printf "\n${PTFormat}\n" 'Partition' 'Boot' 'Start Sector' 'End Sector' '# of Sectors' 'Id' 'System' >> ${PartitionTable}; ReadPT ${HI} 0 4 ${PartitionTable} "${PTFormat}" '' 0; @@ -564,6 +572,7 @@ ## Loop through all Hard Drives. ## for HI in ${!HDName[@]} ; do drive=${HDName[${HI}]}; + [[ "$DEBBUG" ]] && echo "[debug] loop through $drive" ## And then loop through the partitions on that drive. ## for (( PI = FirstPartition[${HI}]; PI <= LastPartition[${HI}]; PI++ )); do part_type=${TypeArray[${PI}]}; # Type of the partition according to fdisk @@ -590,11 +599,13 @@ ## Deactivate dmraid's activated by the script. ## +[[ "$DEBBUG" ]] && echo "[debug] deactivate dmraid if activated by the script" [ x"$InActiveDMRaid" != x'' ] && dmraid -an ${InActiveDMRaid} ## Search LVM partitions for information. ## +[[ "$DEBBUG" ]] && echo "[debug] Search lvm" # Only works if the "LVM2"-package is installed. if [ $(type lvs >> ${Trash} 2>> ${Trash} ; echo $?) -eq 0 ] ; then lvs --nameprefixes --noheadings --options lv_name,vg_name,lv_size,lv_attr --units s | \ @@ -624,6 +635,7 @@ ## Search MDRaid Partitons for Information ## +[[ "$DEBBUG" ]] && echo "[debug] Search mdraid" # Only works if "mdadm" is installed. if [ $(type mdadm >> ${Trash} 2>> ${Trash} ; echo $?) -eq 0 ] ; then # All arrays which are already assembled. @@ -659,6 +671,7 @@ ## Search filesystem hard drives for information. ## +[[ "$DEBBUG" ]] && echo "[debug] Search fs hd" for FD in ${FilesystemDrives[@]} ; do FD_Size=$(fdisks ${FD}); # size in blocks FD_Size=$((2*${FD_Size})); # size in sectors @@ -672,124 +685,164 @@ Get_Partition_Info "${Log}" "${Log1}" "${FD}" "${name}" "${mountname}" "${kind}" "${start}" "${end}" "${system}" "${PI}"; done - +[[ "$DEBBUG" ]] && echo "[debug] os detected" paragraph_os_detected >> "${Log}" +[[ "$DEBBUG" ]] && echo "[debug] systinfo" paragraph_syst_info -echo "$ECHO_ARCH_SECTION -" >> "${Log}" +echo "$ECHO_ARCH_SECTION" >> "${Log}" +[[ "$DEBBUG" ]] && echo "[debug] check efidmsg" +check_efi_dmesg_and_secureboot +paragraph_efi title_gen "UEFI" >> "${Log}" echo "$EFIDMESG -$ECHO_SUMEFI_SECTION -" >> "${Log}" +$ECHO_SUMEFI_SECTION" >> "${Log}" title_gen "Drive/Partition Info" >> "${Log}" echo "$ECHO_PARTS_INFO" >> "${Log}" -if [[ "$DEBBUG" ]];then - printf "bis fdisks (filtered): ___________________________________________________________\n\n" >> "${Log}" +if [[ "$DEBBUG" ]] && [[ ! "$FILTERED" ]];then + printf "\nbis fdisks : ___________________________________________________________________\n\n" >> "${Log}" [ -e ${PartitionTable} ] && cat ${PartitionTable} >> "${Log}" || echo 'no valid partition table found' >> "${Log}" fi +[[ "$DEBBUG" ]] && echo "[debug] print fdisk" printf "\nfdisk -l $FILTERED: ___________________________________________________________\n\n" >> "${Log}"; if [[ "$FILTERED" ]];then - while read line; do - [[ "$line" ]] && [[ ! "$line" =~ 'Sector size (' ]] && [[ ! "$line" =~ 'I/O size (' ]] && [[ ! "$line" =~ 'Units:' ]] && [[ ! "$line" =~ 'Disk /dev/loop' ]] \ - && [[ ! "$line" =~ 'Disk model' ]] && [[ ! "$line" =~ Disklabel ]] && echo "$line" | sed 's|/dev/||g' | sed 's|Device| |g' >> "${Log}" - done < <(LANGUAGE=C LC_ALL=C fdisk -l 2>/dev/null ) + while read line; do + [[ "$line" ]] && [[ ! "$line" =~ 'Sector size (' ]] && [[ ! "$line" =~ 'I/O size (' ]] && [[ ! "$line" =~ 'Units:' ]] && [[ ! "$line" =~ 'Disk /dev/loop' ]] \ + && [[ ! "$line" =~ 'Disk model' ]] && [[ ! "$line" =~ Disklabel ]] && echo "$line" | sed 's|/dev/||g' | sed 's|Device| |g' >> "${Log}" + done < <(LANGUAGE=C LC_ALL=C fdisk -l 2>/dev/null ) # 'Disk id' needed for nvram analysis else LANGUAGE=C LC_ALL=C fdisk -l 2>/dev/null >> "${Log}" fi +[[ "$DEBBUG" ]] && echo "[debug] print parted" printf "\nparted -lm $FILTERED: _________________________________________________________\n\n" >> "${Log}" if [[ "$FILTERED" ]];then - while read line; do - [[ "$line" ]] && [[ ! "$line" =~ BYT ]] && echo "$line" | sed 's|/dev/||g' >> "${Log}" - done < <(echo "$PARTEDLM" ) + write=yes + while read line; do + [[ "$line" =~ 'BYT;' ]] && write=yes + [[ "$line" =~ "/dev/sr" ]] || [[ "$line" =~ "/dev/zram" ]] && write="" + [[ "$write" ]] && [[ "$line" ]] && [[ ! "$line" =~ 'BYT;' ]] && echo "$line" | sed 's|/dev/||g' >> "${Log}" + done < <(echo "$PARTEDLM" ) else - echo "$PARTEDLM" >> "${Log}" + echo "$PARTEDLM" >> "${Log}" fi +[[ "$DEBBUG" ]] && echo "[debug] print free space" +t="\nFree space $([ "$FILTERED" ] && echo ">10MiB"): ______________________________________________________________\n\n" +printfreespace="" +for drivez in ${All_Hard_Drives} ; do + if [[ "$FILTERED" ]];then + while read line; do + line="${line%:free*}"; a=${line##*MiB:}; a=${a%.*} + [ "${a#[0-9]}" ] && t="$t${drivez#/dev/*}: ${line#*:}\n" && printfreespace=y + done < <(LANGUAGE=C LC_ALL=C parted $drivez -ms unit MiB print free 2>/dev/null | grep ':free;' ) + else + printfreespace=y + t="$t$(LANGUAGE=C LC_ALL=C parted $drivez -ms unit MiB print free 2>/dev/null )" + fi +done +[ "$printfreespace" ] && printf "$t" >> "${Log}" + + +[[ "$DEBBUG" ]] && echo "[debug] print sgdisk -p" +[[ ! "$FILTERED" ]] && printf "\nsgdisk $FILTERED: ______________________________________________________________\n\n" >> "${Log}" +for drivez in ${All_Hard_Drives} ; do + #if [[ "$FILTERED" ]];then + # while read line; do + # [[ "$line" ]] && [[ ! "$line" =~ 'gdisk) version' ]] && [[ ! "$line" =~ 'table scan:' ]] && [[ ! "$line" =~ ': not present' ]] && [[ ! "$line" =~ 'Model: ' ]] \ + # && [[ ! "$line" =~ '********' ]] && [[ ! "$line" =~ 'physical): ' ]] && [[ "$line" != 'in memory.' ]] && [[ ! "$line" =~ 'MBR: MBR only' ]] \ + # && [[ ! "$line" =~ 'MBR: protective' ]] && [[ ! "$line" =~ 'GPT: present' ]] && echo "$line" >> "${Log}" + # done < <(LANGUAGE=C LC_ALL=C sudo gdisk -l $drivez ) + #else + [[ ! "$FILTERED" ]] && LANGUAGE=C LC_ALL=C sudo sgdisk -p $drivez >> "${Log}" + #fi +done + +[[ "$DEBBUG" ]] && echo "[debug] print blkid" printf "\nblkid $FILTERED: ______________________________________________________________\n\n" >> "${Log}" if [[ "$FILTERED" ]];then - lsblk -o NAME,FSTYPE,UUID,PARTUUID,LABEL,PARTLABEL | grep -v loop | grep -v sr[0-9] >> "${Log}" + lsblk -o NAME,FSTYPE,UUID,PARTUUID,LABEL,PARTLABEL | grep -v loop | grep -v sr[0-9] | grep -v zram >> "${Log}" else - lsblk -o NAME,FSTYPE,UUID,PARTUUID,LABEL,PARTLABEL >> "${Log}" + lsblk -o NAME,FSTYPE,UUID,PARTUUID,LABEL,PARTLABEL >> "${Log}" fi if [[ ! "$(blkid)" =~ /dev/ ]];then #LP1042230 &1216688 - printf '\nstrace blkid: __________________________________________________________________\n\n' >> "${Log}" - strace blkid >> "${Log}" + printf '\nstrace blkid: __________________________________________________________________\n\n' >> "${Log}" + strace blkid >> "${Log}" fi -printf "\ndf $FILTERED: _________________________________________________________________\n\n" >> "${Log}" +[[ "$DEBBUG" ]] && echo "[debug] print df / findmnt" +printf "\nMount points $FILTERED: _______________________________________________________\n\n" >> "${Log}" #while read line; do # [[ "$line" ]] && [[ ! "$line" =~ '/dev/loop' ]] && [[ ! "$line" =~ 'tmpfs' ]] && echo "$line" >> "${Log}" #done < <(LANGUAGE=C LC_ALL=C df -Th ) if [[ "$FILTERED" ]];then - while read line; do - [[ "$line" =~ "USE%" ]] && echo "$line" | sed 's/SOURCE/ /g' | sed 's/AVAIL/Avail/g' | sed 's/USE/Use/g' | sed 's/TARGET/Mounted on/g' >> "${Log}" - done < <(LANGUAGE=C LC_ALL=C findmnt -l -o SOURCE,AVAIL,USE%,TARGET | grep -v v/loop | grep -v v/fuse | grep -v dev/sr[0-9] ) - while read line; do - [[ ! "$(echo "$line" | sed -e '/^[ ]*\/dev/d' )" ]] && [[ ! "$line" =~ dev/loop ]] && echo "${line#*/dev/}" >> "${Log}" - done < <(LANGUAGE=C LC_ALL=C findmnt -l -o SOURCE,AVAIL,USE%,TARGET | grep -v v/loop | grep -v v/fuse | grep -v dev/sr[0-9] | sort) + LANGUAGE=C LC_ALL=C findmnt -l -o SOURCE,AVAIL,USE%,TARGET | grep USE% | sed 's/SOURCE/ /g' | sed 's/AVAIL/Avail/g' | sed 's/USE/Use/g' | sed 's/TARGET/Mounted on/g' >> "${Log}" + while read line; do + #[[ ! "$(echo "$line" | sed -e '/^[ ]*\/dev/d' )" ]] && + [[ ! "$(echo "$line" | grep none | grep 0%)" ]] && [[ ! "$(echo "$line" | grep udev | grep 0%)" ]] && echo "$line" >> "${Log}" + done < <(LANGUAGE=C LC_ALL=C findmnt -l -o SOURCE,AVAIL,USE%,TARGET | grep % | sed -e '/USE%/d' -e '/tmpfs/d' -e '/quashfs/d' | grep -v v/loop | grep -v v/fuse | grep -v v/sr[0-9] | grep -v /cow | sort) else LANGUAGE=C LC_ALL=C findmnt -l -o SOURCE,AVAIL,USE%,TARGET >> "${Log}" fi ## Mount points. ## -printf "\nMount options: __________________________________________________________________\n\n" >> "${Log}" +[[ "$DEBBUG" ]] && echo "[debug] print mount options" +printf "\nMount options $FILTERED: ______________________________________________________\n\n" >> "${Log}" if [[ "$FILTERED" ]];then - while read line;do - [[ ! "$(echo "$line" | sed -e '/^[ ]*\/dev/d' )" ]] && echo "${line#*/dev/}" >> "${Log}" - done < <(LANGUAGE=C LC_ALL=C findmnt -l -o SOURCE,OPTIONS | grep dev/ | grep -v dev/loop | grep -v v/fuse | grep -v dev/sr[0-9] | sort) + LANGUAGE=C LC_ALL=C findmnt -l -o SOURCE,FSTYPE,OPTIONS | grep / | sed -e '/tmpfs/d' -e '/quashfs/d' | grep -v v/loop | grep -v v/fuse | grep -v v/sr[0-9] | grep -v /cow | sort >> "${Log}" else - LANGUAGE=C LC_ALL=C findmnt -l -o SOURCE,OPTIONS >> "${Log}" + LANGUAGE=C LC_ALL=C findmnt -l -o SOURCE,FSTYPE,OPTIONS >> "${Log}" fi +[[ "$DEBBUG" ]] && echo "[debug] by-id" if [[ "$DEBBUG" ]];then if [ $(ls -l /dev/disk/by-id 2>> ${Trash} | wc -l) -gt 1 ] ; then title_gen "ls -l /dev/disk/by-id" >> "${Log}"; - ls -l /dev/disk/by-id >> "${Log}"; - echo >> "${Log}"; + LANG=C ls -l /dev/disk/by-id >> "${Log}"; fi fi +[[ "$DEBBUG" ]] && echo "[debug] ls mapper" if [ $(ls -R /dev/mapper 2>> ${Trash} | wc -l) -gt 2 ] ; then title_gen "ls -R /dev/mapper/" >> "${Log}"; - ls -R /dev/mapper >> "${Log}"; - #echo >> "${Log}"; + LANG=C ls -R /dev/mapper >> "${Log}"; fi ## Write the content of Log1 to the log file. ## [ -e "${Log1}" ] && cat "${Log1}" >> "${Log}"; -echo >> "${Log}"; ## Add unknown MBRs/Boot Sectors to the log file, if any. ## -if [ -e ${Unknown_MBR} ] ; then - title_gen "Unknown MBRs/Boot Sectors/etc" >> "${Log}"; - cat ${Unknown_MBR} >> "${Log}"; - #echo >> "${Log}"; +if [[ ! "$FILTERED" ]] || [[ ! "$GRUBPACKAGE" =~ efi ]];then + [[ "$DEBBUG" ]] && echo "[debug] unknown mbrs" + if [ -e ${Unknown_MBR} ] ; then + title_gen "Unknown MBRs/Boot Sectors/etc" >> "${Log}"; + cat ${Unknown_MBR} >> "${Log}"; + fi fi - ## Add fake hard drives to the log file, if any. ## -if [ -e ${FakeHardDrives} ] ; then - title_gen "Devices which don't seem to have a corresponding hard drive" >> "${Log}"; - cat ${FakeHardDrives} >> "${Log}"; - printf "\n" >> "${Log}"; +if [[ ! "$FILTERED" ]];then + if [ -e ${FakeHardDrives} ] ; then + title_gen "Devices which don't seem to have a corresponding hard drive" >> "${Log}"; + cat ${FakeHardDrives} >> "${Log}"; + printf "\n" >> "${Log}"; + fi fi - ## Write the Error Log to the log file. ## -if [ -s ${Error_Log} ] ; then - title_gen "StdErr Messages" >> "${Log}"; - cat ${Error_Log} >> "${Log}"; +if [[ "$DEBBUG" ]] || [[ ! "$FILTERED" ]];then + if [ -s ${Error_Log} ] ; then + title_gen "StdErr Messages" >> "${Log}"; + cat ${Error_Log} >> "${Log}"; + fi fi -cat "${Log}" rm -f ${Folder} } diff -Nru boot-repair-4ppa123/usr/share/boot-sav/boot-info-actions.sh boot-repair-4ppa200/usr/share/boot-sav/boot-info-actions.sh --- boot-repair-4ppa123/usr/share/boot-sav/boot-info-actions.sh 2020-03-15 13:14:14.000000000 +0000 +++ boot-repair-4ppa200/usr/share/boot-sav/boot-info-actions.sh 2022-01-29 01:26:59.000000000 +0000 @@ -29,6 +29,8 @@ } stats_diff() { +[[ "$GUI" ]] && echo "SET@_label0.set_text('''$LAB (6). $This_may_require_several_minutes''')" +[[ "$BLKID" =~ zfs ]] && $WGETST $URLST.zfs.$CODO [[ "$GUI" ]] && echo "SET@_label0.set_text('''$LAB (5). $This_may_require_several_minutes''')" $WGETST $URLST.biusage.$CODO [[ "$GUI" ]] && echo "SET@_label0.set_text('''$LAB (4). $This_may_require_several_minutes''')" diff -Nru boot-repair-4ppa123/usr/share/boot-sav/boot-info-gui.sh boot-repair-4ppa200/usr/share/boot-sav/boot-info-gui.sh --- boot-repair-4ppa123/usr/share/boot-sav/boot-info-gui.sh 2020-03-15 13:14:14.000000000 +0000 +++ boot-repair-4ppa200/usr/share/boot-sav/boot-info-gui.sh 2022-01-20 19:32:37.000000000 +0000 @@ -33,6 +33,7 @@ } set_easy_repair_diff() { +MAIN_MENU=Boot-Info set_easy_repair_diff_br_and_bi } diff -Nru boot-repair-4ppa123/usr/share/boot-sav/boot-repair-actions.sh boot-repair-4ppa200/usr/share/boot-sav/boot-repair-actions.sh --- boot-repair-4ppa123/usr/share/boot-sav/boot-repair-actions.sh 2020-03-15 13:14:14.000000000 +0000 +++ boot-repair-4ppa200/usr/share/boot-sav/boot-repair-actions.sh 2022-01-29 01:28:48.000000000 +0000 @@ -60,14 +60,14 @@ WUBIHOMEMOUNTED=yes fi xdg-open "${MOUNTPOINTWUBI[$i]}/home" & - text="$The_browser_will_access_wubi (${MOUNTPOINTWUBI[$i]}/home) $Please_backup_data_now $Then_close_this_window" - echo "$text" + teeext="$The_browser_will_access_wubi (${MOUNTPOINTWUBI[$i]}/home) $Please_backup_data_now $Then_close_this_window" + echo "$teeext" end_pulse - [[ "$GUI" ]] && zenity --width=400 --info --title="$APPNAME2" --text="$text" 2>/dev/null + [[ "$GUI" ]] && zenity --width=400 --info --title="$APPNAME2" --text="$teeext" 2>/dev/null start_pulse pkill pcmanfm #To avoid it automounts [[ "$WUBIHOMEMOUNTED" ]] && echo "umount ${MOUNTPOINTWUBI[$i]}/home" && umount "${MOUNTPOINTWUBI[$i]}/home" - echo "umount ${MOUNTPOINTWUBI[$i]}" #if not unmounted: http://paste.ubuntu.com/1066034 + echo "umount ${MOUNTPOINTWUBI[$i]}" umount "${MOUNTPOINTWUBI[$i]}" done #text="$This_will_try_repair_wubi $Please_backup_data $Do_you_want_to_continue" @@ -89,23 +89,22 @@ ########################################### REPAIR PARTITIONS (FSCK) ################################################################## fsck_function() { -#works: http://paste.ubuntu.com/1385756 then http://paste.ubuntu.com/1387291 update_cattee -local i FUNCTION=NTFSFIX PACKAGELIST=ntfsprogs FILETOTEST=ntfsfix +local i #FUNCTION=NTFSFIX PACKAGELIST=ntfsprogs FILETOTEST=ntfsfix force_unmount_blkid_partitions #fsck -fyM # repair partitions detected in the /etc/fstab except those mounted for ((i=1;i<=NBOFPARTITIONS;i++)); do [[ "$GUI" ]] && echo "SET@_label0.set_text('''$Repair_file_systems ${LISTOFPARTITIONS[$i]}. $This_may_require_several_minutes''')" - if [[ "$(echo "$BLKID" | grep ntfs | grep "${LISTOFPARTITIONS[$i]}:" )" ]];then - [[ ! "$(type -p $FILETOTEST)" ]] && installpackagelist - [[ "$(type -p $FILETOTEST)" ]] && echo " -ntfsfix /dev/${LISTOFPARTITIONS[$i]}" \ - && LANGUAGE=C LC_ALL=C ntfsfix /dev/${LISTOFPARTITIONS[$i]} #Repair NTFS partitions - else +# if [[ "$(echo "$BLKID" | grep ntfs | grep "${LISTOFPARTITIONS[$i]}:" )" ]];then +# [[ ! "$(type -p $FILETOTEST)" ]] && installpackagelist +# [[ "$(type -p $FILETOTEST)" ]] && echo " +#ntfsfix /dev/${LISTOFPARTITIONS[$i]}" \ +# && LANGUAGE=C LC_ALL=C ntfsfix /dev/${LISTOFPARTITIONS[$i]} #Repair NTFS partitions +# else echo " fsck -fyM /dev/${LISTOFPARTITIONS[$i]}" LANGUAGE=C LC_ALL=C fsck -fyM /dev/${LISTOFPARTITIONS[$i]} #Repair other partitions (except if mounted = security) - fi +# fi done [[ "$(cat "$CATTEE" | grep 'FILE SYSTEM WAS MODIFIED' )" ]] && FSFIXED=yes mount_all_blkid_partitions_except_df @@ -115,19 +114,19 @@ force_unmount_blkid_partitions() { local i if [[ ! "$FORCEYES" ]];then - if [[ "$GUI" ]];then - end_pulse - zenity --width=400 --info --title="$APPNAME2" --text="$Filesystem_repair_need_unmount_parts $Please_close_all_programs $Then_close_this_window" 2>/dev/null - start_pulse - else - read -r -p "$Filesystem_repair_need_unmount_parts $Please_close_all_programs [Enter] " - fi + if [[ "$GUI" ]];then + end_pulse + zenity --width=400 --info --title="$APPNAME2" --text="$Filesystem_repair_need_unmount_parts $Please_close_all_programs $Then_close_this_window" 2>/dev/null + start_pulse + else + read -r -p "$Filesystem_repair_need_unmount_parts $Please_close_all_programs [Enter] " + fi fi echo "Force Unmount all blkid partitions (for fsck) except / /boot /cdrom /dev /etc /home /opt /pas /proc /rofs /sys /tmp /usr /var " pkill pcmanfm #To avoid it automounts for ((i=1;i<=NBOFPARTITIONS;i++)); do [[ "${BLKIDMNT_POINT[$i]}" ]] \ - && [[ "$(echo "${BLKIDMNT_POINT[$i]}" | grep -v /boot | grep -v /cdrom | grep -v /dev | grep -v /etc| grep -v /home | grep -v /opt | grep -v /pas | grep -v /proc | grep -v /rofs | grep -v /sys | grep -v /tmp | grep -v /usr | grep -v /var )" ]] \ + && [[ "$(echo "${BLKIDMNT_POINT[$i]}" | grep -v /zfs | grep -v /boot | grep -v /cdrom | grep -v /dev | grep -v /etc| grep -v /home | grep -v /opt | grep -v /pas | grep -v /proc | grep -v /rofs | grep -v /sys | grep -v /tmp | grep -v /usr | grep -v /var )" ]] \ && umount "${BLKIDMNT_POINT[$i]}" done } @@ -147,7 +146,7 @@ echo "" elif [[ "$USEDPERCENT" -ge 97 ]];then temp="$(echo "$BLKID" | grep "${OS__PARTITION[$i]}:")"; temp=${temp#*TYPE=\"}; temp=${temp%%\"*} - if [[ ! "${READONLY[$i]}" ]] || [[ "$temp" != ntfs ]];then #http://paste.ubuntu.com/989382 + if [[ ! "${READONLY[$i]}" ]] || [[ "$temp" != ntfs ]];then echo "${OS__PARTITION[$i]} is $USEDPERCENT % full" if [[ ! "$FORCEYES" ]];then if [[ "$GUI" ]];then @@ -184,7 +183,6 @@ } determine_usedpercent() { -#care: http://paste.ubuntu.com/1053287 USEDPERCENT="$(df /dev/${OS__PARTITION[$i]} | grep / | grep % )" USEDPERCENT=${USEDPERCENT%%\%*}; USEDPERCENT=${USEDPERCENT##* } } @@ -192,16 +190,19 @@ ######################### STATS FOR IMPROVING BOOT-REPAIR################## stats_diff() { +#[[ "$GUI" ]] && echo "SET@_label0.set_text('''$LAB (20). $This_may_require_several_minutes''')" +#[[ ! "$PASTEBIN_ACTION" ]] && $WGETST $URLST.noreport.$CODO [[ "$GUI" ]] && echo "SET@_label0.set_text('''$LAB (20). $This_may_require_several_minutes''')" [[ "$DISABLEWEBCHECK" ]] && $WGETST $URLST.nointernetchk.$CODO [[ "$GUI" ]] && echo "SET@_label0.set_text('''$LAB (19). $This_may_require_several_minutes''')" -[[ ! "$PASTEBIN_ACTION" ]] && $WGETST $URLST.noreport.$CODO -[[ "$GUI" ]] && echo "SET@_label0.set_text('''$LAB (18). $This_may_require_several_minutes''')" -[[ "$PASTEBIN_ACTION" ]] && [[ ! "$UPLOAD" ]] && $WGETST $URLST.local.$CODO +[[ ! "$UPLOAD" ]] && $WGETST $URLST.local.$CODO #[[ "$PASTEBIN_ACTION" ]] && if [[ "$MAIN_MENU" = Boot-Info ]];then - [[ "$GUI" ]] && echo "SET@_label0.set_text('''$LAB (17). $This_may_require_several_minutes''')" + [[ "$GUI" ]] && echo "SET@_label0.set_text('''$LAB (18). $This_may_require_several_minutes''')" $WGETST $URLST.bootinfo.$CODO else + [[ "$GUI" ]] && echo "SET@_label0.set_text('''$LAB (18). $This_may_require_several_minutes''')" + [[ "$BLKID" =~ zfs ]] && $WGETST $URLST.zfs.$CODO + [[ "$GUI" ]] && echo "SET@_label0.set_text('''$LAB (17). $This_may_require_several_minutes''')" [[ "$GRUBPACKAGE" =~ sign ]] && $WGETST $URLST.secureboot.$CODO [[ "$GUI" ]] && echo "SET@_label0.set_text('''$LAB (16). $This_may_require_several_minutes''')" [[ "$MAIN_MENU" = Recommended-Repair ]] && $WGETST $URLST.recommendedrepair.$CODO @@ -221,7 +222,7 @@ [[ "$GUI" ]] && echo "SET@_label0.set_text('''$LAB (9). $This_may_require_several_minutes''')" [[ "$KERNEL_PURGE" ]] && $WGETST $URLST.kernelpurge.$CODO [[ "$GUI" ]] && echo "SET@_label0.set_text('''$LAB (8). $This_may_require_several_minutes''')" - [[ "$GRUBPACKAGE" =~ grub-efi ]] && $WGETST $URLST.efi.$CODO + [[ "$GRUBPACKAGE" =~ efi ]] && $WGETST $URLST.efi.$CODO [[ "$GUI" ]] && echo "SET@_label0.set_text('''$LAB (7). $This_may_require_several_minutes''')" if [[ "$(lsb_release -is)" =~ Debian ]] && [[ -f /etc/skel/.config/autostart/boot-repair.desktop ]] \ || [[ "$(lsb_release -ds)" =~ Boot-Repair-Disk ]];then diff -Nru boot-repair-4ppa123/usr/share/boot-sav/boot-repair-gui.sh boot-repair-4ppa200/usr/share/boot-sav/boot-repair-gui.sh --- boot-repair-4ppa123/usr/share/boot-sav/boot-repair-gui.sh 2020-03-15 13:14:14.000000000 +0000 +++ boot-repair-4ppa200/usr/share/boot-sav/boot-repair-gui.sh 2022-01-20 20:43:39.000000000 +0000 @@ -20,7 +20,7 @@ echo "SET@_label_bootrepairsubtitle.set_markup('''$Repair_the_boot_of_the_computer''')" echo "SET@_label_recommendedrepair.set_text('''${Recommended_repair}\\n($repairs_most_frequent_problems)''')" echo "SET@_label_justbootinfo.set_text('''${Create_a_BootInfo_report}\\n($to_get_help_by_email_or_forum)''')" - echo "SET@_label_pastebin.set_text('''$Create_a_BootInfo_report ($to_get_help_by_email_or_forum)''')" +# echo "SET@_label_pastebin.set_text('''$Create_a_BootInfo_report ($to_get_help_by_email_or_forum)''')" echo 'SET@_vbox_pastebin.show()' echo "SET@_label_appname.set_markup('''Boot-Repair''')" #${APPNAME_VERSION%~*} echo "SET@_label_appdescription.set_text('''$Repair_the_boot_of_the_computer''')" @@ -28,7 +28,7 @@ echo 'SET@_logo_brmenu.show()' echo "SET@_linkbutton_websitebr.show()" echo "SET@_label_repairfilesystems.set_text('''$Repair_file_systems''')" - [[ "$(lsb_release -is)" != Debian ]] && echo 'SET@_checkbutton_repairfilesystems.show()' #http://paste2.org/p/2551257 + [[ "$(lsb_release -is)" != Debian ]] && echo 'SET@_checkbutton_repairfilesystems.show()' echo "SET@_label_wubi.set_text('''$Repair_Wubi''')" echo 'SET@_checkbutton_wubi.show()' fi @@ -37,6 +37,7 @@ } set_easy_repair_diff() { +MAIN_MENU=Recommended-Repair set_easy_repair_diff_br_and_bi } @@ -52,7 +53,7 @@ _checkbutton_repairfilesystems() { if [[ "${@}" = True ]]; then - FSCK_ACTION=repair-filesystems + FSCK_ACTION=" repair-filesystems" if [[ ! "$ROOTDISKMISSING" ]];then echo "$Please_backup_data" [[ "$GUI" ]] && zenity --width=400 --info --title="$APPNAME2" --text="$Please_backup_data" 2>/dev/null @@ -64,7 +65,7 @@ } _checkbutton_wubi() { -[[ "${@}" = True ]] && WUBI_ACTION=repair-wubi || WUBI_ACTION="" +[[ "${@}" = True ]] && WUBI_ACTION=" repair-wubi" || WUBI_ACTION="" [[ "$DEBBUG" ]] && echo "[debug]WUBI_ACTION becomes: $WUBI_ACTION" } diff -Nru boot-repair-4ppa123/usr/share/boot-sav/boot-sav.glade boot-repair-4ppa200/usr/share/boot-sav/boot-sav.glade --- boot-repair-4ppa123/usr/share/boot-sav/boot-sav.glade 2014-11-24 01:46:56.000000000 +0000 +++ boot-repair-4ppa200/usr/share/boot-sav/boot-sav.glade 2022-01-20 20:38:18.000000000 +0000 @@ -104,7 +104,7 @@ True none True - https://sourceforge.net/p/boot-repair + https://sourceforge.net/p/boot-repair/home True @@ -115,13 +115,13 @@ - https://launchpad.net/boot-info + https://sourceforge.net/p/boot-info False True True none True - https://launchpad.net/boot-info + https://sourceforge.net/p/boot-info/wiki True @@ -131,13 +131,13 @@ - https://launchpad.net/os-uninstaller + https://sourceforge.net/p/os-uninstaller False True True none True - https://launchpad.net/os-uninstaller + https://sourceforge.net/p/os-uninstaller/wiki True @@ -2598,7 +2598,7 @@ False - True + False True False 0 @@ -2796,6 +2796,7 @@ gtk-apply False + False True True 5 diff -Nru boot-repair-4ppa123/usr/share/boot-sav/bs-cmd.sh boot-repair-4ppa200/usr/share/boot-sav/bs-cmd.sh --- boot-repair-4ppa123/usr/share/boot-sav/bs-cmd.sh 2020-03-15 13:14:14.000000000 +0000 +++ boot-repair-4ppa200/usr/share/boot-sav/bs-cmd.sh 2022-01-25 16:01:23.000000000 +0000 @@ -32,6 +32,7 @@ --python2 ) PY=python2;; -b ) BLOCK_GUI=yes;; --bootinfo ) BLOCK_GUI=yes;; + -u ) BLOCK_GUI=yes;; --bootinfo-url ) BLOCK_GUI=yes;; * ) if [[ ! "$arg" =~ "-t=" ]];then @@ -55,6 +56,7 @@ --python2 ) PY=python2;; -b ) BLOCK_GUI=yes;[[ $EUID -ne 0 ]] && echo "Root privileges are required to run $APPNAME -i" || bootinfo-cli;; --bootinfo ) BLOCK_GUI=yes;[[ $EUID -ne 0 ]] && echo "Root privileges are required to run $APPNAME -i" || bootinfo-cli;; + -u ) BLOCK_GUI=yes;[[ $EUID -ne 0 ]] && echo "Root privileges are required to run $APPNAME -i" || bootinfo-cli pastebin;; --bootinfo-url ) BLOCK_GUI=yes;[[ $EUID -ne 0 ]] && echo "Root privileges are required to run $APPNAME -i" || bootinfo-cli pastebin;; * ) if [[ "$arg" =~ "-t=" ]];then #https://bugs.launchpad.net/boot-info/+bug/1719537 diff -Nru boot-repair-4ppa123/usr/share/boot-sav/bs-cmd_terminal.sh boot-repair-4ppa200/usr/share/boot-sav/bs-cmd_terminal.sh --- boot-repair-4ppa123/usr/share/boot-sav/bs-cmd_terminal.sh 2020-03-15 13:14:14.000000000 +0000 +++ boot-repair-4ppa200/usr/share/boot-sav/bs-cmd_terminal.sh 2022-03-06 21:55:00.000000000 +0000 @@ -1,5 +1,5 @@ #! /bin/bash -# Copyright 2020 Yann MRN +# Copyright 2022 Yann MRN # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published @@ -18,7 +18,7 @@ ################## ECHO VERSION ################################## check_appname_version() { check_package_manager -APPNAME_VERSION=$($PACKVERSION $APPNAME ) +APPNAME_VERSION=$($PACKVERSION boot-sav ) G2S="glade2script$G2SPY_VERSION"; G2S_VERSION=$($PACKVERSION $G2S ) # dpkg-query -W -f='${Version}' paquet [[ "$1" ]] && echo "$APPNAME version : $APPNAME_VERSION " [[ "$DEBBUG" ]] && echo "G2S version : $G2S_VERSION" @@ -66,63 +66,53 @@ esp_check() { #ESP with Windows bootmgr: http://ubuntuforums.org/showthread.php?t=2090605 part="${LISTOFPARTITIONS[$i]}" #eg mapper/isw_beaibbhjji_Volume0p1 -d="${DISKNB_PART[$i]}" f="" while read line;do if [[ "$line" =~ /dev/ ]];then - [[ "$line" =~ "/dev/${DISK_PART[$i]}:" ]] && f=ok || f="" + [[ "$line" =~ "/dev/${DISK_PART[$i]}:" ]] && [[ "$part" =~ "${DISK_PART[$i]}" ]] && f=ok || f="" # part =~ ${DISK_PART in order to avoid issues when e.g. part=md127p1 but md127 is not in blkid so DISK_PART=fallback (eg. vda) fi #eg 11:162GB:162GB:210MB:fat32::boot, hidden; EFIPARTNUMERO="${line%%:*}" #eg 1 #echo "[debug] WWW $line <$EFIPARTNUMERO>${part##*[a-z]}>" # if [[ "$EFIPARTNUMERO" = "${part##*[a-z]}" ]] && [[ "$f" ]];then - if [[ "$(echo "$line" | grep fat | grep boot | grep -v hidden | grep -v ext4)" ]] \ - || [[ "$(echo "$line" | grep fat | grep esp | grep -v hidden | grep -v ext4)" ]] \ - || [[ "$(echo "$line" | grep fat | grep ':EFI system partition:' | grep -v hidden | grep -v ext4)" ]];then #exclude ext4 because hidden win esp: 3:548MB:1079MB:531MB:ext4:DUPFAT32:boot, hidden, esp; + if [[ "$(echo "$line" | grep ':fat' | grep boot | grep -v hidden | grep -v ':ext4')" ]] \ + || [[ "$(echo "$line" | grep ':fat' | grep esp | grep -v hidden | grep -v ':ext4')" ]] \ + || [[ "$(echo "$line" | grep ':fat' | grep ':EFI system partition:' | grep -v hidden | grep -v ':ext4')" ]];then #exclude ext4 because hidden win esp: 3:548MB:1079MB:531MB:ext4:DUPFAT32:boot, hidden, esp; this_part_is_esp - elif [[ "$(echo "$line" | grep fat | grep boot | grep -v ext4)" ]] \ - || [[ "$(echo "$line" | grep fat | grep esp | grep -v ext4)" ]] \ - || [[ "$(echo "$line" | grep fat | grep ':EFI system partition:' | grep -v ext4)" ]];then - this_part_maybe_esp #hidden esp + elif [[ "$(echo "$line" | grep ':fat' | grep boot | grep -v ':ext4')" ]] \ + || [[ "$(echo "$line" | grep ':fat' | grep esp | grep -v ':ext4')" ]] \ + || [[ "$(echo "$line" | grep ':fat' | grep ':EFI system partition:' | grep -v ':ext4:')" ]];then + it_is_hidden_esp fi fi done < <(echo "$PARTEDLM") -#if partedlm is broken, then checks EFI in fdisk -while read line;do - if [[ "$line" =~ "/dev/$part " ]];then - #EFI working without GPT: http://forum.ubuntu-fr.org/viewtopic.php?pid=9962371#p9962371 - if [[ "$(echo "$line" | grep "dev/$part " | grep '*' | grep -i fat | grep -v ext4 | grep -vi ntfs | grep -v hidden)" ]] \ - || [[ "$(echo "$line" | grep "dev/$part " | grep 'EFI' | grep -v ext4 | grep -v hidden)" ]];then #don't add grep fat here. https://launchpadlibrarian.net/299779679/Boot-Repair%20bug.txt - #hidden partitions are shown as normal in fdisk, and some hidden win esp are shown as normal EFI - this_part_is_in_partedlm="" - f="" - while read line;do - if [[ "$line" =~ /dev/ ]];then - [[ "$line" =~ "/dev/${DISK_PART[$i]}:" ]] && f=ok || f="" - fi - EFIPARTNUMERO="${line%%:*}" #eg 1 - if [[ "$EFIPARTNUMERO" = "${part##*[a-z]}" ]] && [[ "$f" ]];then - this_part_is_in_partedlm=yes - fi - done < <(echo "$PARTEDLM") - [[ ! "$this_part_is_in_partedlm" ]] && this_part_is_esp #if partedlm is broken, then assumes it's ESP +#if partedlm could not be used (is broken, or if part has fallback disk), then checks EFI in fdisk +if [[ "${EFI_TYPE[$i]}" = isnotESP ]];then + while read line;do + if [[ "$line" =~ "/dev/$part " ]];then + #EFI working without GPT: http://forum.ubuntu-fr.org/viewtopic.php?pid=9962371#p9962371 + if [[ "$(echo "$line" | grep "dev/$part " | grep '*' | grep -i fat | grep -v ext | grep -vi ntfs | grep -v hidden)" ]] \ + || [[ "$(echo "$line" | grep "dev/$part " | grep EFI | grep -v ext | grep -v hidden)" ]];then #don't add grep fat here. https://launchpadlibrarian.net/299779679/Boot-Repair%20bug.txt + #hidden partitions are shown as normal in fdisk, and some hidden win esp are shown as normal EFI + this_part_is_esp #if partedlm is broken, then assumes it's ESP and hope it's not hidden + fi fi - fi -done < <(echo "$FDISKL") + done < <(echo "$FDISKL") +fi } this_part_is_esp() { if [[ "${EFI_TYPE[$i]}" != is---ESP ]];then - [[ "${GPT_DISK[$d]}" = is-GPT ]] && (( NB_EFIPARTONGPT += 1 )) - EFI_DISK[$d]=has---ESP + [[ "${GPT_DISK[${DISKNB_PART[$i]}]}" = is-GPT ]] && (( NB_EFIPARTONGPT += 1 )) + EFI_DISK[${DISKNB_PART[$i]}]=has---ESP EFI_TYPE[$i]=is---ESP (( NB_BISEFIPART += 1 )) fi } -this_part_maybe_esp() { +it_is_hidden_esp() { if [[ "${EFI_TYPE[$i]}" != is---ESP ]];then - [[ "${EFI_DISK[$d]}" != has---ESP ]] && EFI_DISK[$d]=mayhavESP - EFI_TYPE[$i]=maybeESP + [[ "${EFI_DISK[${DISKNB_PART[$i]}]}" != has---ESP ]] && EFI_DISK[${DISKNB_PART[$i]}]=hashidESP + EFI_TYPE[$i]=hidenESP fi } @@ -134,8 +124,8 @@ esp_check if [[ "${EFI_TYPE[$i]}" = is---ESP ]];then echo "${LISTOFPARTITIONS[$i]} is ESP" - elif [[ "${EFI_TYPE[$i]}" = maybeESP ]];then - echo "${LISTOFPARTITIONS[$i]} may be ESP" + elif [[ "${EFI_TYPE[$i]}" = hidenESP ]];then + echo "${LISTOFPARTITIONS[$i]} is hidden ESP" else echo "${LISTOFPARTITIONS[$i]} is not ESP" fi @@ -144,105 +134,137 @@ ########################## CHECK IF LIVE-SESSION ####################### check_if_live_session() { -local DR -DR="$(df / | grep /dev/ )"; DR="${DR%% *}"; DR="${DR#*v/}" +CURRENTSESSIONPARTITION="$(findmnt -n -o SOURCE /)" #eg rpool/ROOT/ubuntu_64fs0l or /dev/sda3 +[[ ! "$CURRENTSESSIONPARTITION" ]] && echo "Error: empty findmnt -n -o SOURCE / , $PLEASECONTACT" hash lsb_release && DISTRIB_DESCRIPTION="$(lsb_release -ds)" || DISTRIB_DESCRIPTION=Unknown-name -if [ "$(grep -E '(boot=casper)|(boot=live)' /proc/cmdline)" ] || [[ "$DR" =~ loop ]] || [[ "$(df -Th / | grep -E 'aufs|overlay')" ]];then #aufs bug#1281815, overlay since 19.10 - LIVESESSION=live #if (mount | grep -E 'aufs|overlay' | grep -q 'on / type'); then live +if [ "$(grep -E '(boot=casper)|(boot=live)' /proc/cmdline)" ] || [[ "$(findmnt -n -o FSTYPE / | grep -E 'squashfs|aufs|overlay')" ]];then #aufs bug#1281815, overlay since 19.10 + LIVESESSION=live else LIVESESSION=installed CURRENTSESSIONNAME="$The_system_now_in_use - $DISTRIB_DESCRIPTION" - CURRENTSESSIONPARTITION="$DR" fi } -################################### CHECK EFI DMSG ##################### -check_efi_dmesg() { +############################# CHECK EFI DMSG AND SECUREBOOT ##################### +check_efi_dmesg_and_secureboot() { #http://forum.ubuntu-fr.org/viewtopic.php?id=742721 -local ue="$(dmesg | grep EFI | grep -v Variables )" -SECUREBOOT='maybe enabled' -if [[ -d /sys/firmware/efi ]];then #http://paste.ubuntu.com/1176988 - EFIDMESG="BIOS is EFI-compatible, and is setup in EFI-mode for this $LIVESESSION-session." - [[ ! "$ue" ]] && EFIDMESG="$EFIDMESG -No EFI in dmseg." +local ue="$(dmesg | grep EFI | grep -v Variables )" SPECIALSB="" +SECUREBOOT=disabled +EFIDMESG="" +( [[ -f /sys/class/dmi/id/bios_vendor ]] || [[ -f /sys/class/dmi/id/bios_version ]] ) \ +&& EFIDMESG="BIOS/UEFI firmware: $(head -n 1 /sys/class/dmi/id/bios_version 2>/dev/null)$([[ -f /sys/class/dmi/id/bios_release ]] && echo "($(head -n 1 /sys/class/dmi/id/bios_release))") from $(head -n 1 /sys/class/dmi/id/bios_vendor 2>/dev/null) +" +if [[ -d /sys/firmware/efi ]];then + modprobe efivars #cf geole / ubuntu-fr + EFIDMESG="${EFIDMESG}The firmware is EFI-compatible, and is set in EFI-mode for this $LIVESESSION-session. +" + [[ ! "$ue" ]] && EFIDMESG="${EFIDMESG}No EFI in dmseg. +" #SecureBoot http://launchpadlibrarian.net/119223180/ubiquity_2.12.8_2.12.9.diff.gz + #https://fr.opensuse.org/openSUSE:UEFI#Comment_savoir_si_le_Secure_Boot_est_activ.C3.A9 local efi_vars sb_var efi_vars=/sys/firmware/efi/vars sb_var="$efi_vars/SecureBoot-8be4df61-93ca-11d2-aa0d-00e098032b8c/data" sb_var2="$efi_vars/SecureBoot-a8be4df61-93ca-11d2-aa0d-00e098032b8c/data" - if [[ ! -d $efi_vars ]];then - SECUREBOOT=disabled - elif [[ -e "$sb_var" ]];then - [[ "$(printf %x \'"$(cat "$sb_var")")" = 1 ]] && SECUREBOOT=enabled || SECUREBOOT=disabled - elif [[ -e "$sb_var2" ]];then #http://paste.ubuntu.com/1643471 - [[ "$(printf %x \'"$(cat "$sb_var2")")" = 1 ]] && SECUREBOOT=enabled || SECUREBOOT=disabled + if [[ -e "$sb_var" ]];then + #[[ "$(printf %x \'"$(cat "$sb_var")")" = 1 ]] && SECUREBOOT=enabled || SECUREBOOT=disabled + #https://stackoverflow.com/questions/46163678/get-rid-of-warning-command-substitution-ignored-null-byte-in-input + [[ "$(printf %x \'"$(tr -d '\0' < "$sb_var")")" = 1 ]] && SECUREBOOT=enabled + elif [[ -e "$sb_var2" ]];then + [[ "$(printf %x \'"$(tr -d '\0' < "$sb_var2")")" = 1 ]] && SECUREBOOT=enabled else - [[ -f "$sb_var" ]] || [[ -f "$sb_var2" ]] && echo "Warning: sbvar. $PLEASECONTACT" for tst in $(ls $efi_vars );do - if [[ "$tst" =~ "Secure" ]];then - if [ -e "$efi_vars/$tst/data" ];then - [ "$(printf %x \'"$(cat "$efi_vars/$tst/data")")" = 1 ] && SECUREBOOT=enabled || SECUREBOOT=disabled - EFIDMESG="$EFIDMESG -Found $efi_vars/$tst/data. $PLEASECONTACT" - elif [[ -f "$efi_vars/$tst/data" ]];then - SECUREBOOT=disabled - EFIDMESG="$EFIDMESG -Warning: $tst/data . $PLEASECONTACT" - fi - fi - done -# a=""; for b in $(ls $efi_vars);do a="$b, $a";done -# EFIDMESG="$EFIDMESG -#ls $efi_vars -#$a" + if [[ "$tst" =~ "SecureBoot" ]];then + if [ -e "$efi_vars/$tst/data" ];then + [ "$(printf %x \'"$(tr -d '\0' < "$efi_vars/$tst/data")")" = 1 ] && SECUREBOOT=enabled && SPECIALSB=yes + EFIDMESG="${EFIDMESG}Found $efi_vars/$tst/data. $PLEASECONTACT +" + fi + fi + done fi - if [[ "$SECUREBOOT" = 'maybe enabled' ]] && [[ "$(grep signed /proc/cmdline)" ]];then - SECUREBOOT=enabled + if [[ "$SECUREBOOT" = disabled ]] && [[ "$(grep signed /proc/cmdline)" ]];then + SPECIALSB=yes a=""; for b in $(ls $efi_vars);do a="$b,$a";done - EFIDMESG="$EFIDMESG -Special SecureBoot - $PLEASECONTACT -ls $efi_vars : $a" + EFIDMESG="${EFIDMESG}Special SecureBoot - $PLEASECONTACT +grep signed /proc/cmdline: $(grep signed /proc/cmdline) +ls $efi_vars : $a +" + fi + local FUNCTION=SB-detect PACKAGELIST=mokutil FILETOTEST=mokutil + [[ "$SPECIALSB" ]] && [[ ! "$(type -p $FILETOTEST)" ]] && installpackagelist + if [[ "$(type -p mokutil)" ]];then + if [[ "$SECUREBOOT" = disabled ]];then + if [[ "$(mokutil --sb-state 2>&1)" =~ 'Secure Boot is enabled' ]];then + SECUREBOOT="enabled according to mokutil - $PLEASECONTACT" + elif [[ "$(mokutil --sb-state 2>&1)" =~ 'Failed to read' ]] || [[ "$(mokutil --sb-state 2>&1)" =~ 'system doesn' ]];then + SECUREBOOT="disabled - $(mokutil --sb-state 2>&1)" + else + SECUREBOOT="disabled - $(mokutil --sb-state 2>&1) - $PLEASECONTACT" + fi + elif [[ "$SECUREBOOT" = enabled ]] && [[ ! "$(mokutil --sb-state 2>&1)" =~ 'Secure Boot is enabled' ]];then + SECUREBOOT="enabled but mokutil says: $(mokutil --sb-state 2>&1) - $PLEASECONTACT" + fi fi - [[ "$SECUREBOOT" != 'maybe enabled' ]] && EFIDMESG="$EFIDMESG -SecureBoot $SECUREBOOT." + EFIDMESG="${EFIDMESG}SecureBoot $SECUREBOOT. +" + local FUNCTION=UEFI PACKAGELIST=efibootmgr FILETOTEST=efibootmgr + [[ ! "$(type -p $FILETOTEST)" ]] && installpackagelist if [[ "$(type -p efibootmgr)" ]];then - EFIDMESG="$EFIDMESG - -efibootmgr -v -$(LANGUAGE=C LC_ALL=C efibootmgr -v)" # | sed 's|\\|\\\\|g' + EFIDMESG="${EFIDMESG}$(LANGUAGE=C LC_ALL=C efibootmgr -v)" # | sed 's|\\|\\\\|g' else - EFIDMESG="$EFIDMESG -Please install package efibootmgr and retry." + EFIDMESG="${EFIDMESG}Please install package efibootmgr and retry." fi else #[[ "$LIVESESSION" = installed ]] && SECUREBOOT=disabled if [[ "$WINEFIFILEPRESENCE" ]];then - EFIDMESG="BIOS is EFI-compatible, but it is not setup in EFI-mode for this $LIVESESSION-session." - #ex of efi win with no efi dmsg: http://paste.ubuntu.com/1079434 , http://paste.ubuntu.com/1088771 + EFIDMESG="${EFIDMESG}The firmware is EFI-compatible, but this $LIVESESSION-session is in Legacy/BIOS/CSM mode (not in EFI mode). +" + elif [[ "$ue" ]];then + EFIDMESG="${EFIDMESG}The firmware seems EFI-compatible, but this $LIVESESSION-session is in Legacy/BIOS/CSM mode (not in EFI mode). +" elif [[ "$(lsb_release -is)" = Debian ]];then - EFIDMESG="This $LIVESESSION-session is not in EFI-mode. See https://wiki.debian.org/UEFI" - else # http://paste.ubuntu.com/1001831 , http://paste.ubuntu.com/966239 , http://paste.ubuntu.com/934497 - EFIDMESG="This $LIVESESSION-session is not in EFI-mode." + EFIDMESG="${EFIDMESG}This $LIVESESSION-session is in Legacy/BIOS/CSM mode (not in EFI mode). See https://wiki.debian.org/UEFI +" + else + EFIDMESG="${EFIDMESG}This $LIVESESSION-session is in Legacy/BIOS/CSM mode (not in EFI mode). +" fi - [[ "$ue" ]] && EFIDMESG="$EFIDMESG -EFI in dmesg. -$ue" #ex: http://paste.ubuntu.com/1354258 fi } paragraph_syst_info(){ ECHO_ARCH_SECTION="" -[[ ! "$1" ]] && ECHO_ARCH_SECTION="$(title_gen "Architecture/Host Info" ) +[[ ! "$1" ]] && ECHO_ARCH_SECTION="$(title_gen "Host/Hardware" ) " ECHO_ARCH_SECTION="$ECHO_ARCH_SECTION CPU architecture: $ARCHIPC-bit" +[[ "$(type -p lshw)" ]] && ECHO_ARCH_SECTION="$ECHO_ARCH_SECTION +Video: $(echo $(LANG=C sudo lshw -C display | grep product | sed 's/product://g')) from $(echo $(LANG=C sudo lshw -C display | grep vendor | sed 's/vendor://g'))" [[ "$(uname -m)" =~ 64 ]] && LIVE_ARCH=64 || LIVE_ARCH=32 -[[ "$LIVESESSION" != installed ]] && ECHO_ARCH_SECTION="$ECHO_ARCH_SECTION +if [[ "$LIVESESSION" = live ]];then + ECHO_ARCH_SECTION="$ECHO_ARCH_SECTION Live-session OS is $(lsb_release -is) $LIVE_ARCH-bit ($DISTRIB_DESCRIPTION, $(lsb_release -cs), $(uname -m))" -[[ "$LIVESESSION" = installed ]] && ECHO_ARCH_SECTION="$ECHO_ARCH_SECTION + if [[ "$DEBBUG" ]];then + if [ "$(grep 'boot=casper' /proc/cmdline)" ];then ECHO_ARCH_SECTION="$ECHO_ARCH_SECTION +This session has been detected as 'live' because /proc/cmdline contains boot=casper.";fi + if [ "$(grep 'boot=live' /proc/cmdline)" ];then ECHO_ARCH_SECTION="$ECHO_ARCH_SECTION +This session has been detected as 'live' because /proc/cmdline contains boot=live.";fi + [[ "$DR" =~ loop ]] && ECHO_ARCH_SECTION="$ECHO_ARCH_SECTION +This session has been detected as 'live' because df / contains loop." + [[ "$(df -Th / | grep aufs)" ]] && ECHO_ARCH_SECTION="$ECHO_ARCH_SECTION +This session has been detected as 'live' because df -T / contains aufs." + [[ "$(df -Th / | grep overlay)" ]] && ECHO_ARCH_SECTION="$ECHO_ARCH_SECTION +This session has been detected as 'live' because df -T / contains overlay." + fi +else + ECHO_ARCH_SECTION="$ECHO_ARCH_SECTION BOOT_IMAGE of the installed session in use: -$(cat /proc/cmdline | sed 's/BOOT_IMAGE=//g' )" +$(cat /proc/cmdline | sed 's/BOOT_IMAGE=//g' ) +df -Th / : $(df -Th / | grep / )" #rpool/ROOT/ubuntu_64fs0l + #deletes only the 'BOOT_IMAGE' string, nothing before nothing after. +fi } ################################### TAIL COMMON LOGS ##################### @@ -279,24 +301,23 @@ OSPROBER="$(os-prober)" if [[ "$LIVESESSION" = installed ]];then #Add CurrentSession at the beginning of OSPROBER (so that GRUB reinstall of CurrentSession is selected by default) - OSPROBER="/dev/${CURRENTSESSIONPARTITION}:$CURRENTSESSIONNAME CurrentSession:linux + OSPROBER="${CURRENTSESSIONPARTITION}:$CURRENTSESSIONNAME CurrentSession:linux $OSPROBER" fi if [[ "$OSPROBER" ]];then while read ligne; do - if [[ "$ligne" =~ '/dev/' ]] && [[ "$ligne" =~ ':' ]] \ - && [[ ! "$ligne" =~ "@/efi/" ]] && [[ ! "$ligne" =~ "@/EFI/" ]] \ + if [[ "$ligne" =~ / ]] && [[ "$ligne" =~ ':' ]] && [[ ! "$ligne" =~ "@/efi/" ]] && [[ ! "$ligne" =~ "@/EFI/" ]] \ && [[ ! "$(echo "$ligne" | grep indows | grep boot )" ]] \ && [[ ! "$ligne" =~ '(boot)' ]];then #exclude 'Windows 10 (boot)' /dev/sda2@/efi/Microsoft/Boot/bootmgfw.efi:Windows Boot Manager:Windows:efi , or /dev/nvme0n1p1@/efi/Microsoft/Boot/bootmgfw.efi:Windows Boot Manager:Windows:efi - temp=${ligne##*/dev/} - part=${temp%%:*} + [[ "$ligne" =~ /dev/ ]] && ligne=${ligne#*/dev/} + part=${ligne%%:*} ADDOS=yes for ((j=1;j<=TOTAL_QUANTITY_OF_OS;j++));do #To avoid duplicates since os-prober is run twice (bef and aft mount) [[ "${OS__PARTITION[$j]}" = "$part" ]] && ADDOS="" done if [[ "$ADDOS" ]];then (( TOTAL_QUANTITY_OF_OS += 1 )) - OS__PARTITION[$TOTAL_QUANTITY_OF_OS]=$part #e.g. "sda1" or "sdc10" + OS__PARTITION[$TOTAL_QUANTITY_OF_OS]=$part #e.g. sda1 or sdc10 or rpool/ROOT/ubuntu_64fs0l determine_disk_from_part OS__DISK[$TOTAL_QUANTITY_OF_OS]=$disk #e.g. "sda" or "sdc" tempp=${ligne#*:} diff -Nru boot-repair-4ppa123/usr/share/boot-sav/bs-common.sh boot-repair-4ppa200/usr/share/boot-sav/bs-common.sh --- boot-repair-4ppa123/usr/share/boot-sav/bs-common.sh 2020-03-15 13:14:14.000000000 +0000 +++ boot-repair-4ppa200/usr/share/boot-sav/bs-common.sh 2022-02-28 21:20:54.000000000 +0000 @@ -1,5 +1,5 @@ #! /bin/bash -# Copyright 2020 Yann MRN +# Copyright 2021 Yann MRN # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published @@ -17,7 +17,7 @@ blkid_fdisk_and_parted_update() { blkid -g #Update the UUID cache BLKID=$(blkid) -PARTEDLM="$(LANGUAGE=C LC_ALL=C parted -lms)" #may be with null -l but -lm ok +PARTEDLM="$(LANGUAGE=C LC_ALL=C parted -lms 2>/dev/null)" #may be with null -l but -lm ok FDISKL="$(LANGUAGE=C LC_ALL=C fdisk -l 2>/dev/null)" } @@ -37,7 +37,7 @@ if [[ "$(echo "$line" | grep '/dev/' | grep -iv loop | grep ':' | grep ';' )" ]];then disk="${a%%:*}" #eg /dev/sda disk="${disk#*dev/}" - add_disk exclude b + add_disk exclude "a$CURRENTSESSIONPARTITION" fi done < <(echo "$PARTEDLM") } @@ -50,11 +50,17 @@ part=${temp#*dev/} #e.g. "sda12" or "mapper/isw_decghhaeb_Volume0p2" or "mapper/isw_bcbggbcebj_ARRAY4" or "mapper/vg_adamant-lv_root" disk="" #echo "[debug]part : $part" #Add "squashfs" ? #sr1 + #Microsoft reserved: https://forum.ubuntu-fr.org/viewtopic.php?pid=22298412#p22298412 + #2022 ubiquity installs grub on: + #/dev/[hmsv]d[a-z]|/dev/xvd[a-z]|/dev/cciss/c[0-9]d[0-9]*|/dev/ida/c[0-9]d[0-9]*|/dev/rs/c[0-9]d[0-9]*|/dev/mmcblk[0-9]|/dev/ad[0-9]*|/dev/da[0-9]*|/dev/fio[a-z]|/dev/nvme[0-9]n[0-9]) if [[ "$part" ]] && [[ ! "$line" =~ /dev/loop ]] && [[ ! "$(df "/dev/$part")" =~ /cdrom ]] \ && [[ ! "$(df "/dev/$part")" =~ /live/ ]] && [[ ! "$line" =~ "TYPE=\"iso" ]] && [[ ! "$line" =~ "TYPE=\"udf" ]] && [[ ! "$line" =~ "TYPE=\"crypt" ]] \ - && [[ ! "$line" =~ "Microsoft reserved partition" ]] && [[ ! "$(echo "$FDISKL" | grep "/dev/$part" | grep 'BIOS boot' )" ]];then + && [[ ! "$line" =~ "Microsoft reserved partition" ]] && [[ ! "$(echo "$FDISKL" | grep "/dev/$part " | grep 'Microsoft reserved' )" ]] \ + && [[ ! "$(echo "$FDISKL" | grep "/dev/$part " | grep 'BIOS boot' )" ]];then if [[ "$line" =~ LVM2_member ]];then # http://www.linux-sxs.org/storage/fedora2ubuntu.html [[ "$DEBBUG" ]] && echo "[debug] $part is LVM2_member" + elif [[ "$line" =~ zfs_member ]] && [[ ! "$(blkid | grep "${LISTOFPARTITIONS[$i]}:" | grep zfs_member )" ]];then #exclude disks marked as zfs_member by blkid. Only consider zfs partitions. + [[ "$DEBBUG" ]] && echo "[debug] $part is zfs_member disc." elif [[ "$line" =~ raid_member ]];then [[ "$DEBBUG" ]] && echo "[debug] $part is RAID_member" #eg md0 on sdb & sdc determine_disk_from_part @@ -75,14 +81,6 @@ fi fi done < <(echo "$BLKID") -while read line; do - if [[ "$line" =~ zfs ]];then - part="${line% on *}" - disk="" - determine_disk_from_part - add_disk $1 $2 add_part_too - fi -done < <(mount | grep on) } determine_disk_from_part() { @@ -92,7 +90,7 @@ [[ ! "$part" =~ mapper ]] && echo "$part not detected by =~mapper. $PLEASECONTACT" if [[ "$(type -p dmraid)" ]];then if [[ "$(dmraid -sa -c)" ]] && [[ "$(dmraid -sa -c)" != "no raid disk" ]];then - for raidset in $(dmraid -sa -c); do #Be careful: http://paste.ubuntu.com/1042248 + for raidset in $(dmraid -sa -c); do echo "[dmraid -sa -c] $raidset" #http://ubuntuforums.org/showthread.php?t=1559762&page=2 [[ "$(grep "$raidset" <<< "$part" )" ]] && disk="mapper/$raidset" done @@ -117,10 +115,14 @@ #disk of md1 is md1, but better leaving sda #be careful with md1 -> sda set_default_disk +elif [[ "$part" = "$CURRENTSESSIONPARTITION" ]] && [[ "$(findmnt -n -o FSTYPE / | grep zfs )" ]];then #Root in zfs pool + #selects vda by default + set_default_disk elif [[ "$part" =~ cciss/ ]] || [[ "$part" =~ nvme ]] || [[ "$part" =~ mmcblk ]] && [[ "$(grep "p[0-9]" <<< $part )" ]];then disk="${part%p[0-9]*}" #nvme0n1p1, cciss/c1d1p1 -> cciss/c1d1 , https://blueprints.launchpad.net/boot-repair/+spec/check-cciss-support elif [[ "$(grep "hd[a-z][0-9]" <<< $part )" ]] || [[ "$(grep "hd[a-z][a-z][0-9]" <<< $part )" ]] \ -|| [[ "$(grep "sd[a-z][0-9]" <<< $part )" ]] || [[ "$(grep "sd[a-z][a-z][0-9]" <<< $part )" ]] && [[ $(ls /dev/${part%[0-9]*}) ]];then +|| [[ "$(grep "sd[a-z][0-9]" <<< $part )" ]] || [[ "$(grep "sd[a-z][a-z][0-9]" <<< $part )" ]] \ +|| [[ "$(grep "vd[a-z][0-9]" <<< $part )" ]] || [[ "$(grep "vd[a-z][a-z][0-9]" <<< $part )" ]] && [[ $(ls /dev/${part%[0-9]*}) ]];then disk="${part%%[0-9]*}" #e.g. "sda" ##Add sr[0-9] (memcard)? elif [[ "$line" =~ raid_member ]] && [[ $(ls /dev/$part ) ]];then disk="$part" @@ -133,27 +135,30 @@ set_default_disk() { #called by loop_check_blkid_partitions and determine_disk_from_part -# TODO les grep ne fonctionnent probablement plus avec PARTED et FDISK -if [[ "$(echo "$PARTEDLM" | grep /dev/sda | grep -vi error )" ]] || [[ "$(echo "$FDISKL" | grep /dev/sda )" ]];then +# Fallback when disk not found in blkid, e.g. /dev/md127 is not in blkid, while /dev/md127p1 is. +if [[ "$(echo "$PARTEDLM" | grep /dev/vda: | grep -vi error )" ]] || [[ "$(echo "$FDISKL" | grep /dev/vda )" ]];then + disk=vda +elif [[ "$(echo "$PARTEDLM" | grep /dev/sda: | grep -vi error )" ]] || [[ "$(echo "$FDISKL" | grep /dev/sda )" ]];then disk=sda -elif [[ "$(echo "$PARTEDLM" | grep /dev/sdb | grep -vi error )" ]] || [[ "$(echo "$FDISKL" | grep /dev/sdb )" ]];then +elif [[ "$(echo "$PARTEDLM" | grep /dev/sdb: | grep -vi error )" ]] || [[ "$(echo "$FDISKL" | grep /dev/sdb )" ]];then disk=sdb -elif [[ "$(echo "$PARTEDLM" | grep /dev/hda | grep -vi error )" ]] || [[ "$(echo "$FDISKL" | grep /dev/hda )" ]];then +elif [[ "$(echo "$PARTEDLM" | grep /dev/hda: | grep -vi error )" ]] || [[ "$(echo "$FDISKL" | grep /dev/hda )" ]];then disk=hda elif [[ "$NBOFDISKS" != 0 ]];then disk="${LISTOFDISKS[1]}" else disk="$part" #eg sdd -> sdd fi -if [[ "$part" =~ md ]] || [[ "$part" =~ mapper ]] || [[ "$line" =~ raid_member ]] || [[ "$line" =~ zfs ]];then - echo "Set $disk as corresponding disk of $part" +if [[ "$part" =~ md ]] || [[ "$part" =~ mapper ]] || [[ "$line" =~ raid_member ]] || [[ "$part" =~ "pool/" ]];then + [[ "$DEBBUG" ]] && echo "Set $disk as corresponding disk of $part" else echo "$part ($disk) has unknown type. $PLEASECONTACT" fi } add_disk() { -if [[ "a${part}" = "$1" ]] || [[ "$1" = exclude ]] && [[ "a$part" != "$2" ]] && [[ "$disk" ]] && [[ ! "$(df "/dev/$disk")" =~ /cdrom ]];then +if [[ "a$part" = "$1" ]] || [[ "$1" = exclude ]] && [[ "a$part" != "$2" ]] && [[ "$disk" ]] && [[ ! "$(df "/dev/$disk")" =~ /cdrom ]] \ +&& [[ ! "$(lsblk -o FSTYPE /dev/$disk | grep iso )" ]];then #exclude parts on iso disk: https://forum.ubuntu-fr.org/viewtopic.php?pid=22298633#p22298633 local ADD_DISK=yes ADD_PART="$3" b for ((b=1;b<=NBOFDISKS;b++)); do [[ "${LISTOFDISKS[$b]}" = "$disk" ]] && ADD_DISK="" @@ -168,7 +173,8 @@ [[ "${LISTOFPARTITIONS[$b]}" = "$part" ]] && ADD_PART="" done if [[ "$ADD_PART" ]] && [[ "$part" ]];then - if ([[ ! "$part" =~ cciss/ ]] && [[ ! "$part" =~ nvme ]] && [[ ! "$part" =~ mmcblk ]]) || [[ "$(grep "p[0-9]" <<< $part )" ]];then #blkid can contain /dev/nvme0n1 or /dev/mmcblk0 which are not partitions https://forum.ubuntu-fr.org/viewtopic.php?pid=21827617#p21827617 + #blkid can contain /dev/nvme0n1 or /dev/mmcblk0 which are not partitions https://forum.ubuntu-fr.org/viewtopic.php?pid=21827617#p21827617 + if ([[ ! "$part" =~ cciss/ ]] && [[ ! "$part" =~ nvme ]] && [[ ! "$part" =~ mmcblk ]]) || [[ "$(grep "p[0-9]" <<< $part )" ]];then (( NBOFPARTITIONS += 1 )) LISTOFPARTITIONS[$NBOFPARTITIONS]="$part" #sda1 DISK_PART[$NBOFPARTITIONS]="$disk" #sda @@ -251,7 +257,8 @@ grep -q "n.1.0" "${BLKIDMNT_POINT[$i]}"/{windows,Windows,WINDOWS}/{System32,system32}/{Winload,winload}.exe 2>>/dev/null && OSNAME[$i]='Windows 7 or 10'; #Win7 also contains n.1.0 but not i.n.1.0 grep -q "n.7" "${BLKIDMNT_POINT[$i]}"/{windows,Windows,WINDOWS}/{System32,system32}/{Winload,winload}.exe 2>>/dev/null && OSNAME[$i]='Windows 7'; grep -q "n.8" "${BLKIDMNT_POINT[$i]}"/{windows,Windows,WINDOWS}/{System32,system32}/{Winload,winload}.exe 2>>/dev/null && OSNAME[$i]='Windows 8 or 10'; - grep -q "i.n.1.0" "${BLKIDMNT_POINT[$i]}"/{windows,Windows,WINDOWS}/{System32,system32}/{Winload,winload}.exe 2>>/dev/null && OSNAME[$i]='Windows 10'; + grep -q "i.n.1.0" "${BLKIDMNT_POINT[$i]}"/{windows,Windows,WINDOWS}/{System32,system32}/{Winload,winload}.exe 2>>/dev/null && OSNAME[$i]='Windows 10 or 11'; + grep -q "n.1.1" "${BLKIDMNT_POINT[$i]}"/{windows,Windows,WINDOWS}/{System32,system32}/{Winload,winload}.exe 2>>/dev/null && OSNAME[$i]='Windows 11'; #not seen yet OS__NAME[$TOTAL_QUANTITY_OF_OS]="${OSNAME[$i]}" OS__COMPLETE_NAME[$TOTAL_QUANTITY_OF_OS]="${OSNAME[$i]} (not detected by os-prober)" [[ "$DEBBUG" ]] && echo "Windows not detected by os-prober on ${LISTOFPARTITIONS[$i]}." @@ -317,7 +324,7 @@ paragraph_os_detected(){ title_gen "$TOTAL_QTY_OF_OS_INCLUDING_WUBI OS detected" -[[ "$DEBBUG" ]] && echo "$QTY_WUBI Wubi, $QUANTITY_OF_DETECTED_LINUX other Linux, $QUANTITY_OF_DETECTED_MACOS MacOS, $QUANTITY_OF_DETECTED_WINDOWS Windows, $QUANTITY_OF_UNKNOWN_OS unknown type OS." +[[ "$DEBBUG" ]] && echo "[debug] $QTY_WUBI Wubi, $QUANTITY_OF_DETECTED_LINUX other Linux, $QUANTITY_OF_DETECTED_MACOS MacOS, $QUANTITY_OF_DETECTED_WINDOWS Windows, $QUANTITY_OF_UNKNOWN_OS unknown type OS." for ((n=1;n<=TOTAL_QTY_OF_OS_INCLUDING_WUBI;n++)); do echo "OS#$n: ${OS__NAME[$n]} on ${OS__PARTITION[$n]}" done @@ -340,7 +347,7 @@ fi done fi -[[ -f "${BLKIDMNT_POINT[$i]}/Windows/System32/winload.exe" ]] && WINL[$i]=haswinload || WINL[$i]=no-winload #ex http://paste.ubuntu.com/894852 +[[ -f "${BLKIDMNT_POINT[$i]}/Windows/System32/winload.exe" ]] && WINL[$i]=haswinload || WINL[$i]=no-winload [[ "$(ls "${BLKIDMNT_POINT[$i]}/" | grep -xi bootmgr )" ]] \ && WINMGR[$i]="$(ls "${BLKIDMNT_POINT[$i]}/" | grep -xi bootmgr )" || WINMGR[$i]=no-bmgr [[ "$(ls "${BLKIDMNT_POINT[$i]}/" | grep -xi grldr )" ]] \ @@ -379,13 +386,14 @@ ################# CHECK RECOVERY OR HIDDEN PARTS ####################### check_recovery_or_hidden() { local i part f +[[ "$DEBBUG" ]] && echo "[debug] check_recovery_or_hidden" for ((i=1;i<=NBOFPARTITIONS;i++)); do part="${LISTOFPARTITIONS[$i]}" #eg mapper/isw_beaibbhjji_Volume0p1 f="" RECOV[$i]=no-recov-nor-hid while read line;do #eg 1:1049kB:21.0GB:21.0GB:ext4::; if [[ "$line" =~ /dev/ ]];then - [[ "$line" =~ "/dev/${DISK_PART[$i]}:" ]] && f=ok || f="" + [[ "$line" =~ "/dev/${DISK_PART[$i]}:" ]] && [[ "$part" =~ "${DISK_PART[$i]}" ]] && f=ok || f="" fi [[ "$line" =~ diag ]] || [[ "$line" =~ hidden ]] && [[ "$f" ]] && [[ "${line%%:*}" = "${part##*[a-z]}" ]] \ && RECOV[$i]=recovery-or-hidden #may have hidden ESP @@ -399,6 +407,7 @@ [[ "$(echo "$BLKID" | grep "${LISTOFPARTITIONS[$i]} " | grep -i recovery )" ]] \ || [[ "$(grep -i recovery <<< "${OSNAME[$i]}" )" ]] && RECOV[$i]=recovery-or-hidden + [[ "$DEBBUG" ]] && echo "[debug] ls ${BLKIDMNT_POINT[$i]}/ | grep -xi bootmgr (${LISTOFPARTITIONS[$i]})" [[ "$(ls "${BLKIDMNT_POINT[$i]}/" | grep -xi bootmgr )" ]] && [[ ! -d "${BLKIDMNT_POINT[$i]}/Windows/System32" ]] \ && SEPWINBOOT[$i]=yes || SEPWINBOOT[$i]="" [[ "${SEPWINBOOT[$i]}" ]] && OSNAME[$i]="${OSNAME[$i]} (boot)" @@ -439,83 +448,103 @@ mount_all_blkid_partitions_except_df() { local i j temp MOUNTCODE [[ "$DEBBUG" ]] && echo "[debug]Mount all blkid partitions except the ones already mounted and BIOS_Boot" -MOUNTB="$(mount)" MOUNTERROR="" +#Define BLKIDMNT_POINT[$i] and try to mount all partitions for ((i=1;i<=NBOFPARTITIONS;i++)); do - if [[ ! "$(blkid | grep "/dev/${LISTOFPARTITIONS[$i]}:" | grep zfs_member )" ]];then - if [[ "$MOUNTB" =~ "/dev/${LISTOFPARTITIONS[$i]} on" ]];then - if [[ "${LISTOFPARTITIONS[$i]}" != "$CURRENTSESSIONPARTITION" ]];then - [[ "$DEBBUG" ]] && echo "[debug]DF$(df /dev/${LISTOFPARTITIONS[$i]} | grep "/dev/${LISTOFPARTITIONS[$i]}" )" #debug - temp="$(grep "/dev/${LISTOFPARTITIONS[$i]} on" <<< "$MOUNTB" )" - temp="${temp#*on }" - BLKIDMNT_POINT[$i]="${temp%% type*}" - if [[ "${BLKIDMNT_POINT[$i]}/" =~ " " ]] || [[ "${BLKIDMNT_POINT[$i]}/" =~ "&" ]] || [[ "${BLKIDMNT_POINT[$i]}/" =~ "\\" ]];then - ECHO_LVM_RAID_PREPAR="$ECHO_LVM_RAID_PREPAR + #already mounted partitions + if [[ "${LISTOFPARTITIONS[$i]}" = "$CURRENTSESSIONPARTITION" ]];then + BLKIDMNT_POINT[$i]="" + elif [[ "$(blkid | grep "${LISTOFPARTITIONS[$i]}:" | grep zfs_member )" ]];then + if [[ "$(df -Th / | grep zfs )" ]];then + [[ "$(echo "$FDISKL" | grep "${LISTOFPARTITIONS[$i]} " | grep boot)" ]] && BLKIDMNT_POINT[$i]="/boot" || BLKIDMNT_POINT[$i]="" + else + [[ "$(echo "$FDISKL" | grep "${LISTOFPARTITIONS[$i]} " | grep boot)" ]] && BLKIDMNT_POINT[$i]="/mnt/boot-sav/zfs/boot" || BLKIDMNT_POINT[$i]="/mnt/boot-sav/zfs" + fi + else + BLKIDMNT_POINT[$i]="$(findmnt -n -o TARGET "/dev/${LISTOFPARTITIONS[$i]}" )" + fi + #Try to unmount in order to remove special mount points + if [[ "${BLKIDMNT_POINT[$i]}/" =~ " " ]] || [[ "${BLKIDMNT_POINT[$i]}/" =~ "&" ]] || [[ "${BLKIDMNT_POINT[$i]}/" =~ "\\" ]];then + PART1="${LISTOFPARTITIONS[$i]}"; update_translations + text="$This_will_mount_PART1_to_new_mountpoint_without_special_characters $Do_you_want_to_continue" + if [[ "$GUI" ]];then + echo "$text" + end_pulse + zenity --width=400 --question --title="$APPNAME2" --text="$text" 2>/dev/null || userok="" + start_pulse + else + read -r -p "$text [yes/no] " response + [[ ! "$response" =~ y ]] && userok="" + fi + [[ "$userok" ]] && ECHO_LVM_RAID_PREPAR="$ECHO_LVM_RAID_PREPAR +$text Unmount ${LISTOFPARTITIONS[$i]} from ${BLKIDMNT_POINT[$i]}/ to avoid special characters (& or \\ or space) incompatibilities $(umount "${BLKIDMNT_POINT[$i]}")" - MOUNTB="$(mount)" - fi - else - BLKIDMNT_POINT[$i]="" - fi - fi - if [[ ! "$MOUNTB" =~ "/dev/${LISTOFPARTITIONS[$i]} on" ]];then - BLKIDMNT_POINT[$i]="/mnt/boot-sav/${LISTOFPARTITIONS[$i]}" - mkdir -p "${BLKIDMNT_POINT[$i]}/" - if [[ "$(echo "$BLKID" | grep btrfs | grep "${LISTOFPARTITIONS[$i]}:" )" ]];then - mount /dev/${LISTOFPARTITIONS[$i]} "${BLKIDMNT_POINT[$i]}/" - ECHO_LVM_RAID_PREPAR="$ECHO_LVM_RAID_PREPAR + BLKIDMNT_POINT[$i]="$(findmnt -n -o TARGET "/dev/${LISTOFPARTITIONS[$i]}" )" + fi + #Mount partitions + if [[ ! "${BLKIDMNT_POINT[$i]}" ]];then + BLKIDMNT_POINT[$i]="/mnt/boot-sav/${LISTOFPARTITIONS[$i]}" + mkdir -p "${BLKIDMNT_POINT[$i]}/" + if [[ "$(echo "$BLKID" | grep btrfs | grep "${LISTOFPARTITIONS[$i]}:" )" ]];then + ECHO_LVM_RAID_PREPAR="$ECHO_LVM_RAID_PREPAR BTRFS detected on ${LISTOFPARTITIONS[$i]} ls ${LISTOFPARTITIONS[$i]}: $(ls ${BLKIDMNT_POINT[$i]}) --- +mount /dev/${LISTOFPARTITIONS[$i]} ${BLKIDMNT_POINT[$i]}/ $(mount /dev/${LISTOFPARTITIONS[$i]} ${BLKIDMNT_POINT[$i]}/ 2>/dev/null)" + MOUNTCODE="$?" + ECHO_LVM_RAID_PREPAR="$ECHO_LVM_RAID_PREPAR +MOUNTCODE=$MOUNTCODE +--- os-prober before @ subvol mount: -$(os-prober)" - if [[ -d "${BLKIDMNT_POINT[$i]}/@" ]];then - ECHO_LVM_RAID_PREPAR="$ECHO_LVM_RAID_PREPAR +$(os-prober) +---" + if [[ -d "${BLKIDMNT_POINT[$i]}/@" ]];then + ECHO_LVM_RAID_PREPAR="$ECHO_LVM_RAID_PREPAR umount ${BLKIDMNT_POINT[$i]} $(umount "${BLKIDMNT_POINT[$i]}") -mount -t btrfs -o subvol=@ /dev/${LISTOFPARTITIONS[$i]} ${BLKIDMNT_POINT[$i]}/ -$(mount -t btrfs -o subvol=@ /dev/${LISTOFPARTITIONS[$i]} "${BLKIDMNT_POINT[$i]}/")" - MOUNTCODE="$?" - ECHO_LVM_RAID_PREPAR="$ECHO_LVM_RAID_PREPAR -os-prober after @ subvol mount: -$(os-prober)" - fi - else - mount /dev/${LISTOFPARTITIONS[$i]} "${BLKIDMNT_POINT[$i]}/" >/dev/null - MOUNTCODE="$?" - fi - if [[ "$MOUNTCODE" = 14 ]];then #https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/1064928 - #http://ubuntuforums.org/showthread.php?t=2067828 +--- +mount -t btrfs -o subvol=@ /dev/${LISTOFPARTITIONS[$i]} ${BLKIDMNT_POINT[$i]}/ $(mount -t btrfs -o subvol=@ /dev/${LISTOFPARTITIONS[$i]} "${BLKIDMNT_POINT[$i]}/") +---" + MOUNTCODE="$?" ECHO_LVM_RAID_PREPAR="$ECHO_LVM_RAID_PREPAR -mount -t ntfs-3g -o remove_hiberfile /dev/${LISTOFPARTITIONS[$i]} ${BLKIDMNT_POINT[$i]} -$(mount -t ntfs-3g -o remove_hiberfile /dev/${LISTOFPARTITIONS[$i]} "${BLKIDMNT_POINT[$i]}")" - MOUNTCODE="$?" +MOUNTCODE=$MOUNTCODE +os-prober after @ subvol mount: +$(os-prober) +---" fi - if [[ "$MOUNTCODE" != 0 ]];then - ECHO_LVM_RAID_PREPAR="$ECHO_LVM_RAID_PREPAR + else + mount /dev/${LISTOFPARTITIONS[$i]} "${BLKIDMNT_POINT[$i]}/" 2>/dev/null + MOUNTCODE="$?" + fi + if [[ "$MOUNTCODE" != 0 ]] && [[ "$(blkid /dev/${LISTOFPARTITIONS[$i]} | grep ntfs)" ]];then #https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/1064928 + #hiberfile.sys at root of windows disc + ECHO_LVM_RAID_PREPAR="$ECHO_LVM_RAID_PREPAR +mount -t ntfs-3g -o remove_hiberfile /dev/${LISTOFPARTITIONS[$i]} ${BLKIDMNT_POINT[$i]} $(mount -t ntfs-3g -o remove_hiberfile /dev/${LISTOFPARTITIONS[$i]} "${BLKIDMNT_POINT[$i]}")" + MOUNTCODE="$?" + fi + if [[ "$MOUNTCODE" != 0 ]];then + mount -r /dev/${LISTOFPARTITIONS[$i]} "${BLKIDMNT_POINT[$i]}" 2>/dev/null + [[ "$DEBBUG" ]] && ECHO_LVM_RAID_PREPAR="$ECHO_LVM_RAID_PREPAR Error code $MOUNTCODE -mount -r /dev/${LISTOFPARTITIONS[$i]} ${BLKIDMNT_POINT[$i]} -$(mount -r /dev/${LISTOFPARTITIONS[$i]} "${BLKIDMNT_POINT[$i]}")" - MOUNTCODE="$?" - if [[ "$MOUNTCODE" != 0 ]];then - ECHO_LVM_RAID_PREPAR="$ECHO_LVM_RAID_PREPAR +mount -r /dev/${LISTOFPARTITIONS[$i]} ${BLKIDMNT_POINT[$i]} $(mount -r /dev/${LISTOFPARTITIONS[$i]} "${BLKIDMNT_POINT[$i]}")" \ + && MOUNTCODE="$?" + if [[ "$DEBBUG" ]] && [[ "$MOUNTCODE" != 0 ]];then + ECHO_LVM_RAID_PREPAR="$ECHO_LVM_RAID_PREPAR mount -r /dev/${LISTOFPARTITIONS[$i]} : Error code $MOUNTCODE" - if [[ "$(echo "$BLKID" | grep ext | grep "${LISTOFPARTITIONS[$i]}:" )" ]];then - MOUNTERROR="$MOUNTCODE" #http://ubuntuforums.org/showthread.php?t=2068280 - fi - fi + [[ "$(echo "$BLKID" | grep ext | grep "${LISTOFPARTITIONS[$i]}:" )" ]] && MOUNTERROR="$MOUNTCODE" #http://ubuntuforums.org/showthread.php?t=2068280 fi fi - [[ "$DEBBUG" ]] && echo "[debug]BLKID Mount point of ${LISTOFPARTITIONS[$i]} is: ${BLKIDMNT_POINT[$i]}" - for ((j=1;j<=TOTAL_QUANTITY_OF_OS;j++)); do - if [[ "${LISTOFPARTITIONS[$i]}" = "${OS__PARTITION[$j]}" ]];then - OS__MNT_PATH[$j]="${BLKIDMNT_POINT[$i]}" - [[ "$DEBBUG" ]] && echo "[debug]Mount path of ${OS__PARTITION[$j]} is: ${OS__MNT_PATH[$j]}" - fi - done -# fi + fi + #Define OS__MNT_PATH[$j] + [[ "$DEBBUG" ]] && echo "[debug]BLKIDMNT_POINT of ${LISTOFPARTITIONS[$i]} is: ${BLKIDMNT_POINT[$i]}" + for ((j=1;j<=TOTAL_QUANTITY_OF_OS;j++)); do + if [[ "${LISTOFPARTITIONS[$i]}" = "${OS__PARTITION[$j]}" ]];then + OS__MNT_PATH[$j]="${BLKIDMNT_POINT[$i]}" + [[ "$DEBBUG" ]] && echo "[debug]Mount path of ${OS__PARTITION[$j]} is: ${OS__MNT_PATH[$j]}" + fi + done done } @@ -536,11 +565,15 @@ [[ "$DEBBUG" ]] && echo "[debug]Unmount all blkid partitions except df ones" pkill pcmanfm #To avoid it automounts for ((i=1;i<=NBOFPARTITIONS;i++)); do - [[ "$DEBBUG" ]] && echo "[debug]BLKID Mount point of ${LISTOFPARTITIONS[$i]} is: ${BLKIDMNT_POINT[$i]}" - [[ "${BLKIDMNT_POINT[$i]}/" =~ "/mnt/boot-sav" ]] \ - && [[ ! "$(mount | grep "${LISTOFPARTITIONS[$i]} " | grep "subvol=" | grep -v 'subvol=/)' | grep -v 'subvol=/,' )" ]] \ - && umount "${BLKIDMNT_POINT[$i]}" + if [[ "${BLKIDMNT_POINT[$i]}/" =~ /mnt/boot-sav ]] && [[ ! "${BLKIDMNT_POINT[$i]}/" =~ sav/zfs ]] \ + && [[ ! "$(mount | grep "${LISTOFPARTITIONS[$i]} " | grep "subvol=" | grep -v 'subvol=/)' | grep -v 'subvol=/,' )" ]];then + [[ "$DEBBUG" ]] && echo "[debug] unmount ${BLKIDMNT_POINT[$i]}" + umount "${BLKIDMNT_POINT[$i]}" + fi done +if [[ "$LIVESESSION" = live ]] && [[ "$BLKID" =~ zfs ]];then + [[ "$DEBBUG" ]] && echo "[debug] zpool export -f -a $(zpool export -f -a)" || echo "zpool export -f -a $(zpool export -f -a 2>/dev/null)" +fi } @@ -548,9 +581,9 @@ echo_df_and_fdisk() { #blkid_fdisk_and_parted_update title_gen "df -Th (filtered)" -while read line; do - [[ "$line" ]] && [[ ! "$line" =~ '/dev/loop' ]] && [[ ! "$line" =~ 'tmpfs' ]] && echo "$line" -done < <(LANGUAGE=C LC_ALL=C df -Th ) +while read line; do #dont hide /cdrom to identify live disc more easily + [[ ! "$line" =~ '/dev/loop' ]] && echo "$line" +done < <(LANGUAGE=C LC_ALL=C df -Th | sed -e '/^$/d' -e '/tmpfs/d' ) title_gen "fdisk -l (filtered)" while read line; do [[ "$line" ]] && [[ ! "$line" =~ 'Sector size (' ]] && [[ ! "$line" =~ 'I/O size (' ]] && [[ ! "$line" =~ 'Units:' ]] && [[ ! "$line" =~ 'Disk /dev/loop' ]] && echo "$line" @@ -559,9 +592,7 @@ echo_blkid() { title_gen "blkid (filtered)" -while read line; do - [[ "$line" ]] && [[ ! "$line" =~ squashfs ]] && echo "$line" -done < <(LANGUAGE=C LC_ALL=C blkid) +LANGUAGE=C LC_ALL=C blkid | sed -e '/^$/d' -e '/quashfs/d' } ############################# CHECKS IF TMP/MBR IS GRUB TYPE OR NOT ############################################# diff -Nru boot-repair-4ppa123/usr/share/boot-sav/gui-actions-grub.sh boot-repair-4ppa200/usr/share/boot-sav/gui-actions-grub.sh --- boot-repair-4ppa123/usr/share/boot-sav/gui-actions-grub.sh 2020-03-15 13:14:14.000000000 +0000 +++ boot-repair-4ppa200/usr/share/boot-sav/gui-actions-grub.sh 2022-03-06 21:55:00.000000000 +0000 @@ -1,5 +1,5 @@ #! /bin/bash -# Copyright 2020 Yann MRN +# Copyright 2022 Yann MRN # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published @@ -21,7 +21,7 @@ echo "Error: no $regrubfstab" else for bootusr in /boot /usr /boot/efi;do - [[ "$bootusr" = /boot ]] && TMPPART_TO_USE="$BOOTPART_TO_USE" && FLINE1A=0 && FLINE1B=2 && FLINE2A=1 && FLINE2B=2 #1204, Fedora13 + [[ "$bootusr" = /boot ]] && TMPPART_TO_USE="$BOOTPART_TO_USE" && FLINE1A=0 && FLINE1B=2 && FLINE2A=1 && FLINE2B=2 #1204, Fedora13 [[ "$bootusr" = /usr ]] && TMPPART_TO_USE="$USRPART_TO_USE" && FLINE1A=0 && FLINE1B=2 && FLINE2A=1 && FLINE2B=2 #1204, ? [[ "$bootusr" = /boot/efi ]] && TMPPART_TO_USE="$EFIPART_TO_USE" && FLINE1A=0 && FLINE1B=1 && FLINE2A=1 && FLINE2B=1 #1204, ? ( [[ "$bootusr" = /boot ]] && [[ "$USE_SEPARATEBOOTPART" ]] ) \ @@ -37,34 +37,35 @@ [[ ! -f "$OLDFSTAB" ]] && cp "$regrubfstab" "$OLDFSTAB" NEWFSTAB="$LOGREP/${LISTOFPARTITIONS[$REGRUB_PART]}/etc_fstab_new" rm -f "$NEWFSTAB" - ADDIT="" + ADDIT="" if [[ "$FSTABFIXTYPE" = added ]];then temp="$(lsblk -n -o FSTYPE /dev/${LISTOFPARTITIONS[$TMPPART_TO_USE]} )" #ex: vfat - CORRECTLINEBEG="UUID=${PART_UUID[$TMPPART_TO_USE]} $bootusr $temp" - CORRECTLINEMID1=" umask=0077 " #20.04 /boot/efi (https://forum.ubuntu-fr.org/viewtopic.php?pid=22273685#p22273685) UUID=FC23-4CBE /boot/efi vfat umask=0077 0 1 - CORRECTLINEMID2=" defaults " - CORRECTLINEMID3=" relatime " + CORRECTLINEBEG="UUID=${PART_UUID[$TMPPART_TO_USE]} $bootusr $temp" + CORRECTLINEMID1=' umask=0077 ' #20.04 /boot/efi (https://forum.ubuntu-fr.org/viewtopic.php?pid=22273685#p22273685) UUID=FC23-4CBE /boot/efi vfat umask=0077 0 1 + CORRECTLINEMID2=' defaults ' + CORRECTLINEMID3=' relatime ' + CORRECTLINEMID4=' umask=0022,fmask=0022,dmask=0022 ' #20.04 /boot/efi in zfs install CORRECTLINEEND1="$FLINE1A $FLINE1B" - CORRECTLINEEND2="$FLINE2A $FLINE2B" + CORRECTLINEEND2="$FLINE2A $FLINE2B" ADDIT=yes fi CHANGEDONE="" while read line; do - if [[ "$line" =~ "$bootusr" ]] && [[ ! "$line" =~ "$bootusr/" ]] && [[ ! "$line" =~ "#" ]];then - CONTROL="" - if [[ "$FSTABFIXTYPE" = added ]];then - for midlin in $CORRECTLINEMID1 $CORRECTLINEMID2 $CORRECTLINEMID3;do #check all possible combinations, and allow any nb of spaces - for endlin in $CORRECTLINEEND1 $CORRECTLINEEND2;do - [[ "$(echo "$line" | sed 's/ //g' )" = "$(echo "$CORRECTLINEBEG$midlin$endlin" | sed 's/ //g' )" ]] && CONTROL=correct_lin_already_in_fstab - done - done - fi - if [[ "$CONTROL" ]];then - echo "$line" >> "$NEWFSTAB" - ADDIT="" #If the correct line was already in fstab, keep it and don't add a new one - else - CHANGEDONE=yes && echo "#$line" >> "$NEWFSTAB" #Comment any incorrect line containing $bootusr - fi + if [[ "$line" =~ "$bootusr" ]] && [[ ! "$line" =~ "$bootusr/" ]] && [[ ! "$line" =~ "#" ]];then + CONTROL="" + if [[ "$FSTABFIXTYPE" = added ]];then + for midlin in "$CORRECTLINEMID1" "$CORRECTLINEMID2" "$CORRECTLINEMID3" "$CORRECTLINEMID4";do #check all possible combinations, and allow any nb of spaces + for endlin in "$CORRECTLINEEND1" "$CORRECTLINEEND2";do + [[ "$(echo "$line" | sed 's/ //g' )" = "$(echo "$CORRECTLINEBEG$midlin$endlin" | sed 's/ //g' )" ]] && CONTROL=correct_lin_already_in_fstab + done + done + fi + if [[ "$CONTROL" ]];then + echo "$line" >> "$NEWFSTAB" + ADDIT="" #If the correct line was already in fstab, keep it and don't add a new one + else + CHANGEDONE=yes && echo "#$line" >> "$NEWFSTAB" #Comment any incorrect line containing $bootusr + fi else echo "$line" >> "$NEWFSTAB" fi @@ -93,7 +94,7 @@ echo "Fixed file rights of $direct$fichero" fi done - [[ "$DEBBUG" ]] && echo "[debug]End fix $direct" #http://paste.ubuntu.com/1095010 + [[ "$DEBBUG" ]] && echo "[debug]End fix $direct" else echo "No $direct folder. $PLEASECONTACT" fi @@ -108,7 +109,7 @@ fix_grub_d [[ "$FORCE_GRUB" = place-in-all-MBRs ]] && [[ ! "$GRUBPACKAGE" =~ efi ]] \ && [[ ! "$REMOVABLEDISK" ]] && loop_install_grub_in_all_other_disks -#Reinstall in main MBR at the end to avoid core.img missing (http://paste.ubuntu.com/988941) +#Reinstall in main MBR at the end to avoid core.img missing NOW_IN_OTHER_DISKS="" NOFORCE_DISK="$BCKUPNOFORCE_DISK" reinstall_grub @@ -125,8 +126,9 @@ reinstall_grub_from_non_removable() { -NOW_USING_CHOSEN_GRUB="" -NOW_IN_OTHER_DISKS=yes +NOW_USING_CHOSEN_GRUB="" #used in 'force_unmount_and_prepare_chroot', and 'mount_separate_boot_if_required' +NOW_IN_OTHER_DISKS=yes #used in 'reinstall_grubstageone' +[[ "$FORCE_GRUB" = place-in-all-MBRs ]] && NOFORCE_DISK="${DISK_PART[$REGRUB_PART]}" #in case user changed disc before selecting install-in-all-mbrs BCKUPREGRUB_PART="$REGRUB_PART" BCKUPNOFORCE_DISK="$NOFORCE_DISK" BCKUPUSRPART="$USRPART" @@ -140,13 +142,15 @@ || ( [[ "$y" = 2 ]] && [[ ! "${GRUBOK_OF_PART[$x]}" ]] && [[ "${APTTYP[$x]}" != nopakmgr ]]) \ && ( [[ "${ARCH_OF_PART[$x]}" = 32 ]] || [[ "$(uname -m)" = x86_64 ]] ) \ && [[ "$REGRUB_PART" = none ]] \ - && [[ "${DISK_PART[$BCKUPREGRUB_PART]}" != "${DISK_PART[$x]}" ]];then + && ( [[ "${GPT_DISK[${DISKNB_PART[$x]}]}" != is-GPT ]] || [[ "${BIOS_BOOT_DISK[${DISKNB_PART[$x]}]}" != no-BIOSboot ]] ) \ + && [[ "${REALWINONDISC[${DISKNB_PART[$x]}]}" = no-wind ]] \ + && [[ "${DISK_PART[$x]}" != "$BCKUPNOFORCE_DISK" ]];then GRUBOS_ON_OTHERDISK=yes if [[ "$LIVESESSION" = live ]] && [[ ! "$USE_SEPARATEBOOTPART" ]] && [[ ! "$USE_SEPARATEUSRPART" ]];then REGRUB_PART="$x" if [[ "${GRUBOK_OF_PART[$x]}" ]];then USRPART="$x" - loop_install_grub_in_all_other_disks + loop_install_grub_in_all_other_disks #First installs the grub of the 2nd Linux (the one on non-removable disc) in MBRs of discs without OS if [[ "$INSTALLEDINOTHERDISKS" ]];then [[ "${UPDATEGRUB_OF_PART[$USRPART]}" != noupdategrub ]] && grub_mkconfig_main unchroot_linux_to_reinstall @@ -163,25 +167,27 @@ fi done done - if [[ ! "$GRUBOS_ON_OTHERDISK" ]];then #No GRUB on other disks, so will restore MBRs - for ((n=1;n<=NBOFDISKS;n++));do - if [[ "${USBDISK[$n]}" != liveusb ]] && [[ "${MMCDISK[$n]}" != livemmc ]] && [[ "${DISK_HASOS[$n]}" = has-os ]] \ - && [[ "${GPT_DISK[$n]}" != is-GPT ]] && [[ "${EFI_DISK[$n]}" = has-noESP ]] && [[ "$n" != "${DISKNB_PART[$BCKUPREGRUB_PART]}" ]];then - for ((icrmf=1;icrmf<=NB_MBR_CAN_BE_RESTORED;icrmf++));do - MBR_TO_RESTORE="${MBR_CAN_BE_RESTORED[$icrmf]}" - if [[ "$MBR_TO_RESTORE" =~ "${LISTOFDISKS[$n]} " ]];then - combobox_restore_mbrof_consequences - restore_mbr - break - fi - done - fi - done - elif [[ ! "$LIVESESSION" = live ]] || [[ "$USE_SEPARATEBOOTPART" ]] || [[ "$USE_SEPARATEUSRPART" ]];then +# if [[ ! "$GRUBOS_ON_OTHERDISK" ]];then #No GRUB on other disks, so will restore MBRs +# for ((n=1;n<=NBOFDISKS;n++));do +# if [[ "${USBDISK[$n]}" != liveusb ]] && [[ "${MMCDISK[$n]}" != livemmc ]] && [[ "${DISK_HASOS[$n]}" = has-os ]] \ +# && [[ "${GPT_DISK[$n]}" != is-GPT ]] && [[ "${EFI_DISK[$n]}" = has-noESP ]] && [[ "$n" != "${DISKNB_PART[$BCKUPREGRUB_PART]}" ]];then +# for ((icrmf=1;icrmf<=NB_MBR_CAN_BE_RESTORED;icrmf++));do +# MBR_TO_RESTORE="${MBR_CAN_BE_RESTORED[$icrmf]}" +# if [[ "$MBR_TO_RESTORE" =~ "${LISTOFDISKS[$n]} " ]];then +# combobox_restore_mbrof_consequences +# restore_mbr +# break +# fi +# done +# fi +# done +# el + if [[ ! "$LIVESESSION" = live ]] || [[ "$USE_SEPARATEBOOTPART" ]] || [[ "$USE_SEPARATEUSRPART" ]] && [[ "$GRUBOS_ON_OTHERDISK" ]];then GRUBFOUNDONANOTHERDISK=yes fi + REGRUB_PART="$BCKUPREGRUB_PART"; USRPART="$BCKUPUSRPART" fi -REGRUB_PART="$BCKUPREGRUB_PART";USRPART="$BCKUPUSRPART"; NOW_USING_CHOSEN_GRUB=yes +NOW_USING_CHOSEN_GRUB=yes force_unmount_and_prepare_chroot } @@ -193,33 +199,33 @@ #title_gen "lspci -nnk | grep -iA3 vga" #${CHROOTCMD}lspci -nnk | grep -iA3 vga title_gen "Reinstall the $GRUBPACKAGE of ${LISTOFPARTITIONS[$REGRUB_PART]}" -echo "${GRUBTYPE_OF_PART[$USRPART]} --version" +echo "$CHROOTCMD${GRUBTYPE_OF_PART[$USRPART]} --version" GVERSION="$($CHROOTCMD${GRUBTYPE_OF_PART[$USRPART]} --version)" #-v in old, -V in new distros # grub-install (GNU GRUB 0.97), "grub-install (GRUB) 1.99-21ubuntu3.1", or "grub-install (GRUB) 2.00-5ubuntu3", "grub-install (GRUB) 2.02~beta2-9ubuntu1" GSVERSION="${GVERSION%%.*}" #grub-install (GRUB) 1 or "grub-install (GNU GRUB 0" or "grub-install (GRUB) 2" echo "$GVERSION" if ( [[ "$GSVERSION" =~ 0 ]] && [[ ! "$GRUBPACKAGE" = grub ]] ) \ || ( [[ ! "$GSVERSION" =~ 0 ]] && [[ "$GRUBPACKAGE" = grub ]] );then - ERROR=yes - echo "Wrong GRUB version detected. $PLEASECONTACT" + ERROR="Wrong GRUB version detected ($GSVERSION). $PLEASECONTACT"; echo "$ERROR" [[ "$GSVERSION" =~ 0 ]] && GRUBPACKAGE=grub [[ ! "$GSVERSION" =~ 0 ]] && GRUBPACKAGE=grub-pc fi [[ "$GSVERSION" =~ 0 ]] && ATA="" if [[ "$GRUBPACKAGE" =~ efi ]];then - [[ "$GSVERSION" =~ 0 ]] || [[ "$GSVERSION" =~ 1 ]] && [[ ! "$GVERSION" =~ "1.99-21ubuntu3.10" ]] && [[ ! "$GVERSION" =~ "1.99-21ubuntu3.14" ]] && [[ "$GRUBPACKAGE" =~ signed ]] \ + [ -d /sys/firmware/efi ] && echo "${CHROOTCMD}modprobe efivars $(LC_ALL=C ${CHROOTCMD}modprobe efivars)" #cf geole / ubuntu-fr + [[ "$GSVERSION" =~ 0 ]] || [[ "$GSVERSION" =~ 1 ]] && [[ ! "$GVERSION" =~ "1.99-21" ]] && [[ "$GRUBPACKAGE" =~ signed ]] \ && echo "GRUB too old for SecureBoot. Defaulting to grub-efi. $PLEASECONTACT" && GRUBPACKAGE=grub-efi echo " -efibootmgr -v from chroot before grub install" +${CHROOTCMD}efibootmgr -v before grub install" EFIBMGRBEF="$(LANGUAGE=C LC_ALL=C ${CHROOTCMD}efibootmgr -v)" echo "$EFIBMGRBEF -uname -r" +${CHROOTCMD}uname -r" RARINGK="$(LANGUAGE=C LC_ALL=C ${CHROOTCMD}uname -r)" - BUGGYK="" echo "$RARINGK" - [[ "$RARINGK" =~ 3.8.0-[1-9][0-9] ]] || [[ "$RARINGK" =~ 3.8.[1-9] ]] || [[ "$RARINGK" =~ 3.9.[0-9] ]] && BUGGYK=is-buggy - [[ "$BUGGYK" ]] && FUNCTION=buggy-kernel || FUNCTION=WinEFI +# BUGGYK="" +# [[ "$RARINGK" =~ 3.8.0-[1-9][0-9] ]] || [[ "$RARINGK" =~ 3.8.[1-9] ]] || [[ "$RARINGK" =~ 3.9.[0-9] ]] && BUGGYK=is-buggy +# [[ "$BUGGYK" ]] && FUNCTION=buggy-kernel || FUNCTION=WinEFI # if [[ ! "$WINEFI_BKP_ACTION" ]];then # OPTION="$Msefi_too" # repbg=yes @@ -228,31 +234,38 @@ # zenity --width=400 --question --title="$APPNAME2" --text="$FUNCTION_detected $Do_you_want_activate_OPTION $If_any_fail_try_other" 2>/dev/null || repbg=no # echo "$FUNCTION_detected $Do_you_want_activate_OPTION $repbg $If_any_fail_try_other" # start_pulse -# [[ "$repbg" = yes ]] && WINEFI_BKP_ACTION=rename-ms-efi && CREATE_BKP_ACTION=backup-and-rename-efi-files #fixes 1173423 +# [[ "$repbg" = yes ]] && WINEFI_BKP_ACTION=" rename-ms-efi" && CREATE_BKP_ACTION=backup-and-rename-efi-files #fixes 1173423 # fi GRUBSTAGEONE="" DEVGRUBSTAGEONE="" [[ "$GSVERSION" =~ 2 ]] && [[ "${ARCH_OF_PART[$USRPART]}" = 32 ]] && FORCEPARAM=" --efi-directory=/boot/efi --target=i386-efi" if [[ "${ARCH_OF_PART[$USRPART]}" = 64 ]];then [[ "$GSVERSION" =~ 2 ]] && FORCEPARAM=" --efi-directory=/boot/efi --target=x86_64-efi" - [[ "$GRUBPACKAGE" =~ signed ]] && FORCEPARAM="$FORCEPARAM --uefi-secure-boot" || FORCEPARAM="$FORCEPARAM --no-uefi-secure-boot" + if [[ "$GRUBPACKAGE" =~ signed ]];then + FORCEPARAM="$FORCEPARAM --uefi-secure-boot" + #elif [[ "$GVERSION" = "2.06~4~manjaro" ]] || [[ "$GVERSION" = "2.02~beta2" ]];then + # FORCEPARAM="$FORCEPARAM" #unrecognized option '--no-uefi-secure-boot' for 2.06~4~manjaro + #else + # FORCEPARAM="$FORCEPARAM --no-uefi-secure-boot" + fi fi [[ "$GVERSION" =~ "1.99-21ubuntu3.10" ]] && FORCEPARAM="$FORCEPARAM /dev/$NOFORCE_DISK" ATA="" + [[ "$CHROOTCMD" =~ /boot-sav/zfs ]] && fix_etc_default_grub_for_zfs reinstall_grubstageone echo " -efibootmgr -v from chroot after grub install" +${CHROOTCMD}efibootmgr -v after grub install" EFIBMGRAFT="$(LANGUAGE=C LC_ALL=C ${CHROOTCMD}efibootmgr -v)" - echo "$EFIBMGRAFT" - if [[ "$EFIBMGRBEF" = "$EFIBMGRAFT" ]];then - LSBRELIS="$(LANGUAGE=C LC_ALL=C ${CHROOTCMD}lsb_release -is)" - if [[ "$(echo "$EFIBMGRAFT" | grep -i "$LSBRELIS" )" ]];then - NVRAMUNCHANGED=yes && echo "Warning: NVram was not modified." - else - ERROR=yes; NVRAMLOCKED=yes && echo "Error: NVram is locked ($LSBRELIS not found in efibootmgr)." - fi - fi -elif [[ "$FORCE_GRUB" = force-in-PBR ]];then #http://paste.ubuntu.com/1063825 + echo "$EFIBMGRAFT" + if [[ "$EFIBMGRBEF" = "$EFIBMGRAFT" ]];then + LSBRELIS="$(LANGUAGE=C LC_ALL=C ${CHROOTCMD}lsb_release -is)" + if [[ "$(echo "$EFIBMGRAFT" | grep -i "$LSBRELIS" )" ]] || ( [[ "$LSBRELIS" =~ mint ]] && [[ "$(echo "$EFIBMGRAFT" | grep -i buntu )" ]] );then #coz mint uses efi/ubuntu/ folder + NVRAMUNCHANGED=yes && echo "Warning: NVram was not modified." + else + ERROR="Error: NVram is locked ($LSBRELIS not found in efibootmgr). $PLEASECONTACT"; NVRAMLOCKED=yes && echo "$ERROR" + fi + fi +elif [[ "$FORCE_GRUB" = force-in-PBR ]];then GRUBSTAGEONE="$FORCE_PARTITION" DEVGRUBSTAGEONE="/dev/$GRUBSTAGEONE" FORCEPARAM=" --force" @@ -268,16 +281,50 @@ fi } +fix_etc_default_grub_for_zfs() { +echo "${CHROOTCMD}grub-probe /boot" +LANGUAGE=C LC_ALL=C ${CHROOTCMD}grub-probe /boot +#echo "${CHROOTCMD}update-initramfs -c -k all" +#LANGUAGE=C LC_ALL=C ${CHROOTCMD}update-initramfs -c -k all +sed -i 's/#GRUB_CMDLINE_LINUX=/GRUB_CMDLINE_LINUX=/' "${BLKIDMNT_POINT[$REGRUB_PART]}/etc/default/grub" +sed -i 's/# GRUB_CMDLINE_LINUX=/GRUB_CMDLINE_LINUX=/' "${BLKIDMNT_POINT[$REGRUB_PART]}/etc/default/grub" +#Needed until grub becomes zfs compatible. https://openzfs.github.io/openzfs-docs/Getting%20Started/Debian/Debian%20Bullseye%20Root%20on%20ZFS.html#step-5-grub-installation +RTPL="$(zfs list | grep ROOT/ | grep v/zfs | grep -v zfs/ )" +RTPL="${RTPL%% *}" # eg. tmprpool/ROOT/ubuntu_64fs0l +if [[ "$LIVESESSION" = live ]];then #don't risk to break installed session + echo "Set GRUB_CMDLINE_LINUX=\"root=ZFS=${RTPL}\" in ${BLKIDMNT_POINT[$REGRUB_PART]}/etc/default/grub" + [[ "$TMP_FOLDER_TO_BE_CLEARED" ]] && rm -f $TMP_FOLDER_TO_BE_CLEARED/defgrub_new + while read line; do + if [[ "$line" =~ "GRUB_CMDLINE_LINUX=" ]];then + [[ ! "$line" =~ "#GRUB_CMDLINE_LINUX=" ]] && [[ ! "$line" =~ "# GRUB_CMDLINE_LINUX=" ]] && echo "#$line" >> $TMP_FOLDER_TO_BE_CLEARED/defgrub_new + echo "GRUB_CMDLINE_LINUX=\"root=ZFS=${RTPL}\"" >> $TMP_FOLDER_TO_BE_CLEARED/defgrub_new + else + echo "$line" >> $TMP_FOLDER_TO_BE_CLEARED/defgrub_new + fi + done < <(cat "${BLKIDMNT_POINT[$REGRUB_PART]}/etc/default/grub" ) + cp -f $TMP_FOLDER_TO_BE_CLEARED/defgrub_new "${BLKIDMNT_POINT[$REGRUB_PART]}/etc/default/grub" +else + echo "cat /etc/default/grub (filtered)" + cat /etc/default/grub | sed -e '/^$/d' -e '/#/d' +fi +echo "${CHROOTCMD}update-grub" +${CHROOTCMD}update-grub +} loop_install_grub_in_all_other_disks() { local n -echo " -==> Reinstall the GRUB of ${LISTOFPARTITIONS[$REGRUB_PART]} into MBRs of all disks (except live-disks and removable disks without OS)" INSTALLEDINOTHERDISKS="" +#&& [[ "${LISTOFDISKS[$n]}" != "$BCKUPNOFORCE_DISK" ]] #equals [[ "$n" != "${DISKNB_PART[$BCKUPREGRUB_PART]}" ]] for ((n=1;n<=NBOFDISKS;n++)); do - [[ "${DISK_HASOS[$n]}" = has-os ]] || ( [[ "${USBDISK[$n]}" =~ no ]] && [[ "${MMCDISK[$n]}" =~ no ]] ) \ + if [[ "${DISK_HASOS[$n]}" != has-os ]] && ( [[ "${USBDISK[$n]}" =~ no ]] && [[ "${MMCDISK[$n]}" =~ no ]] ) \ && [[ "${USBDISK[$n]}" != liveusb ]] && [[ "${MMCDISK[$n]}" != livemmc ]] && [[ "$n" != "${DISKNB_PART[$BCKUPREGRUB_PART]}" ]] \ - && [[ "${LISTOFDISKS[$n]}" != "$BCKUPNOFORCE_DISK" ]] && INSTALLEDINOTHERDISKS=yes + && ( [[ "${GPT_DISK[$n]}" != is-GPT ]] || [[ "${BIOS_BOOT_DISK[$n]}" != no-BIOSboot ]] ) \ + && [[ "${REALWINONDISC[$n]}" = no-wind ]];then + INSTALLEDINOTHERDISKS=yes + echo " +==> Reinstall the GRUB of ${LISTOFPARTITIONS[$REGRUB_PART]} into MBRs of all disks without OS, except live-disks and USB/MMC disks." + break + fi done if [[ "$INSTALLEDINOTHERDISKS" ]];then if [[ "$REMOVABLEDISK" ]];then @@ -285,10 +332,12 @@ fix_grub_d fi for ((n=1;n<=NBOFDISKS;n++)); do - if [[ "${DISK_HASOS[$n]}" = has-os ]] || ( [[ "${USBDISK[$n]}" =~ no ]] && [[ "${MMCDISK[$n]}" =~ no ]] ) \ - && [[ "${USBDISK[$n]}" != liveusb ]] && [[ "${MMCDISK[$n]}" != livemmc ]] && [[ "$n" != "${DISKNB_PART[$BCKUPREGRUB_PART]}" ]];then - NOFORCE_DISK="${LISTOFDISKS[$n]}" - [[ "$NOFORCE_DISK" != "$BCKUPNOFORCE_DISK" ]] && reinstall_grub + if [[ "${DISK_HASOS[$n]}" != has-os ]] && ( [[ "${USBDISK[$n]}" =~ no ]] && [[ "${MMCDISK[$n]}" =~ no ]] ) \ + && [[ "${USBDISK[$n]}" != liveusb ]] && [[ "${MMCDISK[$n]}" != livemmc ]] && [[ "$n" != "${DISKNB_PART[$BCKUPREGRUB_PART]}" ]] \ + && ( [[ "${GPT_DISK[$n]}" != is-GPT ]] || [[ "${BIOS_BOOT_DISK[$n]}" != no-BIOSboot ]] ) \ + && [[ "${REALWINONDISC[$n]}" = no-wind ]];then + NOFORCE_DISK="${LISTOFDISKS[$n]}" #name of the non-removable disk on which we install grub in the mbr + reinstall_grub fi done fi @@ -305,26 +354,26 @@ if [[ ! "$NOW_IN_OTHER_DISKS" ]];then if [[ "$(cat "$CATTEE" | grep FlexNet )" ]] \ || [[ "$(cat "$CATTEE" | grep 't known to reserve space' )" ]] || [[ "$BLANKEXTRA_ACTION" ]];then - if [[ ! "$BLANKEXTRA_ACTION" ]];then #http://paste.ubuntu.com/1058971 , http://paste.ubuntu.com/1060937, http://paste.ubuntu.com/1367610 + if [[ ! "$BLANKEXTRA_ACTION" ]];then #iso9660: http://askubuntu.com/questions/158299/why-does-installing-grub2-give-an-iso9660-filesystem-destruction-warning [[ "$(cat "$CATTEE" | grep 't known to reserve space' )" ]] && FUNCTION=Extra-MBR-space-error || FUNCTION=FlexNet update_translations - if [[ ! "$FORCEYES" ]];then - if [[ "$GUI" ]];then - end_pulse - zenity --width=400 --question --title="$APPNAME2" --text="$FUNCTION_detected $Please_backup_data $Do_you_want_to_continue" 2>/dev/null || repflex=no - start_pulse - else - read -r -p "$FUNCTION_detected $Please_backup_data $Do_you_want_to_continue [yes/no] " response - [[ ! "$response" =~ y ]] && repflex=no - fi - fi + if [[ ! "$FORCEYES" ]];then + if [[ "$GUI" ]];then + end_pulse + zenity --width=400 --question --title="$APPNAME2" --text="$FUNCTION_detected $Please_backup_data $Do_you_want_to_continue" 2>/dev/null || repflex=no + start_pulse + else + read -r -p "$FUNCTION_detected $Please_backup_data $Do_you_want_to_continue [yes/no] " response + [[ ! "$response" =~ y ]] && repflex=no + fi + fi fi if [[ "$repflex" = yes ]];then blankextraspace grubinstall else - ERROR=yes + ERROR="User cancelled $FUNCTION solving."; echo "$ERROR" fi fi if [[ "$(cat "$CATTEE" | grep recheck )" ]] || [[ "$(cat "$CATTEE" | grep 'device.map' )" ]];then @@ -350,53 +399,51 @@ LANGUAGE=C LC_ALL=C dd if=/dev/"$GRUBSTAGEONE" bs="${BYTES_PER_SECTOR[$GRUBSTAGEONENB]}" count=1 skip="$SKIPP" 2>/dev/null | hd if [[ ! "$(LANGUAGE=C LC_ALL=C dd if=/dev/"$GRUBSTAGEONE" bs="${BYTES_PER_SECTOR[$GRUBSTAGEONENB]}" count=1 skip="$SKIPP" 2>/dev/null | hd | grep PRIVHEAD )" ]] \ && [[ ! "$(LANGUAGE=C LC_ALL=C dd if=/dev/"$GRUBSTAGEONE" bs="${BYTES_PER_SECTOR[$GRUBSTAGEONENB]}" count=1 skip=6 2>/dev/null | hd | grep PRIVHEAD )" ]];then - echo "Error: no PRIVHEAD in 6th nor last sector. $PLEASECONTACT" - ERROR=yes + ERROR="Error: no PRIVHEAD in 6th nor last sector. $PLEASECONTACT"; echo "$ERROR" fi if [[ "$(LANGUAGE=C LC_ALL=C dd if=/dev/"$GRUBSTAGEONE" bs="${BYTES_PER_SECTOR[$GRUBSTAGEONENB]}" count=1 skip="$SKIPP" 2>/dev/null | hd | grep PRIVHEAD )" ]];then - if [[ ! "$FORCEYES" ]];then - if [[ "$GUI" ]];then - end_pulse - zenity --width=400 --question --title="$APPNAME2" --text="$FUNCTION_detected $Please_backup_data $Do_you_want_to_continue" 2>/dev/null || repldm=no - start_pulse - else - read -r -p "$FUNCTION_detected $Please_backup_data $Do_you_want_to_continue [yes/no] " response - [[ ! "$response" =~ y ]] && repldm=no - fi - fi + if [[ ! "$FORCEYES" ]];then + if [[ "$GUI" ]];then + end_pulse + zenity --width=400 --question --title="$APPNAME2" --text="$FUNCTION_detected $Please_backup_data $Do_you_want_to_continue" 2>/dev/null || repldm=no + start_pulse + else + read -r -p "$FUNCTION_detected $Please_backup_data $Do_you_want_to_continue [yes/no] " response + [[ ! "$response" =~ y ]] && repldm=no + fi + fi echo "$FUNCTION_detected $Please_backup_data $Do_you_want_to_continue $repldm" if [[ "$repldm" = yes ]];then echo "dd if=/dev/zero of=/dev/$GRUBSTAGEONE bs=${BYTES_PER_SECTOR[$GRUBSTAGEONENB]} seek=$SKIPP count=1" LANGUAGE=C LC_ALL=C dd if=/dev/zero of=/dev/"$GRUBSTAGEONE" bs="${BYTES_PER_SECTOR[$GRUBSTAGEONENB]}" seek="$SKIPP" count=1 2>/dev/null grubinstall else - ERROR=yes + ERROR="User cancelled $FUNCTION solving."; echo "$ERROR" fi fi if [[ "$(LANGUAGE=C LC_ALL=C dd if=/dev/"$GRUBSTAGEONE" bs="${BYTES_PER_SECTOR[$GRUBSTAGEONENB]}" count=1 skip=6 2>/dev/null | hd | grep PRIVHEAD )" ]];then echo "$PLEASECONTACT" - if [[ ! "$FORCEYES" ]];then - if [[ "$GUI" ]];then - end_pulse - zenity --width=400 --question --title="$APPNAME2" --text="$FUNCTION_detected This will delete the 6th sector of $GRUBSTAGEONE. $Do_you_want_to_continue" 2>/dev/null || repldm=no - start_pulse - else - read -r -p "$FUNCTION_detected This will delete the 6th sector of $GRUBSTAGEONE. $Do_you_want_to_continue [yes/no] " response - [[ ! "$response" =~ y ]] && repldm=no - fi - fi - echo "$FUNCTION_detected This will delete the 6th sector of $GRUBSTAGEONE. $Do_you_want_to_continue $repldm" + if [[ ! "$FORCEYES" ]];then + if [[ "$GUI" ]];then + end_pulse + zenity --width=400 --question --title="$APPNAME2" --text="$FUNCTION_detected This will delete the 6th sector of $GRUBSTAGEONE. $Do_you_want_to_continue" 2>/dev/null || repldm=no + start_pulse + else + read -r -p "$FUNCTION_detected This will delete the 6th sector of $GRUBSTAGEONE. $Do_you_want_to_continue [yes/no] " response + [[ ! "$response" =~ y ]] && repldm=no + fi + fi + echo "$FUNCTION_detected This will delete the 6th sector of $GRUBSTAGEONE. $Do_you_want_to_continue $repldm" if [[ "$repldm" = yes ]];then echo "dd if=/dev/zero of=/dev/$GRUBSTAGEONE bs=${BYTES_PER_SECTOR[$GRUBSTAGEONENB]} seek=6 count=1" LANGUAGE=C LC_ALL=C dd if=/dev/zero of=/dev/"$GRUBSTAGEONE" bs="${BYTES_PER_SECTOR[$GRUBSTAGEONENB]}" seek=6 count=1 2>/dev/null grubinstall else - ERROR=yes + ERROR="User cancelled $FUNCTION solving"; echo "$ERROR" fi fi else - echo "Error: bad parameters for LDM workaround. $PLEASECONTACT" - ERROR=yes + ERROR="Error: bad parameters for LDM workaround."; echo "$ERROR $PLEASECONTACT" fi elif [[ "$(cat "$CATTEE" | grep 'will not proceed with blocklists' )" ]];then FORCEPARAM=" --force" #http://www.linuxquestions.org/questions/linux-newbie-8/problem-installing-fedora-17-in-dual-booting-with-windows-7-a-4175412439/page2.html @@ -406,16 +453,16 @@ FUNCTION=out-of-memory OPTION="$Ata_disk" update_translations - if [[ ! "$FORCEYES" ]];then - if [[ "$GUI" ]];then - end_pulse - zenity --width=400 --question --title="$APPNAME2" --text="$FUNCTION_detected $Do_you_want_activate_OPTION" 2>/dev/null || repoom=no - start_pulse - else - read -r -p "$FUNCTION_detected $Do_you_want_activate_OPTION [yes/no] " response - [[ ! "$response" =~ y ]] && repoom=no - fi - fi + if [[ ! "$FORCEYES" ]];then + if [[ "$GUI" ]];then + end_pulse + zenity --width=400 --question --title="$APPNAME2" --text="$FUNCTION_detected $Do_you_want_activate_OPTION" 2>/dev/null || repoom=no + start_pulse + else + read -r -p "$FUNCTION_detected $Do_you_want_activate_OPTION [yes/no] " response + [[ ! "$response" =~ y ]] && repoom=no + fi + fi echo "$FUNCTION_detected $Do_you_want_activate_OPTION $repoom" #http://paste.ubuntu.com/1041994 solved by ATA if [[ "$repoom" = yes ]];then @@ -448,9 +495,9 @@ for gg in /usr/sbin/ /usr/bin/ /sbin/ /bin/ /usr/sbin/lib*/*/*/ /usr/bin/lib*/*/*/ /sbin/lib*/*/*/ /bin/lib*/*/*/;do #not sure "type" is available in all distros for gi in grub-install grub2-install grub-install.unsupported;do if [[ -f "${BLKIDMNT_POINT[$REGRUB_PART]}$gg$gi" ]];then - ls -l "${BLKIDMNT_POINT[$REGRUB_PART]}$gg$gi" + LANG=C ls -l "${BLKIDMNT_POINT[$REGRUB_PART]}$gg$gi" chmod a+x "${BLKIDMNT_POINT[$REGRUB_PART]}$gg$gi" - ls -l "${BLKIDMNT_POINT[$REGRUB_PART]}$gg$gi" + LANG=C ls -l "${BLKIDMNT_POINT[$REGRUB_PART]}$gg$gi" fi done done @@ -468,8 +515,7 @@ [[ -f "$EFIDOFI/Microsoft/bootmgfw.efi" ]] && [[ "$REFI" ]] && echo "Restore /Microsoft/Boot/bootmgfw.efi" \ && mv "$EFIDOFI/Microsoft/bootmgfw.efi" "$EFIDOFI/Microsoft/Boot/bootmgfw.efi" done - #http://paste.ubuntu.com/1070906 , http://paste.ubuntu.com/1069331, http://paste.ubuntu.com/1196571 - BEFIDO="${BLKIDMNT_POINT[$EFIPART_TO_USE]}" #eg http://paste.ubuntu.com/1227221 + BEFIDO="${BLKIDMNT_POINT[$EFIPART_TO_USE]}" NEEDMENUUPDATE="" LOCKEDESP="" #https://bugs.launchpad.net/bugs/1090829 / https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1091477 @@ -481,11 +527,11 @@ if [[ "$(cat "$CATTEE" | grep 'Input/output')" ]] || [[ "$(cat "$CATTEE" | grep Read-only )" ]];then echo " rm -Rf /dev/${LISTOFPARTITIONS[$EFIPART_TO_USE]}/ubuntu .. fedora" - LANGUAGE=C LC_ALL=C rm -Rf /dev/${LISTOFPARTITIONS[$EFIPART_TO_USE]}/ubuntu - LANGUAGE=C LC_ALL=C rm -Rf /dev/${LISTOFPARTITIONS[$EFIPART_TO_USE]}/fedora + [[ "${OSNAME[$REGRUB_PART]}" =~ buntu ]] || [[ "${OSNAME[$REGRUB_PART]}" =~ int ]] && LANGUAGE=C LC_ALL=C rm -Rf /dev/${LISTOFPARTITIONS[$EFIPART_TO_USE]}/EFI/ubuntu + [[ "${OSNAME[$REGRUB_PART]}" =~ edora ]] && LANGUAGE=C LC_ALL=C rm -Rf /dev/${LISTOFPARTITIONS[$EFIPART_TO_USE]}/EFI/fedora grubinstall [[ "$(cat "$CATTEE" | grep 'Input/output')" ]] || [[ "$(cat "$CATTEE" | grep Read-only )" ]] \ - && ERROR=yes && LOCKEDESP=yes && echo " + && ERROR="Write-locked ESP. $PLEASECONTACT" && LOCKEDESP=yes && echo " $DASH (Write-locked ESP) dmesg: $(dmesg) @@ -493,17 +539,39 @@ $(cat /var/log/syslog)" fi fi + #https://ubuntuforums.org/showthread.php?t=2400234 + if [[ "$(cat "$CATTEE" | grep 'error: cannot open' | grep 'Not a directory' )" ]];then #grub-install: error: cannot open `/boot/efi/EFI/ubuntu/grubx64.efi': Not a directory. + echo "Not a directory error detected. Delete corresponding folder/file." #Hard to isolate 'ubuntu' coz of special character ` + [[ "$(cat "$CATTEE" | grep 'Not a directory' | grep /boot/efi/EFI/ubuntu )" ]] && echo "${CHROOTCMD}rm -Rf /boot/efi/EFI/ubuntu" \ + && LANGUAGE=C LC_ALL=C ${CHROOTCMD}rm -Rf /boot/efi/EFI/ubuntu + [[ "$(cat "$CATTEE" | grep 'Not a directory' | grep /boot/efi/EFI/fedora )" ]] && echo "${CHROOTCMD}rm -Rf /boot/efi/EFI/fedora" \ + && LANGUAGE=C LC_ALL=C ${CHROOTCMD}rm -Rf /boot/efi/EFI/fedora + grubinstall + [[ "$(cat "$CATTEE" | grep 'error: cannot open' | grep 'Not a directory' )" ]] && ERROR="Write-locked ESP, not a directory error. $PLEASECONTACT" && LOCKEDESP=yes + fi + EFIGRUBFILE="" for secureb in grub shim;do #Signed GRUB in priority if [[ "$GRUBPACKAGE" =~ sign ]] || [[ "$secureb" = grub ]];then #http://ubuntuforums.org/showthread.php?p=12376694#post12376694 - for z in "$BEFIDO/efi/"*/${secureb}*.efi "$BEFIDO/EFI/"*/${secureb}*.efi;do #http://paste.ubuntu.com/1382319 - #echo "(debug) $z" - [[ "$(echo "$z" | grep -v '*' | grep -vi Microsoft )" ]] && EFIGRUBFILE="$z" + for z in "$BEFIDO/efi/"*/${secureb}*.efi "$BEFIDO/EFI/"*/${secureb}*.efi;do + #Prefers efi file in folder corresponding to OS name. TODO: complete with main distribs (need to know in which folder they install grub*.efi) + if ( [[ "${OSNAME[$REGRUB_PART]}" =~ buntu ]] || [[ "${OSNAME[$REGRUB_PART]}" =~ int ]] && [[ "$z" =~ buntu ]] && ( [[ ! "$EFIGRUBFILE" =~ buntu ]] || [[ ! "$EFIGRUBFILE" =~ "$secureb" ]] )) \ + || ( [[ "${OSNAME[$REGRUB_PART]}" =~ edora ]] && [[ "$z" =~ edora ]] && ( [[ ! "$EFIGRUBFILE" =~ edora ]] || [[ ! "$EFIGRUBFILE" =~ "$secureb" ]] )) \ + || ( [[ "${OSNAME[$REGRUB_PART]}" =~ rch ]] && [[ "$z" =~ rch ]] && ( [[ ! "$EFIGRUBFILE" =~ rch ]] || [[ ! "$EFIGRUBFILE" =~ "$secureb" ]] )) \ + || ( [[ "${OSNAME[$REGRUB_PART]}" =~ use ]] && [[ "$z" =~ use ]] && ( [[ ! "$EFIGRUBFILE" =~ use ]] || [[ ! "$EFIGRUBFILE" =~ "$secureb" ]] )) \ + || ( [[ "${OSNAME[$REGRUB_PART]}" =~ ebian ]] && ( [[ "$z" =~ ebian ]] || [[ "$z" =~ sid ]] ) && ( [[ ! "$EFIGRUBFILE" =~ ebian ]] && [[ ! "$EFIGRUBFILE" =~ sid ]] || [[ ! "$EFIGRUBFILE" =~ "$secureb" ]] )) \ + || ( [[ "${OSNAME[$REGRUB_PART]}" =~ at ]] && [[ "$z" =~ at ]] && ( [[ ! "$EFIGRUBFILE" =~ at ]] || [[ ! "$EFIGRUBFILE" =~ "$secureb" ]] )) \ + || ( [[ "${OSNAME[$REGRUB_PART]}" =~ ali ]] && [[ "$z" =~ ali ]] && ( [[ ! "$EFIGRUBFILE" =~ ali ]] || [[ ! "$EFIGRUBFILE" =~ "$secureb" ]] )) \ + || ( [[ "${OSNAME[$REGRUB_PART]}" =~ op ]] && [[ "$z" =~ op ]] && ( [[ ! "$EFIGRUBFILE" =~ op ]] || [[ ! "$EFIGRUBFILE" =~ "$secureb" ]] )) \ + || ( [[ "$(echo "${OSNAME[$REGRUB_PART]}" | sed -e '/buntu/d' -e '/int/d' -e '/edora/d' -e '/rch/d' -e '/use/d' -e '/ebian/d' -e '/at/d' -e '/ali/d' -e '/op/d' )" ]] \ + && [[ "$(echo "$z" | sed -e '/buntu/d' -e '/int/d' -e '/edora/d' -e '/rch/d' -e '/use/d' -e '/ebian/d' -e '/sid/d' -e '/at/d' -e '/ali/d' -e '/op/d' )" ]] && [[ ! "$EFIGRUBFILE" =~ "$secureb" ]] ) ;then + [[ "$(echo "$z" | grep -v '*' | grep -vi Microsoft | grep -vi "efi/Boot/$secureb" )" ]] && EFIGRUBFILE="$z" + fi done fi done - ### Copies EFI/Ubuntu/grubx64.efi (and shim) to all ESPs. + ### Copies EFI/Ubuntu/grubx64.efi (and shim) to all ESPs. if [[ "$EFIGRUBFILE" ]];then EFIGRUBFILESHORT="${EFIGRUBFILE#*$BEFIDO/}" EFIGRUBFILESHORT="${EFIGRUBFILESHORT#*/}" #eg ubuntu/shimx64.efi @@ -528,11 +596,10 @@ fi done else - ERROR=yes && echo "Error: no grub*.efi generated. $PLEASECONTACT -" + ERROR="Error: no grub*.efi generated for ${OSNAME[$REGRUB_PART]}. $PLEASECONTACT"; echo "$ERROR" fi - ######### WINEFI_BKP_ACTION and CREATE_BKP_ACTION (efi files renaming) + ######### WINEFI_BKP_ACTION and CREATE_BKP_ACTION (efi files renaming) #/efi/ubuntu/grubx64.efi, grubia32.efi http://forum.ubuntu-fr.org/viewtopic.php?id=207366&p=69 MEMADDEDENTRY="" for tmprecov in 1 2 3 4;do @@ -604,47 +671,49 @@ done [[ "$DEBBUG" ]] && md5_efi_partition #debug fi - if [[ "$DEBBUG" = TODO ]];then ########### TODO: To be converted in an optional feature in the "GRUB Options" tab - #Workaround https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1024383 - echo "Add $EFIDO efi entries in $GRUBCUSTOM" - GRUBCUSTOM="${BLKIDMNT_POINT[$REGRUB_PART]}"/etc/grub.d/25_custom - [[ -f "$GRUBCUSTOM" ]] && echo "mv 25_custom" && mv "$GRUBCUSTOM" "$LOGREP/${LISTOFPARTITIONS[$REGRUB_PART]}/25_custom" - for WINORMAC in Microsoft Boot MacOS Other;do #Other: http://ubuntuforums.org/showthread.php?p=12421487#post12421487 - if [[ "$WINORMAC" = MacOS ]];then - for z in "$EFIDOFI"*/{,*/}*/*.scap;do - [[ ! "$z" =~ '*' ]] && add_custom_efi - done - else - for priorityefi in 1 2;do - for z in "$EFIDOFI"*/{,*/}*.efi;do - ZFOLD="${z%/*}" - ZFICHEND="${z##*/}" - ZNEWFIL="$ZFOLD/bkp$ZFICHEND" - if ( [[ "$priorityefi" = 1 ]] && [[ "${ZFICHEND%%p*}" = bk ]] ) \ - || ( [[ "$priorityefi" = 2 ]] && [[ "${ZFICHEND%%p*}" != bk ]] && [[ ! -f "$ZNEWFIL" ]] ) \ - && [[ ! "$z" =~ '*' ]] && [[ ! -f "$z".grb ]] \ - && [[ ! "$z" =~ memtest.efi ]] && [[ ! "$z" =~ grub ]] && [[ ! "$z" =~ shim ]] \ - && ( [[ "$z" =~ "$EFIDOFI$WINORMAC" ]] || [[ "$WINORMAC" = Other ]] ) \ - && [[ ! "$z" =~ bootmgr.efi ]];then #http://ubuntuforums.org/showpost.php?p=12114780&postcount=18 - [[ "$(grep "$z,$efitmp;" <<< "$MEMADDEDENTRY")" ]] \ - && echo "${LISTOFPARTITIONS[$efitmp]}/$ZFICHEND already added" || add_custom_efi - fi - done - done - fi - done - fi + if [[ "$DEBBUG" = TODO ]];then ########### TODO: To be converted in an optional feature in the "GRUB Options" tab + #Workaround https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1024383 + echo "Add $EFIDO efi entries in $GRUBCUSTOM" + GRUBCUSTOM="${BLKIDMNT_POINT[$REGRUB_PART]}"/etc/grub.d/25_custom + [[ -f "$GRUBCUSTOM" ]] && echo "mv 25_custom" && mv "$GRUBCUSTOM" "$LOGREP/${LISTOFPARTITIONS[$REGRUB_PART]}/25_custom" + for WINORMAC in Microsoft Boot MacOS Other;do #Other: http://ubuntuforums.org/showthread.php?p=12421487#post12421487 + if [[ "$WINORMAC" = MacOS ]];then + for z in "$EFIDOFI"*/{,*/}*/*.scap;do + [[ ! "$z" =~ '*' ]] && add_custom_efi + done + else + for priorityefi in 1 2;do + for z in "$EFIDOFI"*/{,*/}*.efi;do + ZFOLD="${z%/*}" + ZFICHEND="${z##*/}" + ZNEWFIL="$ZFOLD/bkp$ZFICHEND" + if ( [[ "$priorityefi" = 1 ]] && [[ "${ZFICHEND%%p*}" = bk ]] ) \ + || ( [[ "$priorityefi" = 2 ]] && [[ "${ZFICHEND%%p*}" != bk ]] && [[ ! -f "$ZNEWFIL" ]] ) \ + && [[ ! "$z" =~ '*' ]] && [[ ! -f "$z".grb ]] \ + && [[ ! "$z" =~ memtest.efi ]] && [[ ! "$z" =~ grub ]] && [[ ! "$z" =~ shim ]] \ + && ( [[ "$z" =~ "$EFIDOFI$WINORMAC" ]] || [[ "$WINORMAC" = Other ]] ) \ + && [[ ! "$z" =~ bootmgr.efi ]];then #http://ubuntuforums.org/showpost.php?p=12114780&postcount=18 + [[ "$(grep "$z,$efitmp;" <<< "$MEMADDEDENTRY")" ]] \ + && echo "${LISTOFPARTITIONS[$efitmp]}/$ZFICHEND already added" || add_custom_efi + fi + done + done + fi + done + fi fi done done [[ "$NEEDMENUUPDATE" ]] && grubinstall fi if [[ "$GI_EXITCODE" != 0 ]];then - echo " ----- Grub-install recheck" - grubinstall_recheck - echo "---- End of grub-install recheck -" + if [[ "$GRUBPACKAGE" =~ efi ]];then + grubinstall_recheck + [[ "$GI_EXITCODE" != 0 ]] && grubinstall_nonvram + else + grubinstall_recheck + [[ "$GI_EXITCODE" != 0 ]] && ERROR="--recheck exit code: $GI_EXITCODE $PLEASECONTACT" && echo "$ERROR" + fi fi fi } @@ -664,7 +733,7 @@ echo "Warning: no grub*.efi in same folder as shim. $PLEASECONTACT " fi -fi +fi } @@ -679,7 +748,7 @@ cp /etc/resolv.conf "${BLKIDMNT_POINT[$REGRUB_PART]}/etc/resolv.conf" # Required to connect to the Internet. fi [[ "$GUI" ]] && echo "SET@_label0.set_text('''Purge ${LISTOFPARTITIONS[$REGRUB_PART]} (dep). $This_may_require_several_minutes''')" - repair_dep "$REGRUB_PART" + #repair_dep "$REGRUB_PART" update_cattee aptget_update_function fi @@ -697,7 +766,7 @@ if [[ "$WINORMAC" = Other ]];then EFILABEL="${EFIFIL#*/}" else - if [[ "$EFILABEL" =~ bootmgfw.efi ]];then #http://paste.ubuntu.com/1308398 + if [[ "$EFILABEL" =~ bootmgfw.efi ]];then [[ "${RECOV[$efitmp]}" = recovery-or-hidden ]] && EFILABEL=recovery || EFILABEL=loader elif [[ "${RECOV[$efitmp]}" = recovery-or-hidden ]];then EFILABEL="recovery ${EFIFIL##*/}" @@ -727,21 +796,29 @@ grubinstall() { -update_cattee #eg 2 efi updates: http://paste.ubuntu.com/1547330 +update_cattee echo " -${GRUBTYPE_OF_PART[$USRPART]}$FORCEPARAM$RECHECK$ATA $DEVGRUBSTAGEONE" +${CHROOTCMD}${GRUBTYPE_OF_PART[$USRPART]}$FORCEPARAM$RECHECK$ATA $DEVGRUBSTAGEONE" LANGUAGE=C LC_ALL=C $CHROOTCMD${GRUBTYPE_OF_PART[$USRPART]}$FORCEPARAM$RECHECK$ATA $DEVGRUBSTAGEONE GI_EXITCODE="$?" [[ "$GI_EXITCODE" != 0 ]] && echo "Exit code: $GI_EXITCODE" } grubinstall_recheck() { -update_cattee #eg 2 efi updates: http://paste.ubuntu.com/1547330 +update_cattee echo " -${GRUBTYPE_OF_PARTZ[$USRPART]}$FORCEPARAM$ATA --recheck $DEVGRUBSTAGEONE" +${CHROOTCMD}${GRUBTYPE_OF_PARTZ[$USRPART]}$FORCEPARAM$ATA --recheck $DEVGRUBSTAGEONE" LANGUAGE=C LC_ALL=C $CHROOTCMD${GRUBTYPE_OF_PARTZ[$USRPART]}$FORCEPARAM$ATA --recheck $DEVGRUBSTAGEONE GI_EXITCODE="$?" -[[ "$GI_EXITCODE" != 0 ]] && echo "Exit code: $GI_EXITCODE" && ERROR=yes +} + +grubinstall_nonvram() { +update_cattee +echo " +${CHROOTCMD}${GRUBTYPE_OF_PARTZ[$USRPART]}$FORCEPARAM$ATA --no-nvram $DEVGRUBSTAGEONE" +LANGUAGE=C LC_ALL=C $CHROOTCMD${GRUBTYPE_OF_PARTZ[$USRPART]}$FORCEPARAM$ATA --no-nvram $DEVGRUBSTAGEONE +GI_EXITCODE="$?" +[[ "$GI_EXITCODE" != 0 ]] && ERROR="--no-nvram exit code: $GI_EXITCODE $PLEASECONTACT" && echo "$ERROR" } grub_mkconfig_main() { @@ -751,9 +828,8 @@ UPDATEYES="" grub_mkconfig fi -if [[ "$(cat "$CATTEE" | grep 'error:' )" ]];then #eg http://paste.ubuntu.com/1097173 http://paste.ubuntu.com/1306993 - ERROR=yes -fi +#exclude 'error: cannot find a GRUB drive' because false-positive on ESPs. +[[ "$(cat "$CATTEE" | grep 'error:' | grep -v 'error: cannot find a GRUB drive' | grep -v 'grub-probe: error: failed to get canonical path' )" ]] && ERROR="Error detected in grub_mkconfig. $PLEASECONTACT" for z in grub grub2;do #Set Windows as default OS if [[ -f "${BLKIDMNT_POINT[$REGRUB_PART]}"/boot/$z/grub.cfg ]] && [[ "$CHANGEDEFAULTOS" ]];then r="$(cat "${BLKIDMNT_POINT[$REGRUB_PART]}/boot/$z/grub.cfg" | grep -i windows | grep menuentry | grep -v '#' )" @@ -808,7 +884,7 @@ if [[ ! "$FEDORA_DETECTED" ]];then for ((fuopimerg=1;fuopimerg<=NBOFPARTITIONS;fuopimerg++)); do if [[ "${PART_WITH_OS[$fuopimerg]}" = is-os ]] && [[ "${BLKIDMNT_POINT[$fuopimerg]}" ]] \ - && [[ "${BLKIDMNT_POINT[$fuopimerg]}" != /boot ]] && [[ "${BLKIDMNT_POINT[$fuopimerg]}" != /usr ]] \ + && [[ "${BLKIDMNT_POINT[$fuopimerg]}" != /boot ]] && [[ "${BLKIDMNT_POINT[$fuopimerg]}" != /usr ]] && [[ ! "${BLKIDMNT_POINT[$fuopimerg]}" =~ /zfs ]] \ && [[ ! "${OSNAME[$fuopimerg]}" =~ Fedora ]] && [[ ! "${OSNAME[$fuopimerg]}" =~ Arch ]] \ && [[ "$fuopimerg" != "$REGRUB_PART" ]] && [[ "${EFI_TYPE[$fuopimerg]}" = isnotESP ]];then umount "${BLKIDMNT_POINT[$fuopimerg]}" @@ -830,7 +906,7 @@ cp -r "${BLKIDMNT_POINT[$REGRUB_PART]}/boot" "${BLKIDMNT_POINT[$REGRUB_PART]}/boot_bak" mkdir -p "${BLKIDMNT_POINT[$REGRUB_PART]}/boot" fi - if [[ "$LIVESESSION" = live ]] || [[ "${BLKIDMNT_POINT[$BOOTPART_TO_USE]}" != /boot ]];then + if [[ "${BLKIDMNT_POINT[$BOOTPART_TO_USE]}" != "${BLKIDMNT_POINT[$REGRUB_PART]}/boot" ]];then umount "${BLKIDMNT_POINT[$BOOTPART_TO_USE]}" BLKIDMNT_POINT[$BOOTPART_TO_USE]="${BLKIDMNT_POINT[$REGRUB_PART]}/boot" echo "Mount ${LISTOFPARTITIONS[$BOOTPART_TO_USE]} on ${BLKIDMNT_POINT[$BOOTPART_TO_USE]}" @@ -838,16 +914,16 @@ fi fi [[ -d "${BLKIDMNT_POINT[$BOOTPART_TO_USE]}/boot" ]] && [[ ! -d "${BLKIDMNT_POINT[$BOOTPART_TO_USE]}/dev" ]] \ - && mv "${BLKIDMNT_POINT[$BOOTPART_TO_USE]}/boot" "${BLKIDMNT_POINT[$BOOTPART_TO_USE]}/boot_rm" #http://paste.ubuntu.com/1313675 + && mv "${BLKIDMNT_POINT[$BOOTPART_TO_USE]}/boot" "${BLKIDMNT_POINT[$BOOTPART_TO_USE]}/boot_rm" if [[ "$GRUBPACKAGE" =~ efi ]];then pkill pcmanfm #To avoid it automounts if [[ ! -d "${BLKIDMNT_POINT[$REGRUB_PART]}/boot/efi" ]];then mkdir -p "${BLKIDMNT_POINT[$REGRUB_PART]}/boot/efi" echo "Created ${LISTOFPARTITIONS[$REGRUB_PART]}/boot/efi" elif [[ "$(ls "${BLKIDMNT_POINT[$REGRUB_PART]}/boot/efi" )" ]];then - echo "${LISTOFPARTITIONS[$REGRUB_PART]}/boot/efi not empty" + echo "${LISTOFPARTITIONS[$REGRUB_PART]}/boot/efi not empty" fi - if [[ "$LIVESESSION" = live ]] || [[ "${BLKIDMNT_POINT[$EFIPART_TO_USE]}" != /boot/efi ]];then + if [[ "${BLKIDMNT_POINT[$EFIPART_TO_USE]}" != "${BLKIDMNT_POINT[$REGRUB_PART]}/boot/efi" ]];then umount "${BLKIDMNT_POINT[$EFIPART_TO_USE]}" BLKIDMNT_POINT[$EFIPART_TO_USE]="${BLKIDMNT_POINT[$REGRUB_PART]}/boot/efi" echo "Mount ${LISTOFPARTITIONS[$EFIPART_TO_USE]} on ${BLKIDMNT_POINT[$EFIPART_TO_USE]}" @@ -858,7 +934,7 @@ [[ ! "$aa" =~ ubuntu ]] && [[ ! "$aa" =~ mint ]] && echo "No ${LISTOFPARTITIONS[$REGRUB_PART]}/boot/efi/efi/ ubuntu/mint folder" fi fi - if [[ "$USE_SEPARATEUSRPART" ]] && [[ "$LIVESESSION" = live ]];then + if [[ "$USE_SEPARATEUSRPART" ]] && [[ "${BLKIDMNT_POINT[$USRPART_TO_USE]}" != "${BLKIDMNT_POINT[$REGRUB_PART]}/usr" ]];then pkill pcmanfm #To avoid it automounts umount "${BLKIDMNT_POINT[$USRPART_TO_USE]}" if [[ ! -d "${BLKIDMNT_POINT[$REGRUB_PART]}/usr" ]];then @@ -886,7 +962,7 @@ [[ "$GRUBPACKAGE" =~ efi ]] && umount "${BLKIDMNT_POINT[$REGRUB_PART]}/boot/efi" [[ "$USE_SEPARATEBOOTPART" ]] && umount "${BLKIDMNT_POINT[$REGRUB_PART]}/boot" [[ "$USE_SEPARATEUSRPART" ]] && umount "${BLKIDMNT_POINT[$REGRUB_PART]}/usr" - for w in run sys proc dev/pts dev; do umount "${BLKIDMNT_POINT[$REGRUB_PART]}/$w" ; done + for w in run sys proc dev/pts dev; do umount -lf "${BLKIDMNT_POINT[$REGRUB_PART]}/$w" ; done fi } @@ -897,13 +973,32 @@ if [[ "$LIVESESSION" = live ]];then [[ "$GUI" ]] && echo "SET@_label0.set_text('''$LAB (chroot). $This_may_require_several_minutes''')" local w - [[ ! -d "${BLKIDMNT_POINT[$REGRUB_PART]}/dev" ]] && mount /dev/${LISTOFPARTITIONS[$REGRUB_PART]} "${BLKIDMNT_POINT[$REGRUB_PART]}" \ - && echo "Mounted /dev/${LISTOFPARTITIONS[$REGRUB_PART]} on ${BLKIDMNT_POINT[$REGRUB_PART]}" \ - || echo "[debug] Already mounted /dev/${LISTOFPARTITIONS[$REGRUB_PART]} on ${BLKIDMNT_POINT[$REGRUB_PART]}" #debug error 127 - for w in dev dev/pts proc run sys; do - mkdir -p "${BLKIDMNT_POINT[$REGRUB_PART]}/$w" - mount -B /$w "${BLKIDMNT_POINT[$REGRUB_PART]}/$w" - done #ubuntuforums.org/showthread.php?t=1965163 + if [[ "${BLKIDMNT_POINT[$REGRUB_PART]}" =~ sav/zfs ]];then + #https://openzfs.github.io/openzfs-docs/Getting%20Started/Debian/Debian%20Bullseye%20Root%20on%20ZFS.html#rescuing-using-a-live-cd + for w in dev proc sys; do + mkdir -p "${BLKIDMNT_POINT[$REGRUB_PART]}/$w" + mount --make-private --rbind /$w "${BLKIDMNT_POINT[$REGRUB_PART]}/$w" + done + mount -t tmpfs tmpfs "${BLKIDMNT_POINT[$REGRUB_PART]}/run" + mkdir -p "${BLKIDMNT_POINT[$REGRUB_PART]}/run/lock" + chroot "${BLKIDMNT_POINT[$REGRUB_PART]}" mkdir -p /boot + chroot "${BLKIDMNT_POINT[$REGRUB_PART]}" mount /boot 2>/dev/null #in case a zfs distro has /boot in fstab + #chroot "${BLKIDMNT_POINT[$REGRUB_PART]}" mkdir -p /boot/grub + #chroot "${BLKIDMNT_POINT[$REGRUB_PART]}" mount /boot/grub + #chroot "${BLKIDMNT_POINT[$REGRUB_PART]}" mkdir -p /boot/efi + #chroot "${BLKIDMNT_POINT[$REGRUB_PART]}" mount /boot/efi + echo "chroot ${BLKIDMNT_POINT[$REGRUB_PART]} mount -a" + chroot "${BLKIDMNT_POINT[$REGRUB_PART]}" mount -a #mounts acc to fstab (e.g. jammy: sda2 on /boot/efi, and /boot/efi/grub on boot/grub) + echo "modprobe zfs $(modprobe zfs)" #cf geole + else + [[ ! -d "${BLKIDMNT_POINT[$REGRUB_PART]}/dev" ]] && mount /dev/${LISTOFPARTITIONS[$REGRUB_PART]} "${BLKIDMNT_POINT[$REGRUB_PART]}" \ + && echo "Mounted /dev/${LISTOFPARTITIONS[$REGRUB_PART]} on ${BLKIDMNT_POINT[$REGRUB_PART]}" \ + || echo "[debug] Already mounted /dev/${LISTOFPARTITIONS[$REGRUB_PART]} on ${BLKIDMNT_POINT[$REGRUB_PART]}" #debug error 127 + for w in dev dev/pts proc run sys; do + mkdir -p "${BLKIDMNT_POINT[$REGRUB_PART]}/$w" + mount -B /$w "${BLKIDMNT_POINT[$REGRUB_PART]}/$w" + done #ubuntuforums.org/showthread.php?t=1965163 + fi CHROOTCMD="chroot ${BLKIDMNT_POINT[$REGRUB_PART]} " CHROOTUSR="chroot \"${BLKIDMNT_POINT[$REGRUB_PART]}\" " #CHROOTCMD='chroot "${BLKIDMNT_POINT[$REGRUB_PART]}" ' diff -Nru boot-repair-4ppa123/usr/share/boot-sav/gui-actions-purge.sh boot-repair-4ppa200/usr/share/boot-sav/gui-actions-purge.sh --- boot-repair-4ppa123/usr/share/boot-sav/gui-actions-purge.sh 2020-03-15 13:14:14.000000000 +0000 +++ boot-repair-4ppa200/usr/share/boot-sav/gui-actions-purge.sh 2022-02-22 00:37:08.000000000 +0000 @@ -1,5 +1,5 @@ #! /bin/bash -# Copyright 2020 Yann MRN +# Copyright 2021 Yann MRN # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published @@ -83,7 +83,7 @@ # Pre-download the packages before purging them (security in case of internet failure just after purge) #if [[ "$GRUBPACKAGE" = grub2 ]] || [[ "$GRUBPACKAGE" = grub-pc ]];then # check_deb_install_feasibility "grub-gfxpayload-lists grub-pc grub-pc-bin grub2-common" - #elif [[ "$GRUBPACKAGE" = grub-efi ]];then + #elif [[ "$GRUBPACKAGE" =~ efi ]];then # check_deb_install_feasibility "efibootmgr grub-efi-ia32 grub-efi-amd64 grub-efi-ia32-bin grub-efi-amd64-bin" #fi #check_deb_install_feasibility "$GRUBPACKAGE grub-common ucf debconf" @@ -99,32 +99,49 @@ [[ "$GUI" ]] && echo 'SET@_hbox_kernelpurgebuttons.hide()'; [[ "$GUI" ]] && echo 'SET@_hbox_grubpurgebuttons.show()' if [[ "${GRUBTYPE_OF_PART[$USRPART]}" != nogrubinstall ]];then - GPURGEPACKS='grub*-common' #on 14.04 , if grub*, then E: Unable to locate package grub-reinstall_programs, - #+ bug#1405174 obsolete since grub-common:i386 absent from xenial https://forum.ubuntu-fr.org/viewtopic.php?id=2049789 - [[ -d "${BLKIDMNT_POINT[$USRPART]}/usr/share/lupin-support" ]] \ - || [[ -d "${BLKIDMNT_POINT[$USRPART]}/share/lupin-support" ]] && GPURGEPACKS="$GPURGEPACKS lupin-s*" - testvalidsource shim-signed - [[ "$VALIDSOURCE" ]] && GPURGEPACKS="$GPURGEPACKS shim-signed" - #testvalidsource linux-signed-generic - #[[ "$VALIDSOURCE" ]] && GPURGEPACKS="$GPURGEPACKS linux-signed*" - COMMAND="sudo $CHROOTUSR${APTTYP[$USRPART]} ${PURGETYP[$USRPART]} ${YESTYP[$USRPART]} $GPURGEPACKS" - add_dpkgconf_to_command - echo "Please type: $COMMAND" - if [[ "$GUI" ]];then - echo 'SET@_image_purgegrub.show()'; echo 'SET@_image_installgrub.hide()' - echo 'SET@_button_cancelpurgegrub.show()'; echo 'SET@_button_nextpurgegrub.show()' - echo 'SET@_button_abortinstallgrub.hide()';echo 'SET@_button_nextinstallgrub.hide()' - [[ "$SEVERALCOMMANDS" ]] && echo "SET@_label8.set_text('''$Please_open_a_terminal_then_type_the_following_commands''')" \ - || echo "SET@_label8.set_text('''$Please_open_a_terminal_then_type_the_following_command''')" - echo "SET@_label9.set_text('''$COMMAND''')" - if [[ "${DOCGRUB[$USRPART]}" =~ pc ]] && [[ "$GRUBPACKAGE" != grub ]];then - echo "SET@_label10.set_text('''\\n$Then_choose_Yes_if_the_below_window_appears\\n''')" - echo 'SET@_image_purgegrub.show()' - else - echo "SET@_label10.set_text('''\\n''')" - echo 'SET@_image_purgegrub.hide()' - fi - fi + GPURGEPACKS="" + #on 14.04 , if grub*, then E: Unable to locate package grub-reinstall_programs, + if [[ "${APTTYP[$USRPART]}" ]];then + COMMAND="" + [[ -d "${BLKIDMNT_POINT[$USRPART]}/usr/share/lupin-support" ]] || [[ -d "${BLKIDMNT_POINT[$USRPART]}/share/lupin-support" ]] \ + && COMMAND="sudo ${CHROOTUSR}${APTTYP[$USRPART]} ${PURGETYP[$USRPART]} ${YESTYP[$USRPART]} lupin-s*\\n$COMMAND" + for ppack in grub2-common:* grub-common:* shim-signed grub2-com* grub-com* ;do + #[[ "$(sudo ${CHROOTUSR}${PACKVERTYP[$USRPART]} 'grub-common' 2>/dev/null)" ]] && GPURGEPACKS="$GPURGEPACKS grub-common" + COMMAND="sudo ${CHROOTUSR}${APTTYP[$USRPART]} ${PURGETYP[$USRPART]} ${YESTYP[$USRPART]} $ppack\\n$COMMAND" + #[[ "$(sudo ${CHROOTUSR}dpkg -l | grep 'grub2-common:')" ]] && GPURGEPACKS="$GPURGEPACKS grub2-common:*" + done + #+ bug#1405174 obsolete since grub-common:i386 absent from xenial https://forum.ubuntu-fr.org/viewtopic.php?id=2049789 + #testvalidsource linux-signed-generic + #[[ "$VALIDSOURCE" ]] && GPURGEPACKS="$GPURGEPACKS linux-signed*" + #COMMAND="sudo ${CHROOTUSR}${APTTYP[$USRPART]} ${PURGETYP[$USRPART]} ${YESTYP[$USRPART]}$GPURGEPACKS" + #[[ "${APTTYP[$USRPART]}" != apt-get ]] && COMMAND="sudo ${CHROOTUSR}${APTTYP[$USRPART]} ${PURGETYP[$USRPART]} ${YESTYP[$USRPART]}grub*-common:i386\\n$COMMAND" + add_dpkgconf_to_command + echo "Please type: $COMMAND" + if [[ "$GUI" ]];then + echo 'SET@_image_purgegrub.show()'; echo 'SET@_image_installgrub.hide()' + echo 'SET@_button_cancelpurgegrub.show()'; echo 'SET@_button_nextpurgegrub.show()' + echo 'SET@_button_abortinstallgrub.hide()'; echo 'SET@_button_nextinstallgrub.hide()' + [[ "$SEVERALCOMMANDS" ]] && echo "SET@_label8.set_text('''$Please_open_a_terminal_then_type_the_following_commands''')" \ + || echo "SET@_label8.set_text('''$Please_open_a_terminal_then_type_the_following_command''')" + echo "SET@_label9.set_text('''$COMMAND''')" + if [[ "${DOCGRUB[$USRPART]}" =~ pc ]] && [[ "$GRUBPACKAGE" != grub ]];then + echo "SET@_label10.set_text('''\\n$Then_choose_Yes_if_the_below_window_appears\\n''')" + echo 'SET@_image_purgegrub.show()' + else + echo "SET@_label10.set_text('''\\n''')" + echo 'SET@_image_purgegrub.hide()' + fi + fi + else + echo "Please purge grub*-common* packages from ${BLKIDMNT_POINT[$USRPART]}." + if [[ "$GUI" ]];then + echo 'SET@_image_purgegrub.show()'; echo 'SET@_image_installgrub.hide()' + echo 'SET@_button_cancelpurgegrub.show()'; echo 'SET@_button_nextpurgegrub.show()' + echo 'SET@_button_abortinstallgrub.hide()'; echo 'SET@_button_nextinstallgrub.hide()' + echo "SET@_label8.set_text('''Please purge grub*-common* packages from ${BLKIDMNT_POINT[$USRPART]}.''')" + echo "SET@_label9.set_text(''' ''')" + fi + fi PURGEDONE=yes else #GRUB already missing then_type_this_purge_command @@ -159,12 +176,13 @@ SEVERALCOMMANDS="" COMMAND="" OSPROBERABSENT=yes +EFIBOOTMGRABSENT=yes for gg in /usr/sbin/ /usr/bin/ /sbin/ /bin/;do - if [[ -f "${BLKIDMNT_POINT[$i]}${gg}os-prober" ]];then - OSPROBERABSENT="" - fi + [[ -f "${BLKIDMNT_POINT[$i]}${gg}os-prober" ]] && OSPROBERABSENT="" + [[ -f "${BLKIDMNT_POINT[$i]}${gg}efibootmgr" ]] && EFIBOOTMGRABSENT="" done [[ "$OSPROBERABSENT" ]] && [[ ! "$GRUBPACKAGE" =~ os-prober ]] && GRUBPACKAGE="$GRUBPACKAGE os-prober" +[[ "$EFIBOOTMGRABSENT" ]] && [[ ! "$GRUBPACKAGE" =~ efibootmgr ]] && [[ "$GRUBPACKAGE" =~ -efi ]] && GRUBPACKAGE="$GRUBPACKAGE efibootmgr" if [[ "$GRUBPACKAGE" =~ signed ]];then testvalidsource shim-signed [[ "$VALIDSOURCE" ]] && [[ ! "$GRUBPACKAGE" =~ shim-signed ]] && GRUBPACKAGE="$GRUBPACKAGE shim-signed" @@ -232,9 +250,14 @@ COMMAND="sudo $CHROOTUSR${APTTYP[$USRPART]} ${INSTALLTYP[$USRPART]} ${YESTYP[$USRPART]} mdadm\\n$COMMAND" fi fi +if [[ "$BLKID" =~ zfs ]];then + SEVERALCOMMANDS=yes + COMMAND="sudo $CHROOTUSR${APTTYP[$USRPART]} ${INSTALLTYP[$USRPART]} ${YESTYP[$USRPART]} zfsutils-linux\\n$COMMAND" +fi if [[ "${APTTYP[$USRPART]}" = apt-get ]];then SEVERALCOMMANDS=yes COMMAND="sudo ${CHROOTUSR}apt-get install -fy\\n$COMMAND" + #sudo apt --fix-broken install for gg in /usr/sbin/ /usr/bin/ /sbin/ /bin/;do if [[ -f "${BLKIDMNT_POINT[$i]}${gg}dpkg" ]];then COMMAND="sudo ${CHROOTUSR}dpkg --configure -a\\n$COMMAND" @@ -294,7 +317,7 @@ #Called by grub_purge & quit_purge restore_resolvconf_and_unchroot() { -restore_dep "$REGRUB_PART" +#restore_dep "$REGRUB_PART" if [[ "${LISTOFPARTITIONS[$REGRUB_PART]}" != "$CURRENTSESSIONPARTITION" ]] \ && [[ -f "${BLKIDMNT_POINT[$REGRUB_PART]}/etc/resolv.conf.old" ]];then rm -f "${BLKIDMNT_POINT[$REGRUB_PART]}/etc/resolv.conf" @@ -307,8 +330,8 @@ _button_nextpurgegrub() { check_part_types if [[ "${GRUBTYPE_OF_PART[$USRPART]}" != nogrubinstall ]];then - echo "$GRUB_is_still_present $Please_try_again" - [[ "$GUI" ]] && zenity --width=400 --warning --title="$APPNAME2" --text="$GRUB_is_still_present $Please_try_again" 2>/dev/null + echo "$GRUB_is_still_present $Please_try_again (purge grub* packages from ${BLKIDMNT_POINT[$USRPART]})" + [[ "$GUI" ]] && zenity --width=400 --warning --title="$APPNAME2" --text="$GRUB_is_still_present ${Please_try_again}\\n(purge grub* packages from ${BLKIDMNT_POINT[$USRPART]})" 2>/dev/null #[[ "$GUI" ]] && echo "SET@_label11.set_text('''\\n$GRUB_is_still_present $Please_try_again''')" #echo 'SET@_label11.show()'; sleep 3; echo 'SET@_label11.hide()' else @@ -355,7 +378,6 @@ ############################# PURGE KERNEL ############################# kernel_purge() { -#works: http://paste.ubuntu.com/1021100 title_gen "dpkg -l | grep linux- before kernel purge" ${CHROOTCMD}dpkg -l | grep linux- [[ "$GUI" ]] && echo "SET@_label0.set_text('''$Purge_and_reinstall_kernels ${LISTOFPARTITIONS[$REGRUB_PART]}. $This_may_require_several_minutes''')" @@ -378,7 +400,7 @@ echo "ls ${BLKIDMNT_POINT[$REGRUB_PART]}/boot/:$a" if [[ "$(ls "${BLKIDMNT_POINT[$REGRUB_PART]}/boot/" | grep vmlinuz )" ]] \ || [[ "$(ls "${BLKIDMNT_POINT[$REGRUB_PART]}/boot/" | grep initrd )" ]] \ - || [[ "$USE_SEPARATEBOOTPART" ]];then #debug of http://paste.ubuntu.com/1050940 + || [[ "$USE_SEPARATEBOOTPART" ]];then PACKSTOPURGE="linux-headers-* linux-image-*" #linux-signed* COMMAND="${APTTYP[$USRPART]} ${PURGETYP[$USRPART]} ${YESTYP[$USRPART]}" # if [[ "${APTTYP[$REGRUB_PART]}" = apt-get ]];then @@ -411,10 +433,16 @@ purge_cancelled() { #when [[ ! "$VALIDSOURCE" ]] or [[ "$DEBCHECK" = debNG ]] PACKKK=$1 #linux or $GRUBPACKAGE -ERROR=yes check_internet_connection text="" -if [[ "$(cat "$CATTEE" | grep 'dpkg --configure -a' )" ]];then +if [[ "$(cat "$CATTEE" | grep '/var/lib/dpkg' )" ]] && [[ "$LIVESESSION" = installed ]];then + text="$Please_open_a_terminal_then_type_the_following_command + +sudo dpkg --configure -a + +$Please_close_all_your_package_managers ($Software_Centre, \ +$Update_Manager, Synaptic, ...). $Then_try_again" +elif [[ "$(cat "$CATTEE" | grep '/var/lib/dpkg' )" ]] && [[ "$LIVESESSION" = live ]] || [[ "$(cat "$CATTEE" | grep 'dpkg --configure -a' )" ]];then FUNCTION=dpkg-error; update_translations text="$FUNCTION_detected $Please_open_a_terminal_then_type_the_following_command @@ -428,9 +456,6 @@ sudo ${CHROOTUSR}apt-get -f install $Then_close_this_window" -elif [[ "$(cat "$CATTEE" | grep '/var/lib/dpkg' )" ]];then - text="$Please_close_all_your_package_managers ($Software_Centre, \ -$Update_Manager, Synaptic, ...). $Then_try_again" elif [[ ! "$APTUPDTMP" =~ Hit ]] && [[ "$INTERNET" != connected ]];then text="$No_internet_connection_detected. $Please_connect_internet $Then_try_again" elif [[ ! "$VALIDSOURCE" ]];then @@ -438,7 +463,7 @@ text="$Please_enable_a_rep_for_PACKAGELIST_pack_in_DISTRO $Then_try_again" open_sources_editor & else - text="$1 purge cancelled. $PLEASECONTACT" + text="$1 purge cancelled." [[ "$DEBCHECK" != debNG ]] && text="Strange $text" fi echo " @@ -454,12 +479,9 @@ $DASH No valid source for $PACKKK in ${BLKIDMNT_POINT[$REGRUB_PART]}$slist :" SOURCESLIST="$(cat "${BLKIDMNT_POINT[$REGRUB_PART]}$slist")" echo "$SOURCESLIST" - for vv in trusty xenial bionic eoan focal;do - if [[ ! "$(echo "$SOURCESLIST" | grep "$vv" | grep main | grep -v "#" )" ]];then #Ubuntu only, must expand to other OSs - xdg-open "${BLKIDMNT_POINT[$REGRUB_PART]}$slist" & - break - fi - done + if [[ ! "$(echo "$SOURCESLIST" | grep main | grep -v "#" )" ]];then + xdg-open "${BLKIDMNT_POINT[$REGRUB_PART]}$slist" & + fi fi } diff -Nru boot-repair-4ppa123/usr/share/boot-sav/gui-actions.sh boot-repair-4ppa200/usr/share/boot-sav/gui-actions.sh --- boot-repair-4ppa123/usr/share/boot-sav/gui-actions.sh 2020-03-15 13:14:14.000000000 +0000 +++ boot-repair-4ppa200/usr/share/boot-sav/gui-actions.sh 2022-02-25 16:43:34.000000000 +0000 @@ -1,5 +1,5 @@ #! /bin/bash -# Copyright 2020 Yann MRN +# Copyright 2021 Yann MRN # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published @@ -37,9 +37,8 @@ [[ "$GUI" ]] && zenity --width=400 --error --text="Error : $MBR_TO_RESTORE could not be restored in $DISK_TO_RESTORE_MBR. $PLEASECONTACT" 2>/dev/null fi else - echo "Error : $LOGREP/$DISK_TO_RESTORE_MBR/current_mbr.img does not exist. $PLEASECONTACT" [[ "$GUI" ]] && zenity --width=400 --error --text="Error : $LOGREP/$DISK_TO_RESTORE_MBR/current_mbr.img does not exist. MBR could not be restored. $PLEASECONTACT" 2>/dev/null - ERROR=yes + ERROR="Error : $LOGREP/$DISK_TO_RESTORE_MBR/current_mbr.img does not exist. $PLEASECONTACT"; echo "$ERROR" fi } @@ -118,7 +117,7 @@ cp "${BLKIDMNT_POINT[$i]}/etc/default/grub" "$LOGREP/${LISTOFPARTITIONS[$i]}/etc_default_grub_new" MODIFDONE="" for word in $(cat "${BLKIDMNT_POINT[$i]}/etc/default/grub"); do - if [[ "$word" =~ "GRUB_TIMEOUT=" ]] && [[ "$word" != "GRUB_TIMEOUT=${UNHIDEBOOT_TIME}" ]];then + if [[ "$word" =~ "GRUB_TIMEOUT=" ]] && [[ ! "$word" =~ "#GRUB_TIMEOUT=" ]] && [[ "$word" != "GRUB_TIMEOUT=${UNHIDEBOOT_TIME}" ]];then sed -i "s/${word}.*/GRUB_TIMEOUT=${UNHIDEBOOT_TIME}/" "$LOGREP/${LISTOFPARTITIONS[$i]}/etc_default_grub_new" MODIFDONE=yes #Set timout to UNHIDEBOOT_TIME seconds elif [[ "$word" =~ "GRUB_HIDDEN_TIMEOUT=" ]] && [[ ! "$word" =~ "#GRUB_HIDDEN_TIMEOUT=" ]];then @@ -127,8 +126,18 @@ elif [[ "$word" =~ "GRUB_DISABLE_RECOVERY=" ]] && [[ ! "$word" =~ "#GRUB_DISABLE_RECOVERY=" ]];then sed -i "s/${word}.*/#${word}/" "$LOGREP/${LISTOFPARTITIONS[$i]}/etc_default_grub_new" MODIFDONE=yes #Comment GRUB_DISABLE_RECOVERY + elif [[ "$word" =~ "GRUB_TIMEOUT_STYLE=" ]] && [[ ! "$word" =~ "#GRUB_TIMEOUT_STYLE=" ]] && [[ ! "$word" =~ "GRUB_TIMEOUT_STYLE=menu" ]];then + sed -i "s/${word}.*/GRUB_TIMEOUT_STYLE=menu/" "$LOGREP/${LISTOFPARTITIONS[$i]}/etc_default_grub_new" + MODIFDONE=yes #Set GRUB_TIMEOUT_STYLE to menu (generally instead of hidden) + elif [[ "$word" =~ "GRUB_DISABLE_OS_PROBER=" ]] && [[ "$word" != "GRUB_DISABLE_OS_PROBER=false" ]];then + sed -i "s/${word}.*/GRUB_DISABLE_OS_PROBER=false/" "$LOGREP/${LISTOFPARTITIONS[$i]}/etc_default_grub_new" + MODIFDONE=yes #Set GRUB_DISABLE_OS_PROBER to false fi done + if [[ ! "$(cat "$LOGREP/${LISTOFPARTITIONS[$i]}/etc_default_grub_new" | grep 'GRUB_DISABLE_OS_PROBER=false' )" ]];then + echo "GRUB_DISABLE_OS_PROBER=false" >> "$LOGREP/${LISTOFPARTITIONS[$i]}/etc_default_grub_new" + MODIFDONE=yes + fi if [[ -f "$LOGREP/${LISTOFPARTITIONS[$i]}/etc_default_grub_new" ]] && [[ "$MODIFDONE" = yes ]];then #Security echo " Unhide GRUB boot menu in ${LISTOFPARTITIONS[$i]}/etc/default/grub" @@ -142,7 +151,6 @@ fi fi done -[[ "${DISABLE_OS[$REGRUB_PART]}" ]] && sed -i "s/GRUB_DISABLE_OS/#GRUB_DISABLE_OS/" "${BLKIDMNT_POINT[$REGRUB_PART]}/etc/default/grub" } unhide_boot_menus_grubcfg() { @@ -214,12 +222,32 @@ DISKTOFLAG="${DISK_PART[$PARTTOBEFLAGGED]}" #sdX [[ ! "$(echo "$FDISKL" | grep '*' | grep "/$temp " )" ]] \ && echo "parted /dev/$DISKTOFLAG set $PRIMARYNUM boot on" && parted /dev/$DISKTOFLAG set $PRIMARYNUM boot on -for r in 1 2 3 4;do #http://paste.ubuntu.com/1111263 +for r in 1 2 3 4;do [[ "$(echo "$FDISKL" | grep '*' | grep "/$DISKTOFLAG$r " )" ]] && [[ "$r" != "$PRIMARYNUM" ]] \ && echo "parted /dev/$DISKTOFLAG set $r boot off" && parted /dev/$DISKTOFLAG set $r boot off done #Don't work if "Can't have a partition outside the disk!" http://ubuntuforums.org/showpost.php?p=12179704&postcount=23 } +############################# REMOVE HIDDEN FLAG ################################# +remove_hiddenflag() { +local PARTTOUNFLAG=$1 PARTB PRIMARYNUM DISKTOUNFLAG userok=yes +PARTB=${LISTOFPARTITIONS[$PARTTOUNFLAG} #sdXY +PRIMARYNUM="${PARTB##*[a-z]}" #Y (1~4) of sdXY +DISKTOUNFLAG="${DISK_PART[$PARTTOUNFLAG]}" #sdX +update_translations +text="$Do_u_wanna_remove_hidden_flag_from_PARTB" +if [[ "$GUI" ]];then + echo "$text" + end_pulse + zenity --width=400 --question --title="$APPNAME2" --text="$text" 2>/dev/null || userok="" + start_pulse +else + read -r -p "$text [yes/no] " response + [[ ! "$response" =~ y ]] && userok="" +fi +[[ "$userok" ]] && echo "parted /dev/$DISKTOUNFLAG set $PRIMARYNUM hidden off" && parted /dev/$DISKTOFLAG set $PRIMARYNUM hidden off 2>/dev/null +} + ##################### REPAIR WINDOWS ################################ repair_boot_ini() { SYSTEM1=Windows @@ -229,7 +257,7 @@ [[ "$DEBBUG" ]] && echo "[debug]repair_boot_ini (solves bug#923374)" echo "Quantity of real Windows: $QUANTITY_OF_REAL_WINDOWS" for ((i=1;i<=NBOFPARTITIONS;i++)); do #http://ubuntuforums.org/showthread.php?p=12210940#post12210940 - if [[ "${WINXPTOREPAIR[$i]}" ]] && [[ "$QUANTITY_OF_REAL_WINDOWS" = 1 ]];then #eg http://paste.ubuntu.com/999367 + if [[ "${WINXPTOREPAIR[$i]}" ]] && [[ "$QUANTITY_OF_REAL_WINDOWS" = 1 ]];then part=${LISTOFPARTITIONS[$i]} #sdXY disk="${DISK_PART[$i]}" #sdX num="${part##*[a-z]}" #Y of sdXY @@ -264,9 +292,8 @@ echo "Detected $BOOTPINI.bak" fi fi - for file in ntldr NTDETECT.COM;do #http://paste.ubuntu.com/997227 - if [[ ! "$(ls ${BLKIDMNT_POINT[$i]}/ | grep -ix $file )" ]] \ - && [[ "$QUANTITY_OF_REAL_WINDOWS" = 1 ]];then #http://paste.ubuntu.com/996163 + for file in ntldr NTDETECT.COM;do + if [[ ! "$(ls ${BLKIDMNT_POINT[$i]}/ | grep -ix $file )" ]] && [[ "$QUANTITY_OF_REAL_WINDOWS" = 1 ]];then for ((j=1;j<=NBOFPARTITIONS;j++)); do if [[ "$(ls ${BLKIDMNT_POINT[$j]}/ | grep -ix $file )" ]];then filetocopy="$(ls ${BLKIDMNT_POINT[$j]} | grep -ix $file )" @@ -276,7 +303,7 @@ fi done [[ ! "$(ls ${BLKIDMNT_POINT[$i]}/ | grep -ix $file )" ]] && repair_boot_ini_nonfree - [[ ! "$(ls ${BLKIDMNT_POINT[$i]}/ | grep -ix $file )" ]] && ERROR=yes + [[ ! "$(ls ${BLKIDMNT_POINT[$i]}/ | grep -ix $file )" ]] && ERROR="No ntldr nor NTDETECT could be created in ${LISTOFPARTITIONS[$i]}. $PLEASECONTACT" fi done fi @@ -328,17 +355,6 @@ done } - -####################### OPEN etc/default/grub ########################## -_button_open_etc_default_grub() { -if [[ -f "${BLKIDMNT_POINT[$REGRUB_PART]}/etc/default/grub" ]];then - xdg-open "${BLKIDMNT_POINT[$REGRUB_PART]}/etc/default/grub" & -else - echo "${BLKIDMNT_POINT[$REGRUB_PART]}/etc/default/grub does not exist. Please choose the [Purge and reinstall] option." - [[ "$GUI" ]] && zenity --width=400 --info --title="$APPNAME2" --text="${BLKIDMNT_POINT[$REGRUB_PART]}/etc/default/grub does not exist. Please choose the [Purge and reinstall] option." 2>/dev/null -fi -} - ################################ ADD KERNEL ############################ add_kernel_option() { echo "add_kernel_option CHOSEN_KERNEL_OPTION is : $CHOSEN_KERNEL_OPTION" @@ -348,6 +364,7 @@ [[ "$TMP_FOLDER_TO_BE_CLEARED" ]] && rm -f $TMP_FOLDER_TO_BE_CLEARED/grub_new while read line; do if [[ "$line" =~ "GRUB_CMDLINE_LINUX_DEFAULT=" ]];then + [[ ! "$line" =~ "#GRUB_CMDLINE_LINUX_DEFAULT=" ]] && [[ ! "$line" =~ "# GRUB_CMDLINE_LINUX_DEFAULT=" ]] && echo "#$line" >> $TMP_FOLDER_TO_BE_CLEARED/grub_new echo "${line%\"*} ${CHOSEN_KERNEL_OPTION}\"" >> $TMP_FOLDER_TO_BE_CLEARED/grub_new else echo "$line" >> $TMP_FOLDER_TO_BE_CLEARED/grub_new @@ -377,8 +394,7 @@ $cmd 2>/dev/null if [[ ! -f "$LOGREP/$GRUBSTAGEONE/before_wiping.img" ]] \ || [[ ! "$(ls "/sys/block/$GRUBSTAGEONE/" | grep "$GRUBSTAGEONE")" ]];then - echo "Could not backup, wipe cancelled." - ERROR=yes + ERROR="Could not backup, wipe cancelled. $PLEASECONTACT"; echo "$ERROR" else echo "WIPE $GRUBSTAGEONE : $SECTORS_TO_WIPE sectors * $BYTES_PER_SECTOR bytes" if [[ "$SECTORS_TO_WIPE" -gt 0 ]] && [[ "$SECTORS_TO_WIPE" -le 2048 ]] && [[ "$BYTES_PER_SECTOR" -ge 512 ]] \ @@ -390,11 +406,10 @@ else MSSG="By security, $GRUBSTAGEONE sectors were not wiped. \ (one of these values is incorrect: SECTORS_TO_WIPE=$SECTORS_TO_WIPE , BYTES_PER_SECTOR=$BYTES_PER_SECTOR )" - echo "$MSSG" end_pulse [[ "$GUI" ]] && zenity --width=400 --warning --title="$APPNAME2" --text="$MSSG" 2>/dev/null start_pulse - ERROR=yes + ERROR="$MSSG $PLEASECONTACT"; echo "$ERROR" fi fi fi @@ -412,43 +427,44 @@ ########################## Final sequence ############################## display_action_settings_start() { -ACTION_SETTINGS_START="" +ACTION_SETTINGS_START=" + +" if [[ "$MAIN_MENU" != Recommended-Repair ]];then if [[ "$MAIN_MENU" =~ fo ]];then - THISSET="Suggested repair" - ACTION_SETTINGS_START="Suggested repair: ______________________________________________________________ + THISSET="Suggested repair" + ACTION_SETTINGS_START="${ACTION_SETTINGS_START}Suggested repair: ______________________________________________________________ -$IMPVARUN" - else - THISSET="Default settings of $CLEANNAME" - ACTION_SETTINGS_START=" -Default settings: ______________________________________________________________ +$IMPVARUN +" + else + THISSET="Default settings of $CLEANNAME" + ACTION_SETTINGS_START="${ACTION_SETTINGS_START}Default settings: ______________________________________________________________ -$IMPVARUN" - fi +$IMPVARUN +" + fi [[ "$BTEXTUN" ]] || [[ "$ATEXTUN" ]] && ACTION_SETTINGS_START="$ACTION_SETTINGS_START - Blockers in case of suggested repair: __________________________________________ -$BTEXTUN $ATEXTUN" +$BTEXTUN $ATEXTUN +" [[ "$TEXTUN" ]] && ACTION_SETTINGS_START="$ACTION_SETTINGS_START - Confirmation request before suggested repair: __________________________________ -$TEXTUN" +$TEXTUN +" [[ "$TEXTENDUN" ]] && ACTION_SETTINGS_START="$ACTION_SETTINGS_START - Final advice in case of suggested repair: ______________________________________ -$TEXTENDUN" +$TEXTENDUN +" fi if [[ "$MAIN_MENU" =~ Custom ]];then ACTION_SETTINGS_START="$ACTION_SETTINGS_START - User settings: _________________________________________________________________ " fi -[[ "$DEBBUG" ]] && echo "$ACTION_SETTINGS_START" WIOULD=will debug_echo_important_variables } @@ -460,7 +476,9 @@ first_actions() { [[ "$DEBBUG" ]] && echo "[debug] first_actions=action before removal (if os-un)" -[[ "$MBR_ACTION" != reinstall ]] || [[ ! "$GRUBPACKAGE" =~ efi ]] && [[ "$BOOTFLAG_ACTION" ]] && [[ "$BOOTFLAG_TO_USE" ]] && bootflag_action $BOOTFLAG_TO_USE +[[ "$MBR_ACTION" != reinstall ]] && [[ "$BOOTFLAG_ACTION" ]] && [[ "$BOOTFLAG_TO_USE" ]] && bootflag_action $BOOTFLAG_TO_USE +[[ "$MBR_ACTION" = reinstall ]] && [[ "$GRUBPACKAGE" =~ efi ]] && [[ "$EFIPART_TO_USE" = "${LIST_EFIPART[1]}" ]] \ +&& [[ "${EFI_TYPE[$EFIPART_TO_USE]}" = hidenESP ]] && remove_hiddenflag $EFIPART_TO_USE #only if default esp [[ "$MBR_ACTION" = reinstall ]] && fix_fstab [[ "$RESTORE_BKP_ACTION" ]] || [[ "$CREATE_BKP_ACTION" ]] && restore_efi_bkp_files if [[ "$WINBOOT_ACTION" ]];then @@ -490,6 +508,7 @@ unhideboot_and_textprepare() { BSERROR="" if [[ "$UNHIDEBOOT_ACTION" ]];then + [[ "$DEBBUG" ]] && echo "[debug]unhideboot" unhide_boot_menus_xp unhide_boot_menus_grubcfg #To replace the "-1" fi @@ -499,6 +518,7 @@ || [[ "$BOOTFLAG_ACTION" ]] || [[ "$WINBOOT_ACTION" ]];then if [[ "$ERROR" ]];then TEXTBEG="$An_error_occurred_during +$ERROR " else @@ -516,7 +536,7 @@ fi if [[ "$NVRAMLOCKED" ]];then FUNCTION=Locked-NVram; OPTION5=SecureBoot; update_translations - [[ "$SECUREBOOT" = disabled ]] && TEXTEND="$FUNCTION_detected + [[ "${SECUREBOOT%% *}" = disabled ]] && TEXTEND="$FUNCTION_detected " || TEXTEND="$TEXTEND$FUNCTION_detected $Please_disable_OPTION5_in_BIOS $Then_try_again " fi @@ -541,32 +561,32 @@ first_translations if [[ "$MBR_ACTION" = reinstall ]];then if [[ "$FORCE_GRUB" = force-in-PBR ]] || [[ "$ADVISE_BOOTLOADER_UPDATE" = yes ]];then - TEXTEND="$TEXTEND -$Please_update_main_bootloader" + TEXTEND="$TEXTEND$Please_update_main_bootloader +" elif [[ "$GRUBPACKAGE" =~ efi ]];then #[[ ! -d /sys/firmware/efi ]] || [[ ! "$CREATE_BKP_ACTION" ]] && [[ "$EFIGRUBFILE" ]] FILE1="${LISTOFPARTITIONS[$EFIPART_TO_USE]}${EFIGRUBFILE#*/boot/efi}"; SYSTEM1="${OSNAME[$REGRUB_PART]}" ; update_translations - TEXTEND="$TEXTEND -$Please_setup_firmware_on_SYSTEM1_FILE1" + TEXTEND="$TEXTEND$Please_setup_firmware_on_SYSTEM1_FILE1 +" elif [[ "$NBOFDISKS" != 1 ]];then if [[ "$REMOVABLEDISK" ]];then - TEXTEND="$TEXTEND -$Please_setup_bios_on_removable_disk" + TEXTEND="$TEXTEND$Please_setup_bios_on_removable_disk +" else a="$(echo "$PARTEDLM" | grep "/dev/$NOFORCE_DISK:" )"; a="${a%:*}"; a="${a##*:}" [[ "$a" ]] && DISK1="$NOFORCE_DISK ($a)" || DISK1="$NOFORCE_DISK" update_translations - TEXTEND="$TEXTEND -$Please_setup_bios_on_DISK1" + TEXTEND="$TEXTEND$Please_setup_bios_on_DISK1 +" fi fi - if [[ "$SECUREBOOT" = enabled ]] && [[ "$QUANTITY_OF_REAL_WINDOWS" != 0 ]] && [[ ! "$GRUBPACKAGE" =~ sign ]] && [[ "$GRUBPACKAGE" =~ efi ]];then + if [[ "${SECUREBOOT%% *}" = enabled ]] && [[ "$QUANTITY_OF_REAL_WINDOWS" != 0 ]] && [[ ! "$GRUBPACKAGE" =~ sign ]] && [[ "$GRUBPACKAGE" =~ efi ]];then OPTION5=SecureBoot; update_translations - TEXTEND="$TEXTEND -$Please_disable_OPTION5_in_BIOS" + TEXTEND="$TEXTEND$Please_disable_OPTION5_in_BIOS +" fi if [[ "$QUANTITY_OF_DETECTED_MACOS" != 0 ]] || [[ "$MACEFIFILEPRESENCE" ]];then - TEXTEND="$TEXTEND -$You_may_also_want_to_install_PROGRAM6 (https://help.ubuntu.com/community/ubuntupreciseon2011imac)" + TEXTEND="$TEXTEND$You_may_also_want_to_install_PROGRAM6 (https://help.ubuntu.com/community/ubuntupreciseon2011imac) +" fi if [[ "${FARBIOS[$BOOTPART]}" = farbios ]] && [[ "$FORCE_GRUB" != force-in-PBR ]] \ && [[ ! "$GRUBPACKAGE" =~ efi ]] && [[ "${GPT_DISK[${DISKNB_PART[$REGRUB_PART]}]}" != is-GPT ]] && [[ "$LIVESESSION" = live ]];then @@ -574,28 +594,26 @@ OPTION2="$Separate_TYPE3_partition"; update_translations [[ "$DEBBUG" ]] && echo "$Boot_files_of_SYSTEM2_are_far" #TEXTEND="$TEXTEND -# #$Boot_files_of_SYSTEM2_are_far \ #$You_may_want_to_retry_after_creating_TYP_part (EXT4, >200MB, $start_of_the_disk). $Via_TOOL1 \ #$Then_select_this_part_via_OPTION2_of_TOOL3 ($BootPartitionDoc)" fi - if [[ "${FARBIOS[$EFIPART_TO_USE]}" = farbios ]] && [[ "$GRUBPACKAGE" =~ grub-efi ]] && [[ "$FORCE_GRUB" != force-in-PBR ]] && [[ "$LIVESESSION" = live ]];then + if [[ "${FARBIOS[$EFIPART_TO_USE]}" = farbios ]] && [[ "$GRUBPACKAGE" =~ efi ]] && [[ "$FORCE_GRUB" != force-in-PBR ]] && [[ "$LIVESESSION" = live ]];then SYSTEM2="${OSNAME[$REGRUB_PART]}"; TYP=ESP; TOOL1=gParted; TYPE3=/boot/efi; update_translations FLAGTYP=boot; OPTION2="$Separate_TYPE3_partition"; update_translations [[ "$DEBBUG" ]] && echo "$Boot_files_of_SYSTEM2_are_far" #TEXTEND="$TEXTEND -# #$Boot_files_of_SYSTEM2_are_far \ #$You_may_want_to_retry_after_creating_TYP_part (FAT32, 100MB~250MB, $start_of_the_disk, $FLAGTYP_flag). $Via_TOOL1 \ #$Then_select_this_part_via_OPTION2_of_TOOL3" fi - if [[ "$WINEFIFILEPRESENCE" ]] && [[ "$GRUBPACKAGE" =~ efi ]];then + if [[ "$QUANTITY_OF_REAL_WINDOWS" != 0 ]] && [[ "$WINEFIFILEPRESENCE" ]] && [[ "$GRUBPACKAGE" =~ efi ]];then OPTION="$Msefi_too" OPTION1="$Msefi_too" update_translations if [[ "$WINEFI_BKP_ACTION" ]];then - TEXTEND="$TEXTEND -$You_may_want_to_retry_after_deactivating_OPTION" + TEXTEND="$TEXTEND$You_may_want_to_retry_after_deactivating_OPTION +" else temp="" if [[ "$EFIGRUBFILE" ]];then @@ -605,33 +623,32 @@ temp="$Via_command_in_win bcdedit /set {bootmgr} path \\\\EFI\\\\${temp////\\\\}" fi # \\ are displayed \ in zenity - TEXTEND="$TEXTEND -$If_boot_win_try_change_firmware_order - + TEXTEND="$TEXTEND$If_boot_win_try_change_firmware_order $If_firmware_blocked_change_win_order -$temp" +$temp +" #$Alternatively_you_can_try_OPTION1 fi fi - if [[ "$FINALMSG_UPDATEGRUB" ]];then #must be bef to avoid duplicate msg 'may need to change to Legacy' - [[ "$QUANTITY_OF_REAL_WINDOWS" != 0 ]] && [[ ! "$WINEFIFILEPRESENCE" ]] && SYSTEM8=Windows || SYSTEM8=MacOS - SYSTEM6="${OSNAME[$REGRUB_PART]}"; COMMANDTOTYP5='sudo update-grub'; update_translations - TEXTEND="$TEXTEND -$Reboot_in_SYSTEM6_and_COMMANDTOTYP5_to_add_SYSTEM8_entry" - elif [[ ! -d /sys/firmware/efi ]] && [[ "$GRUBPACKAGE" =~ efi ]];then + if [[ "$FINALMSG_UPDATEGRUB" ]];then #must be bef to avoid duplicate msg 'may need to change to Legacy' + [[ "$QUANTITY_OF_REAL_WINDOWS" != 0 ]] && [[ ! "$WINEFIFILEPRESENCE" ]] && SYSTEM8=Windows || SYSTEM8=MacOS + SYSTEM6="${OSNAME[$REGRUB_PART]}"; COMMANDTOTYP5='sudo update-grub'; update_translations + TEXTEND="$TEXTEND$Reboot_in_SYSTEM6_and_COMMANDTOTYP5_to_add_SYSTEM8_entry +" + elif [[ ! -d /sys/firmware/efi ]] && [[ "$GRUBPACKAGE" =~ efi ]];then MODE1=BIOS-compatibility/CSM/Legacy; MODE2=UEFI; update_translations - TEXTEND="$TEXTEND -$Boot_is_MODE1_may_need_change_to_MODE2" + TEXTEND="$TEXTEND$Boot_is_MODE1_may_need_change_to_MODE2 +" elif [[ -d /sys/firmware/efi ]] && [[ ! "$GRUBPACKAGE" =~ efi ]];then MODE1=UEFI; MODE2=BIOS-compatibility/CSM/Legacy; update_translations - TEXTEND="$TEXTEND -$Boot_is_MODE1_may_need_change_to_MODE2" + TEXTEND="$TEXTEND$Boot_is_MODE1_may_need_change_to_MODE2 +" fi fi if [[ "$ROOTDISKMISSING" ]];then - TEXTEND="$TEXTEND -$Broken_wubi_detected -$Missingrootdiskurl" + TEXTEND="$TEXTEND$Broken_wubi_detected +$Missingrootdiskurl +" fi } @@ -665,16 +682,13 @@ local temp line PACKAGELIST=pastebinit FUNCTION=BootInfo FILETOTEST=pastebinit LAB="$Create_a_BootInfo_report" [[ "$GUI" ]] || [[ "$DEBBUG" ]] && echo "SET@_label0.set_text('''$LAB. $This_may_require_several_minutes''')" -[[ "$UPLOAD" ]] && [[ ! "$(type -p $FILETOTEST)" ]] && installpackagelist cp "$TMP_LOG" "${TMP_LOG}t" sed -i "/^SET@/ d" "${TMP_LOG}t" sed -i "/^DEBUG=>/ d" "${TMP_LOG}t" sed -i "/^\[debug\]/ d" "${TMP_LOG}t" sed -i "/^COMBO@@/ d" "${TMP_LOG}t" sed -i "/^done/ d" "${TMP_LOG}t" -sed -i "/^1+0/ d" "${TMP_LOG}t" sed -i "/^gpg:/ d" "${TMP_LOG}t" -sed -i "/^sh: 0: getc/ d" "${TMP_LOG}t" sed -i "/^Executing: gpg/ d" "${TMP_LOG}t" sed -i "/^Reading/ d" "${TMP_LOG}t" sed -i "/^Building dependency/ d" "${TMP_LOG}t" @@ -683,16 +697,18 @@ sed -i "/^Gtk-Message: / d" "${TMP_LOG}t" sed -i "/^Get:/ d" "${TMP_LOG}t" sed -i "/^Download complete/ d" "${TMP_LOG}t" -sed -i "/^sh: getcwd/ d" "${TMP_LOG}t" sed -i "/^E: Package 'pastebinit' has no installation candidate/ d" "${TMP_LOG}t" +# Package 'linux-xxx' is not installed, so not removed +sed -i "/^Package 'linux-/ d" "${TMP_LOG}t" -[[ "$GUI" ]] || [[ "$DEBBUG" ]] && echo "SET@_label0.set_text('''$LAB (bis). $This_may_require_several_minutes''')" +[[ "$GUI" ]] && echo "SET@_label0.set_text('''$LAB (bis). $This_may_require_several_minutes''')" . /usr/share/boot-sav/b-i-s.sh -echo "${APPNAME}-$APPNAME_VERSION [$DATE]" >> "${TMP_LOG}b" +echo "${APPNAME}-$APPNAME_VERSION $([[ "$DEBBUG" ]] && echo debug || echo " ") $([[ "$FILTERED" ]] && echo " " || echo no-filter ) [$DATE]" >> "${TMP_LOG}b" if [[ "$MAIN_MENU" = Boot-Info ]];then title_gen "Boot Info Summary" >> "${TMP_LOG}b" - bootinfoscript >> "${TMP_LOG}b" + [[ "$DEBBUG" ]] && echo "[debug] bis" + bootinfoscript if [[ "$USERCHOICES" ]];then echo "$(title_gen "User choice") $USERCHOICES" >> "${TMP_LOG}b" @@ -719,16 +735,19 @@ && echo "$line" >> "${TMP_LOG}b" done < <(cat ${TMP_LOG}t ) title_gen "Boot Info After Repair" >> "${TMP_LOG}b" - bootinfoscript >> "${TMP_LOG}b" + [[ "$DEBBUG" ]] && echo "[debug] bis" + bootinfoscript fi -rm "${TMP_LOG}t" -unmount_all_blkid_partitions_except_df # necessary ? - -check_if_grub_in_bootsector - -[[ "$GUI" ]] || [[ "$DEBBUG" ]] && echo "SET@_label0.set_text('''$LAB (ter). $This_may_require_several_minutes''')" +if [[ "$FILTERED" ]];then + sed -i "/^Warning: Unable to open / d" "${TMP_LOG}b" + sed -i "/^Warning: The driver descriptor says/ d" "${TMP_LOG}b" + sed -i "/^sh: getcwd/ d" "${TMP_LOG}b" + sed -i "/^1+0/ d" "${TMP_LOG}b" + sed -i "/^sh: 0: getc/ d" "${TMP_LOG}b" +fi +[[ "$GUI" ]] && echo "SET@_label0.set_text('''$LAB (ter). $This_may_require_several_minutes''')" repup=yes if [[ "$GUI" ]] || [[ "$MAIN_MENU" != Boot-Info ]] && [[ ! "$APPNAME" =~ inf ]] && [[ "$UPLOAD" ]];then @@ -745,7 +764,9 @@ start_pulse fi fi +PASTEBIN_URL="" if [[ "$UPLOAD" ]] && [[ "$repup" = yes ]];then + [[ ! "$(type -p $FILETOTEST)" ]] && installpackagelist [[ "$GUI" ]] && echo "SET@_label0.set_text('''$LAB (net-check). $This_may_require_several_minutes''')" check_internet_connection ask_internet_connection @@ -756,60 +777,24 @@ elif [[ "$(lsb_release -is)" = Ubuntu ]];then PASTEB="paste.ubuntu.com" else - PASTEB="paste2.org" + PASTEB="sprunge.us" fi - PASTEBIN_URL=$(cat "${TMP_LOG}b" | pastebinit -a boot-repair -f bash -b $PASTEB) + PASTEBIN_URL=$(cat "${TMP_LOG}b" | pastebinit -a $APPNAME -f bash -b $PASTEB) pastebin_retry pastebin_retry fi fi -[[ "$GUI" ]] || [[ "$DEBBUG" ]] && echo "SET@_label0.set_text('''$LAB (qua). $This_may_require_several_minutes''')" -} - -pastebin_retry() { -if [[ "$PASTEBIN_URL" = "http://$PASTEB/" ]] || [[ ! "$PASTEBIN_URL" ]] || [[ "$PASTEBIN_URL" =~ new-paste ]];then - [[ "$PASTEBIN_URL" =~ host ]] && echo "No internet for $PASTEB ($PASTEBIN_URL)." >> "${TMP_LOG}b" - if [[ "$PASTEB" =~ ubuntu ]];then - echo "$PASTEB ko ($PASTEBIN_URL)" >> "${TMP_LOG}b" - PASTEB="paste.debian.net" - elif [[ "$PASTEB" =~ debian ]];then - echo "$PASTEB ko ($PASTEBIN_URL)" >> "${TMP_LOG}b" - PASTEB="paste2.org" - else - echo "$PASTEB ko ($PASTEBIN_URL)" >> "${TMP_LOG}b" - PASTEB="paste.ubuntu.com" - fi - PASTEBIN_URL=$(cat "${TMP_LOG}b" | pastebinit -a boot-repair -f bash -b $PASTEB) -fi -} +[[ "$GUI" ]] && echo "SET@_label0.set_text('''$LAB (qua). $This_may_require_several_minutes''')" -check_if_grub_in_bootsector() { -local GRUBINBS="" PARTBS="" line - [[ "$GUI" ]] || [[ "$DEBBUG" ]] && echo "SET@_label0.set_text('''$LAB (bs-check). $This_may_require_several_minutes''')" - while read line;do - [[ "$(grep ': __' <<< "$line")" ]] && GRUBINBS="" && PARTBS="${line%:*}" - [[ "$PARTBS" ]] && [[ "$(echo "$line" | grep "is installed in the boot sector" | grep -i grub )" ]] && GRUBINBS=ok - [[ "$PARTBS" ]] && [[ "$GRUBINBS" ]] && [[ "$(echo "$line" | grep "Operating System" | grep -i windows )" ]] && ERROR=yes && BSERROR="$PARTBS" - [[ "$(grep 'Drive/Partition Info' <<< "$line")" ]] && break - done < <(cat "${TMP_LOG}b") -} - -unmount_all_and_success_br_and_bi() { -[[ "$DEBBUG" ]] && echo "[debug] unmount_all_and_success_br_and_bi" -TEXTMID="" -unhideboot_and_textprepare -[[ "$PASTEBIN_ACTION" ]] && pastebinaction -stats_and_endpulse -FILENAME="" -if [[ "$PASTEBIN_ACTION" ]];then - [[ "$ERROR" ]] && or_to_your_favorite_support_forum="" - if [[ "$PASTEBIN_URL" ]] && [[ "$PASTEBIN_URL" != "http://paste.debian.net/" ]] \ - && [[ "$PASTEBIN_URL" != "http://paste.ubuntu.com/" ]] && [[ ! "$PASTEBIN_URL" =~ host ]];then - TEXTMID="$Please_write_url_on_paper +[[ "$ERROR" ]] && or_to_your_favorite_support_forum="" +if [[ "$PASTEBIN_URL" != "http://$PASTEB/" ]] && [[ "$PASTEBIN_URL" != "https://$PASTEB/" ]] \ +&& [[ "$PASTEBIN_URL" != "http://$PASTEB" ]] && [[ "$PASTEBIN_URL" != "https://$PASTEB" ]] \ +&& [[ "$PASTEBIN_URL" ]] && [[ ! "$PASTEBIN_URL" =~ new-paste ]] && [[ ! "$PASTEBIN_URL" =~ host ]];then + TEXTMID="$Please_write_url_on_paper $PASTEBIN_URL " - [[ ! "$MAIN_MENU" =~ nf ]] && TEXTMID="$TEXTMID + [[ ! "$MAIN_MENU" =~ nf ]] && TEXTMID="$TEXTMID $Indicate_it_in_case_still_pb boot.repair@gmail.com $or_to_your_favorite_support_forum @@ -817,15 +802,15 @@ $Indicate_url_if_pb $On_forums_eg " - elif [[ -f "${TMP_LOG}b" ]];then - if [[ "$GUI" ]];then - FILENAME="$LOGREP/Boot-Info_$DATE.txt" #can't include the ~/ - mv "${TMP_LOG}b" "$FILENAME" - update_translations - TEXTMID="$FILENAME_has_been_created +elif [[ -f "${TMP_LOG}b" ]];then + if [[ "$GUI" ]];then + FILENAME="$LOGREP/Boot-Info_$DATE.txt" #can't include the ~/ + mv "${TMP_LOG}b" "$FILENAME" + update_translations + TEXTMID="$FILENAME_has_been_created " - [[ ! "$MAIN_MENU" =~ nf ]] && TEXTMID="$TEXTMID + [[ ! "$MAIN_MENU" =~ nf ]] && TEXTMID="$TEXTMID $Indicate_its_content_in_case_still_pb boot.repair@gmail.com $or_to_your_favorite_support_forum @@ -833,25 +818,66 @@ $Indicate_content_if_pb $On_forums_eg " - else - TEXTMID="$(cat ${TMP_LOG}b)" - fi else - TEXTMID="(Could not create BootInfo. $PLEASECONTACT )" + TEXTMID="$(cat ${TMP_LOG}b)" fi - if [[ "$BSERROR" ]];then - PARTBS="$BSERROR"; TOOL1=TestDisk; update_translations - TEXTMID="$TEXTMID +else + TEXTMID="(Could not create BootInfo. $PLEASECONTACT )" +fi + +check_if_grub_in_windoz_bootsector +if [[ "$BSERROR" ]];then + PARTBS="$BSERROR"; TOOL1=TestDisk; update_translations + TEXTMID="$TEXTMID $Please_fix_bs_of_PARTBS $Via_TOOL1 (https://help.ubuntu.com/community/BootSectorFix) " +fi +} + + +pastebin_retry() { +if [[ "$PASTEBIN_URL" = "http://$PASTEB/" ]] || [[ "$PASTEBIN_URL" = "https://$PASTEB/" ]] \ +|| [[ "$PASTEBIN_URL" = "http://$PASTEB" ]] || [[ "$PASTEBIN_URL" = "https://$PASTEB" ]] \ +|| [[ ! "$PASTEBIN_URL" ]] || [[ "$PASTEBIN_URL" =~ new-paste ]] || [[ "$PASTEBIN_URL" =~ host ]];then + [[ "$PASTEBIN_URL" =~ host ]] && echo "No internet for $PASTEB ($PASTEBIN_URL)." >> "${TMP_LOG}b" + if [[ "$PASTEB" =~ ubuntu ]];then + echo "$PASTEB ko ($PASTEBIN_URL)" >> "${TMP_LOG}b" + PASTEB="paste.debian.net" + elif [[ "$PASTEB" =~ debian ]];then + echo "$PASTEB ko ($PASTEBIN_URL)" >> "${TMP_LOG}b" + PASTEB="sprunge.us" + else + echo "$PASTEB ko ($PASTEBIN_URL)" >> "${TMP_LOG}b" + PASTEB="paste.ubuntu.com" fi -elif [[ "$ERROR" ]];then - TEXTMID="$PLEASECONTACT -" + PASTEBIN_URL=$(cat "${TMP_LOG}b" | pastebinit -a $APPNAME -f bash -b $PASTEB) fi +} + +check_if_grub_in_windoz_bootsector() { +local GRUBINBS="" PARTBS="" line + [[ "$GUI" ]] || [[ "$DEBBUG" ]] && echo "SET@_label0.set_text('''$LAB (bs-check). $This_may_require_several_minutes''')" + while read line;do + [[ "$(grep ': __' <<< "$line")" ]] && GRUBINBS="" && PARTBS="${line%:*}" + [[ "$PARTBS" ]] && [[ "$(echo "$line" | grep "is installed in the boot sector" | grep -i grub )" ]] && GRUBINBS=ok + [[ "$PARTBS" ]] && [[ "$GRUBINBS" ]] && [[ "$(echo "$line" | grep "Operating System" | grep -i windows )" ]] && ERROR="bs-check $line $PLEASECONTACT" && BSERROR="$PARTBS" + [[ "$(grep '==========' <<< "$line")" ]] && break + done < <(cat "${TMP_LOG}b") +} + +unmount_all_and_success_br_and_bi() { +[[ "$DEBBUG" ]] && echo "[debug] unmount_all_and_success_br_and_bi" +TEXTMID="" +FILENAME="" +unhideboot_and_textprepare +#[[ "$PASTEBIN_ACTION" ]] && +pastebinaction +rm "${TMP_LOG}t" +unmount_all_blkid_partitions_except_df +stats_and_endpulse finalzenity_and_exitapp } @@ -864,7 +890,7 @@ MAIN_MENU=Boot-Info MBR_ACTION=nombraction ; UNHIDEBOOT_ACTION="" ; FSCK_ACTION="" ; WUBI_ACTION="" GRUBPURGE_ACTION="" ; BLANKEXTRA_ACTION="" ; UNCOMMENT_GFXMODE="" ; KERNEL_PURGE="" -BOOTFLAG_ACTION="" ; WINBOOT_ACTION="" ; PASTEBIN_ACTION=create-bootinfo +BOOTFLAG_ACTION="" ; WINBOOT_ACTION="" #; PASTEBIN_ACTION=create-bootinfo RESTORE_BKP_ACTION=""; CREATE_BKP_ACTION=""; WINEFI_BKP_ACTION="" [[ "$DEBBUG" ]] && echo "[debug]MAIN_MENU becomes : $MAIN_MENU" LAB="$Create_a_BootInfo_report" diff -Nru boot-repair-4ppa123/usr/share/boot-sav/gui-init.sh boot-repair-4ppa200/usr/share/boot-sav/gui-init.sh --- boot-repair-4ppa123/usr/share/boot-sav/gui-init.sh 2020-03-15 13:14:14.000000000 +0000 +++ boot-repair-4ppa200/usr/share/boot-sav/gui-init.sh 2022-02-10 21:26:44.000000000 +0000 @@ -24,7 +24,7 @@ GUI=yes #before start_pulse start_pulse DEBBUG=""; FORCEYES=""; G2SPY_VERSION=-python3; G2SVERBOSE=""; -if [[ "$(blkid | grep zfs)" ]];then FILTERED="";else FILTERED="(filtered)";fi #cannot && || +FILTERED="(filtered)" #[[ "$(blkid | grep zfs)" ]] && FILTERED="" for arg in $*;do case "$arg" in -d ) DEBBUG=" -d";; @@ -101,8 +101,10 @@ TMP_FOLDER_TO_BE_CLEARED="$(mktemp -td ${APPNAME}-XXXXX)" exec >& >(tee "$TMP_LOG") #fi + propose_decrypt activate_lvm_if_needed [[ "$choice" != exit ]] && activate_raid_if_needed + [[ "$choice" != exit ]] && activate_zfs_if_needed if [[ "$choice" = exit ]];then end_pulse echo "$No_change_on_your_pc" diff -Nru boot-repair-4ppa123/usr/share/boot-sav/gui-raid-lvm.sh boot-repair-4ppa200/usr/share/boot-sav/gui-raid-lvm.sh --- boot-repair-4ppa123/usr/share/boot-sav/gui-raid-lvm.sh 2020-03-15 13:14:14.000000000 +0000 +++ boot-repair-4ppa200/usr/share/boot-sav/gui-raid-lvm.sh 2022-02-24 16:01:37.000000000 +0000 @@ -1,5 +1,5 @@ #! /bin/bash -# Copyright 2020 Yann MRN +# Copyright 2022 Yann MRN # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published @@ -45,28 +45,42 @@ } ################################# CRYPT ################################## -#propose_decrypt() { -#BLKID=$(blkid) -#FUNCTION=LUKS PACKAGELIST=ecryptfs-utils FILETOTEST=ecryptfsd -#if [[ "$(echo "$BLKID" | grep -i crypt | grep -vi swap )" ]];then -# update_translations -# text="$Encryption_detected $You_may_want_to_retry_after_installing_PACKAGELIST" -# echo "$text" -# end_pulse -# zenity --width=400 --info --title="$APPNAME2" --text="$text" 2>/dev/null -# [[ ! "$(type -p $FILETOTEST)" ]] && installpackagelist -# start_pulse -# text="$You_may_want_decrypt ($Decrypt_links)" -#fi - -#apt-get install lvm2 cryptsetup; sudo modprobe dm-crypt; sudo cryptsetup luksOpen /dev/sda5 crypt1 ;sudo vgscan --mknodes; sudo vgscan --mknodes #http://ubuntuforums.org/showthread.php?p=4530641 - +propose_decrypt() { +CRYPTPART="$(blkid | grep crypto_LUKS | grep -vi swap)" +if [[ "$CRYPTPART" ]];then + FUNCTION=LUKS; PACKAGELIST=cryptsetup; FILETOTEST=cryptsetup + CRYPTPART="${CRYPTPART%%:*}" #eg /dev/sda3 + update_translations + [[ ! "$(type -p $FILETOTEST)" ]] && installpackagelist + if [[ ! "$(type -p $FILETOTEST)" ]];then + text="$Encryption_detected $You_may_want_to_retry_after_installing_PACKAGELIST" + echo "$text" + end_pulse + [[ "$GUI" ]] && zenity --width=400 --info --title="$APPNAME2" --text="$text" 2>/dev/null + start_pulse + fi + modprobe dm-crypt #maybe not necessary on recent live discs + #try to propose decrypt only when necessary + #vgubuntu-root is frequent case (default for encrypted lvm). Might want to add other frequent cases (eg default for other distribs) + if [[ "$(type -p $FILETOTEST)" ]] && [[ ! "$(os-prober | grep -v Windows | grep -vi Mac)" ]] \ + && [[ ! "$(cryptsetup status /dev/mapper/vgubuntu-root | grep 'is activ' )" ]];then + text="$You_may_want_decrypt (sudo cryptsetup luksOpen $CRYPTPART myvolume)" # ($Decrypt_links)" #apt install cryptsetup; sudo cryptsetup luksOpen /dev/sda3 myvolume + echo "$text" + end_pulse + [[ "$GUI" ]] && zenity --width=400 --info --title="$APPNAME2" --text="$text" 2>/dev/null + start_pulse + fi +fi +} ################################# LVM ################################## activate_lvm_if_needed() { -#works: http://paste.ubuntu.com/1004461 +#After fresh lvm install, in installed session blkid returns sda1: PARTLABEL="EFI System Partition", sda2 TYPE="LVM2_member", +# /dev/mapper/vgubuntu-root: UUID="..." TYPE="ext4", and /dev/mapper/vgubuntu-swap_1 +#parted -lms returns sda1=esp, sda2=lvm, /dev/mapper/vgubuntu-root (and swap) are considered as loop disks +#fdisk returns sda1 =EFI, sda2= LVM Linux, /dev/mapper/vgubuntu-root is disk local FUNCTION=LVM PACKAGELIST=lvm2 FILETOTEST=vgchange BLKID=$(blkid) ECHO_LVM_RAID_PREPAR="" @@ -82,14 +96,14 @@ if [[ ! "$(type -p $FILETOTEST)" ]];then choice=exit else - if [[ "$DEBBUG" ]];then - title_gen "blkid (filtered) before lvm activation" - while read line; do - [[ "$line" ]] && [[ ! "$line" =~ squashfs ]] && [[ "$DEBBUG" ]] && echo "$line" - done < <(blkid) - fi + ECHO_LVM_RAID_PREPAR="$ECHO_LVM_RAID_PREPAR +$(title_gen "blkid (filtered) before lvm activation") + +$(blkid | sed -e '/^$/d' -e '/quashfs/d' )" #remove blank / squash lines # Not sure if modprobe and vgscan are necessary - ECHO_LVM_RAID_PREPAR="$(title_gen "LVM activation") + ECHO_LVM_RAID_PREPAR="$ECHO_LVM_RAID_PREPAR + +$(title_gen "LVM activation") modprobe dm-mod $(modprobe dm-mod) vgscan --mknodes @@ -102,7 +116,11 @@ $(blkid -g)" BLKID=$(blkid) [[ "$BEFLVMBLKID" != "$BLKID" ]] && ECHO_LVM_RAID_PREPAR="$ECHO_LVM_RAID_PREPAR -Successfully activated LVM." +Successfully activated LVM. + +$(title_gen "blkid (filtered) after lvm activation") + +$(blkid | sed -e '/^$/d' -e '/quashfs/d' )" #remove blank / squash lines fi fi } @@ -116,7 +134,7 @@ echo "$FUNCTION_detected $Please_use_DISK44_which_is_FUNCTION44_ok" [[ "$GUI" ]] && zenity --width=400 --info --title="$APPNAME2" --text="$FUNCTION_detected $Please_use_DISK44_which_is_FUNCTION44_ok" 2>/dev/null choice=exit -elif [[ "$BLKID" =~ raid ]] || [[ "$(echo "$BLKID" | grep /dev/mapper/ | grep -v swap | grep -vi LVM)" ]];then +elif [[ "$BLKID" =~ raid ]] || [[ "$(echo "$BLKID" | grep /dev/mapper/ | grep -v swap | grep -vi LVM | grep -v mapper/vg)" ]];then raiduser=yes if [[ ! "$BLKID" =~ raid ]];then if [[ ! "$FORCEYES" ]];then @@ -140,12 +158,10 @@ DMRAID="" MD_ARRAY="" BEFRAIDBLKID="$BLKID" - ECHO_LVM_RAID_PREPAR="$ECHO_LVM_RAID_PREPAR -$(title_gen "blkid (filtered) before raid activation:")" - while read line; do - [[ "$line" ]] && [[ ! "$line" =~ squashfs ]] && ECHO_LVM_RAID_PREPAR="$ECHO_LVM_RAID_PREPAR -$line" - done < <(blkid) + ECHO_LVM_RAID_PREPAR="$ECHO_LVM_RAID_PREPAR +$(title_gen "blkid (filtered) before raid activation") + +$(blkid | sed -e '/^$/d' -e '/quashfs/d' )" #remove blank / squash lines [[ "$(type -p dmraid)" ]] && INIT_DMR=y || INIT_DMR="" if [[ "$INIT_DMR" ]];then assemble_dmraid @@ -175,7 +191,11 @@ fi BLKID=$(blkid) [[ "$BEFRAIDBLKID" != "$BLKID" ]] && ECHO_LVM_RAID_PREPAR="$ECHO_LVM_RAID_PREPAR -Successfully activated RAID." +Successfully activated RAID. + +$(title_gen "blkid (filtered) after raid activation") + +$(blkid | sed -e '/^$/d' -e '/quashfs/d' )" #remove blank / squash lines fi fi } @@ -230,6 +250,9 @@ #if [[ ! "$dmraidenable" ]]; then DMRAID="$(dmraid -si -c)" ECHO_LVM_RAID_PREPAR="$ECHO_LVM_RAID_PREPAR + +$(title_gen "dmraid") + dmraid -si -c $DMRAID" if [[ "$DMRAID" =~ "no raid disk" ]];then @@ -243,7 +266,7 @@ DMRAID="$(dmraid -sa -c)" ECHO_LVM_RAID_PREPAR="$ECHO_LVM_RAID_PREPAR dmraid -sa -c: -$DMRAID" #e.g. isw_bcbggbcebj_ARRAY (http://paste.ubuntu.com/1055404) +$DMRAID" #e.g. isw_bcbggbcebj_ARRAY fi #fi fi @@ -253,6 +276,8 @@ if [[ "$(type -p mdadm)" ]];then #Assemble all arrays ECHO_LVM_RAID_PREPAR="$ECHO_LVM_RAID_PREPAR + +$(title_gen "mdadm") mdadm --assemble --scan $(mdadm --assemble --scan)" # All arrays. @@ -269,3 +294,112 @@ #done fi } + + +################################# ZFS ################################## +activate_zfs_if_needed() { +#example blkid: /dev/sda6 12215859673123677634 zfs_member bpool +#ex2: /dev/sda7 9932272560944743958 zfs_member rpool +#https://openzfs.github.io/openzfs-docs/Getting%20Started/Debian/Debian%20Stretch%20Root%20on%20ZFS.html#rescuing-using-a-live-cd +local FUNCTION=ZFS PACKAGELIST=zfsutils-linux FILETOTEST=zpool +if [[ "$BLKID" =~ zfs ]];then + BEFZFSMOUNT="$(findmnt -n -o TARGET | grep zfs)" + [[ ! "$(type -p $FILETOTEST)" ]] && installpackagelist + if [[ ! "$(type -p $FILETOTEST)" ]];then + choice=exit + elif [[ "$LIVESESSION" != live ]] && [[ "$(findmnt -n -o FSTYPE / | grep zfs )" ]];then #Root in zfs pool + SUCCESSACTZFS=yes + ECHO_LVM_RAID_PREPAR="$ECHO_LVM_RAID_PREPAR + +$(title_gen "Installed session with Root on ZFS") + +zpool list $(LANGUAGE=C LC_ALL=C zpool list) + +$(LANGUAGE=C LC_ALL=C findmnt -D | grep % | sed -e '/tmpfs/d' -e '/loop/d' ) + +" + else + ECHO_LVM_RAID_PREPAR="$ECHO_LVM_RAID_PREPAR + +$(title_gen "ZFS activation") + +$PACKVERSION zfsutils-linux : $($PACKVERSION zfsutils-linux ) +zpool export -f -a $(zpool export -f -a) +" + if [[ ! "$(LANGUAGE=C LC_ALL=C zpool list)" =~ 'o pools available' ]];then + SUCCESSACTZFS=no + echo "$zfs_already_activated_please_retry" + if [[ "$GUI" ]];then + end_pulse + zenity --width=400 --error --text="$zfs_already_activated_please_retry" 2>/dev/null + fi + choice=exit + else + SUCCESSACTZFS=yes #default + [[ "$DEBBUG" ]] && ECHO_LVM_RAID_PREPAR="$ECHO_LVM_RAID_PREPAR + +$(LANGUAGE=C LC_ALL=C findmnt -D | grep % | sed -e '/tmpfs/d' -e '/loop/d' ) + +zpool list before activation $(LANGUAGE=C LC_ALL=C zpool list) +zfs list $(LANGUAGE=C LC_ALL=C zfs list) +" + #mkdir -p /mnt/boot-sav/zfs/boot/efi + #mkdir -p /mnt/boot-sav/zfs/boot/grub + #https://openzfs.github.io/openzfs-docs/Getting%20Started/Debian/Debian%20Bullseye%20Root%20on%20ZFS.html#rescuing-using-a-live-cd + POOLLIST="" + for i in $(LANGUAGE=C LC_ALL=C zpool import | grep 'pool:' | sed 's/pool: //g'); do + POOLLIST="$i $POOLLIST" +# ECHO_LVM_RAID_PREPAR="$ECHO_LVM_RAID_PREPAR +#zpool import -f -D $i tmp$i $(LANGUAGE=C LC_ALL=C zpool import -f -D $i tmp$i) +#zpool import -f $i tmp$i $(LANGUAGE=C LC_ALL=C zpool import -f $i tmp$i) +#zfs set mountpoint=/mnt/boot-sav/zfs tmp$i $(LANGUAGE=C LC_ALL=C zfs set mountpoint=/mnt/boot-sav/zfs tmp$i) +#zfs mount tmp$i $(LANGUAGE=C LC_ALL=C zfs mount tmp$i)" + ECHO_LVM_RAID_PREPAR="$ECHO_LVM_RAID_PREPAR +zpool import -N -f -R /mnt/boot-sav/zfs $i $(zpool import -N -f -R /mnt/boot-sav/zfs $i)" + done + ECHO_LVM_RAID_PREPAR="$ECHO_LVM_RAID_PREPAR +If needed, type 'sudo zfs load-key -a' in another terminal." + if [[ "$GUI" ]];then + end_pulse + zenity --width=400 --info --text="If needed, type 'sudo zfs load-key -a' in a terminal, then close this window." 2>/dev/null + start_pulse + else + read -r -p "If needed, type 'zfs load-key -a' in another terminal, then press [Enter] here to proceed." + fi + RTPL="$(zfs list | grep ROOT/ | grep v/zfs | grep -v zfs/ )" + RTPL="${RTPL%% *}" # eg. tmprpool/ROOT/ubuntu_64fs0l + ECHO_LVM_RAID_PREPAR="$ECHO_LVM_RAID_PREPAR +zfs mount $RTPL $(zfs mount $RTPL)" + #ECHO_LVM_RAID_PREPAR="$ECHO_LVM_RAID_PREPAR +#zpool import -a -f -D -R /mnt/boot-sav/zfs $(LANGUAGE=C LC_ALL=C zpool import -a -f -D -R /mnt/boot-sav/zfs) +#zpool import -a -f -R /mnt/boot-sav/zfs $(LANGUAGE=C LC_ALL=C zpool import -a -f -R /mnt/boot-sav/zfs)" + ECHO_LVM_RAID_PREPAR="$ECHO_LVM_RAID_PREPAR +zfs mount -a $(zfs mount -a)" + AFTZFSMOUNT="$(findmnt -n -o TARGET | grep zfs)" + for i in $POOLLIST;do #bpool rpool + [[ "$DEBBUG" ]] && echo "[debug] Checking if $i is mounted." + [[ ! "$(findmnt -n -o SOURCE )" =~ "${i}/" ]] && echo "$i missing in findmnt." && SUCCESSACTZFS=no + done + [[ "$AFTZFSMOUNT" = "$BEFZFSMOUNT" ]] && SUCCESSACTZFS=no + if [[ "$SUCCESSACTZFS" = yes ]];then + ECHO_LVM_RAID_PREPAR="$ECHO_LVM_RAID_PREPAR +Successfully activated ZFS." + else + ECHO_LVM_RAID_PREPAR="$ECHO_LVM_RAID_PREPAR +Error: could not activate ZFS. $PLEASECONTACT" + fi + ECHO_LVM_RAID_PREPAR="$ECHO_LVM_RAID_PREPAR +zpool list after activation +$(LANGUAGE=C LC_ALL=C zpool list) + +zfs list +$(LANGUAGE=C LC_ALL=C zfs list) +$(title_gen "findmnt (filtered) after ZFS activation") + +$(LANGUAGE=C LC_ALL=C findmnt -D | grep % | sed -e '/tmpfs/d' -e '/loop/d' ) + +" + fi + fi +fi +} diff -Nru boot-repair-4ppa123/usr/share/boot-sav/gui-scan.sh boot-repair-4ppa200/usr/share/boot-sav/gui-scan.sh --- boot-repair-4ppa123/usr/share/boot-sav/gui-scan.sh 2020-03-15 13:14:14.000000000 +0000 +++ boot-repair-4ppa200/usr/share/boot-sav/gui-scan.sh 2022-02-27 23:30:24.000000000 +0000 @@ -1,5 +1,5 @@ #! /bin/bash -# Copyright 2020 Yann MRN +# Copyright 2021 Yann MRN # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published @@ -28,17 +28,17 @@ determine_part_uuid #After check_blkid_partitions check_location_first_partitions #Output: $BYTES_BEFORE_PART[$disk] check_os_detected_by_os-prober #run os-prober a 2nd time after mounting -mount_all_blkid_partitions_except_df #To update OS_Mount_points +mount_all_blkid_partitions_except_df #To update OS_Mount_points determine_part_with_os $1 #after check_os_detected_by_os-prober, to get OSNAME (before check_recovery_or_hidden) check_recovery_or_hidden #After mount_all_blkid_partitions_except_df & before logs put_the_current_mbr_in_tmp #[[ "$GUI" ]] && echo "SET@_label0.set_text('''$LAB. $This_may_require_several_minutes''')" [[ "$GUI" ]] && echo "SET@_label0.set_text('''$LAB ($([[ -d /sys/firmware/efi ]] && echo "EFI-session" || echo "BIOS-session" )). $This_may_require_several_minutes''')" -check_disk_types #before part_types (for usb and gpt and esp_check) +check_disk_types #before part_types (for usb and gpt and esp_check) check_part_types $1 #After mount_all_blkid_partitions_except_df & determine_part_uuid & determine_part_with_os -check_efi_dmesg #Ideally after check_efi_parts +check_efi_dmesg_and_secureboot #Ideally after check_efi_parts #[[ "$GUI" ]] && echo "SET@_label0.set_text('''$Scanning_systems. $Please_wait''')" -[[ "$GUI" ]] && echo "SET@_label0.set_text('''$LAB ($([[ -d /sys/firmware/efi ]] && echo "SecureBoot $SECUREBOOT" || echo "BIOS-session" )). $Please_wait''')" +[[ "$GUI" ]] && echo "SET@_label0.set_text('''$LAB ($([[ -d /sys/firmware/efi ]] && echo "SecureBoot ${SECUREBOOT%%ed*}ed" || echo "BIOS-session" )). $Please_wait''')" paragraph_part_info } @@ -56,7 +56,7 @@ for ((d=1;d<=NBOFDISKS;d++)); do ECHO_PARTS_INFO="$ECHO_PARTS_INFO ${LISTOFDISKS[$d]} : ${GPT_DISK[$d]}, ${BIOS_BOOT_DISK[$d]}, ${EFI_DISK[$d]}, \ - ${USBDISK[$d]}, ${MMCDISK[$d]}, ${DISK_HASOS[$d]}, ${SECTORS_BEFORE_PART[$d]} sectors * ${BYTES_PER_SECTOR[$d]} bytes" + ${USBDISK[$d]}, ${MMCDISK[$d]}, ${DISK_HASOS[$d]}, ${REALWINONDISC[$d]}, ${SECTORS_BEFORE_PART[$d]} sectors * ${BYTES_PER_SECTOR[$d]} bytes" done ECHO_PARTS_INFO="$ECHO_PARTS_INFO @@ -80,7 +80,7 @@ " for ((i=1;i<=NBOFPARTITIONS;i++)); do ECHO_PARTS_INFO="$ECHO_PARTS_INFO -${LISTOFPARTITIONS[$i]} : ${PART_WITH_SEPARATEBOOT[$i]}, ${BOOTPRESENCE_OF_PART[$i]}, ${BOOT_IN_FSTAB_OF_PART[$i]}, ${SEPARATE_USR_PART[$i]}, ${USRPRESENCE_OF_PART[$i]}, ${USR_IN_FSTAB_OF_PART[$i]}, ${CUSTOMIZER[$i]}, ${DISK_PART[$i]}" +${LISTOFPARTITIONS[$i]} : ${PART_WITH_SEPARATEBOOT[$i]}, ${BOOT_AND_KERNEL_IN[$i]}, ${FSTAB_HAS_GOOD_BOOT[$i]}, ${SEPARATE_USR_PART[$i]}, ${USRPRESENCE_OF_PART[$i]}, ${USR_IN_FSTAB_OF_PART[$i]}, ${CUSTOMIZER[$i]}, ${DISK_PART[$i]}" done if [[ "$DEBBUG" ]];then title_gen "parted -lm" @@ -99,7 +99,7 @@ title_gen "mount (filtered)" while read line; do [[ "$line" =~ "dev/" ]] && [[ ! "$line" =~ hugetlbfs ]] && [[ ! "$line" =~ tmpfs ]] && [[ ! "$line" =~ mqueue ]] && [[ ! "$line" =~ devpts ]] && echo "$line" - done < <(echo "$MOUNTB" ) + done < <(mount ) #debug title_gen "ls (filtered)" a=/sys/block/;for x in $(ls $a);do if [[ ! "$x" =~ ram ]] && [[ ! "$x" =~ oop ]] && [[ ! "$x" =~ sr ]];then b="";for y in $(ls $a$x);do b="$b $y";done;echo "$a$x: $b";fi;done @@ -135,10 +135,10 @@ GPT_DISK_WITHOUT_BIOS_BOOT="" MSDOSPRESENT="" NB_EFIPARTONGPT=0; NB_BISEFIPART=0 #cant move to check_part_types -for ((d=1;d<=NBOFDISKS;d++)); do #ex: http://paste.ubuntu.com/894616 , http://paste.ubuntu.com/1199042 +for ((d=1;d<=NBOFDISKS;d++)); do BIOS_BOOT_DISK[$d]=no-BIOSboot TMPDISK="${LISTOFDISKS[$d]}" - if [[ "$(LANGUAGE=C LC_ALL=C fdisk -l "/dev/$TMPDISK" 2>/dev/null | grep -i GPT )" ]] \ + if [[ "$(LANGUAGE=C LC_ALL=C fdisk -l "/dev/$TMPDISK" 2>/dev/null | grep -i GPT | grep -i Disklabel )" ]] \ && [[ ! "$(echo "$PARTEDLM" | grep -i msdos | grep "/dev/${TMPDISK}:" )" ]] \ && [[ ! "$(echo "$PARTEDLM" | grep -i loop | grep "/dev/${TMPDISK}:" )" ]] \ || [[ "$(echo "$PARTEDLM" | grep -i gpt | grep "/dev/${TMPDISK}:" )" ]];then @@ -148,12 +148,12 @@ if [[ "$e" =~ /dev/ ]];then [[ "$e" =~ "/dev/${TMPDISK}:" ]] && f=ok || f="" fi - [[ "$f" ]] && [[ "$e" =~ bios_grub ]] && BIOS_BOOT_DISK[$d]=hasBIOSboot #eg http://paste.ubuntu.com/961886 + [[ "$f" ]] && [[ "$e" =~ bios_grub ]] && BIOS_BOOT_DISK[$d]=hasBIOSboot done [[ "$(LANGUAGE=C LC_ALL=C fdisk -l "/dev/$TMPDISK" 2>/dev/null | grep 'BIOS boot' )" ]] && BIOS_BOOT_DISK[$d]=hasBIOSboot #security in case parted KO [[ "${BIOS_BOOT_DISK[$d]}" != hasBIOSboot ]] && GPT_DISK_WITHOUT_BIOS_BOOT=yes else - GPT_DISK[$d]=notGPT #table may be loop http://paste.ubuntu.com/1159385 + GPT_DISK[$d]=notGPT #table may be loop MSDOSPRESENT=yes #used by fillin_bootflag_combobox fi [[ "$(ls -l /dev/disk/by-id | grep " usb-" | grep "${LISTOFDISKS[$d]}")" ]] \ @@ -166,12 +166,16 @@ p="$(LANGUAGE=C LC_ALL=C fdisk -l /dev/$TMPDISK 2>/dev/null | grep /dev | grep '*' )" if [[ ! "$(echo $p | grep "/dev/${TMPDISK}1 " )" ]] && [[ ! "$(echo $p | grep "/dev/${TMPDISK}2 " )" ]] \ && [[ ! "$(echo $p | grep "/dev/${TMPDISK}3 " )" ]] && [[ ! "$(echo $p | grep "/dev/${TMPDISK}4 " )" ]] \ - || [[ "$(echo $p | grep Empty )" ]];then #http://paste.ubuntu.com/1111263 + || [[ "$(echo $p | grep Empty )" ]];then BOOTFLAG_NEEDED[$d]=setflag fi fi EFI_DISK[$d]=has-noESP #init + REALWINONDISC[$d]=no-wind + for ((i=1;i<=NBOFPARTITIONS;i++)); do + [[ "${REALWIN[$i]}" ]] && [[ "${DISKNB_PART[$i]}" = "$d" ]] && REALWINONDISC[$d]=has-win + done done } @@ -233,7 +237,7 @@ GRUBVER[$i]=nogrub for gg in /usr/sbin/ /usr/bin/ /sbin/ /bin/;do #not sure "type" is available in all distros for gi in grub-install.unsupported grub-install grub2-install;do - if [[ -f "${BLKIDMNT_POINT[$i]}$gg$gi" ]];then + if ( [[ ! -f "${BLKIDMNT_POINT[$i]}${gg}grub" ]] || [[ "${GRUBVER[$i]}" != grub2 ]] ) && [[ -f "${BLKIDMNT_POINT[$i]}$gg$gi" ]];then #prefers grub2 GRUBTYPE_OF_PART[$i]=$gi GRUBTYPE_OF_PARTZ[$i]=$gg$gi [[ -f "${BLKIDMNT_POINT[$i]}${gg}grub" ]] && GRUBVER[$i]=grub1 || GRUBVER[$i]=grub2 @@ -270,6 +274,7 @@ LIST_OF_PART_WITH_GRUB[$QTY_OF_PART_WITH_GRUB]="$i" fi + APTTYP[$i]="" if [[ -f "${BLKIDMNT_POINT[$i]}/usr/bin/apt-get" ]] || [[ -f "${BLKIDMNT_POINT[$i]}/usr/bin/yum" ]] \ || [[ -f "${BLKIDMNT_POINT[$i]}/usr/bin/zypper" ]] || [[ -f "${BLKIDMNT_POINT[$i]}/usr/bin/pacman" ]] \ || [[ -f "${BLKIDMNT_POINT[$i]}/bin/apt-get" ]] || [[ -f "${BLKIDMNT_POINT[$i]}/bin/yum" ]] \ @@ -280,11 +285,12 @@ APTTYP[$i]=apt-get #Debian YESTYP[$i]="-y" INSTALLTYP[$i]=install - PURGETYP[$i]=purge + PURGETYP[$i]="purge --allow-remove-essential" POLICYTYP[$i]="apt-cache policy" CANDIDATETYP[$i]="grep Candidate" CANDIDATETYP2[$i]="grep -v none" UPDATETYP[$i]="-y update" + PACKVERTYP[$i]='dpkg-query -W -f=${Version}' elif [[ -f "${BLKIDMNT_POINT[$i]}/usr/bin/yum" ]] || [[ -f "${BLKIDMNT_POINT[$i]}/bin/yum" ]];then APTTYP[$i]=yum #fedora YESTYP[$i]=-y @@ -293,6 +299,7 @@ POLICYTYP[$i]="yum info name" CANDIDATETYP[$i]="grep Available" UPDATETYP[$i]=makecache + PACKVERTYP[$i]='rpm -q --qf=%{version}' elif [[ -f "${BLKIDMNT_POINT[$i]}/usr/bin/zypper" ]] || [[ -f "${BLKIDMNT_POINT[$i]}/bin/zypper" ]];then APTTYP[$i]='zypper --non-interactive' #opensuse YESTYP[$i]='' @@ -301,6 +308,7 @@ POLICYTYP[$i]="zypper info" CANDIDATETYP[$i]="grep Installed" UPDATETYP[$i]=refresh + PACKVERTYP[$i]="zypper se -s --match-exact" elif [[ -f "${BLKIDMNT_POINT[$i]}/usr/bin/pacman" ]] || [[ -f "${BLKIDMNT_POINT[$i]}/bin/pacman" ]];then APTTYP[$i]=pacman #arch YESTYP[$i]='' @@ -310,6 +318,7 @@ CANDIDATETYP[$i]="grep download" UPDATETYP[$i]="-Sy --noconfirm pacman" UPDATETYP2[$i]=pacman-db-upgrade + PACKVERTYP[$i]="pacman -Q" #elif [[ -f "${BLKIDMNT_POINT[$i]}/usr/bin/urpmi" ]] || [[ -f "${BLKIDMNT_POINT[$i]}/bin/urpmi" ]];then # APTTYP[$i]=urpmi #http://wiki.mandriva.com/fr/Installer_et_supprimer_des_logiciels # YESTYP[$i]="" @@ -351,24 +360,13 @@ # fi # fi # fi - fi - - DISABLE_OS[$i]="" - temp="${BLKIDMNT_POINT[$i]}/etc/default/grub" - if [[ -f "$temp" ]];then -# if [[ ! "$1" ]];then -# echo " -#$DASH ${temp#*boot-sav/} (filtered):" -# while read line; do -# [[ "$line" ]] && [[ "$(echo "$line" | grep -v "# ")" ]] && echo "$line" -#done < <(cat "$temp" ) -# fi - [[ "$(cat "$temp" | grep GRUB_DISABLE_OS | grep -v '#GRUB_DISABLE_OS' )" ]] && DISABLE_OS[$i]=yes + else + CUSTOMIZER[$i]=no--grub.d fi LIB64="" for z in "${BLKIDMNT_POINT[$i]}"/{,usr/}lib64;do - if [[ -d "$z" ]];then #http://paste.ubuntu.com/1072493 , http://forum.ubuntu-fr.org/viewtopic.php?pid=10355311#p10355311 + if [[ -d "$z" ]];then #http://forum.ubuntu-fr.org/viewtopic.php?pid=10355311#p10355311 [[ "$(ls "$z" | grep -vi libfakeroot | grep -vi gnomenu | grep -vi elilo )" ]] && LIB64=yes fi done @@ -377,7 +375,7 @@ ARCH_OF_PART[$i]=32 (( QTY_OF_32BITS_PART += 1 )) for z in "${BLKIDMNT_POINT[$i]}"/{,usr/}lib64;do - if [[ -d "$z" ]];then #debug, eg http://paste.ubuntu.com/1195587 + if [[ -d "$z" ]];then #debug if [[ "$(ls "$z" | grep -vi libfakeroot | grep -vi gnomenu | grep -vi elilo )" ]];then b=""; for a in $(ls "$z");do b="$a $b";done;echo "$PLEASECONTACT : $z: $b" fi @@ -388,14 +386,14 @@ (( QTY_OF_64BITS_PART += 1 )) fi - BOOTPRESENCE_OF_PART[$i]=no-boot + BOOT_AND_KERNEL_IN[$i]=no---boot tmp="${BLKIDMNT_POINT[$i]}/boot" - if [[ -d "$tmp" ]] && [[ ! "$(grep -i /boot/efi <<< "${BLKIDMNT_POINT[$i]}/" )" ]];then #http://paste.ubuntu.com/1375034 + if [[ -d "$tmp" ]] && [[ ! "$(grep -i /boot/efi <<< "${BLKIDMNT_POINT[$i]}/" )" ]];then if [[ "$(ls "$tmp" )" ]] && [[ ! "$(ls "$tmp" | grep -ix bcd )" ]];then if [[ "$(ls "$tmp" | grep vmlinuz )" ]] && [[ "$(ls "$tmp" | grep initr )" ]];then #initramfs and vmlinuz-linux for Arch - BOOTPRESENCE_OF_PART[$i]=with-boot + BOOT_AND_KERNEL_IN[$i]=with-boot else #if [[ ! "$(ls "$tmp" | grep '.efi' )" ]];then - BOOTPRESENCE_OF_PART[$i]=no-kernel + BOOT_AND_KERNEL_IN[$i]=no-kernel [[ "$DEBBUG" ]] && echo " $DASH No kernel in ${LISTOFPARTITIONS[$i]}/boot: $(ls "$tmp")" @@ -456,8 +454,8 @@ FSTAB_HASGOODEFI_OFPART[$i]=fstab-without-efi fi if [[ "$(cat "${BLKIDMNT_POINT[$i]}/etc/fstab" | grep /boot | grep -v /boot/ | grep -v '#' )" ]];then - BOOT_IN_FSTAB_OF_PART[$i]=fstab-has-bad-boot - BOOT_OF_PART[$i]="" + FSTAB_HAS_GOOD_BOOT[$i]=fstab-has-bad-boot + BOOTPART_IN_FSTAB_OF[$i]="" b="" while read line;do a="$(echo "$line" | grep /boot | grep -v /boot/ | grep -v '#' )" #eg. UUID=0EC9-AA63 /boot vfat defaults 0 1 @@ -470,26 +468,26 @@ UUID_OF_BOOTPART="${b##*=}" for ((uuidp=1;uuidp<=NBOFPARTITIONS;uuidp++)); do if [[ "$UUID_OF_BOOTPART" =~ "${PART_UUID[$uuidp]}" ]] && [[ "${PART_WITH_OS[$uuidp]}" = no-os ]];then - BOOT_OF_PART[$i]="$uuidp" - BOOT_IN_FSTAB_OF_PART[$i]=fstab-has-goodBOOT + BOOTPART_IN_FSTAB_OF[$i]="$uuidp" + FSTAB_HAS_GOOD_BOOT[$i]=fstab-has-goodBOOT fi done elif [[ "$b" =~ dev/ ]];then PARTOF_BOOTPART="${b##*dev/}" for ((uuidp=1;uuidp<=NBOFPARTITIONS;uuidp++)); do if [[ "$PARTOF_BOOTPART" =~ "${LISTOFPARTITIONS[$uuidp]}" ]] && [[ "${PART_WITH_OS[$uuidp]}" = no-os ]];then - BOOT_OF_PART[$i]="$uuidp" - BOOT_IN_FSTAB_OF_PART[$i]=fstab-has-goodBOOT + BOOTPART_IN_FSTAB_OF[$i]="$uuidp" + FSTAB_HAS_GOOD_BOOT[$i]=fstab-has-goodBOOT fi done fi [[ "$DEBBUG" ]] && echo " -$DASH /boot detected in the fstab of ${LISTOFPARTITIONS[$i]}: $b (${LISTOFPARTITIONS[${BOOT_OF_PART[$i]}]})" +$DASH /boot detected in the fstab of ${LISTOFPARTITIONS[$i]}: $b (${LISTOFPARTITIONS[${BOOTPART_IN_FSTAB_OF[$i]}]})" else - BOOT_IN_FSTAB_OF_PART[$i]=fstab-without-boot + FSTAB_HAS_GOOD_BOOT[$i]=fstab-without-boot fi if [[ "$(cat "${BLKIDMNT_POINT[$i]}/etc/fstab" | grep /usr | grep -v /usr/ | grep -v '#' | grep -v swap)" ]];then - USR_IN_FSTAB_OF_PART[$i]=fstab-has-bad-usr #http://paste.ubuntu.com/1099854 + USR_IN_FSTAB_OF_PART[$i]=fstab-has-bad-usr USR_OF_PART[$i]="" b="" while read line;do @@ -523,17 +521,20 @@ fi else FSTAB_HASGOODEFI_OFPART[$i]=part-has-no-fstab - BOOT_IN_FSTAB_OF_PART[$i]=part-has-no-fstab + FSTAB_HAS_GOOD_BOOT[$i]=part-has-no-fstab USR_IN_FSTAB_OF_PART[$i]=part-has-no-fstab fi - PART_WITH_SEPARATEBOOT[$i]=not-sepboot + PART_WITH_SEPARATEBOOT[$i]=not--sepboot if [[ "${PART_WITH_OS[$i]}" != no-os ]];then - PART_WITH_SEPARATEBOOT[$i]=not-sepboot + PART_WITH_SEPARATEBOOT[$i]=not--sepboot + elif [[ "$(ls "${BLKIDMNT_POINT[$i]}/" | grep vmlinuz )" ]] && [[ "$(ls "${BLKIDMNT_POINT[$i]}/" | grep initr )" ]] \ + && [[ "$(blkid | grep "${LISTOFPARTITIONS[$i]}:" | grep zfs_member )" ]];then + PART_WITH_SEPARATEBOOT[$i]=is--zfs-boot elif [[ "$(ls "${BLKIDMNT_POINT[$i]}/" | grep vmlinuz )" ]] && [[ "$(ls "${BLKIDMNT_POINT[$i]}/" | grep initr )" ]];then [[ "$DEBBUG" ]] && echo "[debug] ${LISTOFPARTITIONS[$i]} contains a kernel, so it is probably a /boot partition." (( QTY_BOOTPART += 1 )) - PART_WITH_SEPARATEBOOT[$i]=is-sepboot + PART_WITH_SEPARATEBOOT[$i]=is---sepboot SEP_BOOT_PARTS_PRESENCE=yes elif [[ ! "$(echo "$BLKID" | grep "/dev/${LISTOFPARTITIONS[$i]}:" | grep 'TYPE="vfat"' )" ]] \ && [[ ! "$(echo "$BLKID" | grep "/dev/${LISTOFPARTITIONS[$i]}:" | grep 'TYPE="ntfs"' )" ]];then @@ -542,8 +543,6 @@ fi [[ "${PART_WITH_OS[$i]}" = no-os ]] && temp="" || temp=/boot - - GRUB_ENV[$i]=no-grubenv if [[ -f "${BLKIDMNT_POINT[$i]}${temp}/grub/grubenv" ]];then GRUB_ENV[$i]=grubenv-ok @@ -565,7 +564,7 @@ WINXPTOREPAIR[$i]="" WINSETOREPAIR[$i]="" #after xp if [[ "${RECOV[$i]}" != recovery-or-hidden ]] && [[ "${WINXP[$i]}" ]];then - #&& [[ "$(ls "${BLKIDMNT_POINT[$i]}/" | grep -ix 'Program Files' )" ]] http://paste.ubuntu.com/1032766 + #&& [[ "$(ls "${BLKIDMNT_POINT[$i]}/" | grep -ix 'Program Files' )" ]] (( QTY_WINBOOTTOREPAIR += 1 )) WINXPTOREPAIR[$i]=yes elif [[ "${WINMGR[$i]}" = no-bmgr ]] || [[ "${WINBCD[$i]}" = no-b-bcd ]] || [[ "${WINL[$i]}" = no-winload ]] \ @@ -600,7 +599,7 @@ f="" while read line;do #eg 1:1049kB:21.0GB:21.0GB:ext4::; if [[ "$line" =~ /dev/ ]];then - [[ "$line" =~ "/dev/${DISK_PART[$i]}:" ]] && f=ok || f="" + [[ "$line" =~ "/dev/${DISK_PART[$i]}:" ]] && [[ "$part" =~ "${DISK_PART[$i]}" ]] && f=ok || f="" fi if [[ "$f" ]] && [[ "${line%%:*}" = "${part##*[a-z]}" ]];then ENDB="${line#*B:}" #eg 21.0GB:21.0GB:ext4::; @@ -613,33 +612,32 @@ fi done < <(echo "$PARTEDLM") - if [[ "$DEBBUG" ]];then - if [[ -f "${BLKIDMNT_POINT[$i]}/etc/mdadm/mdadm.conf" ]];then - [[ "$DEBBUG" ]] && echo " + if [[ "$DEBBUG" ]];then + if [[ -f "${BLKIDMNT_POINT[$i]}/etc/mdadm/mdadm.conf" ]];then + [[ "$DEBBUG" ]] && echo " $DASH ${LISTOFPARTITIONS[$i]}/etc/mdadm/mdadm.conf $FILTERED:" - if [[ ! "$FILTERED" ]];then - while read line; do - [[ "$line" ]] && [[ ! "$line" =~ '# ' ]] && [[ "$line" != '#' ]] && echo "$line" - done < <(cat "${BLKIDMNT_POINT[$i]}"/etc/mdadm/mdadm.conf) - else - cat "${BLKIDMNT_POINT[$i]}"/etc/mdadm/mdadm.conf - fi - if [[ -f "${BLKIDMNT_POINT[$i]}/proc/mdstat" ]];then - [[ "$DEBBUG" ]] && echo " + if [[ ! "$FILTERED" ]];then + cat "${BLKIDMNT_POINT[$i]}"/etc/mdadm/mdadm.conf | sed "/^#/ d" | sed '/^$/d' #remove empty and commented lines + else + cat "${BLKIDMNT_POINT[$i]}"/etc/mdadm/mdadm.conf + fi + fi + if [[ -f "${BLKIDMNT_POINT[$i]}/proc/mdstat" ]];then + [[ "$DEBBUG" ]] && echo " $DASH ${LISTOFPARTITIONS[$i]}/proc/mdstat :" - while read line; do - [[ "$line" ]] && echo "$line" - done < <(cat "${BLKIDMNT_POINT[$i]}"/proc/mdstat ) - fi - fi - fi + if [[ ! "$FILTERED" ]];then + cat "${BLKIDMNT_POINT[$i]}"/proc/mdstat | sed "/^#/ d" | sed '/^$/d' #remove empty and commented lines + else + cat "${BLKIDMNT_POINT[$i]}"/proc/mdstat + fi + fi + fi ddd="${DISKNB_PART[$i]}" if [[ -d "${BLKIDMNT_POINT[$i]}/casper" ]] || [[ -d "${BLKIDMNT_POINT[$i]}/preseed" ]] \ || [[ -f "${BLKIDMNT_POINT[$i]}/autorun.inf" ]] || [[ "$(ls "${BLKIDMNT_POINT[$i]}/" | grep '.sys' )" ]] \ && [[ "${USBDISK[${DISKNB_PART[$i]}]}" = usb-disk ]] || [[ -f "${BLKIDMNT_POINT[$i]}/ldlinux.sys" ]];then #eg http://ubuntuforums.org/showpost.php?p=12264795&postcount=574 - #ex with usb not detected: http://paste.ubuntu.com/1370752 USBDISK[$ddd]=liveusb fi if [[ -d "${BLKIDMNT_POINT[$i]}/casper" ]] || [[ -d "${BLKIDMNT_POINT[$i]}/preseed" ]] \ @@ -649,7 +647,7 @@ fi done efi_scan >/dev/null #must be after USBDISK[ and MMCDISK[ and GPT_DISK[ fillin -paragraph_efi +[[ "$DEBBUG" ]] && paragraph_efi [[ "$DEBBUG" ]] && echo "$ECHO_SUMEFI_SECTION" } @@ -657,7 +655,7 @@ ################## EFI SCAN #DASHM5=yes ECHO_SUMEFI_SECTION="" -[[ "$DEBBUG" ]] && echo "ECHO_SUMEFI_SECTION" +[[ "$DEBBUG" ]] && echo "[debug] ECHO_SUMEFI_SECTION" for ((i=1;i<=NBOFPARTITIONS;i++)); do if [[ -d "${BLKIDMNT_POINT[$i]}/efi" ]] || [[ -d "${BLKIDMNT_POINT[$i]}/EFI" ]];then # && [[ "${PART_WITH_OS[$i]}" = no-os ]] # if [[ "$DASHM5" ]];then @@ -685,8 +683,8 @@ WINEFI[$i]="" BOOTEFI[$i]="" MACEFI[$i]="" - if [[ -d "${BLKIDMNT_POINT[$i]}/efi" ]] || [[ -d "${BLKIDMNT_POINT[$i]}/EFI" ]] \ - && [[ "${USBDISK[$tmp]}" != liveusb ]] && [[ "${MMCDISK[$tmp]}" != livemmc ]];then #exclude liveUSB , eg http://paste.ubuntu.com/1195690 + if ( [[ -d "${BLKIDMNT_POINT[$i]}/efi" ]] || [[ -d "${BLKIDMNT_POINT[$i]}/EFI" ]] ) \ + && ( [[ "${USBDISK[$tmp]}" != liveusb ]] && [[ "${MMCDISK[$tmp]}" != livemmc ]] || [[ "${REALWINONDISC[$tmp]}" = has-win ]] );then #exclude liveUSB/MMC except if Windows on it d="${DISKNB_PART[$i]}" [[ -d "${BLKIDMNT_POINT[$i]}/EFI" ]] && efidoss="${BLKIDMNT_POINT[$i]}/EFI" || efidoss="${BLKIDMNT_POINT[$i]}/efi" for z in $efidoss/Microsoft/{,*/}*.efi;do #eg /EFI/Microsoft/Boot/bootmgfw.efi or bootx64.efi @@ -862,35 +860,38 @@ elif [[ "$MBR_ACTION" = nombraction ]];then IMPVAR="$IMPVAR not act on the boot." else - [[ "$GRUBPURGE_ACTION" ]] && IMPVAR="$IMPVAR purge ($PURGREASON) and" + if [[ "$GRUBPURGE_ACTION" ]];then + [[ "$PURGREASON" ]] && IMPVAR="$IMPVAR purge ($PURGREASON) and" || IMPVAR="$IMPVAR purge and" + fi IMPVAR="$IMPVAR reinstall the $GRUBPACKAGE of ${LISTOFPARTITIONS[$REGRUB_PART]}" if [[ ! "$GRUBPACKAGE" =~ efi ]];then [[ "$FORCE_GRUB" = place-in-MBR ]] || [[ "$REMOVABLEDISK" ]] && IMPVAR="$IMPVAR into the MBR of $NOFORCE_DISK" [[ "$FORCE_GRUB" = force-in-PBR ]] && IMPVAR="$IMPVAR into the PBR of $FORCE_PARTITION" - [[ ! "$REMOVABLEDISK" ]] && [[ "$FORCE_GRUB" = place-in-all-MBRs ]] && IMPVAR="$IMPVAR into the MBRs of all disks (except live-disks and removable disks without OS)" + #[[ ! "$REMOVABLEDISK" ]] && + [[ "$FORCE_GRUB" = place-in-all-MBRs ]] && IMPVAR="$IMPVAR into the MBRs of all disks without OS (except live-disks and removable disks)" fi [[ "$LASTGRUB_ACTION" ]] || [[ "$BLANKEXTRA_ACTION" ]] || [[ "$UNCOMMENT_GFXMODE" ]] || [[ "$ATA" ]] \ || [[ "$KERNEL_PURGE" ]] || [[ "$USE_SEPARATEBOOTPART" ]] || [[ "$USE_SEPARATEUSRPART" ]] \ || [[ "$ADD_KERNEL_OPTION" ]] || [[ "$GRUBPACKAGE" =~ efi ]] || [[ "$DISABLEWEBCHECK" ]] || [[ "$CHANGEDEFAULTOS" ]] \ && IMPVAR="$IMPVAR, -using the following options: $LASTGRUB_ACTION $BLANKEXTRA_ACTION $UNCOMMENT_GFXMODE $KERNEL_PURGE $DISABLEWEBCHECK $ATA $CHANGEDEFAULTOS" \ +using the following options: $LASTGRUB_ACTION$BLANKEXTRA_ACTION$UNCOMMENT_GFXMODE$KERNEL_PURGE$DISABLEWEBCHECK$ATA$CHANGEDEFAULTOS" \ || IMPVAR="$IMPVAR." - [[ "$USE_SEPARATEBOOTPART" ]] && IMPVAR="$IMPVAR ${LISTOFPARTITIONS[$BOOTPART_TO_USE]}/boot," - [[ "$USE_SEPARATEUSRPART" ]] && IMPVAR="$IMPVAR ${LISTOFPARTITIONS[$USRPART_TO_USE]}/usr," - [[ "$GRUBPACKAGE" =~ efi ]] && IMPVAR="$IMPVAR ${LISTOFPARTITIONS[$EFIPART_TO_USE]}/boot/efi," - [[ "$ADD_KERNEL_OPTION" ]] && IMPVAR="$IMPVAR $ADD_KERNEL_OPTION ($CHOSEN_KERNEL_OPTION)," - [[ "$REMOVABLEDISK" ]] && [[ "$FORCE_GRUB" = place-in-all-MBRs ]] && IMPVAR="$IMPVAR -It $WIOULD also fix access to other systems (other MBRs) for the situations -when the removable media is disconnected." - [[ "$NOTEFIREASON" ]] && IMPVAR="$IMPVAR -Grub-efi $WIOULD not be selected by default because: $NOTEFIREASON" + [[ "$USE_SEPARATEBOOTPART" ]] && IMPVAR="$IMPVAR ${LISTOFPARTITIONS[$BOOTPART_TO_USE]}/boot" + [[ "$USE_SEPARATEUSRPART" ]] && IMPVAR="$IMPVAR ${LISTOFPARTITIONS[$USRPART_TO_USE]}/usr" + [[ "$GRUBPACKAGE" =~ efi ]] && IMPVAR="$IMPVAR ${LISTOFPARTITIONS[$EFIPART_TO_USE]}/boot/efi" + [[ "$ADD_KERNEL_OPTION" ]] && IMPVAR="$IMPVAR $ADD_KERNEL_OPTION ($CHOSEN_KERNEL_OPTION)" +# [[ "$REMOVABLEDISK" ]] && [[ "$FORCE_GRUB" = place-in-all-MBRs ]] && IMPVAR="$IMPVAR +#It $WIOULD also fix access to other systems (other MBRs) for the situations +#when the removable media is disconnected." + [[ ! "$GRUBPACKAGE" =~ efi ]] && [[ "$NOTEFIREASON" ]] && IMPVAR="$IMPVAR +Grub-efi $WIOULD not be selected by default because ${NOTEFIREASON}." fi [[ "$BOOTFLAG_ACTION" ]] && IMPVAR="$IMPVAR The boot flag $WIOULD be placed on ${LISTOFPARTITIONS[$BOOTFLAG_TO_USE]}." [[ "$UNHIDEBOOT_ACTION" ]] || [[ "$FSCK_ACTION" ]] || [[ "$WUBI_ACTION" ]] || [[ "$WINBOOT_ACTION" ]] \ || [[ "$CREATE_BKP_ACTION" ]] || [[ "$RESTORE_BKP_ACTION" ]] && IMPVAR="$IMPVAR -Additional repair $WIOULD be performed: $UNHIDEBOOT_ACTION $WINBOOT_ACTION $CREATE_BKP_ACTION $WINEFI_BKP_ACTION $RESTORE_BKP_ACTION $WUBI_ACTION $FSCK_ACTION" +Additional repair $WIOULD be performed: $UNHIDEBOOT_ACTION$WINBOOT_ACTION$CREATE_BKP_ACTION$WINEFI_BKP_ACTION$RESTORE_BKP_ACTION$WUBI_ACTION$FSCK_ACTION" [[ "$WIOULD" = will ]] && IMPVAR="$IMPVAR " diff -Nru boot-repair-4ppa123/usr/share/boot-sav/gui-tab-grub.sh boot-repair-4ppa200/usr/share/boot-sav/gui-tab-grub.sh --- boot-repair-4ppa123/usr/share/boot-sav/gui-tab-grub.sh 2020-03-15 13:14:14.000000000 +0000 +++ boot-repair-4ppa200/usr/share/boot-sav/gui-tab-grub.sh 2022-02-08 21:32:42.000000000 +0000 @@ -1,5 +1,5 @@ #! /bin/bash -# Copyright 2014-2020 Yann MRN +# Copyright 2014-2021 Yann MRN # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published @@ -13,8 +13,18 @@ # You should have received a copy of the GNU General Public License along # with this program. If not, see . + +_button_open_etc_default_grub() { +if [[ -f "${BLKIDMNT_POINT[$REGRUB_PART]}/etc/default/grub" ]];then + echo "[debug]xdg-open ${BLKIDMNT_POINT[$REGRUB_PART]}/etc/default/grub" + xdg-open "${BLKIDMNT_POINT[$REGRUB_PART]}/etc/default/grub" & +else + echo "${BLKIDMNT_POINT[$REGRUB_PART]}/etc/default/grub does not exist. Please choose the [Purge and reinstall] option." + [[ "$GUI" ]] && zenity --width=400 --info --title="$APPNAME2" --text="${BLKIDMNT_POINT[$REGRUB_PART]}/etc/default/grub does not exist. Please choose the [Purge and reinstall] option." 2>/dev/null +fi +} + _checkbutton_signed() { -#ex of working installed Ubuntu with SecureBoot enabled: http://paste.ubuntu.com/1388623 if [[ "${@}" = True ]];then set_signed else @@ -47,27 +57,27 @@ if [[ "$raiduser" = yes ]] && ( [[ "$(type -p dmraid)" ]] || [[ "$(type -p mdadm)" ]] ) ;then RAIDREASON=yes fi -if ( [[ "$GRUBPACKAGE" =~ grub-efi ]] && [[ ! "${DOCGRUB[$USRPART]}" =~ efi ]] ) \ -|| ( [[ "$GRUBPACKAGE" = grub2 ]] && [[ ! "${DOCGRUB[$USRPART]}" =~ pc ]] ) \ +#|| ( [[ ! "$GRUBPACKAGE" =~ signed ]] && [[ "${DOCGRUB[$USRPART]}" =~ signed ]] ) +if ( [[ "$GRUBPACKAGE" =~ efi ]] && [[ ! "${DOCGRUB[$USRPART]}" =~ efi ]] ) \ || ( [[ "$GRUBPACKAGE" = grub2 ]] && [[ "${DOCGRUB[$USRPART]}" =~ efi ]] && [[ -d /sys/firmware/efi ]] ) \ +|| ( [[ "$GRUBPACKAGE" = grub2 ]] && [[ ! "${DOCGRUB[$USRPART]}" =~ pc ]] ) \ || ( [[ "$GRUBPACKAGE" =~ signed ]] && [[ ! "${DOCGRUB[$USRPART]}" =~ signed ]] ) \ -|| ( [[ ! "$GRUBPACKAGE" =~ signed ]] && [[ "${DOCGRUB[$USRPART]}" =~ signed ]] ) \ || [[ "${GRUBTYPE_OF_PART[$USRPART]}" = nogrubinstall ]] || [[ "$LASTGRUB_ACTION" ]] || [[ "$GRUBPACKAGE" = grub ]] \ || [[ "${PART_GRUBLEGACY[$BOOTPART]}" = has-legacyfiles ]] || [[ "${PART_GRUBLEGACY[$REGRUB_PART]}" = has-legacyfiles ]];then BLOCKONPURGE=yes [[ "$GUI" ]] && echo 'SET@_checkbutton_purge_grub.set_sensitive(False)' fi -if [[ "$BLOCKONPURGE" ]] || [[ "${CUSTOMIZER[$REGRUB_PART]}" = customized ]] || [[ "${GRUB_ENV[$REGRUB_PART]}" = grubenv-ng ]] \ +if [[ "$BLOCKONPURGE" ]] || [[ "${CUSTOMIZER[$REGRUB_PART]}" != std-grub.d ]] || [[ "${GRUB_ENV[$REGRUB_PART]}" = grubenv-ng ]] \ || [[ "$RAIDREASON" ]] || [[ "$BLKID" =~ LVM ]];then PURGREASON="in order to" - if ( [[ "$GRUBPACKAGE" =~ grub-efi ]] && [[ ! "${DOCGRUB[$USRPART]}" =~ efi ]] ) || ( [[ "$GRUBPACKAGE" = grub2 ]] && [[ ! "${DOCGRUB[$USRPART]}" =~ pc ]] );then + if ( [[ "$GRUBPACKAGE" =~ efi ]] && [[ ! "${DOCGRUB[$USRPART]}" =~ efi ]] ) || ( [[ "$GRUBPACKAGE" = grub2 ]] && [[ ! "${DOCGRUB[$USRPART]}" =~ pc ]] );then PURGREASON="$PURGREASON fix packages" elif [[ "$GRUBPACKAGE" = grub2 ]] && [[ "${DOCGRUB[$USRPART]}" =~ efi ]] && [[ -d /sys/firmware/efi ]];then PURGREASON="$PURGREASON remove grub-efi" elif [[ "$GRUBPACKAGE" =~ signed ]];then PURGREASON="$PURGREASON sign-grub" - elif [[ "$GRUBPACKAGE" = grub-efi ]];then - PURGREASON="$PURGREASON unsign-grub" +# elif [[ "$GRUBPACKAGE" =~ efi ]];then +# PURGREASON="$PURGREASON unsign-grub" elif [[ "$RAIDREASON" ]];then PURGREASON="$PURGREASON enable-raid" elif [[ "$BLKID" =~ LVM ]];then @@ -78,11 +88,7 @@ PURGREASON="$PURGREASON upgrade version" elif [[ "$LEGACY_ACTION" ]];then PURGREASON="$PURGREASON downgrade version" - elif [[ "${PART_GRUBLEGACY[$BOOTPART]}" = has-legacyfiles ]] || [[ "${PART_GRUBLEGACY[$REGRUB_PART]}" = has-legacyfiles ]];then - PURGREASON="$PURGREASON fix legacy files" - elif [[ "${CUSTOMIZER[$REGRUB_PART]}" = customized ]];then - PURGREASON="$PURGREASON fix customized files" - elif [[ "$GRUBPACKAGE" =~ grub-efi ]] && [[ ! "${DOCGRUB[$USRPART]}" =~ efi ]];then + elif [[ "$GRUBPACKAGE" =~ efi ]] && [[ ! "${DOCGRUB[$USRPART]}" =~ efi ]];then PURGREASON="$PURGREASON help with efi" elif [[ "$GRUBPACKAGE" = grub2 ]] && [[ ! "${DOCGRUB[$USRPART]}" =~ pc ]];then PURGREASON="$PURGREASON fix grub files" @@ -100,8 +106,8 @@ PURGREASON="$PURGREASON clean-up legacy" elif [[ "$GRUBPACKAGE" = grub ]];then PURGREASON="$PURGREASON download legacy" - elif [[ "${CUSTOMIZER[$REGRUB_PART]}" = customized ]];then - PURGREASON="$PURGREASON clean-up customizer" + elif [[ "${CUSTOMIZER[$REGRUB_PART]}" != std-grub.d ]];then + PURGREASON="$PURGREASON fix grub.d" elif [[ "${GRUB_ENV[$REGRUB_PART]}" = grubenv-ng ]];then PURGREASON="$PURGREASON reset grubenv" fi @@ -138,14 +144,14 @@ } set_checkbutton_lastgrub() { -LASTGRUB_ACTION=upgrade-grub +LASTGRUB_ACTION=" upgrade-grub" [[ "$GUI" ]] && echo 'SET@_checkbutton_legacy.set_sensitive(False)' activate_grubpurge_if_necessary } unset_checkbutton_lastgrub() { LASTGRUB_ACTION="" -[[ "$GUI" ]] && [[ ! "$GRUBPACKAGE" =~ grub-efi ]] && echo 'SET@_checkbutton_legacy.set_sensitive(True)' +[[ "$GUI" ]] && [[ ! "$GRUBPACKAGE" =~ efi ]] && echo 'SET@_checkbutton_legacy.set_sensitive(True)' activate_grubpurge_if_necessary } @@ -185,7 +191,7 @@ if [[ "${@}" = True ]];then echo "$Warning_blankextra $Please_backup_data" [[ "$GUI" ]] && zenity --width=400 --warning --title="$APPNAME2" --text="$Warning_blankextra $Please_backup_data" 2>/dev/null - BLANKEXTRA_ACTION=flexnet + BLANKEXTRA_ACTION=" flexnet" else BLANKEXTRA_ACTION="" fi @@ -193,7 +199,7 @@ } _checkbutton_uncomment_gfxmode() { -[[ "${@}" = True ]] && UNCOMMENT_GFXMODE=uncomment-gfxmode || UNCOMMENT_GFXMODE="" +[[ "${@}" = True ]] && UNCOMMENT_GFXMODE=" uncomment-gfxmode" || UNCOMMENT_GFXMODE="" [[ "$DEBBUG" ]] && echo "[debug]UNCOMMENT_GFXMODE becomes : $UNCOMMENT_GFXMODE" } @@ -223,14 +229,14 @@ } _checkbutton_kernelpurge() { -[[ "${@}" = True ]] && KERNEL_PURGE=kernel-purge || KERNEL_PURGE="" +[[ "${@}" = True ]] && KERNEL_PURGE=" kernel-purge" || KERNEL_PURGE="" echo "[debug]KERNEL_PURGE becomes : $KERNEL_PURGE" } activate_kernelpurge_if_necessary() { -if ( [[ ! "$USE_SEPARATEBOOTPART" ]] && [[ "${BOOTPRESENCE_OF_PART[$REGRUB_PART]}" != with-boot ]] ) \ -|| ( [[ "$USE_SEPARATEBOOTPART" ]] && [[ "${PART_WITH_SEPARATEBOOT[$BOOTPART_TO_USE]}" != is-sepboot ]] );then - KERNEL_PURGE=kernel-purge +if ( [[ ! "$USE_SEPARATEBOOTPART" ]] && [[ "${BOOT_AND_KERNEL_IN[$REGRUB_PART]}" != with-boot ]] ) \ +|| ( [[ "$USE_SEPARATEBOOTPART" ]] && [[ "${PART_WITH_SEPARATEBOOT[$BOOTPART_TO_USE]}" != is---sepboot ]] );then #in order to populate/boot + KERNEL_PURGE=" kernel-purge" [[ "$GUI" ]] && echo 'SET@_checkbutton_kernelpurge.set_active(True)' # echo 'SET@_checkbutton_kernelpurge.set_sensitive(False)' else diff -Nru boot-repair-4ppa123/usr/share/boot-sav/gui-tab-loca.sh boot-repair-4ppa200/usr/share/boot-sav/gui-tab-loca.sh --- boot-repair-4ppa123/usr/share/boot-sav/gui-tab-loca.sh 2020-03-15 13:14:14.000000000 +0000 +++ boot-repair-4ppa200/usr/share/boot-sav/gui-tab-loca.sh 2022-02-25 16:43:35.000000000 +0000 @@ -1,5 +1,5 @@ #! /bin/bash -# Copyright 2013 Yann MRN +# Copyright 2013-2022 Yann MRN # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published @@ -55,6 +55,10 @@ if [[ "${@}" = True ]]; then USE_SEPARATEBOOTPART=use-separate-boot; BOOTPART="$BOOTPART_TO_USE" [[ "$GUI" ]] && echo 'SET@_combobox_separateboot.set_sensitive(True)' + if [[ "${BLKIDMNT_POINT[$REGRUB_PART]}" =~ sav/zfs ]] || [[ "$(df -Th / | grep zfs )" ]];then + textwbz="Warning: this would impact fstab. This is not recommended with ZFS." + [[ ! "$GUI" ]] && echo "$textwbz" || zenity --width=400 --warning --text="$textwbz" 2>/dev/null + fi else USE_SEPARATEBOOTPART=""; BOOTPART="$REGRUB_PART" [[ "$GUI" ]] && echo 'SET@_combobox_separateboot.set_sensitive(False)' @@ -70,11 +74,11 @@ local typecsbf lup csbf fichier icsf [[ "$DEBBUG" ]] && echo "[debug]combobox_separateboot_fillin" [[ "$GUI" ]] && echo "COMBO@@CLEAR@@_combobox_separateboot" - for typecsbf in is-sepboot maybesepboot;do + for typecsbf in is---sepboot maybesepboot;do for lup in 1 2 3;do #In priority sep boot located on the same disk for ((csbf=1;csbf<=NBOFPARTITIONS;csbf++)); do - if ( [[ "$lup" = 1 ]] && [[ "${DISK_PART[$REGRUB_PART]}" = "${DISK_PART[$csbf]}" ]] && [[ "$csbf" = "${BOOT_OF_PART[$REGRUB_PART]}" ]] ) \ - || ( [[ "$lup" = 2 ]] && [[ "${DISK_PART[$REGRUB_PART]}" = "${DISK_PART[$csbf]}" ]] && [[ "$csbf" != "${BOOT_OF_PART[$REGRUB_PART]}" ]] ) \ + if ( [[ "$lup" = 1 ]] && [[ "${DISK_PART[$REGRUB_PART]}" = "${DISK_PART[$csbf]}" ]] && [[ "$csbf" = "${BOOTPART_IN_FSTAB_OF[$REGRUB_PART]}" ]] ) \ + || ( [[ "$lup" = 2 ]] && [[ "${DISK_PART[$REGRUB_PART]}" = "${DISK_PART[$csbf]}" ]] && [[ "$csbf" != "${BOOTPART_IN_FSTAB_OF[$REGRUB_PART]}" ]] ) \ || ( [[ "$lup" = 3 ]] && [[ "${DISK_PART[$REGRUB_PART]}" != "${DISK_PART[$csbf]}" ]] ) \ && [[ "${PART_WITH_SEPARATEBOOT[$csbf]}" = "$typecsbf" ]];then (( QTY_PARTWITHOUTOS += 1 )) @@ -97,9 +101,8 @@ [[ "$GUI" ]] && echo 'SET@_vbox_separateboot.hide()' fi -#http://paste.ubuntu.com/854108 -if [[ "$LIVESESSION" != live ]] && [[ "${BOOT_OF_PART[$REGRUB_PART]}" ]] \ - || [[ "${BOOTPRESENCE_OF_PART[$REGRUB_PART]}" != with-boot ]] && [[ "$QTY_BOOTPART" != 0 ]];then +if [[ "$LIVESESSION" != live ]] && [[ "${BOOTPART_IN_FSTAB_OF[$REGRUB_PART]}" ]] \ + || [[ "${BOOT_AND_KERNEL_IN[$REGRUB_PART]}" != with-boot ]] && [[ "$QTY_BOOTPART" != 0 ]];then USE_SEPARATEBOOTPART=use-separate-boot; BOOTPART="$BOOTPART_TO_USE" [[ "$GUI" ]] && echo 'SET@_checkbutton_separateboot.set_active(True)' [[ "$GUI" ]] && echo 'SET@_combobox_separateboot.set_sensitive(True)' @@ -163,7 +166,7 @@ fi if [[ "$LIVESESSION" != live ]] && [[ "${USR_OF_PART[$REGRUB_PART]}" ]] \ -|| [[ "${USRPRESENCE_OF_PART[$REGRUB_PART]}" != with--usr ]] && [[ "$QTY_SEP_USR_PARTS" != 0 ]];then #http://paste.ubuntu.com/1080968 +|| [[ "${USRPRESENCE_OF_PART[$REGRUB_PART]}" != with--usr ]] && [[ "$QTY_SEP_USR_PARTS" != 0 ]];then USE_SEPARATEUSRPART=use-separate-usr USRPART="$USRPART_TO_USE" [[ "$GUI" ]] && echo 'SET@_combobox_sepusr.set_sensitive(True)' #solves glade3 bug @@ -205,15 +208,15 @@ set_efi() { GRUBPACKAGE=grub-efi [[ "$GUI" ]] && echo 'SET@_checkbutton_signed.show()' -if [[ "$ARCHIPC" != 32 ]] && [[ "${ARCH_OF_PART[$USRPART]}" != 32 ]];then #[[ "$SECUREBOOT" = enabled ]];then +if [[ "${SECUREBOOT%% *}" != disabled ]] && [[ "$ARCHIPC" != 32 ]] ;then #&& [[ "${ARCH_OF_PART[... != 32 ]] -> added as blockers before repair set_signed [[ "$GUI" ]] && echo 'SET@_checkbutton_signed.set_active(True)' - [[ "$GUI" ]] && echo 'SET@_checkbutton_signed.set_sensitive(True)' else #there is currently no grub-efi-ia32-signed unset_signed #works: http://ubuntuforums.org/showthread.php?t=2098914 [[ "$GUI" ]] && echo 'SET@_checkbutton_signed.set_active(False)' - [[ "$GUI" ]] && echo 'SET@_checkbutton_signed.set_sensitive(False)' fi +[[ "$ARCHIPC" = 32 ]] && [[ "$GUI" ]] && echo 'SET@_checkbutton_signed.set_sensitive(False)' +[[ "$ARCHIPC" != 32 ]] && [[ "$GUI" ]] && echo 'SET@_checkbutton_signed.set_sensitive(True)' [[ "$GUI" ]] && echo 'SET@_combobox_efi.set_sensitive(True)' [[ "$GUI" ]] && echo 'SET@_vbox_place_or_force.hide()' [[ "$GUI" ]] && echo 'SET@_checkbutton_legacy.hide()' @@ -245,8 +248,8 @@ [[ "$DEBBUG" ]] && echo "[debug]combobox_efi_fillin ${LISTOFPARTITIONS[$REGRUB_PART]} , ${GPTTYPE[$REGRUB_PART]}" QTY_EFIPART=0 QTY_SUREEFIPART=0 -for mef in is---ESP maybeESP;do #not hidden first - for lup in 1 2 3 4 5 6;do #same disk > not live-usb > live-usb +for lup in 1 2 3 4 5 6;do #same disk > not live-usb > live-usb + for mef in is---ESP hidenESP;do #not hidden first for wup in 1 2;do #esp without win files first, then esp with win files for mmcc in 1 2;do #avoid usb and mmc for egpt in is-GPT notGPT;do @@ -274,9 +277,9 @@ && [[ "$DEBBUG" ]] && echo "[debug] ${LISTOFPARTITIONS[$icef]} EFI part (detected by BIS but not in fstab) in a live disk" fi if [[ "$temp" = ok ]];then - (( QTY_EFIPART += 1 )) + (( QTY_EFIPART += 1 )) #Listed in adv options LIST_EFIPART[$QTY_EFIPART]="$icef" - [[ "$mef" = is---ESP ]] && [[ "$lup" != 5 ]] && [[ "$lup" != 6 ]] && (( QTY_SUREEFIPART += 1 )) + [[ "$lup" != 5 ]] && [[ "$lup" != 6 ]] && (( QTY_SUREEFIPART += 1 )) #if ESP not on live disk , except if contains the OS fi fi done @@ -296,12 +299,12 @@ EFIPART_TO_USE="${LIST_EFIPART[1]}" NOTEFIREASON="" [[ "$DEBBUG" ]] && echo "[debug]EFIFILPRESENT $EFIFILPRESENT, QTY_SUREEFIPART $QTY_SUREEFIPART" -#selects grub-efi if either winefi detected or if no legacy windows detected. -if ( [[ "$QUANTITY_OF_REAL_WINDOWS" = 0 ]] && [[ "$QTY_SUREEFIPART" != 0 ]] ) || [[ "$WINEFIFILEPRESENCE" ]] && [[ "$QTY_EFIPART" != 0 ]];then #forum.ubuntu-fr.org/viewtopic.php?id=1091731 +#selects grub-efi if either winefi detected or if no legacy windows detected. If WinEFI detected, takes even ESP in live-discs as last chance. +if ( [[ "$QUANTITY_OF_REAL_WINDOWS" = 0 ]] && [[ "$QTY_SUREEFIPART" != 0 ]] ) || ( [[ "$WINEFIFILEPRESENCE" ]] && [[ "$QUANTITY_OF_REAL_WINDOWS" != 0 ]] ) \ +&& [[ "$QTY_EFIPART" != 0 ]];then #forum.ubuntu-fr.org/viewtopic.php?id=1091731 #boot-repair will block if [[ ! -d /sys/firmware/efi ]] #&& [[ "$QUANTITY_OF_DETECTED_MACOS" = 0 ]] && [[ ! "$MACEFIFILEPRESENCE" ]] bug#1250611 #[[ "${BIOS_BOOT_DISK[${DISKNB_PART[$EFIPART_TO_USE]}]}" != hasBIOSboot ]] - #ex with no efi dmsg: http://paste.ubuntu.com/1079434 set_efi [[ "$GUI" ]] && echo 'SET@_checkbutton_efi.set_active(True)' else @@ -309,15 +312,10 @@ [[ "$GUI" ]] && echo 'SET@_checkbutton_efi.set_active(False)' if [[ "$QTY_EFIPART" = 0 ]];then [[ "$GUI" ]] && echo 'SET@_vbox_efi.hide()' + NOTEFIREASON="no ESP detected" else - temp="" - #[[ "$QUANTITY_OF_DETECTED_MACOS" != 0 ]] || [[ "$MACEFIFILEPRESENCE" ]] && temp="mac-os $temp" - [[ ! "$WINEFIFILEPRESENCE" ]] && temp="no-win-efi $temp" - if [[ "$QUANTITY_OF_REAL_WINDOWS" != 0 ]] || [[ "$QTY_SUREEFIPART" = 0 ]];then - [[ "$QUANTITY_OF_REAL_WINDOWS" != 0 ]] && temp="legacy-win $temp" - [[ "$QTY_SUREEFIPART" = 0 ]] && temp="no-sure-esp $temp" - fi - [[ "$temp" ]] && NOTEFIREASON="$temp" || NOTEFIREASON="other-reason - $PLEASECONTACT" + [[ "$QUANTITY_OF_REAL_WINDOWS" != 0 ]] && NOTEFIREASON="legacy Windows detected" + [[ "$QUANTITY_OF_REAL_WINDOWS" = 0 ]] && [[ "$QTY_SUREEFIPART" = 0 ]] && NOTEFIREASON="no ESP detected outside live discs" fi fi activate_grubpurge_if_necessary @@ -329,10 +327,10 @@ RETOURCOMBO_ostoboot_bydefault="${@}" [[ "$DEBBUG" ]] && echo "[debug]RETOURCOMBO_ostoboot_bydefault : ${RETOURCOMBO_ostoboot_bydefault}" if [[ "$RETOURCOMBO_ostoboot_bydefault" = "$RETOURCOMBO_ostoboot_bydefault_OLD" ]];then - [[ "$DEBBUG" ]] && echo "[debug]Warning: Duplicate _combobox_ostoboot_bydefault" + [[ "$DEBBUG" ]] && echo "[debug]Warning: Duplicate _combobox_ostoboot_bydefault (probably user tried to select impossible OS)" elif [[ "$RETOURCOMBO_ostoboot_bydefault" =~ Windows ]];then REGRUB_PART="${LIST_OF_PART_FOR_REINSTAL[1]}" - CHANGEDEFAULTOS=set-windows-as-default + CHANGEDEFAULTOS=" set-windows-as-default" osbydefault_consequences else for ((cotbbd=1;cotbbd<=NBOFPARTITIONS;cotbbd++)); do @@ -364,7 +362,7 @@ QTY_OF_PART_FOR_REINSTAL=0 if [[ "$QTY_OF_PART_WITH_GRUB" != 0 ]] || [[ "$QTY_OF_PART_WITH_APTGET" != 0 ]];then if [[ "$(uname -m)" != x86_64 ]];then - [[ "$DEBBUG" ]] && echo "[debug]Order Linux according to their arch type" + [[ "$DEBBUG" ]] && echo "[debug]Order Linux according to their arch type, first 32bit then 64bit" loop_ostoboot_bydefault_fillin 64 loop_ostoboot_bydefault_fillin 32 else @@ -395,7 +393,7 @@ loop_ostoboot_bydefault_fillin() { local tmparch=$1 ilobf grubtmp looop bootyp if [[ "$LIVESESSION" != live ]];then - for ((ilobf=1;ilobf<=NBOFPARTITIONS;ilobf++)); do + for ((ilobf=1;ilobf<=NBOFPARTITIONS;ilobf++)); do #TODO to be checked, maybe use same ordering as below [[ "${GRUBOK_OF_PART[$ilobf]}" ]] || [[ "${APTTYP[$ilobf]}" != nopakmgr ]] \ || ( [[ "${USR_IN_FSTAB_OF_PART[$ilobf]}" != part-has-no-fstab ]] && [[ "$SEP_USR_PARTS_PRESENCE" ]] ) \ && subloop_ostobootbydefault_fillin @@ -403,23 +401,26 @@ else [[ "$DEBBUG" ]] && echo "[debug]Order Linux $tmparch bits" for looop in 1 2 3 4;do #Reinstall, then purge, then sep /usr - for grubtmp in grub2 grub1 nogrub;do #put GRUB2 Linux in priority - for bootyp in with-boot no-kernel no-boot;do - for ((ilobf=1;ilobf<=NBOFPARTITIONS;ilobf++)); do - if [[ "${GRUBVER[$ilobf]}" = "$grubtmp" ]] && [[ "${BOOTPRESENCE_OF_PART[$ilobf]}" = "$bootyp" ]];then - if [[ "$looop" = 1 ]] && [[ "${GRUBOK_OF_PART[$ilobf]}" ]] && [[ "${APTTYP[$ilobf]}" != nopakmgr ]];then - subloop_ostobootbydefault_fillin - elif [[ "$looop" = 2 ]] && [[ "${GRUBOK_OF_PART[$ilobf]}" ]] && [[ "${APTTYP[$ilobf]}" = nopakmgr ]];then - subloop_ostobootbydefault_fillin - elif [[ "$looop" = 3 ]] && [[ "${APTTYP[$ilobf]}" != nopakmgr ]] \ - && [[ ! "${GRUBOK_OF_PART[$ilobf]}" ]];then - subloop_ostobootbydefault_fillin - elif [[ "$looop" = 4 ]] && [[ "${APTTYP[$ilobf]}" = nopakmgr ]] \ - && [[ ! "${GRUBOK_OF_PART[$ilobf]}" ]] && [[ "$SEP_USR_PARTS_PRESENCE" ]] \ - && [[ "${USR_IN_FSTAB_OF_PART[$ilobf]}" != part-has-no-fstab ]];then - subloop_ostobootbydefault_fillin + for grubtmp in grub2 grub1 nogrub;do #prefers Linux with grub-install then maybe separate /usr + for bootyp in with-boot no-kernel no---boot;do #prefers Linux with /boot then /boot without kernel, then maybe separate /boot + for dischaswin in has-win no-wind;do #prefers linux not on same disc as windows + for ((ilobf=1;ilobf<=NBOFPARTITIONS;ilobf++)); do + if [[ "${GRUBVER[$ilobf]}" = "$grubtmp" ]] && [[ "${BOOT_AND_KERNEL_IN[$ilobf]}" = "$bootyp" ]] \ + && [[ "${REALWINONDISC[${DISKNB_PART[$ilobf]}]}" != "$dischaswin" ]];then + if [[ "$looop" = 1 ]] && [[ "${GRUBOK_OF_PART[$ilobf]}" ]] && [[ "${APTTYP[$ilobf]}" != nopakmgr ]];then + subloop_ostobootbydefault_fillin + elif [[ "$looop" = 2 ]] && [[ "${GRUBOK_OF_PART[$ilobf]}" ]] && [[ "${APTTYP[$ilobf]}" = nopakmgr ]];then + subloop_ostobootbydefault_fillin + elif [[ "$looop" = 3 ]] && [[ "${APTTYP[$ilobf]}" != nopakmgr ]] \ + && [[ ! "${GRUBOK_OF_PART[$ilobf]}" ]];then + subloop_ostobootbydefault_fillin + elif [[ "$looop" = 4 ]] && [[ "${APTTYP[$ilobf]}" = nopakmgr ]] \ + && [[ ! "${GRUBOK_OF_PART[$ilobf]}" ]] && [[ "$SEP_USR_PARTS_PRESENCE" ]] \ + && [[ "${USR_IN_FSTAB_OF_PART[$ilobf]}" != part-has-no-fstab ]];then + subloop_ostobootbydefault_fillin + fi fi - fi + done done done done @@ -455,9 +456,9 @@ [[ "$DEBBUG" ]] && echo "[debug]set_radiobutton_place_alldisks" FORCE_GRUB=place-in-all-MBRs if [[ "$GUI" ]];then - for ((srpad=1;srpad<=QTY_OF_PART_WITH_GRUB;srpad++)); do - [[ "${DISK_PART[$REGRUB_PART]}" != "${DISK_PART[${LIST_OF_PART_WITH_GRUB[$srpad]}]}" ]] && echo 'SET@_vbox_is_removable_disk.show()' - done + for ((srpad=1;srpad<=QTY_OF_PART_WITH_GRUB;srpad++)); do + [[ "${DISK_PART[$REGRUB_PART]}" != "${DISK_PART[${LIST_OF_PART_WITH_GRUB[$srpad]}]}" ]] && echo 'SET@_vbox_is_removable_disk.show()' + done fi } @@ -468,7 +469,7 @@ set_radiobutton_place_grub() { [[ "$DEBBUG" ]] && echo "[debug]set_radiobutton_place_grub" -echo 'SET@_combobox_place_grub.set_sensitive(True)'; FORCE_GRUB=place-in-MBR +[[ "$GUI" ]] && echo 'SET@_combobox_place_grub.set_sensitive(True)'; FORCE_GRUB=place-in-MBR } _combobox_place_grub() { @@ -481,14 +482,14 @@ #Place GRUB into ######### NOFORCE_DISK="${DISK_PART[$REGRUB_PART]}" if [[ "$GUI" ]];then - echo "COMBO@@CLEAR@@_combobox_place_grub" - while read fichier; do - echo "COMBO@@END@@_combobox_place_grub@@${fichier}"; - done < <( echo "${NOFORCE_DISK}"; - for ((cpgarf=1;cpgarf<=NBOFDISKS;cpgarf++)); do - [[ "${LISTOFDISKS[$cpgarf]}" != "${NOFORCE_DISK}" ]] && echo "${LISTOFDISKS[$cpgarf]}" #Propose by default the disk of PART_TO_REINSTALL_GRUB - done) - echo 'SET@_combobox_place_grub.set_active(0)' + echo "COMBO@@CLEAR@@_combobox_place_grub" + while read fichier; do + echo "COMBO@@END@@_combobox_place_grub@@${fichier}"; + done < <( echo "${NOFORCE_DISK}"; + for ((cpgarf=1;cpgarf<=NBOFDISKS;cpgarf++)); do + [[ "${LISTOFDISKS[$cpgarf]}" != "${NOFORCE_DISK}" ]] && echo "${LISTOFDISKS[$cpgarf]}" #Propose by default the disk of PART_TO_REINSTALL_GRUB + done) + echo 'SET@_combobox_place_grub.set_active(0)' fi #Place GRUB in all MBR , and removable disk #### @@ -503,59 +504,64 @@ #called by combobox_place_grub_and_removable_fillin & _checkbutton_separateboot REMOVABLEDISK="" SHOW_REMOVABLEDISK=no -if [[ "$QUANTITY_OF_DETECTED_MACOS" != 0 ]] || [[ "$MACEFIFILEPRESENCE" ]];then - [[ "$GUI" ]] && echo 'SET@_radiobutton_force_grub.show()' +#if [[ "$QUANTITY_OF_DETECTED_MACOS" != 0 ]] && [[ ! "$MACEFIFILEPRESENCE" ]];then +# [[ "$GUI" ]] && echo 'SET@_radiobutton_force_grub.show()' # if [[ "$FORCE_GRUB" != force-in-PBR ]];then # echo 'SET@_radiobutton_force_grub.set_active(True)'; FORCE_GRUB=force-in-PBR # fi # ( [[ ! "$USE_SEPARATEBOOTPART" ]] && [[ ! "$USE_SEPARATEUSRPART" ]] || #RAID is broken if install GRUB in sdX #Mac: forum.ubuntu-fr.org/viewtopic.php?id=1091731 -elif [[ "/${LISTOFPARTITIONS[$REGRUB_PART]}" =~ "/md" ]] || [[ ! "${LISTOFPARTITIONS[$REGRUB_PART]}" =~ "mapper/" ]] \ -&& [[ "$NBOFDISKS" != 1 ]] && [[ ! "$GRUBPACKAGE" =~ efi ]];then - [[ "$GUI" ]] && echo 'SET@_radiobutton_place_alldisks.show()' - [[ "$GUI" ]] && echo 'SET@_radiobutton_place_alldisks.set_active(True)'; - set_radiobutton_place_alldisks - DISKA="${DISK_PART[$REGRUB_PART]}" - for ((cpgarf=1;cpgarf<=TOTAL_QUANTITY_OF_OS;cpgarf++));do - if [[ "${OS__DISK[$cpgarf]}" != "$DISKA" ]];then - [[ "$DEBBUG" ]] && echo "[debug]It exists another disk with OS" - [[ "$GUI" ]] && echo 'SET@_vbox_is_removable_disk.show()' - a="$(grep "/dev/${DISKA}:" <<< "$PARTEDLM" )"; a="${a%:*}"; a="${a##*:}" - [[ "$a" ]] && DISK5="$DISKA ($a)" || DISK5="$DISKA" - DISK1="$DISK5" - update_translations - [[ "$GUI" ]] && echo "SET@_label_is_removable_disk.set_text('''$DISK5_is_a_removable_disk''')" - SHOW_REMOVABLEDISK=yes - if [[ ! "${REMOVABLE[$DISKA]}" ]];then - #end_pulse - REMOVABLE[$DISKA]=yes - if [[ ! "$FORCEYES" ]];then - if [[ "$GUI" ]];then - zenity --width=400 --question --text="$Is_DISK1_removable" 2>/dev/null || REMOVABLE[$DISKA]=no - else - read -r -p "$Is_DISK1_removable [yes/no] " response - [[ "$response" =~ y ]] || REMOVABLE[$DISKA]=no - fi - fi - [[ "$DEBBUG" ]] && echo "$Is_DISK1_removable ${REMOVABLE[$DISKA]}" - USERCHOICES="$USERCHOICES -Is ${DISK1} a removable disk? ${REMOVABLE[$DISKA]}" - fi - if [[ "${REMOVABLE[$DISKA]}" = yes ]];then - REMOVABLEDISK=is-removable-disk; - [[ "$GUI" ]] && echo 'SET@_checkbutton_is_removable_disk.set_active(True)' - else - REMOVABLEDISK=""; - [[ "$GUI" ]] && echo 'SET@_checkbutton_is_removable_disk.set_active(False)' - fi - break - fi - done -else +#fi +#if [[ "/${LISTOFPARTITIONS[$REGRUB_PART]}" =~ "/md" ]] || [[ ! "${LISTOFPARTITIONS[$REGRUB_PART]}" =~ "mapper/" ]] && [[ "$NBOFDISKS" != 1 ]] && [[ ! "$GRUBPACKAGE" =~ efi ]];then +# [[ "$GUI" ]] && echo 'SET@_radiobutton_place_alldisks.show()' +# if [[ "$QUANTITY_OF_REAL_WINDOWS" = 0 ]];then +# [[ "$GUI" ]] && echo 'SET@_radiobutton_place_alldisks.set_active(True)'; +# set_radiobutton_place_alldisks +# DISKA="${DISK_PART[$REGRUB_PART]}" +# for ((cpgarf=1;cpgarf<=TOTAL_QUANTITY_OF_OS;cpgarf++));do +# if [[ "${OS__DISK[$cpgarf]}" != "$DISKA" ]];then +# [[ "$DEBBUG" ]] && echo "[debug]It exists another disk with OS" +# [[ "$GUI" ]] && echo 'SET@_vbox_is_removable_disk.show()' +# a="$(grep "/dev/${DISKA}:" <<< "$PARTEDLM" )"; a="${a%:*}"; a="${a##*:}" +# [[ "$a" ]] && DISK5="$DISKA ($a)" || DISK5="$DISKA" +# DISK1="$DISK5" +# update_translations +# [[ "$GUI" ]] && echo "SET@_label_is_removable_disk.set_text('''$DISK5_is_a_removable_disk''')" +# SHOW_REMOVABLEDISK=yes +# if [[ ! "${REMOVABLE[$DISKA]}" ]];then +# #end_pulse +# REMOVABLE[$DISKA]=yes +# if [[ ! "$FORCEYES" ]];then +# if [[ "$GUI" ]];then +# zenity --width=400 --question --text="$Is_DISK1_removable" 2>/dev/null || REMOVABLE[$DISKA]=no +# else +# read -r -p "$Is_DISK1_removable [yes/no] " response +# [[ "$response" =~ y ]] || REMOVABLE[$DISKA]=no +# fi +# fi +# [[ "$DEBBUG" ]] && echo "$Is_DISK1_removable ${REMOVABLE[$DISKA]}" +# USERCHOICES="$USERCHOICES +#Is ${DISK1} a removable disk? ${REMOVABLE[$DISKA]}" +# fi +# if [[ "${REMOVABLE[$DISKA]}" = yes ]];then +# REMOVABLEDISK=is-removable-disk; +# [[ "$GUI" ]] && echo 'SET@_checkbutton_is_removable_disk.set_active(True)' +# else +# REMOVABLEDISK=""; +# [[ "$GUI" ]] && echo 'SET@_checkbutton_is_removable_disk.set_active(False)' +# fi +# break +# fi +# done +# else +# [[ "$GUI" ]] && echo 'SET@_radiobutton_place_grub.set_active(True)'; +# set_radiobutton_place_grub +# fi +#else [[ "$GUI" ]] && echo 'SET@_radiobutton_place_grub.set_active(True)'; - set_radiobutton_place_grub -fi + set_radiobutton_place_grub +#fi } ######################## Force GRUB diff -Nru boot-repair-4ppa123/usr/share/boot-sav/gui-tab-main.sh boot-repair-4ppa200/usr/share/boot-sav/gui-tab-main.sh --- boot-repair-4ppa123/usr/share/boot-sav/gui-tab-main.sh 2020-03-15 13:14:14.000000000 +0000 +++ boot-repair-4ppa200/usr/share/boot-sav/gui-tab-main.sh 2022-03-06 21:55:00.000000000 +0000 @@ -1,5 +1,5 @@ #! /bin/bash -# Copyright 2020 Yann MRN +# Copyright 2022 Yann MRN # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published @@ -16,14 +16,13 @@ ###################################### DEFAULT FILLING ######################################### set_easy_repair() { [[ "$GUI" ]] && echo 'SET@_button_recommendedrepair.set_sensitive(False)' #To avoid applying before variables are changed -set_easy_repair_diff #Differences between BR and OS-U -MAIN_MENU=Recommended-Repair +set_easy_repair_diff #Differences between BR, BI and OS-U [[ "$DEBBUG" ]] && echo "[debug]MAIN_MENU becomes : $MAIN_MENU" MBR_ACTION=nombraction UNHIDEBOOT_ACTION="" if [[ "$TOTAL_QUANTITY_OF_OS" != 0 ]] && [[ "$NB_MBR_CAN_BE_RESTORED" != 0 ]] || [[ "$QTY_OF_PART_FOR_REINSTAL" != 0 ]];then UNHIDEBOOT_TIME=10 - UNHIDEBOOT_ACTION=unhide-bootmenu-10s; + UNHIDEBOOT_ACTION=" unhide-bootmenu-10s" [[ "$GUI" ]] && echo 'SET@_checkbutton_unhide_boot_menu.set_active(True)' if [[ "$QTY_OF_PART_FOR_REINSTAL" != 0 ]];then set_checkbutton_reinstall_grub @@ -54,7 +53,7 @@ fi elif [[ "$NBOFPARTITIONS" != 0 ]];then #http://askubuntu.com/questions/215432/cant-boot-after-disk-error-12-10 #Works: http://paste2.org/p/2481100 - echo "No OS or WinEFI system" + echo "No OS to fix." unset_checkbutton_reinstall_grub unset_checkbutton_restore_mbr if [[ "$GUI" ]];then @@ -70,13 +69,15 @@ fi fi bootflag_update +WINBOOT_ACTION="" if [[ "$QTY_WINBOOTTOREPAIR" = 0 ]];then - WINBOOT_ACTION=""; [[ "$GUI" ]] && echo 'SET@_vbox_winboot.set_sensitive(False)' else - WINBOOT_ACTION=win-legacy-basic-fix; - [[ "$GUI" ]] && echo 'SET@_checkbutton_winboot.set_active(True)' [[ "$GUI" ]] && echo 'SET@_vbox_winboot.set_sensitive(True)' + if [[ ! "$GRUBPACKAGE" =~ efi ]];then + [[ "$GUI" ]] && echo 'SET@_checkbutton_winboot.set_active(True)' + WINBOOT_ACTION=" win-legacy-basic-fix" + fi fi [[ "$GUI" ]] && echo 'SET@_button_recommendedrepair.set_sensitive(True)' #To avoid applying before variables are changed } @@ -84,23 +85,23 @@ set_easy_repair_diff_br_and_bi() { #if [[ "$QTY_OF_PART_FOR_REINSTAL" = 0 ]] && [[ "$NB_MBR_CAN_BE_RESTORED" = 0 ]] && [[ "$(grep BYT <<< "$PARTEDLM" )" ]] \ #|| [[ "$ROOTDISKMISSING" ]] || [[ "$MOUNTERROR" ]];then -# FSCK_ACTION=repair-filesystems; echo 'SET@_checkbutton_repairfilesystems.set_active(True)' +# FSCK_ACTION=" repair-filesystems"; echo 'SET@_checkbutton_repairfilesystems.set_active(True)' #else - FSCK_ACTION=""; + FSCK_ACTION="" [[ "$GUI" ]] && echo 'SET@_checkbutton_repairfilesystems.set_active(False)' #fi if [[ "$QTY_WUBI" != 0 ]];then - WUBI_ACTION=repair-wubi; + WUBI_ACTION=" repair-wubi" [[ "$GUI" ]] && echo 'SET@_checkbutton_wubi.set_active(True)' [[ "$GUI" ]] && echo 'SET@_checkbutton_wubi.set_sensitive(True)' else - WUBI_ACTION=""; + WUBI_ACTION="" [[ "$GUI" ]] && echo 'SET@_checkbutton_wubi.set_active(False)' [[ "$GUI" ]] && echo 'SET@_checkbutton_wubi.set_sensitive(False)' fi -PASTEBIN_ACTION=create-bootinfo; -[[ "$GUI" ]] && echo 'SET@_checkbutton_pastebin.set_active(True)' -UPLOAD=pastebin; +#PASTEBIN_ACTION=create-bootinfo +#[[ "$GUI" ]] && echo 'SET@_checkbutton_pastebin.set_active(True)' +UPLOAD=pastebin [[ "$GUI" ]] && echo 'SET@_checkbutton_upload.set_active(True)' } @@ -152,7 +153,7 @@ _spinbutton_unhide_boot_menu() { UNHIDEBOOT_TIME="${@}"; UNHIDEBOOT_TIME="${UNHIDEBOOT_TIME%*.0}" [[ "$DEBBUG" ]] && echo "[debug]UNHIDEBOOT_TIME becomes: $UNHIDEBOOT_TIME" -[[ "$UNHIDEBOOT_ACTION" ]] && UNHIDEBOOT_ACTION="unhide-bootmenu-${UNHIDEBOOT_TIME}s" +[[ "$UNHIDEBOOT_ACTION" ]] && UNHIDEBOOT_ACTION=" unhide-bootmenu-${UNHIDEBOOT_TIME}s" } _checkbutton_unhide_boot_menu() { @@ -195,22 +196,22 @@ } update_bkp_boxes() { +RESTORE_BKP_ACTION="" if [[ "$BKPFILEPRESENCE" ]];then [[ "$GUI" ]] && echo 'SET@_checkbutton_restore_bkp.show()' - RESTORE_BKP_ACTION=restore-efi-backups - [[ "$GUI" ]] && echo 'SET@_checkbutton_restore_bkp.set_active(True)' else [[ "$GUI" ]] && echo 'SET@_checkbutton_restore_bkp.hide()' - RESTORE_BKP_ACTION="" fi -if [[ "$MBR_ACTION" = reinstall ]] && [[ "$GRUBPACKAGE" =~ grub-efi ]];then +if [[ "$MBR_ACTION" = reinstall ]] && [[ "$GRUBPACKAGE" =~ efi ]];then + [[ "$BKPFILEPRESENCE" ]] && RESTORE_BKP_ACTION=" restore-efi-backups" + [[ "$BKPFILEPRESENCE" ]] && [[ "$GUI" ]] && echo 'SET@_checkbutton_restore_bkp.set_active(True)' [[ "$GUI" ]] && echo 'SET@_checkbutton_create_bkp.show()' [[ "$GUI" ]] && echo 'SET@_checkbutton_winefi_bkp.show()' - CREATE_BKP_ACTION=use-standard-efi-file + CREATE_BKP_ACTION=" use-standard-efi-file" [[ "$GUI" ]] && echo 'SET@_checkbutton_create_bkp.set_active(True)' #http://ubuntuforums.org/showpost.php?p=12457638&postcount=9 if [[ "$WINBKPFILEPRESENCE" ]];then - #WINEFI_BKP_ACTION=rename-ms-efi && echo 'SET@_checkbutton_winefi_bkp.set_active(True)' + #WINEFI_BKP_ACTION=" rename-ms-efi" && echo 'SET@_checkbutton_winefi_bkp.set_active(True)' [[ "$GUI" ]] && echo 'SET@_checkbutton_winefi_bkp.show()' fi else @@ -239,7 +240,6 @@ [[ "$MBR_ACTION" != reinstall ]] && MBR_ACTION=nombraction unset_checkbutton_restore_mbr fi -bootflag_update } set_checkbutton_restore_mbr() { @@ -259,8 +259,8 @@ ############################### Bkp _checkbutton_create_bkp() { if [[ "${@}" = True ]]; then - CREATE_BKP_ACTION=use-standard-efi-file - [[ "$GUI" ]] && [[ "$WINEFIFILEPRESENCE" ]] && echo 'SET@_checkbutton_winefi_bkp.show()' #|| WINEFI_BKP_ACTION=rename-ms-efi + CREATE_BKP_ACTION=" use-standard-efi-file" + [[ "$GUI" ]] && [[ "$QUANTITY_OF_REAL_WINDOWS" != 0 ]] && [[ "$WINEFIFILEPRESENCE" ]] && echo 'SET@_checkbutton_winefi_bkp.show()' #|| WINEFI_BKP_ACTION=rename-ms-efi else CREATE_BKP_ACTION="" [[ "$GUI" ]] && echo 'SET@_checkbutton_winefi_bkp.hide()' @@ -271,14 +271,14 @@ _checkbutton_restore_bkp() { if [[ "${@}" = True ]]; then - RESTORE_BKP_ACTION=restore-efi-backups + RESTORE_BKP_ACTION=" restore-efi-backups" else RESTORE_BKP_ACTION="" fi } _checkbutton_winefi_bkp() { -[[ "${@}" = True ]] && WINEFI_BKP_ACTION=rename-ms-efi || WINEFI_BKP_ACTION="" +[[ "${@}" = True ]] && WINEFI_BKP_ACTION=" rename-ms-efi" || WINEFI_BKP_ACTION="" } ############### Action items ################ @@ -319,7 +319,7 @@ [[ "$GUI" ]] && zenity --width=400 --warning --title="$APPNAME2" --text="$ATEXT" 2>/dev/null [[ "$GUI" ]] && echo 'SET@_mainwindow.show()' elif [[ "$TEXT" ]];then - printf "\nAdvices: _______________________________________________________________________\n" + [[ "$DEBBUG" ]] && printf "\nAdvices: _______________________________________________________________________\n" end_pulse tmanswer=yes if [[ ! "$FORCEYES" ]];then @@ -330,7 +330,7 @@ [[ "$response" =~ y ]] || tmanswer=no fi fi - echo "$TEXT $tmanswer" + [[ "$DEBBUG" ]] && echo "$TEXT $tmanswer" [[ "$tmanswer" = yes ]] && mainapplypulsate || unmount_all_partitions_and_quit_glade else actions @@ -344,10 +344,7 @@ #called by _button_mainapply and _button_justbootinfo [[ "$GRUBPURGE_ACTION" ]] || [[ "$KERNEL_PURGE" ]] && [[ "$MBR_ACTION" = reinstall ]] && check_internet_connection #Block and quit -if [[ "$TOTAL_QUANTITY_OF_OS" = 0 ]] || ( [[ ! "$DISK_TO_RESTORE_MBR" ]] && [[ "$MBR_ACTION" = restore ]] ) \ -&& [[ "$(echo "$BLKID" | grep -i crypt | grep -vi swap )" ]];then - BTEXT="$Encryption_detected $Please_decrypt ($Decrypt_links)" -elif [[ "$MBR_ACTION" = restore ]] && [[ ! "$DISK_TO_RESTORE_MBR" ]];then +if [[ "$MBR_ACTION" = restore ]] && [[ ! "$DISK_TO_RESTORE_MBR" ]];then BTEXT="No disk to restore MBR. $PLEASECONTACT" elif [[ "$(mount | grep '/target' )" ]] && [[ "$MBR_ACTION" = reinstall ]] && [[ ! "$DEBBUG" ]];then FUNCTION='/target'; SYSTEM2="$(lsb_release -is)" ; update_translations @@ -355,7 +352,7 @@ elif [[ "$QUANTITY_OF_REAL_WINDOWS" != 0 ]] && [[ ! "$WINEFIFILEPRESENCE" ]] && [[ "$LIVESESSION" != live ]] && [[ -d /sys/firmware/efi ]];then FUNCTION=LegacyWindows; update_translations BTEXT="$FUNCTION_detected $Use_in_live_session_with_your_BIOS_set_in_Legacy_mode" -elif [[ "$WINEFIFILEPRESENCE" ]] && [[ "$LIVESESSION" != live ]] && [[ ! -d /sys/firmware/efi ]];then +elif [[ "$QUANTITY_OF_REAL_WINDOWS" != 0 ]] && [[ "$WINEFIFILEPRESENCE" ]] && [[ "$LIVESESSION" != live ]] && [[ ! -d /sys/firmware/efi ]];then FUNCTION=WindowsEFI; DISK5="$DISK33"; update_translations BTEXT="$FUNCTION_detected $Use_in_live_session_with_your_BIOS_set_in_UEFI_mode $Eg_use_DISK5_usb_efi" elif [[ "$QUANTITY_OF_DETECTED_MACOS" != 0 ]] && [[ ! "$MACEFIFILEPRESENCE" ]] && [[ "$LIVESESSION" != live ]] && [[ -d /sys/firmware/efi ]];then @@ -364,7 +361,7 @@ elif [[ "$MACEFIFILEPRESENCE" ]] && [[ "$LIVESESSION" != live ]] && [[ ! -d /sys/firmware/efi ]];then FUNCTION=MacEFI; DISK5="$DISK33"; update_translations BTEXT="$FUNCTION_detected $Use_in_live_session_with_your_BIOS_set_in_UEFI_mode $Eg_use_DISK5_usb_efi" -elif [[ "$WINEFIFILEPRESENCE" ]] || [[ "$MACEFIFILEPRESENCE" ]] && [[ "$GRUBPACKAGE" =~ grub-efi ]] && [[ "$MBR_ACTION" = reinstall ]] && [[ ! -d /sys/firmware/efi ]];then +elif [[ "$WINEFIFILEPRESENCE" ]] || [[ "$MACEFIFILEPRESENCE" ]] && [[ "$GRUBPACKAGE" =~ efi ]] && [[ "$MBR_ACTION" = reinstall ]] && [[ ! -d /sys/firmware/efi ]];then DISK5="$DISK33";update_translations BTEXT="$Current_session_is_CSM $Use_in_live_session_with_your_BIOS_set_in_UEFI_mode $Eg_use_DISK5_usb_efi" fi @@ -372,7 +369,7 @@ #Block and main window if [[ "$MBR_ACTION" = reinstall ]] && [[ "$LIVESESSION" != live ]] && [[ "${LISTOFPARTITIONS[$REGRUB_PART]}" != "$CURRENTSESSIONPARTITION" ]];then ATEXT="$Please_use_in_live_session $This_will_enable_this_feature" -elif [[ ! "$WINEFIFILEPRESENCE" ]] && [[ ! "$MACEFIFILEPRESENCE" ]] && [[ "$GRUBPACKAGE" =~ grub-efi ]] && [[ "$MBR_ACTION" = reinstall ]] && [[ ! -d /sys/firmware/efi ]];then +elif [[ ! "$WINEFIFILEPRESENCE" ]] && [[ ! "$MACEFIFILEPRESENCE" ]] && [[ "$GRUBPACKAGE" =~ efi ]] && [[ "$MBR_ACTION" = reinstall ]] && [[ ! -d /sys/firmware/efi ]];then DISK5="$DISK33";update_translations ATEXT="$Current_session_is_CSM $Use_in_live_session_with_your_BIOS_set_in_UEFI_mode $Eg_use_DISK5_usb_efi $This_will_enable_this_feature" elif [[ "${ARCH_OF_PART[$REGRUB_PART]}" = 64 ]] || [[ "${ARCH_OF_PART[$USRPART]}" = 64 ]] && [[ "$(uname -m)" != x86_64 ]] && [[ "$MBR_ACTION" = reinstall ]];then @@ -381,29 +378,42 @@ elif [[ "$DISTRIB_DESCRIPTION" =~ Debian ]] || [[ "$DISTRIB_DESCRIPTION" =~ Unknown ]] && [[ "$FSCK_ACTION" ]];then FUNCTION=FSCK; FUNCTION44=FSCK; DISK44="$DISK33";update_translations ATEXT="$FUNCTION_detected $Please_use_DISK44_which_is_FUNCTION44_ok $This_will_enable_this_feature" +elif [[ "$MBR_ACTION" = reinstall ]] && [[ "$GRUBPACKAGE" =~ efi ]] && [[ ! "$(type -p efibootmgr)" ]];then + PACKAGELIST=efibootmgr; update_translations + ATEXT="$please_install_PACKAGELIST $Then_try_again $Alternatively_you_can_use" elif [[ "$MBR_ACTION" = restore ]] && [[ ! "$MBR_TO_RESTORE" =~ xp ]] || [[ "$BOOTFLAG_ACTION" ]] && [[ ! "$(type -p parted)" ]];then PACKAGELIST=parted; update_translations - ATEXT="$please_install_PACKAGELIST $Then_try_again" + ATEXT="$please_install_PACKAGELIST $Then_try_again $Alternatively_you_can_use" elif [[ "$MBR_ACTION" = restore ]] && [[ "$MBR_TO_RESTORE" =~ xp ]] && [[ ! "$(type -p install-mbr)" ]];then PACKAGELIST=mbr; update_translations - ATEXT="$please_install_PACKAGELIST $Then_try_again" + ATEXT="$please_install_PACKAGELIST $Then_try_again $Alternatively_you_can_use" #elif [[ "$GRUBPURGE_ACTION" ]] || [[ "$KERNEL_PURGE" ]] && [[ "$MBR_ACTION" = reinstall ]] && [[ "$INTERNET" = no-internet ]];then # OPTION="$Check_internet"; update_translations # ATEXT="$No_internet_connection_detected. $Please_connect_internet $Then_try_again $Alternatively_you_may_want_to_retry_after_deactivating_OPTION" elif [[ "$MBR_ACTION" = reinstall ]] && [[ "$GRUBPURGE_ACTION" = purge-grub ]] && [[ "${APTTYP[$USRPART]}" = nopakmgr ]];then ATEXT="No valid package manager in ${OSNAME[$REGRUB_PART]} (${LISTOFPARTITIONS[$USRPART]}). $PLEASECONTACT" -elif [[ "$MBR_ACTION" = reinstall ]] && [[ ! "$GRUBPACKAGE" =~ grub-efi ]] && [[ "${GPT_DISK[${DISKNB_PART[$REGRUB_PART]}]}" = is-GPT ]] \ +elif [[ "$MBR_ACTION" = reinstall ]] && [[ ! "$GRUBPACKAGE" =~ efi ]] && [[ "${GPT_DISK[${DISKNB_PART[$REGRUB_PART]}]}" = is-GPT ]] \ && [[ "${BIOS_BOOT_DISK[${DISKNB_PART[$REGRUB_PART]}]}" = no-BIOSboot ]];then FUNCTION=GPT; TYP=BIOS-Boot; FLAGTYP=bios_grub; TOOL1=Gparted; TYPE3=/boot/efi; update_translations - OPTION1="$Separate_TYPE3_partition";update_translations #ex: http://paste.ubuntu.com/894616 , http://paste.ubuntu.com/1051824 + OPTION1="$Separate_TYPE3_partition";update_translations ATEXT="$FUNCTION_detected $Please_create_TYP_part (>1MB, $No_filesystem, $FLAGTYP_flag). $Via_TOOL1 $Then_try_again" - [[ "$NB_BISEFIPART" != 0 ]] && ATEXT="$ATEXT + [[ "$QTY_EFIPART" != 0 ]] && ATEXT="$ATEXT $Alternatively_you_can_try_OPTION1" - echo "(debug) $MBR_ACTION $GRUBPACKAGE $FORCE_GRUB ${BIOS_BOOT_DISK[${DISKNB_PART[$REGRUB_PART]}]} (${LISTOFPARTITIONS[$REGRUB_PART]})" -elif [[ "$MBR_ACTION" = reinstall ]] && [[ "$GRUBPACKAGE" =~ grub-efi ]] && [[ "$NB_BISEFIPART" = 0 ]];then + #echo "(debug) $MBR_ACTION $GRUBPACKAGE $FORCE_GRUB ${BIOS_BOOT_DISK[${DISKNB_PART[$REGRUB_PART]}]} (${LISTOFPARTITIONS[$REGRUB_PART]})" +elif [[ "$MBR_ACTION" = reinstall ]] && [[ "$GRUBPACKAGE" =~ efi ]] && [[ "$QTY_EFIPART" = 0 ]];then ### TBC, was NB_BISEFIPART=0 TYP=ESP; FLAGTYP=boot; TOOL1=Gparted; TYPE3=/boot/efi; update_translations - OPTION1="$Separate_TYPE3_partition";update_translations #ex: http://paste.ubuntu.com/894616 , http://paste.ubuntu.com/1051824 + OPTION1="$Separate_TYPE3_partition"; update_translations ATEXT="$Please_create_TYP_part (FAT32, 100MB~250MB, $start_of_the_disk, $FLAGTYP_flag). $Via_TOOL1 $Then_try_again" +elif ( [[ ! "$USE_SEPARATEUSRPART" ]] && [[ "${ARCH_OF_PART[$REGRUB_PART]}" = 32 ]] ) || ( [[ "$USE_SEPARATEUSRPART" ]] && [[ "${ARCH_OF_PART[$USRPART]}" = 32 ]] ) \ + && [[ "$GRUBPACKAGE" =~ signed ]] && [[ "$MBR_ACTION" = reinstall ]] ;then + FUNCTION=32bit-vs-signed-efi; update_translations + ATEXT="$FUNCTION_detected $You_may_want_install_64os $This_will_enable_this_feature" +elif [[ "$BLKID" =~ zfs ]] && [[ "$MAIN_MENU" != Boot-Info ]] && [[ ! "$($PACKVERSION zfsutils-linux)" =~ '2.' ]];then + PACK7=zfsutils; update_translations + ATEXT="$Please_retry_from_a_live_disc_containing_a_recent_version_of_PACK7 +" +elif [[ "$MBR_ACTION" = restore ]] || [[ "$MBR_ACTION" = reinstall ]] && [[ "$CRYPTPART" ]] && [[ "$QUANTITY_OF_DETECTED_LINUX" = 0 ]];then + ATEXT="$Encryption_detected $Please_decrypt (sudo cryptsetup luksOpen $CRYPTPART myvolume)" fi #Ask confirmation before repair @@ -411,86 +421,110 @@ if [[ "$GRUBPURGE_ACTION" ]] || [[ "$KERNEL_PURGE" ]] && [[ "$INTERNET" = no-internet ]];then TEXT="$TEXT$Continuing_without_internet_would_unbootable $Please_connect_internet " - elif [[ "$FDISKL" =~ SFS ]];then #eg http://paste.ubuntu.com/1008500 + elif [[ "$FDISKL" =~ SFS ]];then FUNCTION=SFS; TOOL1="TestDisk"; TOOL2="EASEUS-Partition-Master / MiniTool-Partition-Wizard"; update_translations TEXT="$TEXT$FUNCTION_detected $You_may_want_to_retry_after_converting_SFS $Via_TOOL1_or_TOOL2 " fi - if [[ "$GRUBPACKAGE" =~ grub-efi ]];then #grub-efi ok even without GPT (see ReadEFIdos) - if [[ ! -d /sys/firmware/efi ]] && [[ ! "$WINEFIFILEPRESENCE" ]] && [[ ! "$MACEFIFILEPRESENCE" ]];then # if WinEFI or MacEFI, is blocked (above) - MODE1=BIOS-compatibility/CSM/Legacy; MODE2=EFI; TYPE3=/boot/efi; OPTION="$Separate_TYPE3_partition"; update_translations - TEXT="$TEXT$Boot_is_MODE1_may_need_change_to_MODE2 -" - [[ ! "$EFIFILPRESENT" ]] && TEXT="$TEXT$Alternatively_you_may_want_to_retry_after_deactivating_OPTION -" - fi - if [[ "${ARCH_OF_PART[$REGRUB_PART]}" = 32 ]] && [[ "${ARCH_OF_PART[$USRPART]}" = 32 ]] \ - && [[ "$ARCHIPC" = 64 ]] && [[ "$GRUBPACKAGE" =~ grub-efi ]] && [[ "$MBR_ACTION" = reinstall ]];then + if [[ "$GRUBPACKAGE" =~ efi ]];then #grub-efi ok even without GPT (see ReadEFIdos) +# if [[ ! -d /sys/firmware/efi ]] && [[ ! "$WINEFIFILEPRESENCE" ]] && [[ ! "$MACEFIFILEPRESENCE" ]];then # if WinEFI or MacEFI, is blocked (above) +# MODE1=BIOS-compatibility/CSM/Legacy; MODE2=EFI; TYPE3=/boot/efi; OPTION="$Separate_TYPE3_partition"; update_translations +# TEXT="$TEXT$Boot_is_MODE1_may_need_change_to_MODE2 +#" +# [[ ! "$EFIFILPRESENT" ]] && TEXT="$TEXT$Alternatively_you_may_want_to_retry_after_deactivating_OPTION +#" +# fi + if ( [[ ! "$USE_SEPARATEUSRPART" ]] && [[ "${ARCH_OF_PART[$REGRUB_PART]}" = 32 ]] ) || ( [[ "$USE_SEPARATEUSRPART" ]] && [[ "${ARCH_OF_PART[$USRPART]}" = 32 ]] ) \ + && [[ "$ARCHIPC" = 64 ]] && [[ "$GRUBPACKAGE" =~ efi ]] && [[ "$MBR_ACTION" = reinstall ]];then # TBC PARTITION1="${LISTOFPARTITIONS[$REGRUB_PART]}"; update_translations TEXT="$TEXT$You_have_installed_on_PARTITION1_EFI_incompat $You_may_want_install_64os " fi - if [[ "$SECUREBOOT" = enabled ]] && [[ "$WINEFIFILEPRESENCE" ]];then ## à passer dans le message final ??? - MODE1=Secure; MODE2=non-Secure; update_translations; - TEXT="$TEXT$Boot_is_MODE1_may_need_change_to_MODE2 -" - fi - if [[ "${BIOS_BOOT_DISK[${DISKNB_PART[$REGRUB_PART]}]}" = hasBIOSboot ]] && [[ ! "$EFIFILPRESENT" ]];then #if user forced grub-efi +# if [[ "${SECUREBOOT%% *}" = enabled ]] && [[ "$WINEFIFILEPRESENCE" ]];then ## à passer dans le message final ??? +# MODE1=Secure; MODE2=non-Secure; update_translations; +# TEXT="$TEXT$Boot_is_MODE1_may_need_change_to_MODE2 +#" +# fi + if [[ "${BIOS_BOOT_DISK[${DISKNB_PART[$REGRUB_PART]}]}" = hasBIOSboot ]] && [[ ! "$WINEFIFILEPRESENCE" ]] && [[ "$QTY_SUREEFIPART" = 0 ]];then FUNCTION=BIOS-Boot; TYPE3=/boot/efi; update_translations; OPTION="$Separate_TYPE3_partition"; update_translations TEXT="$TEXT$FUNCTION_detected $You_may_want_to_retry_after_deactivating_OPTION " fi - if [[ "$QUANTITY_OF_REAL_WINDOWS" != 0 ]] && [[ ! "$WINEFIFILEPRESENCE" ]] && [[ ! "$MACEFIFILEPRESENCE" ]];then + if [[ "$QUANTITY_OF_REAL_WINDOWS" != 0 ]] && [[ ! "$WINEFIFILEPRESENCE" ]];then FUNCTION=LegacyWindows; TYPE3=/boot/efi; update_translations; OPTION="$Separate_TYPE3_partition"; update_translations TEXT="$TEXT$FUNCTION_detected $You_may_want_to_retry_after_deactivating_OPTION " fi if [[ "$QUANTITY_OF_DETECTED_MACOS" != 0 ]] && [[ ! "$MACEFIFILEPRESENCE" ]] && [[ ! "$WINEFIFILEPRESENCE" ]];then - FUNCTION=MacOS; TYPE3=/boot/efi; update_translations; OPTION="$Separate_TYPE3_partition"; update_translations + FUNCTION=LegacyMacOS; TYPE3=/boot/efi; update_translations; OPTION="$Separate_TYPE3_partition"; update_translations TEXT="$TEXT$FUNCTION_detected $You_may_want_to_retry_after_deactivating_OPTION " fi + if [[ "${EFI_TYPE[$EFIPART_TO_USE]}" = hidenESP ]] && [[ "$EFIPART_TO_USE" != "${LIST_EFIPART[1]}" ]];then #only if not default esp. Else, B-R will propose to remove hidden flag. + HIDDENESP="${LISTOFPARTITIONS[$EFIPART_TO_USE]}"; TOOL1=Gparted; update_translations; + TEXT="$TEXT$You_may_want_retry_after_remov_hidden_flag_from_HIDDENESP $Via_TOOL1 +" + fi + if [[ "$QTY_SUREEFIPART" = 0 ]];then + FUNCTION=ESP-on-live-disc; update_translations; + TEXT="$TEXT$FUNCTION_detected $Please_check_advanced_options +" + fi else [[ "$GRUBVER[$REGRUB_PART]" = grub ]] && TEXT="$TEXT$This_will_install_an_obsolete_bootloader (GRUB Legacy). " if [[ -d /sys/firmware/efi ]];then - if [[ "$QUANTITY_OF_REAL_WINDOWS" != 0 ]] && [[ ! "$WINEFIFILEPRESENCE" ]] && [[ "$LIVESESSION" = live ]];then #update-grub in EFI session will not detect WinLegacy https://forum.ubuntu-fr.org/viewtopic.php?pid=22282356#p22282356 + if [[ "$QUANTITY_OF_REAL_WINDOWS" != 0 ]] && [[ ! "$WINEFIFILEPRESENCE" ]];then #update-grub in EFI session will not detect WinLegacy https://forum.ubuntu-fr.org/viewtopic.php?pid=22282356#p22282356 FUNCTION=LegacyWindows; MODE1=EFI; MODE2=BIOS-compatibility/CSM/Legacy; update_translations - FINALMSG_UPDATEGRUB=yes + [[ "$LIVESESSION" = live ]] && FINALMSG_UPDATEGRUB=yes TEXT="$TEXT$FUNCTION_detected $Boot_is_MODE1_may_need_change_to_MODE2 " fi - if [[ "$QUANTITY_OF_DETECTED_MACOS" != 0 ]] && [[ ! "$MACEFIFILEPRESENCE" ]] && [[ "$LIVESESSION" = live ]];then #update-grub in EFI session will not detect WinLegacy https://forum.ubuntu-fr.org/viewtopic.php?pid=22282356#p22282356 + if [[ "$QUANTITY_OF_DETECTED_MACOS" != 0 ]] && [[ ! "$MACEFIFILEPRESENCE" ]];then #update-grub in EFI session will not detect WinLegacy https://forum.ubuntu-fr.org/viewtopic.php?pid=22282356#p22282356 FUNCTION=LegacyMacOS; MODE1=EFI; MODE2=BIOS-compatibility/CSM/Legacy; update_translations - FINALMSG_UPDATEGRUB=yes + [[ "$LIVESESSION" = live ]] && FINALMSG_UPDATEGRUB=yes TEXT="$TEXT$FUNCTION_detected $Boot_is_MODE1_may_need_change_to_MODE2 " fi - if [[ "$NB_EFIPARTONGPT" = 0 ]] && [[ "$QUANTITY_OF_REAL_WINDOWS" = 0 ]] && [[ "$QUANTITY_OF_DETECTED_MACOS" = 0 ]];then - MODE1=EFI; MODE2=ESP; TYP=ESP; FLAGTYP=boot; update_translations - TEXT="$TEXT$Boot_is_MODE1_but_no_MODE2_part_detected \ + if ( [[ "$QUANTITY_OF_REAL_WINDOWS" = 0 ]] || [[ "$WINEFIFILEPRESENCE" ]] ) \ + && ( [[ "$QUANTITY_OF_DETECTED_MACOS" = 0 ]] || [[ "$MACEFIFILEPRESENCE" ]] );then #if no WinLegacy + if [[ "$QTY_SUREEFIPART" = 0 ]];then + MODE1=EFI; MODE2=ESP; TYP=ESP; FLAGTYP=boot; update_translations + TEXT="$TEXT$Boot_is_MODE1_but_no_MODE2_part_detected \ $You_may_want_to_retry_after_creating_TYP_part (FAT32, 100MB~250MB, $start_of_the_disk, $FLAGTYP_flag). " - fi #efi <500MB ubuntuforums.org/showthread.php?t=2021534 - if [[ "$WINEFIFILEPRESENCE" ]];then #if user forced grub-pc - FUNCTION=WindowsEFI; TYPE3=/boot/efi; update_translations; OPTION="$Separate_TYPE3_partition"; update_translations - TEXT="$TEXT$FUNCTION_detected $You_may_want_to_retry_after_activating_OPTION -" + fi #efi <500MB ubuntuforums.org/showthread.php?t=2021534 fi - if [[ "$MACEFIFILEPRESENCE" ]];then #if user forced grub-pc - FUNCTION=MacEFI; TYPE3=/boot/efi; update_translations; OPTION="$Separate_TYPE3_partition"; update_translations - TEXT="$TEXT$FUNCTION_detected $You_may_want_to_retry_after_activating_OPTION + fi + if [[ "$WINEFIFILEPRESENCE" ]] && [[ "$QUANTITY_OF_REAL_WINDOWS" != 0 ]];then #if user forced grub-pc + FUNCTION=WindowsEFI; TYPE3=/boot/efi; update_translations; OPTION="$Separate_TYPE3_partition"; update_translations + TEXT="$TEXT$FUNCTION_detected $You_may_want_to_retry_after_activating_OPTION +" + fi + if [[ "$MACEFIFILEPRESENCE" ]] && [[ "$QUANTITY_OF_DETECTED_MACOS" != 0 ]];then + FUNCTION=MacEFI; TYPE3=/boot/efi; update_translations; OPTION="$Separate_TYPE3_partition"; update_translations + TEXT="$TEXT$FUNCTION_detected $You_may_want_to_retry_after_activating_OPTION " - fi fi fi fi - -if [[ "$TOTAL_QUANTITY_OF_OS" != 0 ]] && ( [[ "$DISK_TO_RESTORE_MBR" ]] || [[ "$MBR_ACTION" != restore ]] ) \ -&& [[ "$MBR_ACTION" != nombraction ]] && [[ "$(echo "$BLKID" | grep -i crypt | grep -vi swap )" ]];then - TEXT="$You_may_want_decrypt ($Decrypt_links) +if [[ "$BLKID" =~ zfs ]] && [[ "$SUCCESSACTZFS" = no ]];then + if [[ "$MAIN_MENU" != Boot-Info ]];then + TEXT="${TEXT}Warning: ZFS not activated correctly. Repair will fail unless you mount the pools on /mnt/boot-sav/zfs before continuing. $PLEASECONTACT +" + else + TEXT="${TEXT}Warning: ZFS not activated correctly. Boot-info might be incomplete or inaccurate. $PLEASECONTACT " -# != nombraction to avoid the message appear when boot-info + fi +fi +if [[ "$BLKID" =~ zfs ]] && [[ "$MAIN_MENU" = Boot-Info ]] && [[ ! "$($PACKVERSION zfsutils-linux)" =~ '2.' ]];then + TEXT="${TEXT}Warning: old zfsutils version ($($PACKVERSION zfsutils-linux)). Boot-info might be incomplete or inaccurate. You may want to retry from a recent live disc. +" +fi +if [[ "$MAIN_MENU" != Boot-Info ]] && [[ "$CRYPTPART" ]] && ( [[ ! "$(type -p cryptsetup)" ]] || [[ ! "$(cryptsetup status /dev/mapper/vgubuntu-root | grep 'is activ' )" ]] );then + TEXT="$TEXT$You_may_want_decrypt (sudo cryptsetup luksOpen $CRYPTPART myvolume) +" +# [[ "$MAIN_MENU" != Boot-Info ]] to avoid the message appear when boot-info #apt-get install lvm2 cryptsetup; sudo modprobe dm-crypt; sudo cryptsetup luksOpen /dev/sda5 crypt1 ;sudo vgscan --mknodes; sudo vgscan --mknodes #http://ubuntuforums.org/showthread.php?p=4530641 fi @@ -529,21 +563,17 @@ _expander1() { local RETOUREXP=${@} if [[ ${RETOUREXP} = True ]]; then - MAIN_MENU=Recommended-Repair if [[ "$APPNAME" =~ boot- ]];then - [[ "$GUI" ]] && echo 'SET@_button_mainapply.hide()' - [[ "$GUI" ]] && echo 'SET@_hbox_bootrepairmenu.show()' + [[ "$GUI" ]] && echo 'SET@_button_mainapply.hide()' && echo 'SET@_hbox_bootrepairmenu.show()' set_easy_repair fi else + [[ "$GUI" ]] && [[ "$APPNAME" =~ boot- ]] && echo 'SET@_hbox_bootrepairmenu.hide()' \ + && echo 'SET@_button_mainapply.show()' && echo 'SET@_button_mainapply.set_sensitive(False)' debug_echo_important_var_first - MAIN_MENU=Custom-Repair - if [[ "$GUI" ]] && [[ "$APPNAME" =~ boot- ]];then - echo 'SET@_hbox_bootrepairmenu.hide()' - echo 'SET@_button_mainapply.show()' - fi + [[ "$APPNAME" =~ fo ]] && MAIN_MENU=Boot-Info || MAIN_MENU=Custom-Repair + [[ "$GUI" ]] && [[ "$APPNAME" =~ boot- ]] && echo 'SET@_button_mainapply.set_sensitive(True)' fi -[[ "$APPNAME" =~ fo ]] && MAIN_MENU=Boot-Info [[ "$DEBBUG" ]] && echo "[debug]MAIN_MENU becomes : $MAIN_MENU" resizemainwindow } diff -Nru boot-repair-4ppa123/usr/share/boot-sav/gui-tab-other.sh boot-repair-4ppa200/usr/share/boot-sav/gui-tab-other.sh --- boot-repair-4ppa123/usr/share/boot-sav/gui-tab-other.sh 2020-03-15 13:14:14.000000000 +0000 +++ boot-repair-4ppa200/usr/share/boot-sav/gui-tab-other.sh 2022-01-29 15:51:21.000000000 +0000 @@ -1,5 +1,5 @@ #! /bin/bash -# Copyright 2010-2020 Yann MRN +# Copyright 2010-2022 Yann MRN # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published @@ -65,7 +65,7 @@ echo "SET@_label_translate.set_text('''$Translate''')" echo "SET@_label_thanks.set_text('''$Thanks''')" echo "SET@_label_gpl.set_markup('''GNU-GPL v3''')" - echo "SET@_label_copyright.set_markup('''(C) 2010-2020 Yann MRN''')" + echo "SET@_label_copyright.set_markup('''(C) 2010-2022 Yann MRN''')" echo "SET@_backupwindow.set_title('''$APPNAME2''')" echo "SET@_label_pleasechoosebackuprep.set_text('''${Please_choose_folder_to_put_backup}\\n$USB_disk_recommended''')" echo "SET@_label_backup_table.set_text('''$Backup_table''')" @@ -147,15 +147,11 @@ [[ "$GUI" ]] && echo 'SET@_hbox_bootflag.set_sensitive(True)' fi # https://forum.ubuntu-fr.org/viewtopic.php?id=1999956 -if [[ "$MBR_ACTION" = reinstall ]] || [[ "$NB_BISEFIPART" != 0 ]] || [[ "$MBR_ACTION" = restore ]] || [[ "$QTY_FLAGPART" = 0 ]];then - unset_bootflag - [[ "$GUI" ]] && echo 'SET@_checkbutton_bootflag.set_active(False)' -else - set_bootflag - [[ "$GUI" ]] && echo 'SET@_checkbutton_bootflag.set_active(True)' -fi +unset_bootflag +[[ "$GUI" ]] && echo 'SET@_checkbutton_bootflag.set_active(False)' } + _checkbutton_bootflag() { [[ "${@}" = True ]] && set_bootflag || unset_bootflag } @@ -223,12 +219,12 @@ read -r -p "$No_internet_connection_detected. $Please_connect_internet $Then_try_again [Enter] " fi fi - elif [[ ! "$temp" ]] || [[ ! "$temp2" ]];then - echo "$Please_close_all_your_package_managers ($Software_Centre, $Update_Manager, Synaptic, ...). $Then_try_again" - [[ "$GUI" ]] && zenity --width=400 --info --title="$APPNAME2" --text="$Please_close_all_your_package_managers ($Software_Centre, $Update_Manager, Synaptic, ...). $Then_try_again $Alternatively_you_can_use" 2>/dev/null +# elif [[ ! "$temp" ]] || [[ ! "$temp2" ]] && [[ "$LIVESESSION" = installed ]];then +# echo "$Please_close_all_your_package_managers ($Software_Centre, $Update_Manager, Synaptic, ...). $Then_try_again $Alternatively_you_can_use" +# [[ "$GUI" ]] && zenity --width=400 --info --title="$APPNAME2" --text="$Please_close_all_your_package_managers ($Software_Centre, $Update_Manager, Synaptic, ...). $Then_try_again $Alternatively_you_can_use" 2>/dev/null else - echo "$please_install_PACKAGELIST $This_may_require_to_enable_universe $Then_try_again" - [[ "$GUI" ]] && zenity --width=400 --info --title="$APPNAME2" --text="$please_install_PACKAGELIST $This_may_require_to_enable_universe $Then_try_again $Alternatively_you_can_use" 2>/dev/null + echo "$please_install_PACKAGELIST $Then_try_again $Alternatively_you_can_use" + [[ "$GUI" ]] && zenity --width=400 --info --title="$APPNAME2" --text="$please_install_PACKAGELIST $Then_try_again $Alternatively_you_can_use" 2>/dev/null fi start_pulse fi @@ -251,7 +247,7 @@ ################### Winboot repair _checkbutton_winboot() { -[[ "${@}" = True ]] && WINBOOT_ACTION=win-legacy-basic-fix || WINBOOT_ACTION="" +[[ "${@}" = True ]] && WINBOOT_ACTION=" win-legacy-basic-fix" || WINBOOT_ACTION="" [[ "$DEBBUG" ]] && echo "[debug]WINBOOT_ACTION becomes: $WINBOOT_ACTION" } @@ -262,12 +258,12 @@ } _checkbutton_internet() { -[[ "${@}" = True ]] && DISABLEWEBCHECK="" || DISABLEWEBCHECK=disable-internet-check +[[ "${@}" = True ]] && DISABLEWEBCHECK="" || DISABLEWEBCHECK=" disable-internet-check" [[ "$DEBBUG" ]] && echo "[debug]DISABLEWEBCHECK becomes : $DISABLEWEBCHECK" } _checkbutton_internet1() { -[[ "${@}" = True ]] && DISABLEWEBCHECK="" || DISABLEWEBCHECK=disable-internet-check +[[ "${@}" = True ]] && DISABLEWEBCHECK="" || DISABLEWEBCHECK=" disable-internet-check" [[ "$DEBBUG" ]] && echo "[debug]DISABLEWEBCHECK1 becomes : $DISABLEWEBCHECK" } diff -Nru boot-repair-4ppa123/usr/share/boot-sav/gui-translations.sh boot-repair-4ppa200/usr/share/boot-sav/gui-translations.sh --- boot-repair-4ppa123/usr/share/boot-sav/gui-translations.sh 2020-03-15 13:14:14.000000000 +0000 +++ boot-repair-4ppa200/usr/share/boot-sav/gui-translations.sh 2022-02-16 10:16:40.000000000 +0000 @@ -180,6 +180,8 @@ Use_in_live_session_with_your_BIOS_set_in_UEFI_mode=$(eval_gettext $'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.') If_boot_win_try_change_firmware_order=$(eval_gettext $'If your computer reboots directly into Windows, try to change the boot order in your UEFI firmware.') If_firmware_blocked_change_win_order=$(eval_gettext $'If your UEFI firmware does not allow to change the boot order, change the default boot entry of the Windows bootloader.') +Please_check_advanced_options=$(eval_gettext $'Please check the Advanced Options.') +zfs_already_activated_please_retry=$(eval_gettext $'ZFS pools already activated. Please retry from a new live-session, without activating the pools.') #SF sf=$(eval_gettext $'Free (GPL open-source license)') #/// Please do not translate ${APPNAME} @@ -296,5 +298,13 @@ Do_you_want_to_delete_old_auto_backups_from_PATH1=$(eval_gettext $'Do you want to delete old logs and backups located in ${PATH1} ?') #/// Please do not translate ${SYSTEM2} Plz_close_SYSTEM2_installer_then_retry=$(eval_gettext $'Please close the ${SYSTEM2} installer, then retry.') +#/// Please do not translate ${HIDDENESP} +You_may_want_retry_after_remov_hidden_flag_from_HIDDENESP=$(eval_gettext $'You may want to retry after removing the [hidden] flag from the ${HIDDENESP} partition.') +#/// Please do not translate ${PART1} +This_will_mount_PART1_to_new_mountpoint_without_special_characters=$(eval_gettext $'This will modify the mount point of ${PART1} in order to remove spaces and special characters.') +#/// Please do not translate ${PARTB} +Do_u_wanna_remove_hidden_flag_from_PARTB=$(eval_gettext $'Do you want to remove the [hidden] flag of ${PARTB} ?') +#/// Please do not translate ${PACK7} +Please_retry_from_a_live_disc_containing_a_recent_version_of_PACK7=$(eval_gettext $'Please retry from a live disc containing a recent version of ${PACK7}.') update_translations_diff } diff -Nru boot-repair-4ppa123/usr/share/boot-sav/os-uninstaller-actions.sh boot-repair-4ppa200/usr/share/boot-sav/os-uninstaller-actions.sh --- boot-repair-4ppa123/usr/share/boot-sav/os-uninstaller-actions.sh 2020-03-15 13:14:14.000000000 +0000 +++ boot-repair-4ppa200/usr/share/boot-sav/os-uninstaller-actions.sh 2022-01-20 21:13:24.000000000 +0000 @@ -54,12 +54,12 @@ if [[ "$FORMAT_OS" = format-os ]];then pkill pcmanfm umount "${OS__MNT_PATH[$OS_TO_DELETE]}" - if [[ "$FORMAT_TYPE" = "NTFS (fast)" ]]; then + if [[ "$FORMAT_TYPE" =~ NTFS ]]; then mkntfs -f /dev/$OS_TO_DELETE_PARTITION - elif [[ "$FORMAT_TYPE" = NTFS ]]; then - mkntfs /dev/$OS_TO_DELETE_PARTITION - elif [[ "$FORMAT_TYPE" = ext3 ]]; then - mkfs.ext3 /dev/$OS_TO_DELETE_PARTITION + elif [[ "$FORMAT_TYPE" = FAT ]]; then + mkfs.fat /dev/$OS_TO_DELETE_PARTITION + elif [[ "$FORMAT_TYPE" = ext4 ]]; then + mkfs.ext4 /dev/$OS_TO_DELETE_PARTITION fi fi } @@ -75,7 +75,7 @@ if [[ "$MBR_ACTION" = nombraction ]] && [[ ! "$(echo "$OS_TO_DELETE_NAME" | grep -i windows)" ]] && [[ "$WINEFIFILEPRESENCE" ]] && [[ "$QUANTITY_OF_DETECTED_WINDOWS" != 0 ]];then echo " $DASH Remove the $OS_TO_DELETE_NAME entry in UEFI" - for uuu in ubuntu mint debian fedora suse arch hat linux;do + for uuu in ubuntu mint debian fedora suse arch hat kali pop linux;do [[ ! "$tmp" ]] && [[ "$(echo "$OS_TO_DELETE_NAME" | grep -i $uuu)" ]] && tmp="$(echo "$BTO" | grep -i $uuu)" #Boot0004* Linux done fi diff -Nru boot-repair-4ppa123/usr/share/boot-sav/os-uninstaller-gui.sh boot-repair-4ppa200/usr/share/boot-sav/os-uninstaller-gui.sh --- boot-repair-4ppa123/usr/share/boot-sav/os-uninstaller-gui.sh 2020-03-15 13:14:14.000000000 +0000 +++ boot-repair-4ppa200/usr/share/boot-sav/os-uninstaller-gui.sh 2022-01-20 21:13:24.000000000 +0000 @@ -36,14 +36,14 @@ if [[ "$GUI" ]];then while read fichier; do echo "COMBO@@END@@_combobox_format_partition@@${fichier}" - done < <(echo ext3; echo "NTFS (fast)"; echo NTFS) + done < <(echo ext4; echo "NTFS (fast)"; echo FAT) fi - FORMAT_TYPE=ext3 + FORMAT_TYPE=ext4 else if [[ "$GUI" ]];then while read fichier; do echo "COMBO@@END@@_combobox_format_partition@@${fichier}" - done < <(echo "NTFS (fast)"; echo NTFS; echo ext3 ) + done < <(echo "NTFS (fast)"; echo FAT; echo ext4 ) fi FORMAT_TYPE="NTFS (fast)" fi @@ -86,6 +86,7 @@ } set_easy_repair_diff() { +MAIN_MENU=Recommended-Repair FORMAT_OS=format-os; [[ "$GUI" ]] && echo 'SET@_checkbutton_format_partition.set_active(True)' } diff -Nru boot-repair-4ppa123/usr/share/boot-sav/os-uninstaller-translations.sh boot-repair-4ppa200/usr/share/boot-sav/os-uninstaller-translations.sh --- boot-repair-4ppa123/usr/share/boot-sav/os-uninstaller-translations.sh 2014-12-22 22:52:29.000000000 +0000 +++ boot-repair-4ppa200/usr/share/boot-sav/os-uninstaller-translations.sh 2021-12-17 22:48:20.000000000 +0000 @@ -1,5 +1,5 @@ #! /bin/bash -# Copyright 2013 Yann MRN +# Copyright 2013-2022 Yann MRN # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published @@ -17,6 +17,7 @@ APPNAME2=$(eval_gettext $'OS-Uninstaller') #For .desktop & more remove_any_os_from_your_computer=$(eval_gettext $'Remove any operating system from your computer') #For .desktop Wubi_not_supported=$(eval_gettext $'Wubi must be uninstalled from Windows.') +#/// Please translate and, if possible, indicate an equivalent link in your language Wubi_see_for_more_info=$(eval_gettext $'See https://wiki.ubuntu.com/WubiGuide#Uninstallation for more information.') Which_os_do_you_want_to_uninstall=$(eval_gettext $'Which operating system do you want to uninstall ?') We_hope_you_enjoyed_it_and_feedback=$(eval_gettext $'We hope you enjoyed it and look forward to read your feedback.') diff -Nru boot-repair-4ppa123/usr/share/boot-sav-extra/gui-extra.sh boot-repair-4ppa200/usr/share/boot-sav-extra/gui-extra.sh --- boot-repair-4ppa123/usr/share/boot-sav-extra/gui-extra.sh 2020-03-15 13:14:14.000000000 +0000 +++ boot-repair-4ppa200/usr/share/boot-sav-extra/gui-extra.sh 2022-01-19 08:39:51.000000000 +0000 @@ -1,5 +1,5 @@ #! /bin/bash -# Copyright 2010-2020 Yann MRN +# Copyright 2010-2022 Yann MRN # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published @@ -14,14 +14,14 @@ # with this program. If not, see . first_translations_extra() { -RECENTUB=groovy;RECENTREP=Ubuntu-20.10 ##see also: open_sources_editor in actions-purge +RECENTUB=jammy;RECENTREP=Ubuntu-22.04 ##see also: open_sources_editor in actions-purge #/// Please do not translate ${RECENTREP} Warning_lastgrub=$(eval_gettext $'Warning: this will install necessary packages from ${RECENTREP} repositories.') Use_last_grub=$(eval_gettext $'Upgrade GRUB to its most recent version') } lastgrub_extra() { -echo "$Warning_lastgrub $Please_backup_data" +[[ ! "$GUI" ]] && echo "$Warning_lastgrub $Please_backup_data" [[ "$GUI" ]] && zenity --width=400 --warning --title="$APPNAME2" --text="$Warning_lastgrub $Please_backup_data" 2>/dev/null set_checkbutton_lastgrub } @@ -84,9 +84,9 @@ } installpackagelist_extra() { -if [[ "$INTERNET" = connected ]] && [[ "$MISSINGPACKAGE" ]];then - repair_dep; temp="$($UPDCOM)"; temp2="$($INSCOM)"; restore_dep -fi +#if [[ "$INTERNET" = connected ]] && [[ "$MISSINGPACKAGE" ]];then +# repair_dep; temp="$($UPDCOM)"; temp2="$($INSCOM)"; restore_dep +#fi check_missing_packages } @@ -145,7 +145,7 @@ [[ "$(grep "upgrade $APPNAME:" /var/log/dpkg.log | grep $(date +'%Y-%m') )" ]] \ || [[ "$(grep "install $APPNAME:" /var/log/dpkg.log | grep $(date +'%Y-%m') )" ]] || [[ "$DEBBUG" ]] && PROPOSUPDSOFT="" #don't propose if soft was updated during the month fi -if [[ ! "$(ls /var/log/$APPNAME | grep $(date +'%Y%m%d') )" ]] && [[ "$PROPOSUPDSOFT" ]] || [[ "$DEBBUG" ]];then #propose once a day +if [[ ! "$(ls /var/log/$APPNAME | grep $(date +'%Y%m%d') )" ]] && [[ "$PROPOSUPDSOFT" ]];then #propose once a day mkdir -p /var/log/$APPNAME/$DATE$SECOND UPDATESW=y if [[ ! "$FORCEYES" ]];then Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/af/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/af/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/ar/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/ar/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/ast/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/ast/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/az/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/az/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/be/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/be/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/bg/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/bg/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/bn/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/bn/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/br/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/br/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/bs/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/bs/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/ca/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/ca/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/ckb/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/ckb/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/cs/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/cs/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/cy/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/cy/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/da/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/da/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/de/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/de/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/el/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/el/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/en_AU/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/en_AU/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/en_CA/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/en_CA/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/en_GB/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/en_GB/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/eo/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/eo/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/es/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/es/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/et/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/et/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/eu/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/eu/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/fa/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/fa/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/fi/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/fi/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/fil/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/fil/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/fr/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/fr/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/ga/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/ga/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/gl/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/gl/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/gu/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/gu/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/he/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/he/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/hi/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/hi/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/hr/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/hr/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/ht/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/ht/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/hu/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/hu/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/hy/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/hy/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/id/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/id/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/is/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/is/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/it/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/it/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/ja/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/ja/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/ka/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/ka/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/km/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/km/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/kn/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/kn/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/ko/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/ko/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/ln/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/ln/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/lt/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/lt/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/lv/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/lv/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/mg/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/mg/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/mk/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/mk/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/ms/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/ms/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/mt/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/mt/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/my/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/my/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/nb/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/nb/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/nl/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/nl/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/nn/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/nn/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/oc/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/oc/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/pl/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/pl/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/pt/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/pt/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/pt_BR/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/pt_BR/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/ro/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/ro/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/ru/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/ru/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/se/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/se/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/si/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/si/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/sk/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/sk/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/sl/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/sl/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/sq/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/sq/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/sr/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/sr/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/sv/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/sv/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/sw/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/sw/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/ta/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/ta/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/te/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/te/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/tg/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/tg/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/th/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/th/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/tl/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/tl/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/tr/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/tr/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/ug/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/ug/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/uk/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/uk/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/ur/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/ur/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/uz/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/uz/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/vi/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/vi/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/yi/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/yi/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/zh_CN/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/zh_CN/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/zh_HK/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/zh_HK/LC_MESSAGES/boot-sav.mo differ Binary files /tmp/tmpwuxq22lv/yiVKsle5sv/boot-repair-4ppa123/usr/share/locale/zh_TW/LC_MESSAGES/boot-sav.mo and /tmp/tmpwuxq22lv/1brJpByxDT/boot-repair-4ppa200/usr/share/locale/zh_TW/LC_MESSAGES/boot-sav.mo differ