From 8928bf875e87a330b9cc13568d29f3efaf397b4c Mon Sep 17 00:00:00 2001 From: Shrikumar Sharma Date: Tue, 12 Apr 2022 16:26:31 -0400 Subject: [PATCH] Prestaging rootfs and bootfs customization with script provided via the prestage iso When customizing the rootfs and bootfs, an external script is provided via the prestage iso. The kickstart needs to execute this script and obtain the rootfs and bootfs devices. Test Plan: PASS: Test the default prestaging operation on subclouds with different storage types (hard disk/ssd (nvme) ) PASS: Test the force install of prestage iso on different subclouds with different storage types with pre-existing installations PASS: Test the graceful failure to install prestaging content when trying to install on subclouds (with different storage types) with pre-existing installations (and force-install is not used) Regression: PASS: Verify that autoinstaller installs successfully for all options Story: 2009948 Task: 45048 Change-Id: Icc483d3430531a86c9a6488306a38e7d246ddd58 Signed-off-by: Shrikumar Sharma --- bsp-files/kickstarts/pre_common_head.cfg | 5 +++++ bsp-files/kickstarts/pre_disk_setup_common.cfg | 5 +++++ bsp-files/kickstarts/pre_prestaging_install_check.cfg | 5 ++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/bsp-files/kickstarts/pre_common_head.cfg b/bsp-files/kickstarts/pre_common_head.cfg index a3ed1ed4..f654ea5f 100644 --- a/bsp-files/kickstarts/pre_common_head.cfg +++ b/bsp-files/kickstarts/pre_common_head.cfg @@ -7,6 +7,11 @@ set -- `cat /proc/cmdline` for I in $*; do case "$I" in *=*) eval $I 2>/dev/null;; esac; done +# Source the custom setup script if it exists +if [ -e /run/install/repo/ks-setup.cfg ]; then + source /run/install/repo/ks-setup.cfg +fi + append= if [ -n "$console" ] ; then append="console=$console" diff --git a/bsp-files/kickstarts/pre_disk_setup_common.cfg b/bsp-files/kickstarts/pre_disk_setup_common.cfg index b5e48081..99e27469 100644 --- a/bsp-files/kickstarts/pre_disk_setup_common.cfg +++ b/bsp-files/kickstarts/pre_disk_setup_common.cfg @@ -16,6 +16,11 @@ wlog "USB_DEV='$USB_DEV'." set -- `cat /proc/cmdline` for I in $*; do case "$I" in *=*) eval $I 2>/dev/null;; esac; done +# Source the custom setup script if it exists +if [ -e /run/install/repo/ks-setup.cfg ]; then + source /run/install/repo/ks-setup.cfg +fi + if [ -z "$boot_device" ]; then boot_device=$(get_disk_dev) fi diff --git a/bsp-files/kickstarts/pre_prestaging_install_check.cfg b/bsp-files/kickstarts/pre_prestaging_install_check.cfg index 8be8189e..49409c87 100644 --- a/bsp-files/kickstarts/pre_prestaging_install_check.cfg +++ b/bsp-files/kickstarts/pre_prestaging_install_check.cfg @@ -13,8 +13,11 @@ set -- `cat /proc/cmdline` for I in $*; do case "$I" in *=*) eval $I 2>/dev/null;; esac; done for J in $*; do case "$J" in force_install) force_install=${J};; esac; done -# if force_install is set, install anyway. Ignore the remainder of this section. +if [ -e /run/install/repo/ks-setup.cfg ]; then + source /run/install/repo/ks-setup.cfg +fi +# if force_install is set, install anyway. Ignore the remainder of this section. if [ -z ${force_install} ]; then if [ -z "$rootfs_device" ]; then rootfs_device=$(get_disk_dev)