Adds a property to Storage to list packages required for storage, platform, and bootloader. --- pyanaconda/install.py | 2 +- pyanaconda/packaging/__init__.py | 10 +++++++--- pyanaconda/packaging/yumpayload.py | 6 ++---- pyanaconda/storage/__init__.py | 15 +++++++++++++++ 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/pyanaconda/install.py b/pyanaconda/install.py index 11dcb47..a19d04b 100644 --- a/pyanaconda/install.py +++ b/pyanaconda/install.py @@ -48,7 +48,7 @@ def doInstall(storage, payload, ksdata, instClass): turnOnFilesystems(storage, errorHandler) # Do packaging. - payload.preInstall() + payload.preInstall(packages=storage.packages) payload.install() payload.postInstall() diff --git a/pyanaconda/packaging/__init__.py b/pyanaconda/packaging/__init__.py index 1a2fc06..e6026ca 100644 --- a/pyanaconda/packaging/__init__.py +++ b/pyanaconda/packaging/__init__.py @@ -426,9 +426,8 @@ class Payload(object): ### ### METHODS FOR INSTALLING THE PAYLOAD ### - def preInstall(self): + def preInstall(self, packages=None): """ Perform pre-installation tasks. """ - # XXX this should be handled already iutil.mkdirChain(ROOT_PATH + "/root") if self.data.upgrade.upgrade: @@ -452,6 +451,9 @@ class Payload(object): pass instlog.start(ROOT_PATH, syslogname) + if packages is not None: + map(self.selectPackage, packages) + def install(self): """ Install the payload. """ raise NotImplementedError() @@ -491,7 +493,9 @@ class ArchivePayload(ImagePayload): class PackagePayload(Payload): """ A PackagePayload installs a set of packages onto the target system. """ - pass + def preInstall(self, packages=None): + # TODO: kernel selection + super(PackagePayload, self).preInstall(packages=packages) def payloadInitialize(storage, ksdata, payload): from pyanaconda.kickstart import selectPackages diff --git a/pyanaconda/packaging/yumpayload.py b/pyanaconda/packaging/yumpayload.py index 73bb499..6bf24f4 100644 --- a/pyanaconda/packaging/yumpayload.py +++ b/pyanaconda/packaging/yumpayload.py @@ -840,9 +840,9 @@ reposdir=%s self._removeTxSaveFile() - def preInstall(self): + def preInstall(self, packages=None): """ Perform pre-installation tasks. """ - super(YumPayload, self).preInstall() + super(YumPayload, self).preInstall(packages=packages) self._writeInstallConfig() self.checkSoftwareSelection() @@ -850,9 +850,7 @@ reposdir=%s % (len(self._yum.tsInfo.getMembers()), self.spaceRequired)) # doPreInstall - # create a bunch of directories like /var, /var/lib/rpm, /root, &c (?) # create mountpoints for protected device mountpoints (?) - # initialize the backend logger # write static configs (storage, modprobe.d/anaconda.conf, network, keyboard) # on upgrade, just make sure /etc/mtab is a symlink to /proc/self/mounts diff --git a/pyanaconda/storage/__init__.py b/pyanaconda/storage/__init__.py index 8ea582e..2b9e453 100644 --- a/pyanaconda/storage/__init__.py +++ b/pyanaconda/storage/__init__.py @@ -1249,6 +1249,21 @@ class Storage(object): with contextlib.closing(shelve.open(self._dumpFile)) as shelf: shelf[key] = [d.dict for d in self.devices] + @property + def packages(self): + pkgs = [] + if self.platform: + pkgs.extend(self.platform.packages) + + if self.bootloader: + pkgs.extend(self.bootloader.packages) + + for device in self.fsset.devices: + # this takes care of device and filesystem packages + pkgs.extend(device.packages) + + return pkgs + def write(self): self.fsset.write() self.makeMtab() -- 1.7.7.6 _______________________________________________ Anaconda-devel-list mailing list Anaconda-devel-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/anaconda-devel-list