Skip to content

Commit

Permalink
Merge pull request #220 from yast/bug991252
Browse files Browse the repository at this point in the history
Fix for bsc#991252
  • Loading branch information
ancorgs committed Aug 10, 2016
2 parents c717bf1 + 580587c commit 5583f9f
Show file tree
Hide file tree
Showing 11 changed files with 219 additions and 17 deletions.
7 changes: 7 additions & 0 deletions package/yast2-storage.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Aug 10 08:19:49 UTC 2016 - ancor@suse.com

- Do not ignore suggestion made by partitioning proposal of turning
an EFI partition into bios_grub (bsc#991252)
- 3.1.99

-------------------------------------------------------------------
Fri Jul 29 11:14:26 UTC 2016 - ancor@suse.com

Expand Down
6 changes: 3 additions & 3 deletions package/yast2-storage.spec
Expand Up @@ -17,7 +17,7 @@


Name: yast2-storage
Version: 3.1.98
Version: 3.1.99
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand All @@ -29,7 +29,7 @@ License: GPL-2.0
BuildRequires: docbook-xsl-stylesheets
BuildRequires: doxygen
BuildRequires: gcc-c++ libtool
BuildRequires: libstorage-devel >= 2.25.36
BuildRequires: libstorage-devel >= 2.26.6
BuildRequires: libstorage-ruby >= 2.25.36
BuildRequires: libxslt
BuildRequires: perl-XML-Writer
Expand All @@ -43,7 +43,7 @@ BuildRequires: yast2-devtools >= 3.1.10
BuildRequires: yast2-ruby-bindings >= 3.1.7
BuildRequires: yast2-testsuite >= 2.19.0
Requires: libstorage-ruby >= 2.26.1
Requires: libstorage7 >= 2.26.1
Requires: libstorage7 >= 2.26.6
Requires: rubygem(%{rb_default_ruby_abi}:ruby-dbus)
Requires: yast2 >= 3.1.22
Requires: yast2-core >= 2.18.3
Expand Down
26 changes: 13 additions & 13 deletions src/modules/Storage.rb
Expand Up @@ -6193,31 +6193,23 @@ def SpecialBootHandling(tg)
id = Partitions.FsidBoot(dlabel)
part["format"]=false
part["mount"]=""
part["fstype"]=Partitions.FsIdToString(id)
part["prep_install"]=true
if !part.fetch("create",false) &&
part.fetch("fsid",0) != id
part["ori_fsid"] = part.fetch("fsid",0)
part["change_fsid"] = true
end
part["fsid"] = id
propose_new_fsid(part, id)
Builtins.y2milestone( "SpecialBootHandling modified Prep part=%1", part)
end
if Arch.board_mac &&
part.fetch("mount","") == Partitions.BootMount
id = Partitions.fsid_mac_hfs
part["mount"] = ""
part["fstype"] = Partitions.FsIdToString(id)
part["fsid"] = id
propose_new_fsid(part, id)
part["used_fs"] = :hfs
part["detected_fs"] = :hfs
Builtins.y2milestone( "SpecialBootHandling modified hfs part=%1", part)
end
if Arch.ia64 &&
part.fetch("mount","") == Partitions.BootMount
id = Partitions.fsid_gpt_boot
part["fsid"] = id
part["fstype"] = Partitions.FsIdToString(id)
propose_new_fsid(part, id)
if !part.fetch("create",false) &&
part.fetch("detected_fs",:none)==:vfat
part["format"] = false
Expand All @@ -6228,8 +6220,7 @@ def SpecialBootHandling(tg)
dlabel == "gpt" &&
part.fetch("mount","") == Partitions.BootMount
id = Partitions.fsid_bios_grub
part["fsid"] = id
part["fstype"] = Partitions.FsIdToString(id)
propose_new_fsid(part, id)
part["format"] = false
part["mount"] = ""
Builtins.y2milestone( "SpecialBootHandling modified BIOS grub part=%1", part)
Expand Down Expand Up @@ -7174,6 +7165,15 @@ def skip_activation_popup?
Mode.autoinst || Mode.autoupgrade || Installation.restarting?
end

def propose_new_fsid(part, id)
if !part.fetch("create", false) && part.fetch("fsid", 0) != id
part["ori_fsid"] = part.fetch("fsid", 0)
part["change_fsid"] = true
end
part["fstype"] = Partitions.FsIdToString(id)
part["fsid"] = id
end

publish :variable => :resize_partition, :type => "string"
publish :variable => :resize_partition_data, :type => "map"
publish :variable => :resize_cyl_size, :type => "integer"
Expand Down
2 changes: 1 addition & 1 deletion testsuite/data/Makefile.am
Expand Up @@ -5,5 +5,5 @@
SUBDIRS = empty empty-efi half-empty reuse-home windows windows-only \
windows-only-no-resize windows-only-efi empty-s390x empty-ppc64le \
empty-small empty-big empty-big-ppc64le lvm empty-ppc64le-nv \
empty-big-ppc64le-nv bsc-988526
empty-big-ppc64le-nv bsc-988526 bsc-991252

6 changes: 6 additions & 0 deletions testsuite/data/bsc-991252/Makefile.am
@@ -0,0 +1,6 @@
#
# Makefile.am for storage/storage/src/testsuite/data/bsc-991252
#

EXTRA_DIST = disk_sda.info free.info arch.info

4 changes: 4 additions & 0 deletions testsuite/data/bsc-991252/arch.info
@@ -0,0 +1,4 @@
<?xml version="1.0"?>
<arch>
<arch>x86_64</arch>
</arch>
96 changes: 96 additions & 0 deletions testsuite/data/bsc-991252/disk_sda.info
@@ -0,0 +1,96 @@
<?xml version="1.0"?>
<disk>
<name>sda</name>
<device>/dev/sda</device>
<size_k>500107608</size_k>
<major>8</major>
<minor>0</minor>
<range>256</range>
<geometry>
<cylinders>62260</cylinders>
<heads>255</heads>
<sectors>63</sectors>
</geometry>
<label>gpt</label>
<max_primary>128</max_primary>
<udev_path>pci-0000:00:17.0-ata-3</udev_path>
<udev_id>ata-SK_hynix_SC308_SATA_512GB_FS66N501910406H1L</udev_id>
<udev_id>scsi-0ATA_SK_hynix_SC308_S_FS66N501910406H1L</udev_id>
<udev_id>scsi-1ATA_SK_hynix_SC308_SATA_512GB_FS66N501910406H1L</udev_id>
<udev_id>scsi-SATA_SK_hynix_SC308_FS66N501910406H1L</udev_id>
<udev_id>scsi-SATA_SK_hynix_SC308_SFS66N501910406H1L</udev_id>
<udev_id>scsi-SATA_SK_hynix_SC308_S_FS66N501910406H1L</udev_id>
<partition>
<name>sda1</name>
<device>/dev/sda1</device>
<size_k>510976</size_k>
<major>8</major>
<minor>1</minor>
<numeric>true</numeric>
<number>1</number>
<fs_type>vfat</fs_type>
<fs_uuid>F8F9-F597</fs_uuid>
<fs_label>BOOT</fs_label>
<mount_by>uuid</mount_by>
<region>
<start>0</start>
<length>64</length>
</region>
<partition_type>primary</partition_type>
<partition_id>259</partition_id>
<boot_flag>true</boot_flag>
</partition>
<partition>
<name>sda2</name>
<device>/dev/sda2</device>
<size_k>131072</size_k>
<major>8</major>
<minor>2</minor>
<numeric>true</numeric>
<number>2</number>
<region>
<start>63</start>
<length>18</length>
</region>
<partition_type>primary</partition_type>
<partition_id>261</partition_id>
</partition>
<partition>
<name>sda3</name>
<device>/dev/sda3</device>
<size_k>4998144</size_k>
<major>8</major>
<minor>3</minor>
<numeric>true</numeric>
<number>3</number>
<fs_type>ntfs-3g</fs_type>
<fs_uuid>14E6FD15E6FCF7B6</fs_uuid>
<fs_label>Recovery</fs_label>
<mount_by>uuid</mount_by>
<region>
<start>61638</start>
<length>622</length>
</region>
<partition_type>primary</partition_type>
<partition_id>7</partition_id>
</partition>
<partition>
<name>sda4</name>
<device>/dev/sda4</device>
<size_k>494465024</size_k>
<major>8</major>
<minor>4</minor>
<numeric>true</numeric>
<number>4</number>
<fs_type>ntfs-3g</fs_type>
<fs_uuid>B856FC8B56FC4B9E</fs_uuid>
<fs_label>Windows</fs_label>
<mount_by>uuid</mount_by>
<region>
<start>80</start>
<length>61559</length>
</region>
<partition_type>primary</partition_type>
<partition_id>7</partition_id>
</partition>
</disk>
15 changes: 15 additions & 0 deletions testsuite/data/bsc-991252/free.info
@@ -0,0 +1,15 @@
<?xml version="1.0"?>
<free>
<free>
<device>/dev/sda4</device>
<resize_cached>true</resize_cached>
<df_free_k>10000000</df_free_k>
<resize_free_k>10000000</resize_free_k>
<used_k>20000000</used_k>
<resize_ok>true</resize_ok>
<content_cached>true</content_cached>
<windows>true</windows>
<efi>false</efi>
<home>false</home>
</free>
</free>
Empty file added testsuite/tests/bsc-991252.err
Empty file.
40 changes: 40 additions & 0 deletions testsuite/tests/bsc-991252.out
@@ -0,0 +1,40 @@
Dump Hardware Excerpt:
Dump Arch: x86_64
Dump
Dump Proposal Settings Excerpt:
Dump
Dump Proposal:
Dump Shrink Windows partition /dev/sda4 to 22.25 GiB [destructive]
Dump Set type of partition /dev/sda1 to GPT BIOS (107)
Dump Create swap volume /dev/sda5 (517.72 MiB)
Dump Create root volume /dev/sda6 (448.80 GiB) with btrfs
Dump Create subvolume boot/grub2/i386-pc on device /dev/sda6
Dump Create subvolume boot/grub2/x86_64-efi on device /dev/sda6
Dump Create subvolume home on device /dev/sda6
Dump Create subvolume opt on device /dev/sda6
Dump Create subvolume srv on device /dev/sda6
Dump Create subvolume tmp on device /dev/sda6
Dump Create subvolume usr/local on device /dev/sda6
Dump Create subvolume var/cache on device /dev/sda6
Dump Create subvolume var/crash on device /dev/sda6
Dump Create subvolume var/lib/libvirt/images on device /dev/sda6 with option "no copy on write"
Dump Create subvolume var/lib/mailman on device /dev/sda6
Dump Create subvolume var/lib/mariadb on device /dev/sda6 with option "no copy on write"
Dump Create subvolume var/lib/mysql on device /dev/sda6 with option "no copy on write"
Dump Create subvolume var/lib/named on device /dev/sda6
Dump Create subvolume var/lib/pgsql on device /dev/sda6 with option "no copy on write"
Dump Create subvolume var/log on device /dev/sda6
Dump Create subvolume var/opt on device /dev/sda6
Dump Create subvolume var/spool on device /dev/sda6
Dump Create subvolume var/tmp on device /dev/sda6
Dump
Dump Target Map Excerpt:
Dump device:/dev/sda label:gpt
Dump device:/dev/sda1 fsid:0x107
Dump device:/dev/sda2 fsid:0x105
Dump device:/dev/sda3 fsid:0x7
Dump device:/dev/sda4 fsid:0x7
Dump device:/dev/sda5 fsid:0x82
Dump device:/dev/sda6 fsid:0x83 userdata:{"/"=>"snapshots"}
Dump
Dump Proposal Feedback:
34 changes: 34 additions & 0 deletions testsuite/tests/bsc-991252.rb
@@ -0,0 +1,34 @@
# encoding: utf-8

# testedfiles: helper.rb

module Yast

class TestClient < Client

def main

def setup1()
setup_system("bsc-991252")
end

def setup2()
ProductFeatures.SetBooleanFeature("partitioning", "try_separate_home", false)
ProductFeatures.SetBooleanFeature("partitioning", "proposal_lvm", false)
ProductFeatures.SetStringFeature("partitioning", "vm_desired_size", "30 GB")
ProductFeatures.SetStringFeature("partitioning", "root_base_size", "20 GB")
ProductFeatures.SetBooleanFeature("partitioning", "proposal_snapshots", true)
end

def setup3()
end

Yast.include self, "helper.rb"

end

end

end

Yast::TestClient.new.main

0 comments on commit 5583f9f

Please sign in to comment.