F18 beta stuff
by David Lehman
This is the easy ones. I'm still doing test/fix iterations on the messy
ones.
11 years, 6 months
[PATCH] Setup package repo in the background (#870552)
by Jesse Keating
If a remote repo, like a nfs server, takes a long time to return an
error we can wind up sitting at a blank screen for minutes. This moves
the repo setup into the background thread and updates the spoke status
accordingly. Yes there is a lame sleep.
---
pyanaconda/ui/gui/spokes/source.py | 46 ++++++++++++++++++++++----------------
1 file changed, 27 insertions(+), 19 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/source.py b/pyanaconda/ui/gui/spokes/source.py
index 6f56523..4df2d11 100644
--- a/pyanaconda/ui/gui/spokes/source.py
+++ b/pyanaconda/ui/gui/spokes/source.py
@@ -21,6 +21,7 @@
#
import gettext
+import time
_ = lambda x: gettext.ldgettext("anaconda", x)
N_ = lambda x: x
@@ -39,11 +40,14 @@ from pyanaconda.ui.gui.categories.software import SoftwareCategory
from pyanaconda.ui.gui.utils import enlightbox, gtk_thread_wait
from pyanaconda.iutil import ProxyString, ProxyStringError
from pyanaconda.ui.gui.utils import gtk_call_once
+from pyanaconda.threads import threadMgr, AnacondaThread
+from pyanaconda.packaging import PayloadError
__all__ = ["SourceSpoke"]
MOUNTPOINT = "/mnt/install/isodir"
+BASEREPO_SETUP_MESSAGE = _("Setting up installation source...")
METADATA_DOWNLOAD_MESSAGE = _("Downloading package metadata...")
METADATA_ERROR_MESSAGE = _("Error downloading package metadata...")
@@ -425,8 +429,6 @@ class SourceSpoke(NormalSpoke):
self._error = False
def apply(self):
- from pyanaconda.threads import threadMgr, AnacondaThread
- from pyanaconda.packaging import PayloadError
import copy
old_source = copy.copy(self.data.method)
@@ -505,7 +507,18 @@ class SourceSpoke(NormalSpoke):
old_source.opts == self.data.method.opts):
return
+ threadMgr.add(AnacondaThread(name="AnaPayloadMDThread",
+ target=self.getRepoMetadata))
+ self.window.clear_info()
+
+ def getRepoMetadata(self):
communication.send_not_ready("SoftwareSelectionSpoke")
+ communication.send_not_ready(self.__class__.__name__)
+ communication.send_message(self.__class__.__name__,
+ BASEREPO_SETUP_MESSAGE)
+ # this sleep is lame, but without it the message above doesn't seem
+ # to get processed by the hub in time, and is never shown.
+ time.sleep(1)
try:
self.payload.updateBaseRepo(self.storage, fallback=False,
checkmount=False)
@@ -518,26 +531,21 @@ class SourceSpoke(NormalSpoke):
self.window.set_info(Gtk.MessageType.WARNING, _("Failed to set up install source, check the repo url"))
else:
self.window.set_info(Gtk.MessageType.WARNING, _("Failed to set up install source, check the repo url and proxy settings"))
+ communication.send_ready(self.__class__.__name__)
else:
self._error = False
- self.window.clear_info()
- threadMgr.add(AnacondaThread(name="AnaPayloadMDThread",
- target=self.getRepoMetadata))
-
- def getRepoMetadata(self):
- communication.send_not_ready(self.__class__.__name__)
- communication.send_message(self.__class__.__name__,
- METADATA_DOWNLOAD_MESSAGE)
- self.payload.gatherRepoMetadata()
- self.payload.release()
- if not self.payload.baseRepo:
communication.send_message(self.__class__.__name__,
- METADATA_ERROR_MESSAGE)
- communication.send_ready(self.__class__.__name__)
- self._error = True
- else:
- communication.send_ready(self.__class__.__name__)
- communication.send_ready("SoftwareSelectionSpoke")
+ METADATA_DOWNLOAD_MESSAGE)
+ self.payload.gatherRepoMetadata()
+ self.payload.release()
+ if not self.payload.baseRepo:
+ communication.send_message(self.__class__.__name__,
+ METADATA_ERROR_MESSAGE)
+ communication.send_ready(self.__class__.__name__)
+ self._error = True
+ else:
+ communication.send_ready(self.__class__.__name__)
+ communication.send_ready("SoftwareSelectionSpoke")
@property
def completed(self):
--
1.7.11.4
11 years, 6 months
[PATCH 1/4] check disklabels when calculating free space (#863892)
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
You need at least one of the platform's disklabels in order for the free
space on the disk to be useful. If none of the disks labels will work we
set the free space to 0 and allow the resize dialog to be used to remove
all the partitions which will relabel the disk.
---
pyanaconda/ui/gui/spokes/storage.py | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
index 14ea404..7aab762 100644
--- a/pyanaconda/ui/gui/spokes/storage.py
+++ b/pyanaconda/ui/gui/spokes/storage.py
@@ -644,10 +644,22 @@ class StorageSpoke(NormalSpoke, StorageChecker):
disks = [d for d in self.disks if d.name in self.selected_disks]
disks_size = sum(Size(spec="%f MB" % d.size) for d in disks)
- free_space = self.storage.getFreeSpace(disks=disks,
- clearPartType=CLEARPART_TYPE_NONE)
- disk_free = sum([f[0] for f in free_space.itervalues()])
- fs_free = sum([f[1] for f in free_space.itervalues()])
+ # Figure out if the existing disk labels will work on this platform
+ # you need to have at least one of the platform's labels in order for
+ # any of the free space to be useful.
+ disk_labels = set([disk.format.labelType for disk in self.disks \
+ if hasattr(disk.format, "labelType")])
+ platform_labels = set(self.storage.platform.diskLabelTypes)
+ if disk_labels and platform_labels.isdisjoint(disk_labels):
+ disk_free = 0
+ fs_free = 0
+ log.debug("Need disklabel: %s have: %s" % (", ".join(platform_labels),
+ ", ".join(disk_labels)))
+ else:
+ free_space = self.storage.getFreeSpace(disks=disks,
+ clearPartType=CLEARPART_TYPE_NONE)
+ disk_free = sum([f[0] for f in free_space.itervalues()])
+ fs_free = sum([f[1] for f in free_space.itervalues()])
required_space = self.payload.spaceRequired
log.debug("disk free: %s fs free: %s sw needs: %s" % (disk_free,
--
1.7.11.7
11 years, 6 months
[PATCH 1/2] Fix up calling superclass setup methods in packaging (#870556).
by Chris Lumens
---
pyanaconda/packaging/__init__.py | 1 -
pyanaconda/packaging/livepayload.py | 2 ++
pyanaconda/packaging/tarpayload.py | 2 +-
pyanaconda/packaging/yumpayload.py | 2 ++
4 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/packaging/__init__.py b/pyanaconda/packaging/__init__.py
index b7402c7..e415fbb 100644
--- a/pyanaconda/packaging/__init__.py
+++ b/pyanaconda/packaging/__init__.py
@@ -147,7 +147,6 @@ class Payload(object):
def setup(self, storage):
""" Do any payload-specific setup. """
self.storage = storage
- raise NotImplementedError()
def preStorage(self):
""" Do any payload-specific work necessary before writing the storage
diff --git a/pyanaconda/packaging/livepayload.py b/pyanaconda/packaging/livepayload.py
index 78ff9e9..e47f46f 100644
--- a/pyanaconda/packaging/livepayload.py
+++ b/pyanaconda/packaging/livepayload.py
@@ -53,6 +53,8 @@ _ = lambda x: gettext.ldgettext("anaconda", x)
class LiveImagePayload(ImagePayload):
""" A LivePayload copies the source image onto the target system. """
def setup(self, storage):
+ super(LiveImagePayload, self).setup(storage)
+
# Mount the live device and copy from it instead of the overlay at /
osimg = storage.devicetree.getDeviceByPath(self.data.method.partition)
if not stat.S_ISBLK(os.stat(osimg.path)[stat.ST_MODE]):
diff --git a/pyanaconda/packaging/tarpayload.py b/pyanaconda/packaging/tarpayload.py
index 557bdbf..32361d8 100644
--- a/pyanaconda/packaging/tarpayload.py
+++ b/pyanaconda/packaging/tarpayload.py
@@ -58,7 +58,7 @@ class TarPayload(ArchivePayload):
self.archive = None
def setup(self, storage):
- super(TarPayload, self).setup()
+ super(TarPayload, self).setup(storage)
try:
self.archive = tarfile.open(self.image_file)
diff --git a/pyanaconda/packaging/yumpayload.py b/pyanaconda/packaging/yumpayload.py
index 6a22bb6..25372cb 100644
--- a/pyanaconda/packaging/yumpayload.py
+++ b/pyanaconda/packaging/yumpayload.py
@@ -150,6 +150,8 @@ class YumPayload(PackagePayload):
self._resetYum(root=root)
def setup(self, storage):
+ super(YumPayload, self).setup(storage)
+
self._writeYumConfig()
self._setup = True
--
1.7.11.2
11 years, 6 months
[PATCH] Replace ' ' with '_' when looking for ifcfg files (#869106)
by Radek Vykydal
---
pyanaconda/ui/gui/spokes/network.py | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/network.py b/pyanaconda/ui/gui/spokes/network.py
index 26cf3e7..37953d9 100644
--- a/pyanaconda/ui/gui/spokes/network.py
+++ b/pyanaconda/ui/gui/spokes/network.py
@@ -1055,6 +1055,7 @@ def getKSNetworkData(device):
if ap:
ifcfg_suffix = ap.get_ssid()
+ ifcfg_suffix = ifcfg_suffix.replace(' ', '_')
if ifcfg_suffix:
device_cfg = NetworkDevice(netscriptsDir, ifcfg_suffix)
device_cfg.loadIfcfgFile()
--
1.7.4
11 years, 6 months
[PATCH] Fix problems when changing things in the software spoke (#868742, #869424).
by Chris Lumens
We shouldn't be modifying ksdata in the on_environment_changed handler, for
starters. That should only happen in apply.
---
pyanaconda/ui/gui/spokes/software.py | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/software.py b/pyanaconda/ui/gui/spokes/software.py
index 2c7dcab..34dd6b3 100644
--- a/pyanaconda/ui/gui/spokes/software.py
+++ b/pyanaconda/ui/gui/spokes/software.py
@@ -257,9 +257,6 @@ class SoftwareSelectionSpoke(NormalSpoke):
self._addonStore.append([selected, "<b>%s</b>\n%s" % (name, desc), grp])
- self.selectedGroups = [g.name for g in self.data.packages.groupList]
- self.excludedGroups = [g.name
- for g in self.data.packages.excludedGroupList]
self._selectFlag = True
if self._errorMsgs:
@@ -290,12 +287,11 @@ class SoftwareSelectionSpoke(NormalSpoke):
for row in self._environmentStore:
row[0] = False
- # Remove all groups from the previous environment from the selected
- # list, but don't explicitly exclude them.
+ # Then, remove all the groups that were selected by the previously
+ # selected environment.
for groupid in self.payload.environmentGroups(self.environment):
- grp = Group(groupid)
- if grp in self.data.packages.groupList:
- self.data.packages.groupList.remove(grp)
+ if groupid in self.selectedGroups:
+ self.selectedGroups.remove(groupid)
# Then mark the clicked environment as selected and update the screen.
self._environmentStore[path][0] = True
--
1.7.11.2
11 years, 6 months
[master] [PATCH] Do not return None from Size.__str__ (#869405)
by Vratislav Podzimek
__str__ should never return None. If the value exceeds the maximum
size we are able to display, let's replace it with that maximum size.
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
pyanaconda/storage/size.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/storage/size.py b/pyanaconda/storage/size.py
index 757c97b..d86dc96 100644
--- a/pyanaconda/storage/size.py
+++ b/pyanaconda/storage/size.py
@@ -231,4 +231,5 @@ class Size(Decimal):
else:
return retval + " " + prefix + P_("byte", "bytes", newcheck)
- return None
+ # bigger than everything we have
+ return "1 " + _decimalPrefix[-1][2]
--
1.7.11.7
11 years, 6 months
[PATCH 1/2] skip luks passphrase in exception dump (#868509)
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
Also skip logging any kwargs with pass in their name
---
pyanaconda/anaconda_log.py | 2 ++
pyanaconda/exception.py | 1 +
2 files changed, 3 insertions(+)
diff --git a/pyanaconda/anaconda_log.py b/pyanaconda/anaconda_log.py
index 40c1938..046cca7 100644
--- a/pyanaconda/anaconda_log.py
+++ b/pyanaconda/anaconda_log.py
@@ -86,6 +86,8 @@ def log_method_call(d, *args, **kwargs):
for k, v in kwargs.items():
fmt += " %s: %s ;"
+ if "pass" in k.lower() and v:
+ v = "Skipped"
fmt_args.extend([k, v])
logging.getLogger("storage").debug(fmt % tuple(fmt_args))
diff --git a/pyanaconda/exception.py b/pyanaconda/exception.py
index 7b37914..09f9837 100644
--- a/pyanaconda/exception.py
+++ b/pyanaconda/exception.py
@@ -157,6 +157,7 @@ def initExceptionHandling(anaconda):
attrSkipList=["_intf._actions",
"_intf.storage.bootloader.password",
"_intf.storage.data",
+ "_intf.storage.encryptionPassphrase",
"_bootloader.encrypted_password",
"_bootloader.password",
"payload._groups",
--
1.7.11.7
11 years, 6 months
[PATCH] run checkisomd5 from anaconda-diskroot (#848764)
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
anaconda-dracut always passes a path to dmsquash-live-root so its
checkisomd5 never runs (it needs a block device).
NOTE: Tested on real CDs, a good one and a bad one.
---
dracut/anaconda-diskroot | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/dracut/anaconda-diskroot b/dracut/anaconda-diskroot
index 612a131..051081b 100755
--- a/dracut/anaconda-diskroot
+++ b/dracut/anaconda-diskroot
@@ -3,8 +3,24 @@
# usage: anaconda-diskroot DEVICE [PATH]
. /lib/anaconda-lib.sh
-command -v getarg >/dev/null || . /lib/dracut-lib.sh
+command -v getargbool >/dev/null || . /lib/dracut-lib.sh
+# Run checkisomd5 on a device
+run_checkisomd5() {
+ livedev=$1
+ if getargbool 0 rd.live.check -d check; then
+ [ -b $livedev ] && fs=$(blkid -s TYPE -o value $livedev)
+ if [ "$fs" = "iso9660" -o "$fs" = "udf" ]; then
+ [ -x /bin/plymouth ] && /bin/plymouth --hide-splash
+ checkisomd5 --verbose $livedev
+ if [ $? -ne 0 ]; then
+ die "CD check failed!"
+ exit 1
+ fi
+ [ -x /bin/plymouth ] && /bin/plymouth --show-splash
+ fi
+ fi
+}
dev="$1"
path="$2" # optional, could be empty
@@ -14,3 +30,4 @@ path="$2" # optional, could be empty
info "anaconda using disk root at $dev"
mount $dev $repodir || warn "Couldn't mount $dev"
anaconda_live_root_dir $repodir $path
+run_checkisomd5 $dev
--
1.7.11.7
11 years, 6 months
[PATCH] remove dispatch.py
by Chris Lumens
I really dislike the idea of shipping F18 with hundreds of lines of code that
don't do anything. This is a start. Once some other unused files go away,
I can also remove the DISPATCH_* constants.
- Chris
11 years, 6 months