Skip to content

Commit

Permalink
Merge pull request quattor#310 from jrha/revert_drop_end_script
Browse files Browse the repository at this point in the history
Revert "ks: Drop end_script" and deprecate instead
  • Loading branch information
jrha committed May 15, 2019
2 parents 6e71ece + ee57956 commit 4d963e8
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 3 deletions.
4 changes: 4 additions & 0 deletions aii-ks/src/main/pan/quattor/aii/ks/schema.pan
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ type structure_ks_ks_info = {
@{Repositories to disable while SPMA is not available}
"disabled_repos" : string[] = list()
"packages_args" : string[] = list("--ignoremissing", "--resolvedeps")
"end_script" ? string with {
deprecated(0, "end_script is deprecated and will be removed in a future release");
true;
}
"part_label" : boolean = false # Does the "part" stanza support the --label option?
@{Set to true if volgroup statement is required in KS config file (must not be present for SL6+)}
'volgroup_required' : boolean = false
Expand Down
1 change: 1 addition & 0 deletions aii-ks/src/main/pan/quattor/aii/ks/variants/el7.pan
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ prefix "/system/aii/osinstall/ks";
"langsupport" = null;
"packages_args" = list("--ignoremissing");

"end_script" = "%end";
"part_label" = true;
"volgroup_required" = false;
"lvmforce" = true;
Expand Down
1 change: 1 addition & 0 deletions aii-ks/src/main/pan/quattor/aii/ks/variants/sl6.pan
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ prefix "/system/aii/osinstall/ks";
"mouse" = null;
"langsupport" = null;

"end_script" = "%end";
"part_label" = true;
"volgroup_required" = false;

Expand Down
11 changes: 8 additions & 3 deletions aii-ks/src/main/perl/ks.pm
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ use constant { KS => "/system/aii/osinstall/ks",
CCM_CONFIG_PATH => "/software/components/ccm",
NAMESERVER => "/system/network/nameserver/0",
FORWARDPROXY => "forward",
END_SCRIPT_FIELD => "/system/aii/osinstall/ks/end_script",
BASE_PKGS => "/system/aii/osinstall/ks/base_packages",
DISABLED_REPOS => "/system/aii/osinstall/ks/disabled_repos",
LOCALHOST => hostname(),
Expand Down Expand Up @@ -550,8 +551,10 @@ EOF
join ("\n", @packages_in_packages);
}
print "\n";
print $version >= ANACONDA_VERSION_EL_6_0 ? '%end' : '', "\n";

my $end = $config->elementExists(END_SCRIPT_FIELD) ? $config->getElement(END_SCRIPT_FIELD)->getValue() : '%end';
print $version >= ANACONDA_VERSION_EL_6_0 ? $end : '',
"\n";
return $unprocessed_packages;

}
Expand Down Expand Up @@ -860,6 +863,7 @@ EOF

ksuserhooks ($config, PREENDHOOK);

my $end = $config->elementExists(END_SCRIPT_FIELD) ? $config->getElement(END_SCRIPT_FIELD)->getValue() : '%end';
my $kstree = $config->getElement(KS)->getTree;
my $version = get_anaconda_version($kstree);

Expand All @@ -881,7 +885,7 @@ echo 'End of pre section'
# Drain remote logger (0 if not relevant)
sleep \$drainsleep
%end
$end
EOF

Expand Down Expand Up @@ -1709,13 +1713,14 @@ EOF
}

ksuserhooks ($config, PREREBOOTHOOK);
my $end = $config->getElement(END_SCRIPT_FIELD)->getValue();
print <<EOF;
echo 'End of post section'
# Drain remote logger (0 if not relevant)
sleep \$drainsleep
%end
$end
EOF

Expand Down
6 changes: 6 additions & 0 deletions aii-ks/src/main/perl/ks.pod
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@ List of switches to add to the kickstart "%packages" line.
Defaults to "--resolvedeps --ignoremissing"; you probably
want to keep those in the list.

=item * end_script : string

Closing tag used for Kickstart scripts C<%pre> and C<%post> and C<%packages> section
(usually either empty or "%end"). Early Anaconda versions (< 6) did not have such a closing
tag. Later the use of %end became optional, and recent Anaconda releases made it mandatory.

=item * part_label: boolean

If set to true, then the "part" stanzas in the kickstart configuration will
Expand Down

0 comments on commit 4d963e8

Please sign in to comment.