[mythtv-users] can't get wakealarm to write to BIOS

Greg Oliver oliver.greg at gmail.com
Sat Dec 9 06:53:42 UTC 2017


On Sat, Dec 9, 2017 at 12:28 AM, Mike Hodson <mystica at gmail.com> wrote:

> On Fri, Dec 8, 2017 at 7:13 PM, Bill Meek <keemllib at gmail.com> wrote:
>
>> On 12/08/2017 12:53 PM, Marius Schrecker wrote:
>>
>>> $sudo bash -c "echo `date '+%s' -d '+ 6 minutes'` >
>>> /sys/class/rtc/rtc0/wakealarm
>>
>>
>
>> Use: echo `date '+%s' -d '+ 6 minutes'`| sudo tee
>> /sys/class/rtc/rtc0/wakealarm"
>
>
> Bill, normally sudo of echo redirecting will not work; the user-shell is
> still used for redirection.
> However, in his case, not only is he running bash -c "full command with
> redirect", but he also later cats the result in /sys/class/rtc/rtc0/wakealarm
> and comes up with the proper time/date.
>
> >>
> >> $date
> >> fr. 08. des. 19:42:53 +0100 2017
> >> $sudo bash -c "echo `date '+%s' -d '+ 6 minutes'` >
> /sys/class/rtc/rtc0/wakealarm"
> >> $ cat /sys/class/rtc/rtc0/wakealarm
> >> 1512758974
> >> $ date -d @1512758974
> >> fr. 08. des. 19:49:34 +0100 2017
> >>
>
> I've even performed an empirical test, and indeed as long as the redirect
> is within the double-quotes of bash -c "command here > file" it works for
> me in a different scenario:
>
> mike at bifrost /root $ sudo bash -c "echo `date '+%s' -d '+ 6 minutes'` >
> derp"
> Password:
> mike at bifrost /root $ ls -al derp
> -rw-r--r-- 1 root root 11 Dec  9 01:21 derp
> mike at bifrost /root $ cat derp
> 1512800877
>
> Thus I have to believe that Marius's shell is indeed writing the exposed
> rtc device properly, unless there are some syntax quoting issues somewhere
> else..
>
> I'm puzzled here, and am curious if A:  it has ever worked at all
> properly, and if not, B: if the BIOS is buggy?
>
> Mike
>
> echo $(date +%s -d "+6 minutes")
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20171209/ff637cc7/attachment.html>


More information about the mythtv-users mailing list