[PATCH] Don't set MALLOC_PERTURB_ when calling grub2-install. (workaround #806784)

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

 



With MALLOC_PERTURB_ set, we get:
[anaconda root@testraid ~]# export MALLOC_PERTURB_=204
[anaconda root@testraid ~]# grub2-install --no-floppy /dev/mapper/nvidia_dejcgici
/sbin/grub2-bios-setup: error: disk `hostdisk//dev/mapper/�����������������������������������������������������������������������������������������' not found.

This is obviously bad, so we're going to work around it by not setting
that for now.
---
 pyanaconda/bootloader.py |    3 ++-
 pyanaconda/iutil.py      |    6 +++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index 805bd1e..ffa9632 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -1789,7 +1789,8 @@ class GRUB2(GRUB):
 
             rc = iutil.execWithRedirect("grub2-install", args,
                                         stdout="/dev/tty5", stderr="/dev/tty5",
-                                        root=ROOT_PATH)
+                                        root=ROOT_PATH,
+                                        env_prune=['MALLOC_PERTURB_'])
             if rc:
                 raise BootLoaderError("bootloader install failed")
 
diff --git a/pyanaconda/iutil.py b/pyanaconda/iutil.py
index 4ab3354..e3b6c84 100644
--- a/pyanaconda/iutil.py
+++ b/pyanaconda/iutil.py
@@ -83,7 +83,7 @@ class tee(threading.Thread):
 # @param root The directory to chroot to before running command.
 # @return The return code of command.
 def execWithRedirect(command, argv, stdin = None, stdout = None,
-                     stderr = None, root = '/'):
+                     stderr = None, root = '/', env_prune=[]):
     def chroot ():
         os.chroot(root)
 
@@ -129,6 +129,10 @@ def execWithRedirect(command, argv, stdin = None, stdout = None,
     env = os.environ.copy()
     env.update({"LC_ALL": "C"})
 
+    for var in env_prune:
+        if env.has_key(var):
+            del env[var]
+
     try:
         #prepare tee proceses
         proc_std = tee(pstdout, stdout, program_log.info, command)
-- 
1.7.9.3

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list



[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux