]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
support busybox date.
authorVladimir Serbinenko <phcoder@gmail.com>
Mon, 23 Jan 2017 11:31:36 +0000 (14:31 +0300)
committerVladimir Serbinenko <phcoder@gmail.com>
Fri, 27 Jan 2017 20:11:57 +0000 (20:11 +0000)
Busybox date doesn't understand weekdays in -d input,
so strip them beforehand.

tests/grub_cmd_date.in
tests/grub_cmd_sleep.in

index b14d55db7b83b66e30569d8ef914f92414748b0d..f7c9ca00432fa3307a2fb53ac88ca11115d7f73f 100644 (file)
@@ -9,7 +9,7 @@ if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = sparc64-ieee1275 ];
 fi
 
 pdt="$(date -u +%s)"
-dt=`echo date | @builddir@/grub-shell`
+dt=`echo date | @builddir@/grub-shell | sed 's, [A-Z][a-z]*$,,'`
 dtg="$(date -u -d "$dt" +%s)"
 ndt="$(date -u +%s)"
 
index a5e72614ba8e58ebb8a59cb3f25c01fc2a255a12..8797f6632845f5a76ac22b813c223897ceddd672 100644 (file)
@@ -11,8 +11,8 @@ fi
 # Compare RTC with interval timer.
 # Not 100% proper but should check that timer is running ok
 dt=`echo 'date; sleep 10; date' | @builddir@/grub-shell`
-dt1="$(date -u -d "$(echo "$dt" | head -n 1)" +%s)"
-dt2="$(date -u -d "$(echo "$dt" | tail -n 1)" +%s)"
+dt1="$(date -u -d "$(echo "$dt" | head -n 1 | sed 's, [A-Z][a-z]*$,,')" +%s)"
+dt2="$(date -u -d "$(echo "$dt" | tail -n 1 | sed 's, [A-Z][a-z]*$,,')" +%s)"
 
 # Ignore QEMU bug
 if [ "${grub_modinfo_target_cpu}" = arm ] && [ $((dt2 - dt1)) -ge 15 ] && [ $((dt2 - dt1)) -le 17 ]; then