Skip to content
Snippets Groups Projects
Verified Commit 810934bc authored by Clayton Craft's avatar Clayton Craft :speech_balloon:
Browse files

Support busybox 'date' command

BB's `date` doesn't support the long form for args (e.g. `--utc`), only
the short form, while coreutils supports both versions. By using the
short form swclock-offset can support both versions of `date`
parent 6a4e4dce
Branches master
Tags 0.2.5
1 merge request!6Support busybox 'date' command
Pipeline #216769 passed
......@@ -33,4 +33,5 @@ offset_epoch=$(cat $offset_file)
swclock_epoch=$((hwclock_epoch + offset_epoch))
# set system time, dump output
date --utc --set=@$swclock_epoch > /dev/null
# NOTE: use short args here so that it works with 'busybox date'!
date -u -s @$swclock_epoch > /dev/null
......@@ -26,7 +26,8 @@ if [ ! -d $offset_directory ]; then
fi
# calculate offset
swclock_epoch=$(date --utc +%s)
# NOTE: use short args here so that it works with 'busybox date'!
swclock_epoch=$(date -u +%s)
hwclock_epoch=$(cat $rtc_sys_node)
offset_epoch=$((swclock_epoch - hwclock_epoch))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment