Hello everyone,
I am trying to update the RTC through an application running in container.
The host operating system is TorizonCore (torizon-core-docker-apalis-imx6-Tezi_5.4.0+build.10) and I’ve done several tests with “hwclock” command (by console in the host OS) and I hav’nt been able to access write the RTC (at least if I use “sudo”).
I’m using an Apalis imx6Q 2GB IT, V1.1C
I test de setting system clock on boot, it’s ok:
apalis-imx6-10838922:~$ dmesg | grep rtc
[ 1.536308] imx-drm display-subsystem: bound imx-ipuv3-crtc.2 (ops ipu_crtc_ops)
[ 1.536410] imx-drm display-subsystem: bound imx-ipuv3-crtc.3 (ops ipu_crtc_ops)
[ 1.536531] imx-drm display-subsystem: bound imx-ipuv3-crtc.6 (ops ipu_crtc_ops)
[ 1.536641] imx-drm display-subsystem: bound imx-ipuv3-crtc.7 (ops ipu_crtc_ops)
[ 1.650936] rtc-ds1307 0-0068: registered as rtc0
[ 1.652797] snvs_rtc 20cc000.snvs:snvs-rtc-lp: registered as rtc1
[ 2.467024] rtc-ds1307 0-0068: setting system clock to 2015-01-31T11:15:17 UTC (1422702917)
I can’t access to write the RTC:
apalis-imx6-10838922:~$ hwclock -w
hwclock: Cannot access the Hardware Clock via any known method.
hwclock: Use the --verbose option to see the details of our search for an access method.
I change the file /dev/rtc0 access for user Torizon:
apalis-imx6-10838922:~$ sudo chgrp torizon /dev/rtc0
Password:
apalis-imx6-10838922:~$ sudo chmod 777 /dev/rtc0
apalis-imx6-10838922:~$ ls -l /dev/rtc*
lrwxrwxrwx 1 root root 4 Jan 31 11:15 /dev/rtc -> rtc0
crwxrwxrwx 1 root torizon 253, 0 Jan 31 11:15 /dev/rtc0
crw------- 1 root root 253, 1 Jan 31 11:15 /dev/rtc1
And now the respose is:
apalis-imx6-10838922:~$ hwclock -w
hwclock: ioctl(RTC_SET_TIME) to /dev/rtc0 to set the time failed: Permission denied
but, if I use
apalis-imx6-10838922:~$ sudo hwclock -w
apalis-imx6-10838922:~$
I get the writing I expected.
The questions is, what is the correct way to change the RTC value in the host for Torizon user? And now, how to transmitt this propertie to an containerized app?
Thanks!
Summary
This text will be hidden