Merge "Support custom kickstart addon for install from USB"

This commit is contained in:
Zuul 2019-09-24 17:42:08 +00:00 committed by Gerrit Code Review
commit ca8c451d83
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