Author |
Message |
cliffsjunk
|
Posted: Mon Aug 04, 2008 11:05 am |
|
Joined: Fri Sep 15, 2006 12:16 pm
Posts: 292
|
nmcaullay wrote: Could someone post the proper R5.5 hwclock.sh file? or PM me it?
Here is /etc/init.d/hwclock.sh from a clean R5.5 Code: #!/bin/sh # hwclock.sh Set and adjust the CMOS clock, according to the UTC # setting in /etc/default/rcS (see also rcS(5)). # # Version: @(#)hwclock.sh 2.00 14-Dec-1998 miquels@cistron.nl # # Patches: # 2000-01-30 Henrique M. Holschuh <hmh@rcm.org.br> # - Minor cosmetic changes in an attempt to help new # users notice something IS changing their clocks # during startup/shutdown. # - Added comments to alert users of hwclock issues # and discourage tampering without proper doc reading.
# WARNING: Please read /usr/share/doc/util-linux/README.Debian.hwclock # before changing this file. You risk serious clock # misbehaviour otherwise.
# Set this to any options you might need to give to hwclock, such # as machine hardware clock type for Alphas. HWCLOCKPARS=
hwclocksh() { [ ! -x /sbin/hwclock ] && return 0 . /etc/default/rcS
. /lib/lsb/init-functions verbose_log_action_msg() { [ "$VERBOSE" = no ] || log_action_msg "$@"; }
[ "$GMT" = "-u" ] && UTC="yes" case "$UTC" in no|"") GMT="--localtime" UTC="" ;; yes) GMT="--utc" UTC="--utc" ;; *) log_action_msg "Unknown UTC setting: "$UTC""; return 1 ;; esac
case "$BADYEAR" in no|"") BADYEAR="" ;; yes) BADYEAR="--badyear" ;; *) log_action_msg "unknown BADYEAR setting: "$BADYEAR""; return 1 ;; esac
case "$1" in start) if [ ! -f /etc/adjtime ] && [ ! -e /etc/adjtime ]; then echo "0.0 0 0.0" > /etc/adjtime fi
# Uncomment the hwclock --adjust line below if you want # hwclock to try to correct systematic drift errors in the # Hardware Clock. # # WARNING: If you uncomment this option, you must either make # sure *nothing* changes the Hardware Clock other than # hwclock --systohc, or you must delete /etc/adjtime # every time someone else modifies the Hardware Clock. # # Common "vilains" are: ntp, MS Windows, the BIOS Setup # program. # # WARNING: You must remember to invalidate (delete) # /etc/adjtime if you ever need to set the system clock # to a very different value and hwclock --adjust is being # used. # # Please read /usr/share/doc/util-linux/README.Debian.hwclock # before enablig hwclock --adjust.
#hwclock --adjust $GMT $BADYEAR :
if [ "$HWCLOCKACCESS" != no ]; then log_action_msg "Setting the system clock."
# Copies Hardware Clock time to System Clock using the correct # timezone for hardware clocks in local time, and sets kernel # timezone. DO NOT REMOVE. /sbin/hwclock --hctosys $GMT $HWCLOCKPARS $BADYEAR
# Announce the local time. verbose_log_action_msg "System Clock set. Local time: `date $UTC`" else verbose_log_action_msg "Not setting System Clock" fi
# Hooks for mythwelcome. If we have an alarm.log, log the startup if [ -f /tmp/alarm.log ]; then echo "Startup:" `date -u` >> /tmp/alarm.log fi
;; stop|restart|reload|force-reload) # # Updates the Hardware Clock with the System Clock time. # This will *override* any changes made to the Hardware Clock. # # WARNING: If you disable this, any changes to the system # clock will not be carried across reboots. # if [ "$HWCLOCKACCESS" != no ]; then log_action_msg "Saving the system clock." if [ "$GMT" = "-u" ]; then GMT="--utc" fi /sbin/hwclock --systohc $GMT $HWCLOCKPARS $BADYEAR verbose_log_action_msg "Hardware Clock updated to `date`" else verbose_log_action_msg "Not saving System Clock" fi
# Hooks for mythwelcome. On shutdown, /usr/local/mythwelcome-set-alarm.sh # is called. This puts the next wakeup time in /tmp/alarm. We set # the alarm here with this time. if [ -f /tmp/alarm ]; then echo 0 > /sys/class/rtc/rtc0/wakealarm cat /tmp/alarm > /sys/class/rtc/rtc0/wakealarm echo "Shutdown:" `date -u` > /tmp/alarm.log echo "Alarm Set:" `cat /tmp/alarm` >> /tmp/alarm.log echo "/proc/driver/rtc:" >> /tmp/alarm.log cat /proc/driver/rtc >> /tmp/alarm.log cat /sys/class/rtc/rtc0/device/power/wakeup >> /tmp/alarm.log cat /sys/class/rtc/rtc0/wakealarm >> /tmp/alarm.log rm /tmp/alarm fi
;; show) if [ "$HWCLOCKACCESS" != no ]; then /sbin/hwclock --show $GMT $HWCLOCKPARS $BADYEAR fi ;; *) log_success_msg "Usage: hwclock.sh {start|stop|reload|force-reload|show}" log_success_msg " start sets kernel (system) clock from hardware (RTC) clock" log_success_msg " stop and reload set hardware (RTC) clock from kernel (system) clock" return 1 ;; esac }
hwclocksh "$@"
Cliff
|
|
Top |
|
|
nmcaullay
|
Posted: Mon Aug 04, 2008 7:57 pm |
|
Joined: Sun Sep 04, 2005 7:48 pm
Posts: 264
Location:
Perth, Australia
|
Thanks Cliff,
That did the trick, the mythwelcome-test script now sets the wakeup time, i shut down, and its alive in 4 minutes! Now just to configure mythwelcome as per this link http://www.knoppmythwiki.org/index.php?page=MythWelcome
Thanks again, this is a great community.... and 1 day in a great release is R5.5!
Cheers,
Nathan
_________________ LinHES: R6 | MB: Asus M3N-H/HDMI | CPU: AMD ??Mhz
Capture: 2xHDHR DVB-T
Graphics: Onboard 8300|PSU: Corsair vx450w
Cooling: Zalman cu?,
Display: Benq xx projector
|
|
Top |
|
|
graysky
|
Posted: Tue Aug 05, 2008 1:38 am |
|
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location:
/dev/null
|
@nmcaullay - you might wana run that test script 5-10 times in a row to make sure it'll still wakeup. I have a A7N8XE-Deluxe MB that will wake once, but not twice for some reason via APCI. nvram-wakeup works every time though.
_________________ Retired KM user (R4 - R6.04); friend to LH users.
|
|
Top |
|
|
nmcaullay
|
Posted: Tue Aug 05, 2008 1:48 am |
|
Joined: Sun Sep 04, 2005 7:48 pm
Posts: 264
Location:
Perth, Australia
|
hi graysky,
The previous /proc/alarm/acpi was fairly stable with R5F27, so im hoping the new method with R5.5 is just as good. If the ACPI fails, i'll give nvram a go, but the warning messages on the nvram instructions scared me towards ACPI wakeup in the first place.
Cheers,
Nathan
_________________ LinHES: R6 | MB: Asus M3N-H/HDMI | CPU: AMD ??Mhz
Capture: 2xHDHR DVB-T
Graphics: Onboard 8300|PSU: Corsair vx450w
Cooling: Zalman cu?,
Display: Benq xx projector
|
|
Top |
|
|
heilig
|
Posted: Tue Aug 05, 2008 3:14 pm |
|
Joined: Sat May 12, 2007 2:41 am
Posts: 51
Location:
Southern Germany
|
Hi Marc,
marc.aronson wrote: Jens, I found out something interesting that may help you to get ACPI wakeup to work. I re-installed r5.5 from scratch and once again could not get the wakeup to work. After some playing around, I found I had to do 3 things to get it to work:
(...) Marc
thanks for the hint. Tried it, but it still does not work
I've run out of ideas. Storage groups and multiple recordings on same multiplex are great features, but having a PC running 24/7 in the living room is an absolute show-stopper.
I'll fiddle around some more next weekend, but after that I will have to give up and go back to R5F27, hoping to get it to work again there. Pity, since so much work was put in R5.5 by Cecil and others, and apart from that all other things are working really great
Thanks for the hints! I'll keep trying some more!
jens
|
|
Top |
|
|
slackey
|
Posted: Wed Aug 06, 2008 1:28 pm |
|
Joined: Wed Aug 06, 2008 1:18 pm
Posts: 3
|
I am having a similar problem with getting my machine to sleep. I run the test wake script and it says it will wake in 4 minutes, but it never wakes up.
On an interesting note, if I suspend the computer instead of shutting down, it wakes up fine in 4 minutes. This leads me to believe that the problem is in the hwclock.sh script, which is called during shutdown.
In this wiki post, it says you need to disable hwclock updates, but it only has instructions for doing this with the old /proc/acpi/alarm method, not the new method used in the latest version of knoppmyth. Any ideas on how to fix the script?
|
|
Top |
|
|
marc.aronson
|
Posted: Wed Aug 06, 2008 7:57 pm |
|
Joined: Tue Jan 18, 2005 2:07 am
Posts: 1532
Location:
California
|
slackey wrote: In this wiki post, it says you need to disable hwclock updates, but it only has instructions for doing this with the old /proc/acpi/alarm method, not the new method used in the latest version of knoppmyth. Any ideas on how to fix the script?
Modify /etc/init.d/hwclock.sh to not update the hardware clock during a shutdown by adding the line ' HWCLOCKACCESS="no" ' just before the last line of the script which currently reads ' hwclocksh "$@" '. I believe this is the last line of the file.
Marc
|
|
Top |
|
|
slackey
|
Posted: Wed Aug 06, 2008 8:20 pm |
|
Joined: Wed Aug 06, 2008 1:18 pm
Posts: 3
|
marc.aronson wrote: slackey wrote: In this wiki post, it says you need to disable hwclock updates, but it only has instructions for doing this with the old /proc/acpi/alarm method, not the new method used in the latest version of knoppmyth. Any ideas on how to fix the script? Modify /etc/init.d/hwclock.sh to not update the hardware clock during a shutdown by adding the line ' HWCLOCKACCESS="no" ' just before the last line of the script which currently reads ' hwclocksh "$@" '. I believe this is the last line of the file. Marc
Ok so I did that and also tried the steps you listed earlier, but nothing worked.
I tried doing an echo to /sys/class/rtc/rtc0/wakealarm directly to set a wakeup time, but after I echo and then do a cat to check, the time is different. For instance, if I echo 1218124067, when I cat I get 2051648163, which is wildly in the future. In my motherboard you can't set year or month, could that be causing the discrepancy? I think this may be the problem with it not waking up and seems to be the same problem the OP has.
|
|
Top |
|
|
marc.aronson
|
Posted: Wed Aug 06, 2008 9:37 pm |
|
Joined: Tue Jan 18, 2005 2:07 am
Posts: 1532
Location:
California
|
slackey wrote: I tried doing an echo to /sys/class/rtc/rtc0/wakealarm directly to set a wakeup time, but after I echo and then do a cat to check, the time is different. For instance, if I echo 1218124067, when I cat I get 2051648163, which is wildly in the future. In my motherboard you can't set year or month, could that be causing the discrepancy? I think this may be the problem with it not waking up and seems to be the same problem the OP has.
I see a similar discrepency between what I write to wakealarm and what I get back when I cat the file: 1218080144 vs. 2051604240. Since things are working for me, and I've seen a lot of other people make the same observation, I don't think that is what is causing the problem. I am out of suggestions -- sorry.
Marc
|
|
Top |
|
|
alien
|
Posted: Thu Aug 07, 2008 12:48 am |
|
Joined: Mon Jun 21, 2004 5:28 am
Posts: 700
Location:
Germany
|
marc.aronson wrote: slackey wrote: In this wiki post, it says you need to disable hwclock updates, but it only has instructions for doing this with the old /proc/acpi/alarm method, not the new method used in the latest version of knoppmyth. Any ideas on how to fix the script? Modify /etc/init.d/hwclock.sh to not update the hardware clock during a shutdown by adding the line ' HWCLOCKACCESS="no" ' just before the last line of the script which currently reads ' hwclocksh "$@" '. I believe this is the last line of the file. Marc A couple of things to note:
The problem described in the wiki above is that many MB will not wakeup if the HW clock is set after the alarm is set. hwclock.sh has already been modified to set them in the correct order. Marc seems to have a different problem then described in the wiki if he has to completely disable the hwclock updates.
Note that if you have to completely disable the hwclock updates, any drifts in the hwclock will never be corrected. You will probably have to correct the BIOS clock manually on occasion.
Allen
_________________ ASUS AT3N7A-I (Atom 330) TBS 8922 PCI (DVB-S2)
|
|
Top |
|
|
slackey
|
Posted: Thu Aug 07, 2008 4:33 am |
|
Joined: Wed Aug 06, 2008 1:18 pm
Posts: 3
|
Well for now I am stumped. I have tried all things listed in Fussy bios section of the wiki, I went as far as reflashing my bios and setting everything back to default settings. The computer wakes if I set it manually in the bios, but not if I use the test script or follow the + 5 minutes procedure directly to wakealarm. I have tried leaving RTC alarm enabled and disabled in the bios. Nothing works. I had this working fine with mythbuntu and /proc/acpi/alarm, but the new way just won't work. I like knoppmyth much better but this is killing me.
just fyi, I am using a fairly new motherboard, a gigabyte ga-ma78gm-s2h
|
|
Top |
|
|
i_c_bradley
|
Posted: Sun Aug 10, 2008 2:55 pm |
|
Joined: Mon Oct 31, 2005 11:42 am
Posts: 3
Location:
UK
|
I had this working with the previous release so after following this thread I also tried the lilo.conf change from here http://mysettopbox.tv/phpBB2/viewtopic. ... 783#114783
and then followed marc's instructions and voila! I used the test mythwelcome script to try it out and I also got a response from rtc when using settime. I hope this gives someone some hope!
If at first you do not succeed try, try and try again.
_________________ Asus P4P800-SE, nvidia 5200, 300Gb SATA
|
|
Top |
|
|
marc.aronson
|
Posted: Sun Aug 10, 2008 6:18 pm |
|
Joined: Tue Jan 18, 2005 2:07 am
Posts: 1532
Location:
California
|
alien wrote: The problem described in the wiki above is that many MB will not wakeup if the HW clock is set after the alarm is set. hwclock.sh has already been modified to set them in the correct order. Marc seems to have a different problem then described in the wiki if he has to completely disable the hwclock updates.
FYI for those that might be interested -- I did some experiments with my system and verified that if the hardware clock is modified at any time, the next alarm wakeup will not work. I tried:
1. Setting the wake up alarm after setting the HW clock.
2. Setting the wake up alarm multiple times after setting the HW clock.
3. Setting the wake up alarm before setting the HW clock.
4. Holding my breath until I turned blue .
None of these solved the problem. Having said this, if I reboot, set the alarm and don't touch the HW clock, things work just fine. This means that the changes that Alien referenced in hwclock.sh won't work for my motherboard, and that I do need to hardware ' HWCLOCKACCESS="no" ' for things to work. (MOBO = Asus P5P800-SE)
Marc
|
|
Top |
|
|
heilig
|
Posted: Mon Aug 11, 2008 9:26 am |
|
Joined: Sat May 12, 2007 2:41 am
Posts: 51
Location:
Southern Germany
|
i_c_bradley wrote: I had this working with the previous release so after following this thread I also tried the lilo.conf change from here http://mysettopbox.tv/phpBB2/viewtopic. ... 783#114783 and then followed marc's instructions and voila! I used the test mythwelcome script to try it out and I also got a response from rtc when using settime. I hope this gives someone some hope!
It does indeed give me some new hope. Especially since you have a P4P800-SE board, which is *almost* the same as my P4P800 board.
Thanks!
Jens
|
|
Top |
|
|
tophee
|
Posted: Mon Aug 18, 2008 1:46 pm |
|
Joined: Tue Sep 13, 2005 10:48 am
Posts: 852
Location:
London, UK
|
After sort-of solving a shutdown issue, my attempts at getting Mythwelcome to work on my current setup (see sig - minus nova-t 500) haven't gone too well. I followed the wiki for APCI and didn't get anywhere.
So I've tried using the nvram version.
That hasn't gone smoothly either.
I followed the extra bits in the Mythwelcome page on the wiki. As a su I've run guess helper. And typed "touch /home/mythtv/.use-nvram" (without speech marks).
Unless I've missed it, now guess helper puts nvram-wakeup.conf in /etc automatically? Yes?
When I exit out of su mode and run Mythwelcome-test.sh
I get an error. It reads:
Code: sh: /tmp/alarm.log:Permission denied sh: /tmp/alarm.log:Permission denied nvram-wakeup retcode: 1Fatal: open /boot/map: Permission denied Execute the following command sudo reboot
So sudo reboot gives me a system reboot.
Running mythwelcome-test-wakeup.sh as root doesn't work either.
_________________ Version:R8 Intel C2D 7400, Nvidia 5600 via HDMI to Samsung B37B650TW (PAL), Asus P5QL-E mobo, 4Gb PC6400 DDR2 ram, Samsung Spinpoint 500 Gb & 1Tb drive, Nova-HD-S2 (x2)
|
|
Top |
|
|