From f0da76d820b1892a8cab01dc4ab897ab7c3f7694 Mon Sep 17 00:00:00 2001 From: Eric MacDonald Date: Fri, 14 Jun 2024 11:20:44 -0400 Subject: [PATCH] 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 %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 --- kickstart/files/kickstart.cfg | 26 ++++++++++++++++++++++++++ kickstart/files/miniboot.cfg | 26 ++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/kickstart/files/kickstart.cfg b/kickstart/files/kickstart.cfg index 176e3861..28655341 100644 --- a/kickstart/files/kickstart.cfg +++ b/kickstart/files/kickstart.cfg @@ -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 +# +# +# +# %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 diff --git a/kickstart/files/miniboot.cfg b/kickstart/files/miniboot.cfg index 5b76e846..68be0e78 100644 --- a/kickstart/files/miniboot.cfg +++ b/kickstart/files/miniboot.cfg @@ -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 +# +# +# +# %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