diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py index 04578e9..11c9644 100644 --- a/pyanaconda/kickstart.py +++ b/pyanaconda/kickstart.py @@ -300,7 +300,8 @@ class Bootloader(commands.bootloader.F18_Bootloader): storage.bootloader.timeout = self.timeout # Throw out drives specified that don't exist. - disk_names = [d.name for d in storage.disks] + disk_names = [d.name for d in storage.disks + if not d.format.hidden and not d.protected] for drive in self.driveorder[:]: if drive not in disk_names: log.warning("requested drive %s in boot drive order doesn't exist" % drive) @@ -1596,7 +1599,7 @@ def runTracebackScripts(scripts): def doKickstartStorage(storage, ksdata, instClass): """ Setup storage state from the kickstart data """ ksdata.clearpart.execute(storage, ksdata, instClass) - if not storage.disks: + if not [d for d in storage.disks if not d.format.hidden]: return ksdata.bootloader.execute(storage, ksdata, instClass) ksdata.autopart.execute(storage, ksdata, instClass) diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py index 79a370e..370013b 100644 --- a/pyanaconda/ui/gui/spokes/storage.py +++ b/pyanaconda/ui/gui/spokes/storage.py @@ -330,9 +330,16 @@ class StorageSpoke(NormalSpoke, StorageChecker): self._previous_autopart = False + def _applyDiskSelection(self, use_names): + onlyuse = use_names[:] + for disk in [d for d in self.storage.disks if d.name in onlyuse]: + onlyuse.extend([d for d in disk.ancestors if d.name not in onlyuse]) + + self.data.ignoredisk.onlyuse = onlyuse + self.data.clearpart.drives = use_names[:] + def apply(self): - self.data.ignoredisk.onlyuse = self.selected_disks[:] - self.data.clearpart.drives = self.selected_disks[:] + self._applyDiskSelection(self.selected_disks) self.data.autopart.autopart = self.autopart self.data.autopart.encrypted = self.encrypted self.data.autopart.passphrase = self.passphrase @@ -467,7 +481,10 @@ class StorageSpoke(NormalSpoke, StorageChecker): def refresh(self): # synchronize our local data store with the global ksdata - self.selected_disks = self.data.ignoredisk.onlyuse[:] + disk_names = [d.name for d in self.disks] + # don't put disks with hidden formats in selected_disks + self.selected_disks = [d for d in self.data.ignoredisk.onlyuse + if d in disk_names] self.autopart = self.data.autopart.autopart self.encrypted = self.data.autopart.encrypted self.passphrase = self.data.autopart.passphrase @@ -517,7 +534,7 @@ class StorageSpoke(NormalSpoke, StorageChecker): # if there's only one disk, select it by default if len(self.disks) == 1 and not self.selected_disks: - self.data.ignoredisk.onlyuse = [self.disks[0].name] + self._applyDiskSelection([self.disks[0].name]) # properties: kind, description, capacity, os, popup-info for disk in self.disks: