[master/rhel7] Skip running efibootmgr for image and dir installations (#1067749)
by Brian C. Lane
Since there is no target UEFI system, just an image, skip running
efibootmgr so that it doesn't remove the host's UEFI boot information.
Resolves: rhbz#1067749
---
pyanaconda/bootloader.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index d6b3034..e71e778 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -1640,6 +1640,10 @@ class EFIGRUB(GRUB2):
self.efi_dir = 'BOOT'
def efibootmgr(self, *args, **kwargs):
+ if flags.imageInstall or flags.dirInstall:
+ log.info("Skipping efibootmgr for image/directory install.")
+ return ""
+
if kwargs.pop("capture", False):
exec_func = iutil.execWithCapture
else:
--
1.8.5.3
10 years, 2 months
[master/rhel7] livemedia-creator: Set the product and release version env variables (#1067746)
by Brian C. Lane
When doing an image install there is no .buildstamp file to pull the
information from so use the cmdline variables (or their defaults) and
pass them to anaconda in the environment.
Resolves: rhbz#1067746
---
src/sbin/livemedia-creator | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/sbin/livemedia-creator b/src/sbin/livemedia-creator
index a82d38f..903488e 100755
--- a/src/sbin/livemedia-creator
+++ b/src/sbin/livemedia-creator
@@ -558,6 +558,9 @@ def novirt_install(opts, disk_img, disk_size, repo_url):
# Create the sparse image
mksparse(disk_img, disk_size * 1024**3)
+ # Make sure anaconda has the right product and release
+ os.environ["ANACONDA_PRODUCTNAME"] = opts.project
+ os.environ["ANACONDA_PRODUCTVERSION"] = opts.releasever
rc = execWithRedirect("anaconda", args)
# Move the anaconda logs over to a log directory
--
1.8.5.3
10 years, 2 months
[PATCH] Add profiling cmdline option
by Brian C. Lane
This adds a --profile (or inst.profile) command that uses the cProfile
module to gather information about Anaconda at runtime. Thread profiles
are dumped in /tmp/thread-*.prof with a unique filename using the thread
id and a counter for duplicates. The id can be matched to the id in
anaconda.log (note that the id can be reused, so count the number of
ThreadDone entries).
Sending a USR2 will include a profile dump in /tmp/anaconda.prof
---
anaconda | 12 ++++++++++++
data/anaconda_options.txt | 7 +++++++
pyanaconda/anaconda.py | 9 +++++++++
pyanaconda/flags.py | 1 +
pyanaconda/threads.py | 19 ++++++++++++++++++-
5 files changed, 47 insertions(+), 1 deletion(-)
diff --git a/anaconda b/anaconda
index 994497f..fde89fe 100755
--- a/anaconda
+++ b/anaconda
@@ -42,6 +42,9 @@ def exitHandler(rebootData, storage, exitCode=None):
if exitCode:
anaconda.intf.shutdown()
+ if anaconda.profiler:
+ anaconda.dumpProfile()
+
if "nokill" in flags.cmdline:
iutil.vtActivate(1)
print "anaconda halting due to nokill flag."
@@ -314,6 +317,8 @@ def parseOptions(argv=None, cmdline=None):
op.add_option("--extlinux", action="store_true", default=False)
op.add_option("--dnf", action="store_true", default=False)
op.add_option("--mpathfriendlynames", action="store_true", default=True)
+ op.add_option("--profile", action="store_true", default=False,
+ help=help_parser.help_text("profile"))
# some defaults change based on cmdline flags
if cmdline is not None:
@@ -814,6 +819,13 @@ if __name__ == "__main__":
anaconda.opts = opts
+ if opts.profile or flags.profile:
+ flags.profile = True
+ import cProfile
+ anaconda.profiler = cProfile.Profile()
+ anaconda.profiler.enable()
+ log.debug("profiling enabled")
+
# check memory, just the text mode for now:
check_memory(anaconda, opts, 't')
diff --git a/data/anaconda_options.txt b/data/anaconda_options.txt
index 6dc90c4..2772256 100644
--- a/data/anaconda_options.txt
+++ b/data/anaconda_options.txt
@@ -15,3 +15,10 @@ This option may be used multiple times to specify multiple disk
images. It is an error to specify the same <path> twice or to use
duplicate names. The --image and --dirinstall options are
mutually exclusive.
+
+profile
+Use Python's cProfile module to profile Anaconda. Stats will be
+dumped to /tmp/anaconda.prof when SIGUSR2 is sent to the process.
+Thread profiles will be dumped to /tmp/thread*prof files. Note
+that thread ID may be reused so a counter is added to keep them
+unique.
diff --git a/pyanaconda/anaconda.py b/pyanaconda/anaconda.py
index 88a9a4d..ccea2cf 100644
--- a/pyanaconda/anaconda.py
+++ b/pyanaconda/anaconda.py
@@ -72,6 +72,7 @@ class Anaconda(object):
self._storage = None
self.updateSrc = None
self.mehConfig = None
+ self.profiler = None
# *sigh* we still need to be able to write this out
self.xdriver = None
@@ -156,12 +157,20 @@ class Anaconda(object):
return self._storage
+ def dumpProfile(self):
+ if self.profiler:
+ self.profiler.create_stats()
+ self.profiler.dump_stats("/tmp/anaconda.prof")
+ self.profiler.enable()
+
def dumpState(self):
from meh import ExceptionInfo
from meh.dump import ReverseExceptionDump
from inspect import stack as _stack
from traceback import format_stack
+ self.dumpProfile()
+
# Skip the frames for dumpState and the signal handler.
stack = _stack()[2:]
stack.reverse()
diff --git a/pyanaconda/flags.py b/pyanaconda/flags.py
index e81972d..b31eb2e 100644
--- a/pyanaconda/flags.py
+++ b/pyanaconda/flags.py
@@ -69,6 +69,7 @@ class Flags(object):
self.testing = False
self.dnf = False
self.mpathFriendlyNames = True
+ self.profile = False
# ksprompt is whether or not to prompt for missing ksdata
self.ksprompt = True
# parse the boot commandline
diff --git a/pyanaconda/threads.py b/pyanaconda/threads.py
index 5b7a80b..394ac3e 100644
--- a/pyanaconda/threads.py
+++ b/pyanaconda/threads.py
@@ -19,6 +19,9 @@
#
# Author(s): Chris Lumens <clumens(a)redhat.com>
#
+import os
+
+from pyanaconda.flags import flags
import logging
log = logging.getLogger("anaconda")
@@ -223,13 +226,27 @@ class AnacondaThread(threading.Thread):
log.info("Running Thread: %s (%s)", self.name, self.ident)
try:
- threading.Thread.run(self, *args, **kwargs)
+ if not flags.profile:
+ threading.Thread.run(self, *args, **kwargs)
+ else:
+ import cProfile
+ profiler = cProfile.Profile()
+ profiler.runcall(threading.Thread.run, self, *args, **kwargs)
# pylint: disable-msg=W0702
except:
threadMgr.set_error(self.name, *sys.exc_info())
if self._fatal:
sys.excepthook(*sys.exc_info())
finally:
+ if flags.profile:
+ # ident could be recycled, make a unique filename
+ dump_template = "/tmp/thread-%d-%d.prof"
+ for i in xrange(0, 99999):
+ dump_path = dump_template % (self.ident, i)
+ if not os.path.exists(dump_path):
+ break
+ profiler.dump_stats(dump_path)
+
threadMgr.remove(self.name)
log.info("Thread Done: %s (%s)", self.name, self.ident)
--
1.8.5.3
10 years, 2 months
[blivet-master/rhel7] return empty set when no matching fcoe nic (#1067159)
by Brian C. Lane
When there is no matching nic (or no nics at all) return an empty set
from dracutSetupArgs.
Resolves: rhbz#1067159
---
blivet/devices.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/blivet/devices.py b/blivet/devices.py
index a607c1b..3cc5c18 100644
--- a/blivet/devices.py
+++ b/blivet/devices.py
@@ -4081,6 +4081,8 @@ class FcoeDiskDevice(DiskDevice, NetworkStorageDevice):
for nic, dcb, auto_vlan in fcoe().nics:
if nic == self.nic:
break
+ else:
+ return set()
if dcb:
dcbOpt = "dcb"
--
1.8.5.3
10 years, 2 months
[PATCH anaconda:rhel7/master] Do not use shim.efi on ARMv8 (aarch64)
by d.marlin
ARMv8 does not use secureboot, so does not use shim.efi to load
grub. Make the EFI binary a variable, and override it for ARMv8.
Signed-off-by: David A. Marlin <dmarlin(a)redhat.com>
---
pyanaconda/bootloader.py | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index 90505a9..9cf73c4 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -1642,6 +1642,8 @@ class EFIGRUB(GRUB2):
stage2_is_valid_stage1 = False
stage2_bootable = False
+ _efi_binary = "\\shim.efi"
+
@property
def _config_dir(self):
return "efi/EFI/%s" % (self.efi_dir,)
@@ -1701,7 +1703,7 @@ class EFIGRUB(GRUB2):
rc = self.efibootmgr("-c", "-w", "-L", productName,
"-d", boot_disk.path, "-p", boot_part_num,
"-l",
- self.efi_dir_as_efifs_dir + "\\shim.efi",
+ self.efi_dir_as_efifs_dir + self._efi_binary),
root=ROOT_PATH)
if rc:
raise BootLoaderError("failed to set new efi boot target")
@@ -1741,6 +1743,7 @@ class Aarch64EFIGRUB(EFIGRUB):
_serial_consoles = ["ttyAMA", "ttyS"]
+ _efi_binary = "\\grubaa64.efi"
class MacEFIGRUB(EFIGRUB):
def mactel_config(self):
--
1.7.1
10 years, 2 months
[blivet][rhel7-branch][master] this week's rhel patches
by David Lehman
If anyone wants to argue that patch 1 belongs in anaconda's custom
spoke, I'd be receptive to that idea. Seems like six on one side,
half dozen on the other to me.
Patch 3 is a minimal version of patch 8 from the set I just sent
for master.
10 years, 2 months
[blivet] patches for master only
by David Lehman
Mixed bag. Several cleanups from the Size set followed by various
things I've found over the last week or three.
10 years, 2 months
[PATCH lorax:rhel7/master] Update the templates and config file to better support EFI on aarch64
by d.marlin
(64-bit ARM).
Signed-off-by: David A. Marlin <dmarlin(a)redhat.com>
---
share/aarch64.tmpl | 12 +-----------
share/config_files/aarch64/grub2-efi.cfg | 9 ++++-----
share/efi.tmpl | 5 +++++
3 files changed, 10 insertions(+), 16 deletions(-)
diff --git a/share/aarch64.tmpl b/share/aarch64.tmpl
index 701b22e..c341aae 100644
--- a/share/aarch64.tmpl
+++ b/share/aarch64.tmpl
@@ -2,7 +2,6 @@
<%
configdir="tmp/config_files/aarch64"
PXEBOOTDIR="images/pxeboot"
-BOOTDIR="boot"
KERNELDIR=PXEBOOTDIR
LIVEDIR="LiveOS"
%>
@@ -11,15 +10,6 @@ mkdir ${LIVEDIR}
install ${runtime_img} ${LIVEDIR}/squashfs.img
treeinfo stage2 mainimage ${LIVEDIR}/squashfs.img
-## install bootloader and config files
-mkdir ${BOOTDIR}
-install ${configdir}/boot.msg ${BOOTDIR}
-install ${configdir}/grub2-efi.cfg ${BOOTDIR}
-
-## configure bootloader
-replace @VERSION@ ${product.version} ${BOOTDIR}/grub2-efi.cfg ${BOOTDIR}/*.msg
-replace @PRODUCT@ '${product.name}' ${BOOTDIR}/grub2-efi.cfg ${BOOTDIR}/*.msg
-
## install kernels
mkdir ${KERNELDIR}
%for kernel in kernels:
@@ -35,7 +25,7 @@ mkdir ${KERNELDIR}
## WHeeeeeeee, EFI.
## We could remove the basearch restriction someday..
<% efiargs=""; efigraft="" %>
-%if exists("boot/efi/EFI/*/gcdaa64.efi"):
+%if exists("boot/efi/EFI/*/grubaa64.efi"):
<%
efiarch = 'AARCH64'
efigraft="EFI/BOOT={0}/EFI/BOOT".format(outroot)
diff --git a/share/config_files/aarch64/grub2-efi.cfg b/share/config_files/aarch64/grub2-efi.cfg
index 289ed43..83f5763 100644
--- a/share/config_files/aarch64/grub2-efi.cfg
+++ b/share/config_files/aarch64/grub2-efi.cfg
@@ -9,10 +9,9 @@ set timeout=5
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/10_linux ###
-menuentry 'Install @PRODUCT@ @VERSION@' --class fedora --class gnu-linux --class gnu --class os {
- set root='hd0,gpt2'
- devicetree @KERNELPATH@/../foundation-v8.dtb
- linuxefi @KERNELPATH@ @ROOT@ mem=2G console=ttyAMA0 earlyprintk=pl011,0x1c090000 debug uefi_debug rw
- initrdefi @INITRDPATH@
+menuentry 'Install @PRODUCT@ @VERSION@' --class red --class gnu-linux --class gnu --class os {
+ linux @KERNELPATH@ @ROOT@ ro console=ttyS0,115200 debug earlyprintk=uart8250-32bit,0x1c020000 maxcpus=1
+ initrd @INITRDPATH@
+ devicetree /images/pxeboot/apm-mustang.dtb
}
diff --git a/share/efi.tmpl b/share/efi.tmpl
index 4e29ec9..7a845bb 100644
--- a/share/efi.tmpl
+++ b/share/efi.tmpl
@@ -7,10 +7,15 @@ APPLE_EFI_DISKNAME=inroot+"/usr/share/pixmaps/bootloader/fedora-media.vol"
mkdir ${EFIBOOTDIR}
mkdir ${EFIBOOTDIR}/fonts/
+%if efiarch == 'AARCH64':
+install boot/efi/EFI/*/grubaa64.efi ${EFIBOOTDIR}/BOOT${efiarch}.efi
+install boot/efi/EFI/*/grubaa64.efi ${EFIBOOTDIR}/grubaa64.efi
+%else:
install boot/efi/EFI/*/shim.efi ${EFIBOOTDIR}/BOOT${efiarch}.efi
install boot/efi/EFI/*/MokManager.efi ${EFIBOOTDIR}/
install usr/share/shim/lockdown.efi ${EFIBOOTDIR}/
install boot/efi/EFI/*/gcdx64.efi ${EFIBOOTDIR}/grubx64.efi
+%endif
install boot/efi/EFI/*/fonts/unicode.pf2 ${EFIBOOTDIR}/fonts/
## actually make the EFI images
--
1.7.1
10 years, 2 months
[anaconda:rhel7/master] Always have a "New ..." page even if it has no devices (#1043763)
by Anne Mulhern
Resolves: rhbz#1043763
There should always be a page for the "New ..." Fedora or RHEL7 install
because that's our target, i.e., what we're trying to install with this
installer.
Several methods assume that a search in the accordion for the page that
corresponds to self.translated_new_install_name will always be successful
and will crash if none is found.
Signed-off-by: mulhern <amulhern(a)redhat.com>
---
pyanaconda/ui/gui/spokes/custom.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 61506fc..f72cae9 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -974,11 +974,11 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
# Add in all the existing (or autopart-created) operating systems.
for root in ui_roots:
- # Don't make a page if none of the root's devices are left.
- # Also, only include devices in an old page if the format is intact.
- if not [d for d in root.swaps + root.mounts.values()
- if d in self._devices and d.disks and
- (root.name == self.translated_new_install_name or d.format.exists)]:
+ # Omit a page for the root if the root has no devices
+ # * unless it is new_root
+ if not (root.name == self.translated_new_install_name or \
+ [d for d in root.swaps + root.mounts.values()
+ if d in self._devices and d.disks and d.format.exists]):
continue
page = Page(root.name)
--
1.8.3.1
10 years, 2 months
[blivet:rhel7/master] Make partitioning error message more friendly (#1020388)
by Anne Mulhern
Resolves: rhbz#1020388
Automatic partitioning is complicated and may fail for a number of reasons
besides an absolute lack of space. This message is supposed to be soothing
yet useful.
---
blivet/partitioning.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/blivet/partitioning.py b/blivet/partitioning.py
index 0076411..605f09f 100644
--- a/blivet/partitioning.py
+++ b/blivet/partitioning.py
@@ -1077,7 +1077,11 @@ def allocatePartitions(storage, disks, partitions, freespace):
break
if free is None:
- raise PartitioningError(_("unable to allocate a large enough partition"))
+ raise PartitioningError(
+ _("Unable to allocate requested partition scheme. "
+ "Consider reducing the size of any already allocated "
+ "partitions. If you are installing to disks of different "
+ "sizes, consider placing the larger disks first."))
_disk = use_disk
disklabel = _disk.format
--
1.8.3.1
10 years, 2 months