Add LAT hook segment syntax error rendering code comment to kickstarts

The Linux Assembly Tool parses a kickstart file containing various
hook segments that are syntactically delineated with statements that
start with '%'.

The example below shows the start and end syntax of a hook block.

%post --interpreter=/bin/bash

<kickstart bash code goes here>

%end

If LAT detects a hook block syntax error it fails the install and
renders it as a Permission denied like this:

./lat-installer.sh: line 539:
/tmp/lat/lat_post_nochroot_script/10_script: Permission denied

This update adds a comment to the kickstart file header explaining
how LAT renders hook syntax errors as file permission denied and
a comment at the end of the kickstart warning not to remove the
Line Feed at the end of the kickstart files.

Test Plan:

PASS: Verify spelling and format of added code comments.
PASS: Verify kickstart.cfg has a Line Feed at the end of the last
      kickstart.cfg and miniboot.cfg files. They were already there.

Closes-Bug: 2069432
Change-Id: Ic4cd168e784abdba98e45e1837749915db9c4e43
Signed-off-by: Eric MacDonald <eric.macdonald@windriver.com>
This commit is contained in:
Eric MacDonald 2024-06-14 11:20:44 -04:00
parent 42253f7b25
commit f0da76d820
2 changed files with 52 additions and 0 deletions

View File

@ -54,6 +54,30 @@
# The first kickstart script creates '/tmp/lat/functions' common functions
# file that can be loaded from any of the other hook sections.
#
############################################################################
#
# Developer Note:
#
# The Linux Assembly Tool parses this kickstart file which contains
# various hook segments that are syntactically delineated with
# statements that start with '%'.
# The example below shows the start and end syntax of a hook block.
#
# %post --interpreter=/bin/bash --nochroot
#
# <kickstart bash code goes here>
#
# %end
#
# Warning: If LAT detects a hook block syntax error it fails the
# install and renders it as a Permission error console output like this.
#
# ./lat-installer.sh: line 539:
# /tmp/lat/lat_post_nochroot_script/10_script: Permission denied
#
# This may occur if for example %end is miss spelled as %en or missing
# or if the last %end is not terminated with a Line Feed.
#
###########################################################################
# Kickstart Early - Common Functions Script
%ks-early --interpreter=/bin/bash
@ -3409,4 +3433,6 @@ if [ -e "/instboot/ks-addon.cfg" ]; then
fi
true
# Warning: Do not remove the line feed from the end of this file
# or the install will fail with a permission denied error.
%end

View File

@ -59,6 +59,30 @@
# The first kickstart script creates '/tmp/lat/functions' common functions
# file that can be loaded from any of the other hook sections.
#
############################################################################
#
# Developer Note:
#
# The Linux Assembly Tool parses this kickstart file which contains
# various hook segments that are syntactically delineated with
# statements that start with '%'.
# The example below shows the start and end syntax of a hook block.
#
# %post --interpreter=/bin/bash --nochroot
#
# <kickstart bash code goes here>
#
# %end
#
# Warning: If LAT detects a hook block syntax error it fails the
# install and renders it as a Permission error console output like this.
#
# ./lat-installer.sh: line 539:
# /tmp/lat/lat_post_nochroot_script/10_script: Permission denied
#
# This may occur if for example %end is miss spelled as %en or missing
# or if the last %end is not terminated with a Line Feed.
#
###########################################################################
# Kickstart Early - Common Functions Script
%ks-early --interpreter=/bin/bash
@ -3172,6 +3196,8 @@ if [ "${storage}" = true ] ; then
fi
true
# Warning: Do not remove the line feed from the end of this file
# or the install will fail with a permission denied error.
%end
# vim: filetype=sh