Add ntpd to installer, sync time from active controller during install

To avoid potential issues due to large time jumps when NTP first syncs
the system time at runtime, this update adds ntpd to the installer
rootfs and adds a pre-script to the kickstarts to sync the time from
the active controller before starting to install the software. This
also ensures that any filesystem timestamps will be accurate right
from the node installation.

Change-Id: I166c52430cec6ba64e5a33ebde64ee65639d623c
Signed-off-by: Don Penney <don.penney@windriver.com>
This commit is contained in:
Don Penney 2018-03-27 10:58:19 -04:00
parent 8344b27b67
commit 8267e3ce99
5 changed files with 29 additions and 6 deletions

View File

@ -116,6 +116,7 @@ write_config_file("controller-compute-lowlatency",
write_config_file("controller", write_config_file("controller",
"${output_dir}/net_controller_ks.cfg", "filter_out_from_controller", "${output_dir}/net_controller_ks.cfg", "filter_out_from_controller",
"pre_common_head.cfg", "pre_common_head.cfg",
"pre_net_common.cfg",
"pre_pkglist.cfg", "pre_pkglist.cfg",
"pre_disk_setup_common.cfg", "pre_disk_setup_common.cfg",
"pre_disk_controller.cfg", "pre_disk_controller.cfg",
@ -128,6 +129,7 @@ write_config_file("controller",
write_config_file("controller-compute", write_config_file("controller-compute",
"${output_dir}/net_smallsystem_ks.cfg", "filter_out_from_smallsystem", "${output_dir}/net_smallsystem_ks.cfg", "filter_out_from_smallsystem",
"pre_common_head.cfg", "pre_common_head.cfg",
"pre_net_common.cfg",
"pre_pkglist.cfg", "pre_pkglist.cfg",
"pre_disk_setup_common.cfg", "pre_disk_setup_common.cfg",
"pre_disk_aio.cfg", "pre_disk_aio.cfg",
@ -141,6 +143,7 @@ write_config_file("controller-compute",
write_config_file("controller-compute-lowlatency", write_config_file("controller-compute-lowlatency",
"${output_dir}/net_smallsystem_lowlatency_ks.cfg", "filter_out_from_smallsystem_lowlatency", "${output_dir}/net_smallsystem_lowlatency_ks.cfg", "filter_out_from_smallsystem_lowlatency",
"pre_common_head.cfg", "pre_common_head.cfg",
"pre_net_common.cfg",
"pre_pkglist_lowlatency.cfg", "pre_pkglist_lowlatency.cfg",
"pre_disk_setup_common.cfg", "pre_disk_setup_common.cfg",
"pre_disk_aio.cfg", "pre_disk_aio.cfg",
@ -154,6 +157,7 @@ write_config_file("controller-compute-lowlatency",
write_config_file("compute", write_config_file("compute",
"${output_dir}/net_compute_ks.cfg", "filter_out_from_compute", "${output_dir}/net_compute_ks.cfg", "filter_out_from_compute",
"pre_common_head.cfg", "pre_common_head.cfg",
"pre_net_common.cfg",
"pre_pkglist.cfg", "pre_pkglist.cfg",
"pre_disk_setup_common.cfg", "pre_disk_setup_common.cfg",
"pre_disk_compute.cfg", "pre_disk_compute.cfg",
@ -165,6 +169,7 @@ write_config_file("compute",
write_config_file("compute-lowlatency", write_config_file("compute-lowlatency",
"${output_dir}/net_compute_lowlatency_ks.cfg", "filter_out_from_compute_lowlatency", "${output_dir}/net_compute_lowlatency_ks.cfg", "filter_out_from_compute_lowlatency",
"pre_common_head.cfg", "pre_common_head.cfg",
"pre_net_common.cfg",
"pre_pkglist_lowlatency.cfg", "pre_pkglist_lowlatency.cfg",
"pre_disk_setup_common.cfg", "pre_disk_setup_common.cfg",
"pre_disk_compute.cfg", "pre_disk_compute.cfg",
@ -176,6 +181,7 @@ write_config_file("compute-lowlatency",
write_config_file("storage", write_config_file("storage",
"${output_dir}/net_storage_ks.cfg", "filter_out_from_storage", "${output_dir}/net_storage_ks.cfg", "filter_out_from_storage",
"pre_common_head.cfg", "pre_common_head.cfg",
"pre_net_common.cfg",
"pre_pkglist.cfg", "pre_pkglist.cfg",
"pre_disk_setup_common.cfg", "pre_disk_setup_common.cfg",
"pre_disk_storage.cfg", "pre_disk_storage.cfg",

View File

@ -0,0 +1,14 @@
%pre
# Setup ntp.conf and sync time
cat <<EOF >/etc/ntp_kickstart.conf
server pxecontroller
EOF
/usr/sbin/ntpd -g -q -n -c /etc/ntp_kickstart.conf
if [ $? -eq 0 ]; then
/sbin/hwclock --systohc --utc
fi
%end

View File

@ -131,6 +131,9 @@ rpm-python-4.14.0-1.tis.1.x86_64.rpm
# We also now need bind-utils in the squashfs, due to the anaconda-preexec we've added. # We also now need bind-utils in the squashfs, due to the anaconda-preexec we've added.
bind-utils-9.9.4-51.el7.x86_64.rpm bind-utils-9.9.4-51.el7.x86_64.rpm
# Add ntpd to the rootfs
ntp-4.2.6p5-25.el7.centos.2.tis.3.x86_64.rpm
# Mount the squashfs.img and copy the rootfs out: # Mount the squashfs.img and copy the rootfs out:
ORIG_SQUASHFS=$PWD/squashfs.img ORIG_SQUASHFS=$PWD/squashfs.img
mkdir squashfs.mnt mkdir squashfs.mnt
@ -178,7 +181,7 @@ rm -rf usr/lib64/python2.7/site-packages/rpm/
for f in ../rootfs-rpms/*.rpm ; do rpm2cpio $f | cpio -idu; done for f in ../rootfs-rpms/*.rpm ; do rpm2cpio $f | cpio -idu; done
#find old .pyo files and delete them #find old .pyo files and delete them
find usr/lib64/python2.7/site-packages/pyanaconda/ usr/lib64/python2.7/site-packages/rpm/ -name *.pyo | xargs rm find usr/lib64/python2.7/site-packages/pyanaconda/ usr/lib64/python2.7/site-packages/rpm/ -name *.pyo | xargs rm
rm -rf usr/lib/.build-id
# IMPORTANT Note, please do NOT forget the following step: # IMPORTANT Note, please do NOT forget the following step:
# MUST HAVE!!! Update the kernel and related kernel modules, same as what was done for "initrd.img" updating # MUST HAVE!!! Update the kernel and related kernel modules, same as what was done for "initrd.img" updating

View File

@ -2,11 +2,11 @@ COPY_LIST="pxe-network-installer//* \
$CGCS_BASE/mwa-beas/bsp-files/grub.cfg \ $CGCS_BASE/mwa-beas/bsp-files/grub.cfg \
$CGCS_BASE/mwa-beas/bsp-files/kickstarts/post_clone_iso_ks.cfg \ $CGCS_BASE/mwa-beas/bsp-files/kickstarts/post_clone_iso_ks.cfg \
$SRC_BASE/cgcs-centos-repo/Binary/images/efiboot.img \ $SRC_BASE/cgcs-centos-repo/Binary/images/efiboot.img \
/import/mirrors/CentOS/tis-installer/initrd.img-stx-0.1 \ /import/mirrors/CentOS/tis-installer/initrd.img-stx-0.2 \
/import/mirrors/CentOS/tis-installer/squashfs.img-stx-0.1 \ /import/mirrors/CentOS/tis-installer/squashfs.img-stx-0.2 \
/import/mirrors/CentOS/tis-installer/vmlinuz-stx-0.1 \ /import/mirrors/CentOS/tis-installer/vmlinuz-stx-0.2 \
" "
TIS_PATCH_VER=25 TIS_PATCH_VER=26
BUILD_IS_BIG=4 BUILD_IS_BIG=4
BUILD_IS_SLOW=4 BUILD_IS_SLOW=4

View File

@ -7,7 +7,7 @@ Group: base
Packager: Wind River <info@windriver.com> Packager: Wind River <info@windriver.com>
URL: unknown URL: unknown
%define tis_image_version stx-0.1 %define tis_image_version stx-0.2
Source0: LICENSE Source0: LICENSE