Skip to content

Commit

Permalink
Add sap autoyast installation profile for sle15
Browse files Browse the repository at this point in the history
  • Loading branch information
badboywj committed Dec 2, 2022
1 parent ad6f441 commit 4f3e686
Show file tree
Hide file tree
Showing 9 changed files with 458 additions and 5 deletions.
300 changes: 300 additions & 0 deletions data/autoyast_sle15/create_hdd/create_hdd_sap.xml.ep
@@ -0,0 +1,300 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE profile>
<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
<suse_register>
<do_registration config:type="boolean">true</do_registration>
<install_updates config:type="boolean">true</install_updates>
<slp_discovery t="boolean">false</slp_discovery>
% if ($check_var->('SLE_PRODUCT', 'sles4sap')) {
<reg_code><%= $get_var->('SCC_REGCODE_SLES4SAP') %></reg_code>
% } else {
<reg_code><%= $get_var->('SCC_REGCODE') %></reg_code>
% }
<reg_server><%= $get_var->('SCC_URL') %></reg_server>
% if (keys %$addons) {
<addons config:type="list">
% while (my ($key, $addon) = each (%$addons)) {
<addon>
<name><%= $addon->{name} %></name>
<version><%= $addon->{version} %></version>
<arch><%= $addon->{arch} %></arch>
% if ($key eq 'we' and $check_var->('SLE_PRODUCT', 'sles')) {
<reg_code><%= $get_var->('SCC_REGCODE_WE') %></reg_code>
% }
% if ($key eq 'we' and $check_var->('SLE_PRODUCT', 'sled')) {
<reg_code><%= $get_var->('SCC_REGCODE') %></reg_code>
% }
% if ($key eq 'rt') {
<reg_code><%= $get_var->('SCC_REGCODE_RT') %></reg_code>
% }
% if ($key eq 'ltss') {
<reg_code><%= $get_var->('SCC_REGCODE_LTSS') %></reg_code>
% }
% if ($key eq 'ha') {
% if ($check_var->('SLE_PRODUCT', 'sles4sap')) {
<reg_code><%= $get_var->('SCC_REGCODE_SLES4SAP') %></reg_code>
% } else {
<reg_code><%= $get_var->('SCC_REGCODE_HA') %></reg_code>
% }
% }
</addon>
% }
% if ($check_var->('SLE_PRODUCT', 'sles4sap')) {
<addon>
<name>sle-module-sap-applications</name>
<version>{{VERSION}}</version>
<arch>{{ARCH}}</arch>
</addon>
% }
</addons>
%}
</suse_register>
<bootloader>
<global>
<timeout config:type="integer">-1</timeout>
</global>
% if ($check_var->('UEFI', '1')) {
<loader_type>grub2-efi</loader_type>
% }
% unless ($check_var->('UEFI', '1')) {
<loader_type>grub2</loader_type>
% }
</bootloader>
<general>
<mode>
% if ($check_var->('BACKEND', 'ipmi') or $check_var->('BACKEND', 'svirt')) {
<final_reboot config:type="boolean">true</final_reboot>
% }
<confirm config:type="boolean">false</confirm>
</mode>
<signature-handling>
<accept_unsigned_file config:type="boolean">true</accept_unsigned_file>
<accept_unknown_gpg_key config:type="boolean">true</accept_unknown_gpg_key>
<accept_non_trusted_gpg_key config:type="boolean">true</accept_non_trusted_gpg_key>
<import_gpg_key config:type="boolean">true</import_gpg_key>
</signature-handling>
</general>
<partitioning config:type="list">
<drive>
<disklabel>gpt</disklabel>
<initialize config:type="boolean">true</initialize>
% if ($check_var->('ARCH', 's390x')) {
<enable_snapshots config:type="boolean">true</enable_snapshots>
<type config:type="symbol">CT_DISK</type>
<partitions config:type="list">
<partition>
<create config:type="boolean">true</create>
<format config:type="boolean">true</format>
<filesystem config:type="symbol">ext2</filesystem>
<mount>/boot/zipl</mount>
<fstopt>acl,user_xattr</fstopt>
<mountby config:type="symbol">path</mountby>
<partition_id config:type="integer">131</partition_id>
<partition_nr config:type="integer">1</partition_nr>
<partition_type>primary</partition_type>
<size>500M</size>
</partition>
<partition>
<create config:type="boolean">true</create>
<filesystem config:type="symbol">swap</filesystem>
<format config:type="boolean">true</format>
<mount>swap</mount>
<mountby config:type="symbol">uuid</mountby>
<partition_id config:type="integer">130</partition_id>
<partition_nr config:type="integer">2</partition_nr>
<partition_type>primary</partition_type>
<size>2G</size>
</partition>
<partition>
<create config:type="boolean">true</create>
<format config:type="boolean">true</format>
<mount>/</mount>
<mountby config:type="symbol">uuid</mountby>
<partition_id config:type="integer">131</partition_id>
<partition_nr config:type="integer">3</partition_nr>
<partition_type>primary</partition_type>
<size>max</size>
</partition>
</partitions>
% }
% unless ($check_var->('ARCH', 's390x')) {
<partitions config:type="list">
% if ($check_var->('ARCH', 'aarch64') or $check_var->('UEFI', '1')) {
<partition>
<mountby config:type="symbol">uuid</mountby>
<create config:type="boolean">true</create>
<filesystem config:type="symbol">vfat</filesystem>
<format config:type="boolean">true</format>
<fstopt>umask=0002,utf8=true</fstopt>
<mount>/boot/efi</mount>
<size>512M</size>
</partition>
% }
<partition>
<create config:type="boolean">true</create>
<filesystem config:type="symbol">swap</filesystem>
<format config:type="boolean">true</format>
<mount>swap</mount>
<mountby config:type="symbol">uuid</mountby>
<partition_id config:type="integer">130</partition_id>
<resize config:type="boolean">false</resize>
<size>2G</size>
</partition>
<partition>
<create config:type="boolean">true</create>
<create_subvolumes config:type="boolean">true</create_subvolumes>
<filesystem config:type="symbol">btrfs</filesystem>
<format config:type="boolean">true</format>
<mount>/</mount>
<mountby config:type="symbol">uuid</mountby>
<partition_id config:type="integer">131</partition_id>
<resize config:type="boolean">false</resize>
<size>max</size>
</partition>
</partitions>
% }
<use>all</use>
</drive>
</partitioning>
<networking>
<interfaces config:type="list">
<interface>
<bootproto>dhcp</bootproto>
<device>eth0</device>
<dhclient_set_default_route>yes</dhclient_set_default_route>
<startmode>auto</startmode>
</interface>
</interfaces>
</networking>
<firewall>
<enable_firewall config:type="boolean">true</enable_firewall>
<start_firewall config:type="boolean">true</start_firewall>
</firewall>
<report>
<errors>
<log config:type="boolean">true</log>
<show config:type="boolean">true</show>
<timeout config:type="integer">0</timeout>
</errors>
<messages>
<log config:type="boolean">true</log>
<show config:type="boolean">true</show>
<timeout config:type="integer">0</timeout>
</messages>
<warnings>
<log config:type="boolean">true</log>
<show config:type="boolean">true</show>
<timeout config:type="integer">0</timeout>
</warnings>
<yesno_messages>
<log config:type="boolean">true</log>
<show config:type="boolean">true</show>
<timeout config:type="integer">0</timeout>
</yesno_messages>
</report>
<keyboard>
<keyboard_values>
<delay/>
<discaps config:type="boolean">false</discaps>
<numlock>bios</numlock>
<rate/>
</keyboard_values>
<keymap>english-us</keymap>
</keyboard>
<language>
<language>en_US</language>
<languages/>
</language>
<ntp-client>
<ntp_policy>auto</ntp_policy>
</ntp-client>
<software>
<products config:type="list">
% if ($check_var->('SLE_PRODUCT','sles4sap')) {
<product>SLES_SAP</product>
% } else {
<product><%= uc $get_var->('SLE_PRODUCT') %></product>
% }
</products>
<packages config:type="list">
<!-- Workaround for bsc#1202234: [addon]-release packages are missing after autoyast installation. -->
% foreach (values %$addons) {
<package><%= lc($_->{name}) %>-release</package>
% }
<!-- end of workaround -->
% if ($check_var->('SLE_PRODUCT', 'sles4sap')) {
<package>sle-module-sap-applications-release</package>
% }
</packages>
<patterns config:type="list">
% for my $pattern (@$patterns) {
<pattern><%= $pattern %></pattern>
% }
</patterns>
</software>
<services-manager>
% if ($check_var->('DESKTOP', 'gnome')) {
<default_target>graphical</default_target>
% }
% if ($check_var->('DESKTOP', 'textmode')) {
<default_target>multi-user</default_target>
% }
<services>
<disable config:type="list"/>
<enable config:type="list">
<service>sshd</service>
</enable>
</services>
</services-manager>
<timezone>
<hwclock>UTC</hwclock>
<timezone>Europe/Berlin</timezone>
</timezone>
<users config:type="list">
% unless ($check_var->('ROOTONLY', '1')) {
<user config:type="map">
<authorized_keys config:type="list"/>
<encrypted config:type="boolean">true</encrypted>
% if ($check_var->('ARCH', 'ppc64le')) {
<fullname>Bernhard M. Wiedemann</fullname>
% }
% unless ($check_var->('ARCH', 'ppc64le')) {
<fullname>bernhard</fullname>
% }
<gid>100</gid>
<home>/home/bernhard</home>
<password_settings config:type="map">
<expire/>
<flag/>
<inact>-1</inact>
<max>99999</max>
<min>0</min>
<warn>7</warn>
</password_settings>
<shell>/bin/bash</shell>
<uid>1000</uid>
<user_password>$6$vYbbuJ9WMriFxGHY$gQ7shLw9ZBsRcPgo6/8KmfDvQ/lCqxW8/WnMoLCoWGdHO6Touush1nhegYfdBbXRpsQuy/FTZZeg7gQL50IbA/</user_password>
<username>bernhard</username>
</user>
% }
<user config:type="map">
<authorized_keys config:type="list"/>
<encrypted config:type="boolean">true</encrypted>
<fullname>root</fullname>
<gid>0</gid>
<home>/root</home>
<password_settings config:type="map">
<expire/>
<flag/>
<inact/>
<max/>
<min/>
<warn/>
</password_settings>
<shell>/bin/bash</shell>
<uid>0</uid>
<user_password>$6$gdDHoMtVLjs4CCzf$2tSvAdgvqrKo84pA59bEjZRh7IGMfv4u0Yl4hrRzPgFPWLd8RXWdn/boT7yM3K3BlTk57qyR0TZ/nMb9rlpzx1</user_password>
<username>root</username>
</user>
</users>
</profile>
2 changes: 1 addition & 1 deletion lib/migration.pm
Expand Up @@ -93,7 +93,7 @@ sub register_system_in_textmode {
register_addons_cmd();
}
else {
yast_scc_registration();
yast_scc_registration(yast2_opts => '--ncurses');
}
# Once SCC registration is done, disable IN_PATCH_SLE so it does not interfere
# with further calls to accept_addons_license (in upgrade for example)
Expand Down
3 changes: 2 additions & 1 deletion lib/registration.pm
Expand Up @@ -279,7 +279,8 @@ sub register_product {
if (get_var('SMT_URL')) {
assert_script_run('SUSEConnect --url ' . get_var('SMT_URL') . ' ' . uc(get_var('SLE_PRODUCT')) . '/' . scc_version(get_var('HDDVERSION')) . '/' . get_var('ARCH'), 200);
} else {
assert_script_run('SUSEConnect -r ' . get_required_var('SCC_REGCODE'), 200);
my $scc_reg_code = is_sles4sap ? get_required_var('SCC_REGCODE_SLES4SAP') : get_required_var('SCC_REGCODE');
assert_script_run('SUSEConnect -r ' . $scc_reg_code, 200);
}
}

Expand Down
9 changes: 7 additions & 2 deletions lib/services/registered_addons.pm
Expand Up @@ -29,7 +29,12 @@ sub suseconnect_ls {
sub check_registered_system {
my ($system) = @_;
my $pro = uc get_var('SLE_PRODUCT');
$pro = 'SLE_' . $pro if ($pro eq 'HPC');
if ($pro eq 'HPC') {
$pro = 'SLE_' . $pro;
}
elsif ($pro eq 'SLES4SAP') {
$pro = 'SLES_SAP';
}
suseconnect_ls($pro);
my $ver = $system =~ s/\-SP/./r;
script_run("SUSEConnect -s | grep " . $ver, die_on_timeout => 0);
Expand Down Expand Up @@ -88,7 +93,7 @@ sub check_suseconnect_cmd {
my $status_out = script_output("SUSEConnect --status-text", 120);
diag "$status_out";
for (my $i = 0; $i < @addons; $i = $i + 1) {
next if ($addons[$i] =~ /^SLE(S|D|_HPC)$|^sle-module-packagehub-subpackages$/);
next if ($addons[$i] =~ /^SLE(S|D|_HPC|S_SAP)$|^sle-module-packagehub-subpackages$/);
diag "$addons[$i]";
die "$addons[$i] is not existed at SUSEConnect --list-extensions" if ($ls_out !~ /Deactivate(.*)$addons[$i]/);
die "$addons[$i] is not existed at SUSEConnect --status-text" if ($status_out !~ /$addons[$i]/);
Expand Down
2 changes: 1 addition & 1 deletion lib/utils.pm
Expand Up @@ -681,7 +681,7 @@ Enables the install DVDs if they were used during the installation.
sub zypper_enable_install_dvd {
# If DVD Packages is used we need to (re-)enable the local repos
# see FATE#325541
zypper_call('mr -e -l') if (is_sle('15+') and (get_var('ISO_1', '') =~ /SLE-.*-Packages-.*\.iso/ || check_var('FLAVOR', 'Full')));
zypper_call('mr -e -l') if (is_sle('15+') and (get_var('ISO_1', '') =~ /SLE-.*-Packages-.*\.iso/ || check_var('FLAVOR', 'Full') || ((get_required_var('FLAVOR') =~ /Migration/) && get_var('MEDIA_UPGRADE', ''))));
zypper_call 'ref';
}

Expand Down

0 comments on commit 4f3e686

Please sign in to comment.