Skip to content

Instantly share code, notes, and snippets.

@imobachgs
Created June 8, 2022 12:21
Embed
What would you like to do?
<?xml version="1.0"?>
<!DOCTYPE profile>
<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
<% home_in_sdb = disks.map { |d| d[:device] }.include?("sdb") %>
<partitioning config:type="list">
<drive>
<device>/dev/sda</device>
<disklabel>gpt</disklabel>
<enable_snapshots t="boolean">true</enable_snapshots>
<partitions t="list">
<% if boot_efi? %>
<partition t="map">
<create t="boolean">true</create>
<filesystem t="symbol">vfat</filesystem>
<format t="boolean">true</format>
<mount>/boot/efi</mount>
<partition_id t="integer">259</partition_id>
<size>500MiB</size>
</partition>
<% end %>
<partition>
<create t="boolean">true</create>
<format t="boolean">true</format>
<filesystem t="symbol">btrfs</filesystem>
<mount>/</mount>
<size>max</size>
</partition>
<% if !home_in_sdb %>
<partition>
<create t="boolean">true</create>
<format t="boolean">true</format>
<filesystem t="symbol">xfs</filesystem>
<mount>/home</mount>
<size>max</size>
</partition>
<% end %>
</partitions>
</drive>
<!-- Please, do not do this, as AutoYaST internals might change -->
<% if home_in_sdb %>
<% url_tokens = Yast::AutoinstConfig.urltok %>
<% path = url_tokens["path"] %> <!-- in the example above, it could be "/profiles/autoinst.xml") -->
<% new_path = File.join(File.dirname(path), "separate-home.xml") %>
<% new_url = Yast::URL.Build(url_tokens.merge("path" => new_path)) %>
<% require "open-uri" %>
<%= URI.open(new_url).read %>
<% end %>
</partitioning>
</profile>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment