Skip to content

Commit

Permalink
Merge pull request #248 from yast/bug_989392_SLE-12-SP2
Browse files Browse the repository at this point in the history
special handling for PREP partitions on PPC PowerNV machines
  • Loading branch information
schubi2 committed Sep 15, 2016
2 parents 1e54251 + b7bc501 commit 7be7bc3
Show file tree
Hide file tree
Showing 6 changed files with 566 additions and 10 deletions.
9 changes: 9 additions & 0 deletions package/autoyast2.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
-------------------------------------------------------------------
Wed Sep 14 17:19:01 CEST 2016 - schubi@suse.de

- Adding an missing PREP partition for PPC, BUT not for
Power8 system (powerNV). PowerNV do not have PREP partitions
and do not need any because they do not call grub2-install
(bnc#989392).
- 3.1.151

-------------------------------------------------------------------
Wed Sep 7 07:27:53 UTC 2016 - igonzalezsosa@suse.com

Expand Down
2 changes: 1 addition & 1 deletion package/autoyast2.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: autoyast2
Version: 3.1.150
Version: 3.1.151
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
20 changes: 11 additions & 9 deletions src/include/autoinstall/autopart.rb
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,12 @@ def preprocess_partition_config(xmlflex)
end

def try_add_boot(conf, disk)
conf = deep_copy(conf)
tc = Builtins.eval(conf)
# If it is a ppc but not a baremetal Power8 system (powerNV).
# powerNV do not have prep partition and do not need any because
# they do not call grub2-install (bnc#989392).
return tc if Arch.ppc && Arch.board_powernv

disk = deep_copy(disk)
dlabel = disk.fetch("label", "")
root = Ops.greater_than(
Expand All @@ -279,16 +284,13 @@ def try_add_boot(conf, disk)
end),
0
)
tc = Builtins.eval(conf)

if !@planHasBoot && root &&
(Ops.greater_than(
Ops.get_integer(disk, "cyl_count", 0),
Partitions.BootCyl
) ||
Arch.ia64 ||
Arch.ppc ||
Arch.sparc)
(Ops.greater_than(
Ops.get_integer(disk, "cyl_count", 0),
Partitions.BootCyl) || Arch.ppc)
pb = {}
# PPCs do not need /boot but prep partition only.
if !Arch.ppc
Ops.set(pb, "mount", Partitions.BootMount)
Ops.set(pb, "fsys", Partitions.DefaultBootFs)
Expand Down
316 changes: 316 additions & 0 deletions test/fixtures/profiles/ppc_partitions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,316 @@
<?xml version="1.0"?>
<!DOCTYPE profile>
<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
<partitioning config:type="list">
<drive>
<device>/dev/rhel</device>
<disklabel>msdos</disklabel>
<enable_snapshots config:type="boolean">true</enable_snapshots>
<initialize config:type="boolean">true</initialize>
<partitions config:type="list">
<partition>
<create config:type="boolean">true</create>
<crypt_fs config:type="boolean">false</crypt_fs>
<filesystem config:type="symbol">ext4</filesystem>
<format config:type="boolean">true</format>
<loop_fs config:type="boolean">false</loop_fs>
<lv_name>home</lv_name>
<mountby config:type="symbol">device</mountby>
<partition_nr config:type="integer">1</partition_nr>
<resize config:type="boolean">false</resize>
<size>224730808320</size>
</partition>
<partition>
<create config:type="boolean">true</create>
<crypt_fs config:type="boolean">false</crypt_fs>
<filesystem config:type="symbol">xfs</filesystem>
<format config:type="boolean">true</format>
<loop_fs config:type="boolean">false</loop_fs>
<lv_name>root</lv_name>
<mountby config:type="symbol">device</mountby>
<partition_nr config:type="integer">1</partition_nr>
<resize config:type="boolean">false</resize>
<size>53687091200</size>
</partition>
<partition>
<create config:type="boolean">true</create>
<crypt_fs config:type="boolean">false</crypt_fs>
<filesystem config:type="symbol">swap</filesystem>
<format config:type="boolean">true</format>
<fstopt>defaults</fstopt>
<loop_fs config:type="boolean">false</loop_fs>
<lv_name>swap</lv_name>
<mount>swap</mount>
<mountby config:type="symbol">device</mountby>
<partition_id config:type="integer">130</partition_id>
<partition_nr config:type="integer">1</partition_nr>
<resize config:type="boolean">false</resize>
<size>4294967296</size>
</partition>
</partitions>
<pesize>4M</pesize>
<type config:type="symbol">CT_LVM</type>
<use>all</use>
</drive>
<drive>
<device>/dev/rhel_ltc-tuleta12</device>
<disklabel>msdos</disklabel>
<enable_snapshots config:type="boolean">true</enable_snapshots>
<initialize config:type="boolean">true</initialize>
<partitions config:type="list">
<partition>
<create config:type="boolean">true</create>
<crypt_fs config:type="boolean">false</crypt_fs>
<filesystem config:type="symbol">ext4</filesystem>
<format config:type="boolean">true</format>
<loop_fs config:type="boolean">false</loop_fs>
<lv_name>home</lv_name>
<mountby config:type="symbol">device</mountby>
<partition_nr config:type="integer">1</partition_nr>
<resize config:type="boolean">false</resize>
<size>81017176064</size>
</partition>
<partition>
<create config:type="boolean">true</create>
<crypt_fs config:type="boolean">false</crypt_fs>
<filesystem config:type="symbol">xfs</filesystem>
<format config:type="boolean">true</format>
<loop_fs config:type="boolean">false</loop_fs>
<lv_name>root</lv_name>
<mountby config:type="symbol">device</mountby>
<partition_nr config:type="integer">1</partition_nr>
<resize config:type="boolean">false</resize>
<size>53687091200</size>
</partition>
<partition>
<create config:type="boolean">true</create>
<crypt_fs config:type="boolean">false</crypt_fs>
<filesystem config:type="symbol">swap</filesystem>
<format config:type="boolean">true</format>
<fstopt>defaults</fstopt>
<loop_fs config:type="boolean">false</loop_fs>
<lv_name>swap</lv_name>
<mount>swap</mount>
<mountby config:type="symbol">device</mountby>
<partition_id config:type="integer">130</partition_id>
<partition_nr config:type="integer">1</partition_nr>
<resize config:type="boolean">false</resize>
<size>4294967296</size>
</partition>
</partitions>
<pesize>4M</pesize>
<type config:type="symbol">CT_LVM</type>
<use>all</use>
</drive>
<drive>
<device>/dev/sda</device>
<disklabel>msdos</disklabel>
<enable_snapshots config:type="boolean">true</enable_snapshots>
<initialize config:type="boolean">true</initialize>
<partitions config:type="list">
<partition>
<create config:type="boolean">true</create>
<crypt_fs config:type="boolean">false</crypt_fs>
<format config:type="boolean">false</format>
<loop_fs config:type="boolean">false</loop_fs>
<mountby config:type="symbol">device</mountby>
<partition_id config:type="integer">65</partition_id>
<partition_nr config:type="integer">1</partition_nr>
<resize config:type="boolean">false</resize>
<size>8225280</size>
</partition>
<partition>
<create config:type="boolean">true</create>
<crypt_fs config:type="boolean">false</crypt_fs>
<filesystem config:type="symbol">xfs</filesystem>
<format config:type="boolean">true</format>
<loop_fs config:type="boolean">false</loop_fs>
<mountby config:type="symbol">device</mountby>
<partition_id config:type="integer">131</partition_id>
<partition_nr config:type="integer">2</partition_nr>
<resize config:type="boolean">false</resize>
<size>516062720</size>
</partition>
<partition>
<create config:type="boolean">true</create>
<crypt_fs config:type="boolean">false</crypt_fs>
<format config:type="boolean">false</format>
<loop_fs config:type="boolean">false</loop_fs>
<lvm_group>rhel_ltc-tuleta12</lvm_group>
<mountby config:type="symbol">device</mountby>
<partition_id config:type="integer">142</partition_id>
<partition_nr config:type="integer">3</partition_nr>
<resize config:type="boolean">false</resize>
<size>139057069568</size>
</partition>
</partitions>
<pesize/>
<type config:type="symbol">CT_DISK</type>
<use>all</use>
</drive>
<drive>
<device>/dev/sdb</device>
<disklabel>gpt</disklabel>
<enable_snapshots config:type="boolean">true</enable_snapshots>
<initialize config:type="boolean">true</initialize>
<partitions config:type="list">
<partition>
<create config:type="boolean">true</create>
<crypt_fs config:type="boolean">false</crypt_fs>
<format config:type="boolean">false</format>
<loop_fs config:type="boolean">false</loop_fs>
<mountby config:type="symbol">device</mountby>
<partition_id config:type="integer">264</partition_id>
<partition_nr config:type="integer">1</partition_nr>
<resize config:type="boolean">false</resize>
<size>8225280</size>
</partition>
<partition>
<create config:type="boolean">true</create>
<crypt_fs config:type="boolean">false</crypt_fs>
<filesystem config:type="symbol">ext4</filesystem>
<format config:type="boolean">true</format>
<loop_fs config:type="boolean">false</loop_fs>
<mountby config:type="symbol">device</mountby>
<partition_id config:type="integer">264</partition_id>
<partition_nr config:type="integer">2</partition_nr>
<resize config:type="boolean">false</resize>
<size>8225280</size>
</partition>
<partition>
<create config:type="boolean">true</create>
<crypt_fs config:type="boolean">false</crypt_fs>
<filesystem config:type="symbol">swap</filesystem>
<format config:type="boolean">true</format>
<fstopt>defaults</fstopt>
<loop_fs config:type="boolean">false</loop_fs>
<mount>swap</mount>
<mountby config:type="symbol">uuid</mountby>
<partition_id config:type="integer">130</partition_id>
<partition_nr config:type="integer">3</partition_nr>
<resize config:type="boolean">false</resize>
<size>5687639552</size>
</partition>
<partition>
<create config:type="boolean">true</create>
<crypt_fs config:type="boolean">false</crypt_fs>
<filesystem config:type="symbol">ext4</filesystem>
<format config:type="boolean">true</format>
<loop_fs config:type="boolean">false</loop_fs>
<mountby config:type="symbol">device</mountby>
<partition_id config:type="integer">131</partition_id>
<partition_nr config:type="integer">4</partition_nr>
<resize config:type="boolean">false</resize>
<size>133872909824</size>
</partition>
</partitions>
<pesize/>
<type config:type="symbol">CT_DISK</type>
<use>all</use>
</drive>
<drive>
<device>/dev/sdc</device>
<disklabel>gpt</disklabel>
<enable_snapshots config:type="boolean">true</enable_snapshots>
<initialize config:type="boolean">true</initialize>
<partitions config:type="list">
<partition>
<create config:type="boolean">true</create>
<crypt_fs config:type="boolean">false</crypt_fs>
<filesystem config:type="symbol">btrfs</filesystem>
<format config:type="boolean">true</format>
<fstopt>defaults</fstopt>
<loop_fs config:type="boolean">false</loop_fs>
<mount>/</mount>
<mountby config:type="symbol">uuid</mountby>
<partition_id config:type="integer">131</partition_id>
<partition_nr config:type="integer">1</partition_nr>
<resize config:type="boolean">false</resize>
<size>42943544832</size>
<subvolumes config:type="list">
<listentry>opt</listentry>
<listentry>srv</listentry>
<listentry>tmp</listentry>
<listentry>usr/local</listentry>
<listentry>var/cache</listentry>
<listentry>var/crash</listentry>
<listentry>var/lib/libvirt/images</listentry>
<listentry>var/lib/machines</listentry>
<listentry>var/lib/mailman</listentry>
<listentry>var/lib/mariadb</listentry>
<listentry>var/lib/mysql</listentry>
<listentry>var/lib/named</listentry>
<listentry>var/lib/pgsql</listentry>
<listentry>var/log</listentry>
<listentry>var/opt</listentry>
<listentry>var/spool</listentry>
<listentry>var/tmp</listentry>
</subvolumes>
</partition>
<partition>
<create config:type="boolean">true</create>
<crypt_fs config:type="boolean">false</crypt_fs>
<filesystem config:type="symbol">xfs</filesystem>
<format config:type="boolean">true</format>
<fstopt>defaults</fstopt>
<loop_fs config:type="boolean">false</loop_fs>
<mount>/home</mount>
<mountby config:type="symbol">uuid</mountby>
<partition_id config:type="integer">131</partition_id>
<partition_nr config:type="integer">2</partition_nr>
<resize config:type="boolean">false</resize>
<size>240832904704</size>
</partition>
</partitions>
<pesize/>
<type config:type="symbol">CT_DISK</type>
<use>all</use>
</drive>
<drive>
<device>/dev/sdd</device>
<disklabel>msdos</disklabel>
<enable_snapshots config:type="boolean">true</enable_snapshots>
<initialize config:type="boolean">true</initialize>
<partitions config:type="list">
<partition>
<create config:type="boolean">true</create>
<crypt_fs config:type="boolean">false</crypt_fs>
<format config:type="boolean">false</format>
<loop_fs config:type="boolean">false</loop_fs>
<mountby config:type="symbol">device</mountby>
<partition_id config:type="integer">65</partition_id>
<partition_nr config:type="integer">1</partition_nr>
<resize config:type="boolean">false</resize>
<size>8225280</size>
</partition>
<partition>
<create config:type="boolean">true</create>
<crypt_fs config:type="boolean">false</crypt_fs>
<filesystem config:type="symbol">xfs</filesystem>
<format config:type="boolean">true</format>
<loop_fs config:type="boolean">false</loop_fs>
<mountby config:type="symbol">device</mountby>
<partition_id config:type="integer">131</partition_id>
<partition_nr config:type="integer">2</partition_nr>
<resize config:type="boolean">false</resize>
<size>1065516544</size>
</partition>
<partition>
<create config:type="boolean">true</create>
<crypt_fs config:type="boolean">false</crypt_fs>
<format config:type="boolean">false</format>
<loop_fs config:type="boolean">false</loop_fs>
<lvm_group>rhel</lvm_group>
<mountby config:type="symbol">device</mountby>
<partition_id config:type="integer">142</partition_id>
<partition_nr config:type="integer">3</partition_nr>
<resize config:type="boolean">false</resize>
<size>282707787264</size>
</partition>
</partitions>
<pesize/>
<type config:type="symbol">CT_DISK</type>
<use>all</use>
</drive>
</partitioning>
</profile>
Loading

0 comments on commit 7be7bc3

Please sign in to comment.