[Why] If the current os has not been integrated into lkp-tests, run method `detect_system`, then var `$_system_name_lowercase` will be 'unknown'. So we should adapt this.
[Error] + local DISTRO=unknown ++ echo ntpdate ++ /home/yuchuan/lkp-tests/sbin/adapt-packages unknown Traceback (most recent call last): 3: from /home/yuchuan/lkp-tests/sbin/adapt-packages:11:in `<main>' 2: from /usr/share/ruby/psych.rb:497:in `load_file' 1: from /usr/share/ruby/psych.rb:497:in `open' /usr/share/ruby/psych.rb:497:in `initialize': No such file or directory @ rb_sysopen - /home/yuchuan/lkp-tests/distro/adaptation/unknown (Errno::ENOENT)
[How] If the current os has not been integrated into lkp-tests, then return.
Signed-off-by: Yu Chuan 13186087857@163.com --- lib/bootstrap.sh | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/lib/bootstrap.sh b/lib/bootstrap.sh index 7d15bb370fa9..912a76bb6687 100755 --- a/lib/bootstrap.sh +++ b/lib/bootstrap.sh @@ -240,6 +240,10 @@ run_ntpdate() has_cmd ntpdate || { detect_system local DISTRO=$_system_name_lowercase + [ "$DISTRO" == "unknown" ] && { + echo "[WARNING] Current os cannot be recognized by lkp-test, so skip run_ntpdate." + return + } . $LKP_SRC/distro/installer/$DISTRO $(echo ntpdate | $LKP_SRC/sbin/adapt-packages $DISTRO) }
On Mon, Jan 04, 2021 at 04:03:08PM +0800, Yu Chuan wrote:
[Why] If the current os has not been integrated into lkp-tests, run method `detect_system`, then var `$_system_name_lowercase` will be 'unknown'. So we should adapt this.
[Error]
- local DISTRO=unknown
++ echo ntpdate ++ /home/yuchuan/lkp-tests/sbin/adapt-packages unknown Traceback (most recent call last): 3: from /home/yuchuan/lkp-tests/sbin/adapt-packages:11:in `<main>' 2: from /usr/share/ruby/psych.rb:497:in `load_file' 1: from /usr/share/ruby/psych.rb:497:in `open' /usr/share/ruby/psych.rb:497:in `initialize': No such file or directory @ rb_sysopen - /home/yuchuan/lkp-tests/distro/adaptation/unknown (Errno::ENOENT)
[How] If the current os has not been integrated into lkp-tests, then return.
Signed-off-by: Yu Chuan 13186087857@163.com
lib/bootstrap.sh | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/lib/bootstrap.sh b/lib/bootstrap.sh index 7d15bb370fa9..912a76bb6687 100755 --- a/lib/bootstrap.sh +++ b/lib/bootstrap.sh @@ -240,6 +240,10 @@ run_ntpdate() has_cmd ntpdate || { detect_system local DISTRO=$_system_name_lowercase
[ "$DISTRO" == "unknown" ] && {
echo "[WARNING] Current os cannot be recognized by lkp-test, so skip run_ntpdate."
return
. $LKP_SRC/distro/installer/$DISTRO $(echo ntpdate | $LKP_SRC/sbin/adapt-packages $DISTRO)}
Well ntpdate is common requirement and that line will install it on every test run. Why it's not pre-installed?
OTOH, ntpdate is typically not a must for each and every job. Bare metal HW should be enough to run ntpdate once per day. And VM could inherit host time.
I'd suggest to simply skip NTP if the ntpdate command is not available.
Thanks, Fengguang
has_cmd ntpdate || { detect_system local DISTRO=$_system_name_lowercase
[ "$DISTRO" == "unknown" ] && {
echo "[WARNING] Current os cannot be recognized by lkp-test, so skip run_ntpdate."
return
. $LKP_SRC/distro/installer/$DISTRO $(echo ntpdate | $LKP_SRC/sbin/adapt-packages $DISTRO)}
Well ntpdate is common requirement and that line will install it on every test run. Why it's not pre-installed?
OTOH, ntpdate is typically not a must for each and every job. Bare metal HW should be enough to run ntpdate once per day. And VM could inherit host time.
Currently, ntpdate is not installed as a basic package for every rootfs.
So, how about install it for every rootfs, and after install finished, we can delete this step in lib/bootstrap.sh?
-------- Thanks Yu Chuan
I'd suggest to simply skip NTP if the ntpdate command is not available.
Thanks, Fengguang
On Mon, Jan 04, 2021 at 07:02:19PM +0800, Yu Chuan wrote:
has_cmd ntpdate || { detect_system local DISTRO=$_system_name_lowercase
[ "$DISTRO" == "unknown" ] && {
echo "[WARNING] Current os cannot be recognized by lkp-test, so skip run_ntpdate."
return
. $LKP_SRC/distro/installer/$DISTRO $(echo ntpdate | $LKP_SRC/sbin/adapt-packages $DISTRO)}
Well ntpdate is common requirement and that line will install it on every test run. Why it's not pre-installed?
OTOH, ntpdate is typically not a must for each and every job. Bare metal HW should be enough to run ntpdate once per day. And VM could inherit host time.
Currently, ntpdate is not installed as a basic package for every rootfs.
So, how about install it for every rootfs, and after install finished,
Nope. nfsroot may be fine, but probably not every rootfs. Like docker image and some minimal rootfs.
What's the scope of problem and what's the minimal change to fix it?
we can delete this step in lib/bootstrap.sh?
Nope. Don't add this mess to bootstrap.sh
Thanks, Fengguang