Author Topic: 5600 - Fix For Time Not Saving On Reboot - 3.5.4  (Read 3379 times)

steven999

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
    • http://
5600 - Fix For Time Not Saving On Reboot - 3.5.4
« on: March 24, 2006, 10:01:33 pm »
Hi All,

I managed to come up with a fix for the time not saving on reboot for the 5600 and OZ 3.5.4.  Taking a look, the timesaving that is done in the reboot script that is symlinked to /etc/rc6.d/S90reboot comes after the scripts that unmount the filesystem.  So I figured that because of the unmount, the datetime in reboot couldn't possibly write to disk.  

What I did was add a script called savetime to init.d with the contents from S90reboot that are relevant to time saving:

#!/bin/sh
# Update the timestamp, if there is one
if test -e /etc/timestamp
then
        date +%2m%2d%2%2M%2Y > /etc/timestamp
fi


I then ran "chmod 766 savetime" to make it executable.  After that, I linked it into /etc/rc6.d with:

ln -s /etc/init.d/savetime /etc/rc6.d/S21savetime

This runs it after the killsigs but before any file unmounting scripts are executed.  

If someone who has this issue could please try this out and verify, it'd be great to see if this is the best fix to do.  

Also, how does one submit something like this to OZ for inclusion?

Thanks and hope that solves the problem for others!
steven

p.s. - Because time is saved in the file and not referenced from the clock, on reboot the time will have drifted by the amount of time it takes the reboot, which for me was about 2 minutes, but it's a lot easier to quickly adjust the two minute than have to enter in day/month/time. =)

Mickeyl

  • Hero Member
  • *****
  • Posts: 1495
    • View Profile
    • http://www.Vanille.de
5600 - Fix For Time Not Saving On Reboot - 3.5.4
« Reply #1 on: March 25, 2006, 07:24:45 am »
Ah right. Could you please add that into the OE bugtracker for future releases?
Cheers,

Michael 'Mickey' Lauer | Embedded Linux Freelancer | www.Vanille-Media.de
Consider donating, if you like the software I contribute to.

steven999

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
    • http://
5600 - Fix For Time Not Saving On Reboot - 3.5.4
« Reply #2 on: March 25, 2006, 09:29:42 am »
Just added:

http://bugs.openembedded.org/show_bug.cgi?id=780

BTW: Thanks for all of your hard work!


Quote
Ah right. Could you please add that into the OE bugtracker for future releases?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=120196\"][{POST_SNAPBACK}][/a][/div]

Greg2

  • Hero Member
  • *****
  • Posts: 790
    • View Profile
    • http://
5600 - Fix For Time Not Saving On Reboot - 3.5.4
« Reply #3 on: March 25, 2006, 10:19:07 am »
I've added a comment to Bugzilla that your (savetime) script has also been tested and works on the collie.

Thanks

Greg

le_bul_de_sier

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • http://
5600 - Fix For Time Not Saving On Reboot - 3.5.4
« Reply #4 on: March 25, 2006, 10:56:43 am »
Here is fixed script (there is an error in fomat string in original post)

Code: [Select]
#!/bin/sh
# Update the timestamp, if there is one
if test -e /etc/timestamp
then
        date +%2m%2d%2H%2M%Y > /etc/timestamp
fi

steven999

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
    • http://
5600 - Fix For Time Not Saving On Reboot - 3.5.4
« Reply #5 on: March 25, 2006, 06:46:36 pm »
Thanks for posting the fix; I had typed it reading from my PDA and didn't double check it well enough and actually have what you wrote on my PDA. =o

Quote
Here is fixed script (there is an error in fomat string in original post)

Code: [Select]
#!/bin/sh
# Update the timestamp, if there is one
if test -e /etc/timestamp
then
        date +%2m%2d%2H%2M%Y > /etc/timestamp
fi
[div align=\"right\"][a href=\"index.php?act=findpost&pid=120206\"][{POST_SNAPBACK}][/a][/div]