Support custom kickstart addon for install from USB

This update provides support for a user-defined kickstart
addon, in conjunction with the update-iso.sh utility, that
allows for custom post-install configuration for initial
installation from USB.

Story: 2006595
Task: 36737
Change-Id: I9cdff82b83bf1e4824ee7583d5985d4e0997cb42
Signed-off-by: Don Penney <don.penney@windriver.com>
This commit is contained in:
Don Penney 2019-09-18 14:32:03 -04:00
parent 8d4f64981d
commit 1f13d2a2f3
2 changed files with 42 additions and 3 deletions

View File

@ -46,7 +46,8 @@ write_config_file("controller",
"post_common.cfg",
"post_kernel_controller.cfg",
"post_lvm_pv_on_rootfs.cfg",
"post_usb_controller.cfg");
"post_usb_controller.cfg",
"post_usb_addon.cfg");
write_config_file("controller-worker",
"${output_dir}/smallsystem_ks.cfg",
"pre_common_head.cfg",
@ -58,7 +59,8 @@ write_config_file("controller-worker",
"post_kernel_aio_and_worker.cfg",
"post_lvm_pv_on_rootfs.cfg",
"post_system_aio.cfg",
"post_usb_controller.cfg");
"post_usb_controller.cfg",
"post_usb_addon.cfg");
write_config_file("controller-worker-lowlatency",
"${output_dir}/smallsystem_lowlatency_ks.cfg",
"pre_common_head.cfg",
@ -70,7 +72,8 @@ write_config_file("controller-worker-lowlatency",
"post_kernel_aio_and_worker.cfg",
"post_lvm_pv_on_rootfs.cfg",
"post_system_aio.cfg",
"post_usb_controller.cfg");
"post_usb_controller.cfg",
"post_usb_addon.cfg");
system("mkdir -p ${pxeboot_output_dir}");

View File

@ -0,0 +1,36 @@
%pre --erroronfail
if [ -d /mnt/install/source ]; then
srcdir=/mnt/install/source
else
srcdir=/run/install/repo
fi
if [ -f ${srcdir}/ks-addon.cfg ]; then
cp ${srcdir}/ks-addon.cfg /tmp/
else
cat <<EOF > /tmp/ks-addon.cfg
# No custom addon included
EOF
fi
%end
%post --nochroot
if [ -d /mnt/install/source ]; then
srcdir=/mnt/install/source
else
srcdir=/run/install/repo
fi
# Store the ks-addon.cfg for debugging
mkdir -p /mnt/sysimage/var/log/anaconda
cp /tmp/ks-addon.cfg /mnt/sysimage/var/log/anaconda/
%end
%post --erroronfail
# Source common functions
. /tmp/ks-functions.sh
%include /tmp/ks-addon.cfg
%end