Репозиторий Sisyphus
Последнее обновление: 19 июля 2019 | Пакетов: 17691 | Посещений: 14358788
en ru br
Репозитории ALT
S:2.02-alt17
D:0.97-alt2
5.1: 0.97-alt5
4.1: 0.97-alt4.M41.1
3.0: 0.95-alt1
www.altlinux.org/Changes

Группа :: Система/Ядро и оборудование
Пакет: grub

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: grub-2.02-check_writes-alt.patch
Скачать


commit acfc908df734047d3b73d2ca0aa4cbdf93f42d08
Author: Leonid Krivoshein <klark@altlinux.org>
Date:   Sun May 13 04:31:16 2018 +0300
    Write to read-only grub device problem fixed.
diff --git a/grub/util/grub-mkconfig_lib.in b/grub/util/grub-mkconfig_lib.in
index 60b31ca..d600c43 100644
--- a/grub/util/grub-mkconfig_lib.in
+++ b/grub/util/grub-mkconfig_lib.in
@@ -109,6 +109,26 @@ convert_system_path_to_grub_path ()
   echo "${drive}${relative_path}"
 }
 
+save_var ()
+{
+  for abstraction in dummy `"${grub_probe}" --device ${GRUB_DEVICE} --target=abstraction`; do
+    case "$abstraction" in
+    diskfilter|lvm)
+      echo "# GRUB lacks write support for $abstraction"
+      return;;
+    esac
+  done
+
+  fs="`"${grub_probe}" --device ${GRUB_DEVICE} --target=fs`"
+  case "$fs" in
+  btrfs|cpiofs|newc|odc|romfs|squash4|tarfs|zfs)
+    echo "# GRUB lacks write support for $fs"
+    return;;
+  esac
+
+  echo "save_env $1"
+}
+
 save_default_entry ()
 {
   if [ "x${GRUB_SAVEDEFAULT}" = "xtrue" ] ; then
diff --git a/grub/util/grub.d/00_header.in b/grub/util/grub.d/00_header.in
index 93a9023..11223db 100644
--- a/grub/util/grub.d/00_header.in
+++ b/grub/util/grub.d/00_header.in
@@ -54,7 +54,7 @@ if cmostest $GRUB_BUTTON_CMOS_ADDRESS ; then
 elif [ "\${next_entry}" ] ; then
    set default="\${next_entry}"
    set next_entry=
-   save_env next_entry
+   $(save_var next_entry)
    set boot_once=true
 else
    set default="${GRUB_DEFAULT}"
@@ -65,7 +65,7 @@ else
 if [ "\${next_entry}" ] ; then
    set default="\${next_entry}"
    set next_entry=
-   save_env next_entry
+   $(save_var next_entry)
    set boot_once=true
 else
    set default="${GRUB_DEFAULT}"
@@ -84,16 +84,16 @@ export menuentry_id_option
 
 if [ "\${prev_saved_entry}" ]; then
   set saved_entry="\${prev_saved_entry}"
-  save_env saved_entry
+  $(save_var saved_entry)
   set prev_saved_entry=
-  save_env prev_saved_entry
+  $(save_var prev_saved_entry)
   set boot_once=true
 fi
 
 function savedefault {
   if [ -z "\${boot_once}" ]; then
     saved_entry="\${chosen}"
-    save_env saved_entry
+    $(save_var saved_entry)
   fi
 }
 
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin