doAutopartition needs stage1_disk to be setup, otherwise it rejects the existing ESP. At this stage not everything is setup for a clean run of setUpBootLoader so it needs to be called with the new 'early' keyword so that it will skip trying to setup stage1_device which would raise an error because the mountpoint on it hasn't been set yet. --- anaconda.spec.in | 2 +- pyanaconda/ui/gui/spokes/custom.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/anaconda.spec.in b/anaconda.spec.in index 1bb458f..4b73cfb 100644 --- a/anaconda.spec.in +++ b/anaconda.spec.in @@ -91,7 +91,7 @@ The anaconda package is a metapackage for the Anaconda installer. %package core Summary: Core of the Anaconda installer Requires: dnf >= %{dnfver} -Requires: python-blivet >= 0.56 +Requires: python-blivet >= 0.58 Requires: python-meh >= %{mehver} Requires: libreport-anaconda >= 2.0.21-1 Requires: libselinux-python diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py index 18c1759..5c91069 100644 --- a/pyanaconda/ui/gui/spokes/custom.py +++ b/pyanaconda/ui/gui/spokes/custom.py @@ -2175,6 +2175,9 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): self._storage_playground.doAutoPart = True self.clear_errors() try: + # doAutoPartitions needs stage1_disk setup so it will reuse existing partitions + self._storage_playground.setUpBootLoader(early=True) + doAutoPartition(self._storage_playground, self.data) except NoDisksError as e: # No handling should be required for this.
Anaconda custom partitioning needs to call setUpBootLoader but at that point the stage1_device setup would fail, so add a flag to skip it so that stage1_drive gets setup without an error being raised. --- blivet/__init__.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/blivet/__init__.py b/blivet/__init__.py index 455b681..f28c32a 100644 --- a/blivet/__init__.py +++ b/blivet/__init__.py @@ -1804,10 +1804,16 @@ class Blivet(object): boot_disks.sort(cmp=self.compareDisks, key=lambda d: d.name) self.bootloader.set_disk_list(boot_disks)
- def setUpBootLoader(self): + def setUpBootLoader(self, early=False): """ Propagate ksdata into BootLoader.
+ :keyword bool early: Set to True to skip stage1_device setup + :raises BootloaderError: if stage1 setup fails + + If this needs to be run early, eg. to setup stage1_disk but + not stage1_device 'early' should be set True to prevent + it from raising BootloaderError """ if not self.bootloader or not self.ksdata: log.warning("either ksdata or bootloader data missing") @@ -1821,7 +1827,8 @@ class Blivet(object): self.ksdata.bootloader.execute(self, self.ksdata, None) self.bootloader.stage1_disk = self.devicetree.resolveDevice(self.ksdata.bootloader.bootDrive) self.bootloader.stage2_device = self.bootDevice - self.bootloader.set_stage1_device(self.devices) + if not early: + self.bootloader.set_stage1_device(self.devices)
@property def bootDisk(self):
On Tue, 2014-06-24 at 16:09 -0700, Brian C. Lane wrote:
Anaconda custom partitioning needs to call setUpBootLoader but at that point the stage1_device setup would fail, so add a flag to skip it so that stage1_drive gets setup without an error being raised.
blivet/__init__.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/blivet/__init__.py b/blivet/__init__.py index 455b681..f28c32a 100644 --- a/blivet/__init__.py +++ b/blivet/__init__.py @@ -1804,10 +1804,16 @@ class Blivet(object): boot_disks.sort(cmp=self.compareDisks, key=lambda d: d.name) self.bootloader.set_disk_list(boot_disks)
- def setUpBootLoader(self):
def setUpBootLoader(self, early=False): """ Propagate ksdata into BootLoader.
:keyword bool early: Set to True to skip stage1_device setup
^^double space
Do you expect 'early' to affect more things in the code in the future? If not, I'd rather give it "more sincere" name like 'skip_stage1_dev'.
Otherwise both this and the anaconda patch look good to me.
On Wed, Jun 25, 2014 at 07:50:19AM +0200, Vratislav Podzimek wrote:
On Tue, 2014-06-24 at 16:09 -0700, Brian C. Lane wrote:
Anaconda custom partitioning needs to call setUpBootLoader but at that point the stage1_device setup would fail, so add a flag to skip it so that stage1_drive gets setup without an error being raised.
blivet/__init__.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/blivet/__init__.py b/blivet/__init__.py index 455b681..f28c32a 100644 --- a/blivet/__init__.py +++ b/blivet/__init__.py @@ -1804,10 +1804,16 @@ class Blivet(object): boot_disks.sort(cmp=self.compareDisks, key=lambda d: d.name) self.bootloader.set_disk_list(boot_disks)
- def setUpBootLoader(self):
def setUpBootLoader(self, early=False): """ Propagate ksdata into BootLoader.
:keyword bool early: Set to True to skip stage1_device setup
^^double space
whoops, fixing locally.
Do you expect 'early' to affect more things in the code in the future? If not, I'd rather give it "more sincere" name like 'skip_stage1_dev'.
I picked early because we do a similar thing with is_valid_stage1_device in pyanaconda.bootloader
Otherwise both this and the anaconda patch look good to me.
Thanks
anaconda-patches@lists.fedorahosted.org