Skip to content

Instantly share code, notes, and snippets.

@imobachgs
Created June 8, 2022 12:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imobachgs/55e7532bfa6ca553c6c2618722d104d6 to your computer and use it in GitHub Desktop.
Save imobachgs/55e7532bfa6ca553c6c2618722d104d6 to your computer and use it in GitHub Desktop.
<?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