From 8267e3ce994e224657b172775b68d1762ab14711 Mon Sep 17 00:00:00 2001 From: Don Penney Date: Tue, 27 Mar 2018 10:58:19 -0400 Subject: [PATCH] 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 --- bsp-files/centos-ks-gen.pl | 6 ++++++ bsp-files/kickstarts/pre_net_common.cfg | 14 ++++++++++++++ installer/initrd/README | 5 ++++- .../pxe-network-installer/centos/build_srpm.data | 8 ++++---- .../centos/pxe-network-installer.spec | 2 +- 5 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 bsp-files/kickstarts/pre_net_common.cfg diff --git a/bsp-files/centos-ks-gen.pl b/bsp-files/centos-ks-gen.pl index 3e95683f..a31ed6fe 100755 --- a/bsp-files/centos-ks-gen.pl +++ b/bsp-files/centos-ks-gen.pl @@ -116,6 +116,7 @@ write_config_file("controller-compute-lowlatency", write_config_file("controller", "${output_dir}/net_controller_ks.cfg", "filter_out_from_controller", "pre_common_head.cfg", + "pre_net_common.cfg", "pre_pkglist.cfg", "pre_disk_setup_common.cfg", "pre_disk_controller.cfg", @@ -128,6 +129,7 @@ write_config_file("controller", write_config_file("controller-compute", "${output_dir}/net_smallsystem_ks.cfg", "filter_out_from_smallsystem", "pre_common_head.cfg", + "pre_net_common.cfg", "pre_pkglist.cfg", "pre_disk_setup_common.cfg", "pre_disk_aio.cfg", @@ -141,6 +143,7 @@ write_config_file("controller-compute", write_config_file("controller-compute-lowlatency", "${output_dir}/net_smallsystem_lowlatency_ks.cfg", "filter_out_from_smallsystem_lowlatency", "pre_common_head.cfg", + "pre_net_common.cfg", "pre_pkglist_lowlatency.cfg", "pre_disk_setup_common.cfg", "pre_disk_aio.cfg", @@ -154,6 +157,7 @@ write_config_file("controller-compute-lowlatency", write_config_file("compute", "${output_dir}/net_compute_ks.cfg", "filter_out_from_compute", "pre_common_head.cfg", + "pre_net_common.cfg", "pre_pkglist.cfg", "pre_disk_setup_common.cfg", "pre_disk_compute.cfg", @@ -165,6 +169,7 @@ write_config_file("compute", write_config_file("compute-lowlatency", "${output_dir}/net_compute_lowlatency_ks.cfg", "filter_out_from_compute_lowlatency", "pre_common_head.cfg", + "pre_net_common.cfg", "pre_pkglist_lowlatency.cfg", "pre_disk_setup_common.cfg", "pre_disk_compute.cfg", @@ -176,6 +181,7 @@ write_config_file("compute-lowlatency", write_config_file("storage", "${output_dir}/net_storage_ks.cfg", "filter_out_from_storage", "pre_common_head.cfg", + "pre_net_common.cfg", "pre_pkglist.cfg", "pre_disk_setup_common.cfg", "pre_disk_storage.cfg", diff --git a/bsp-files/kickstarts/pre_net_common.cfg b/bsp-files/kickstarts/pre_net_common.cfg new file mode 100644 index 00000000..20a0b1aa --- /dev/null +++ b/bsp-files/kickstarts/pre_net_common.cfg @@ -0,0 +1,14 @@ +%pre + +# Setup ntp.conf and sync time +cat </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 + diff --git a/installer/initrd/README b/installer/initrd/README index d9ddfd1e..7c2a87ab 100644 --- a/installer/initrd/README +++ b/installer/initrd/README @@ -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. 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: ORIG_SQUASHFS=$PWD/squashfs.img 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 #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 - +rm -rf usr/lib/.build-id # 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 diff --git a/installer/pxe-network-installer/centos/build_srpm.data b/installer/pxe-network-installer/centos/build_srpm.data index 02ff9f30..2e157186 100644 --- a/installer/pxe-network-installer/centos/build_srpm.data +++ b/installer/pxe-network-installer/centos/build_srpm.data @@ -2,11 +2,11 @@ COPY_LIST="pxe-network-installer//* \ $CGCS_BASE/mwa-beas/bsp-files/grub.cfg \ $CGCS_BASE/mwa-beas/bsp-files/kickstarts/post_clone_iso_ks.cfg \ $SRC_BASE/cgcs-centos-repo/Binary/images/efiboot.img \ - /import/mirrors/CentOS/tis-installer/initrd.img-stx-0.1 \ - /import/mirrors/CentOS/tis-installer/squashfs.img-stx-0.1 \ - /import/mirrors/CentOS/tis-installer/vmlinuz-stx-0.1 \ + /import/mirrors/CentOS/tis-installer/initrd.img-stx-0.2 \ + /import/mirrors/CentOS/tis-installer/squashfs.img-stx-0.2 \ + /import/mirrors/CentOS/tis-installer/vmlinuz-stx-0.2 \ " -TIS_PATCH_VER=25 +TIS_PATCH_VER=26 BUILD_IS_BIG=4 BUILD_IS_SLOW=4 diff --git a/installer/pxe-network-installer/centos/pxe-network-installer.spec b/installer/pxe-network-installer/centos/pxe-network-installer.spec index 916c94bf..0059cec9 100644 --- a/installer/pxe-network-installer/centos/pxe-network-installer.spec +++ b/installer/pxe-network-installer/centos/pxe-network-installer.spec @@ -7,7 +7,7 @@ Group: base Packager: Wind River URL: unknown -%define tis_image_version stx-0.1 +%define tis_image_version stx-0.2 Source0: LICENSE