From 789ebe1e9541fc8ef6e1439ea00c0205d69efcea Mon Sep 17 00:00:00 2001 From: Julia Kreger Date: Fri, 14 Feb 2020 13:58:12 -0800 Subject: [PATCH] Add ntpdate/ntpclient/chrony Adds ntpdate to the binary package list for the diskimage-builder element, and added ntpclient to the tinycore package list and added a small shim to wrap ntpclient as ntpdate is not a native tinycore package. For larger ramdisks, we attempt to use chrony, which superceeds the ntp package as a combined time server and client. Change-Id: If99f2df31af8e4d41ad7813d25f0d779abc23f7a Needed-By: https://review.opendev.org/#/c/707911/ --- dib/ironic-python-agent-ramdisk/package-installs.yaml | 1 + releasenotes/notes/add-ntpdate-3db2f8565fed761e.yaml | 7 +++++++ tinyipa/build-tinyipa.sh | 2 ++ tinyipa/build_files/finalreqs.lst | 1 + tinyipa/build_files/ntpdate | 6 ++++++ tinyipa/finalise-tinyipa.sh | 2 ++ 6 files changed, 19 insertions(+) create mode 100644 releasenotes/notes/add-ntpdate-3db2f8565fed761e.yaml create mode 100755 tinyipa/build_files/ntpdate diff --git a/dib/ironic-python-agent-ramdisk/package-installs.yaml b/dib/ironic-python-agent-ramdisk/package-installs.yaml index 7b3c05a..3365ff7 100644 --- a/dib/ironic-python-agent-ramdisk/package-installs.yaml +++ b/dib/ironic-python-agent-ramdisk/package-installs.yaml @@ -20,6 +20,7 @@ dosfstools: mdadm: efibootmgr: efivar: +chrony: # Unnecessary packages to remove. We run all removals in pre-install phase, to # avoid breaking installs that happen in install phase. diff --git a/releasenotes/notes/add-ntpdate-3db2f8565fed761e.yaml b/releasenotes/notes/add-ntpdate-3db2f8565fed761e.yaml new file mode 100644 index 0000000..0735430 --- /dev/null +++ b/releasenotes/notes/add-ntpdate-3db2f8565fed761e.yaml @@ -0,0 +1,7 @@ +--- +features: + - | + Adds packages required for ``ironic-python-agent`` to + synchronize the system clock, namely ntpdate. The other + dependency of the agent requires is ``hwclock``, however + that package is provided by util-linux. diff --git a/tinyipa/build-tinyipa.sh b/tinyipa/build-tinyipa.sh index 20daa17..afc3dd3 100755 --- a/tinyipa/build-tinyipa.sh +++ b/tinyipa/build-tinyipa.sh @@ -154,6 +154,8 @@ $CHROOT_CMD chmod a+rwx /etc/sysconfig/tcuser mkdir $BUILDDIR/tmp/overides cp $WORKDIR/build_files/fakeuname $BUILDDIR/tmp/overides/uname +sudo cp $WORKDIR/build_files/ntpdate $BUILDDIR/bin/ntpdate + PY_REQS="buildreqs_python2.lst" if [[ $USE_PYTHON3 == "True" ]]; then PY_REQS="buildreqs_python3.lst" diff --git a/tinyipa/build_files/finalreqs.lst b/tinyipa/build_files/finalreqs.lst index 71fa7ac..e187a5e 100644 --- a/tinyipa/build_files/finalreqs.lst +++ b/tinyipa/build_files/finalreqs.lst @@ -21,3 +21,4 @@ filesystems-4.14.10-tinycore64.tcz smartmontools.tcz udev-lib.tcz util-linux.tcz +ntpclient.tcz diff --git a/tinyipa/build_files/ntpdate b/tinyipa/build_files/ntpdate new file mode 100755 index 0000000..cf6eb16 --- /dev/null +++ b/tinyipa/build_files/ntpdate @@ -0,0 +1,6 @@ +#!/bin/sh +if [ "$1" = "-v" ]; then + echo "Magical ntpdate Wrapper 0.0.1" + exit 0 +fi +ntpclient -h $1 -s diff --git a/tinyipa/finalise-tinyipa.sh b/tinyipa/finalise-tinyipa.sh index 80e13f9..60c5ee5 100755 --- a/tinyipa/finalise-tinyipa.sh +++ b/tinyipa/finalise-tinyipa.sh @@ -92,6 +92,8 @@ fi mkdir $FINALDIR/tmp/overides cp $WORKDIR/build_files/fakeuname $FINALDIR/tmp/overides/uname +sudo cp $WORKDIR/build_files/ntpdate $FINALDIR/bin/ntpdate +sudo chmod 755 $FINALDIR/bin/ntpdate PY_REQS="finalreqs_python2.lst" if [[ $USE_PYTHON3 == "True" ]]; then PY_REQS="finalreqs_python3.lst"