Hallo Leute,
ich hab mal versucht meiner Mahlzeit Installation nvram-wakeup beizubringen.
Mainboard Asus Cusl2-c - wird von nvram-wakeup erkannt und braucht keinen Reboot ...
Hier im Forum habe ich nicht ganz so viel dazu finden können,
ich habe mich hauptsächlich an diese Anleitung gehalten.
So geht's (zumindest bei mir):
Also, was brauchen wir ?
- nvram-wakeup
- PowerOff Kernel (alternativ: 'Halt'-Befehl in Grub)
Folgende angepasste Dateien: - /boot/grub/menu.lst (Eintrag für PowerOff(-Kernel))
- /etc/nvram-wakeup.conf (sofern nvram-wakeup das Mainboard nicht kennt)
- /etc/vdr/vdr-nvram-wakeup.conf
- /usr/bin/poweroff_reboot
- /usr/bin/poweroff.pl
Evtl. noch in /etc/modules ein 'nvram' (ohne Striche) hinzufügen, bin mir aber noch
nicht sicher, ob man das nicht auch weglassen kann
nvram-wakeup
Konnte leider nirgends ein passendes .deb finden, welche auch ein
fehlerfrei ausführbares nvram-wakeup enthielt, also selbst kompilieren:
#
# nvram-wakeup für LinVDR - Mahlzeit ISO 4.0ß2
#
mkdir /usr/src
cd /usr/src
# Entwicklungsumgebung installieren:
wget http://link.vdrserver.de/?id=63
tar xjf install_dev.tar.bz2
cd install_dev
./install_dev.sh
# aktuelles nvram-wakeup aus dem cvs runterladen:
cvs -d :pserver:anonymous@cvs.sourceforge.net/cvsroot/nvram-wakeup login CVS
# Passwort: [Enter]
cvs -d:pserver:anonymous@nvram-wakeup.cvs.sourceforge.net:/cvsroot/nvram-wakeup -z3 co nvram-wakeup
cd nvram-wakeup
# Makefile anpassen
mcedit Makefile
prefix = /usr/local
ändern in
prefix = /usr
(INSTALL) -vd
ändern in
(INSTALL) -d
(INSTALL) -vm
ändern in
(INSTALL) -m
make
make install
# Devices erstellen, sofern nicht vorhanden
# mknod /dev/nvram c 10 144
# mknod /dev/rtc c 10 135
# mknod /dev/mem c 1 1
Alles anzeigen
PowerOff Kernel / /boot/grub/menu.lst
Ich verzichte auf den PowerOff-Kernel, da mein MB auch per Grub-Halt ausschaltet
/etc/nvram-wakeup.conf
Verzichte ich ebenfalls drauf, da nvram-wakeup mein Mainboard kennt,
diese Datei ist aber nötig, sofern das Board per 'guess-helper' angelernt wurde.
/etc/vdr/vdr-nvram-wakeup.conf
#
# Configuration file for the VDR nvram-wakeup shutdown hook
#
# This is NOT the nvram-wakeup configuration file, which you can find in
# /etc/nvram-wakeup.conf and which must be set in COMMANDLINE (see below),
# if your mainboard ins not detected automatically.
#
# Set to "yes" to enable nvram-wakeup for VDR
#
ENABLED="yes"
# Here you can specify additional command line parameters, that will be passed
# to nvram-wakeup.
#
# i.e.:
# COMMANDLINE="-I ecs_k7s5au" # mainboard of type K7S5au
# COMMANDLINE="-C /etc/nvram-wakeup.conf" # use config file
#
# see "man nvram-wakeup"
#
#COMMANDLINE="-C /etc/nvram-wakeup.conf --directisa"
COMMANDLINE="--directisa"
# If your mainboard needs to reboot before shutting down, set the command(s) to
# do this here. i.e.:
#
# SPECIALSHUTDOWN="lilo -R PowerOff ; shutdown -r now"
#
# SPECIALSHUTDOWN="echo y | /usr/bin/poweroff_reboot ; reboot"
SPECIALSHUTDOWN=""
# FORCE_REBOOT = "yes"
# If you want your VDR machine to wakeup in regular intervals (i.e. for
# updating EPG data), specify a day interval and a wakeup time:
#
# REGULAR_DAYS=0 # 0=disabled, 1=each day, 2=each 2'nd day, 3=...
# REGULAR_TIME=0 i# 1:00 # HH:M / i# sbin/M; reboo /sbin/t; reboot
Alles anzeigen
/usr/bin/poweroff_reboot
/usr/bin/poweroff.pl
#!/usr/bin/perl
##
# by Thomas Koch <tom@linvdr.org>
##
use POSIX qw(strftime sprintf);
use Time::Local;
my $PROC_ALARM = "/proc/acpi/alarm";
my $SETTIME = "/usr/bin/settime.sh";
my $DEBUG = 0;
my $WAKEUP_MARGIN = 5;
my $TWOOCLOCK = 1;
my $METHOD = 2; # 0 = ACPI-Wakeup, 1 = settime, 2 = nvram
sub true() { 1; }
sub false() { 0; }
sub dprint {
$_ = join("", @_);
chomp;
print "$_\n" if($DEBUG);
}
sub setTime {
system("hwclock -w");
#system("hwclock -w --directisa");
}
sub setAlarm {
my $Next = shift;
my $TwoOclock = NextTwoOclock();
my $NextStart;
my $ShouldStart;
setTime();
if($Next) {
if($Next > $TwoOclock) {
$ShouldStart = true;
}
$NextStart = $Next - ($WAKEUP_MARGIN * 60);
dprint("Next event at ", strftime("%d.%m.%Y %H:%M", localtime($Next)));
} else {
$ShouldStart = true;
}
if($TWOOCLOCK && $ShouldStart) {
$NextStart = $TwoOclock;
}
if($NextStart) {
dprint("Programming wakeup at ", strftime("%d.%m.%Y %H:%M:%S", localtime($NextStart)));
if($METHOD == 0) {
if(-e $PROC_ALARM) {
system(sprintf("echo \"%s\" > %s", strftime("%Y-%m-%d %H:%M:%S", localtime($NextStart)), $PROC_ALARM));
sleep 1;
system(sprintf("echo \"%s\" > %s", strftime("%Y-%m-%d %H:%M:%S", localtime($NextStart)), $PROC_ALARM));
} else {
dprint("$PROC_ALARM does not exist");
}
} elsif ($METHOD == 1) {
if(-e $SETTIME) {
system(sprintf("%s \"%s\"", $SETTIME, strftime("%Y-%m-%d %H:%M:00", localtime($NextStart))));
} else {
dprint("$SETTIME does not exist");
}
} else {
#
#
# Zeile 72 mit Config - Datei
# Zeile 73 für bekanntes Mainboard --directisa
# system("/usr/bin/nvram-wakeup -C /etc/nvram-wakeup.conf --directisa -s $Next");
system("/usr/bin/nvram-wakeup --directisa -s $Next");
#
#
# system("/usr/bin/poweroff_reboot");
}
}
}
sub PowerOff {
#
#
# Zeile 88 + 89 für PowerOff MIT Reboot
# Zeile 90 für PowerOff OHNE Reboot
# system("/usr/bin/poweroff_reboot") if(!$DEBUG);
# system("/bin/busybox reboot") if(!$DEBUG);
system("/bin/busybox poweroff") if(!$DEBUG);
#
#
}
sub NextTwoOclock {
my $now = time();
# Array-Format: ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)
my @today = localtime($now);
@today[0..2] = (0, 0, 2);
# get today 2:00 in seconds since epoc
my $TwoOclock = timelocal(@today);
# Check: Is today 2:00 in future or past?
if($now < $TwoOclock) {
# Today two oclock is in future
return $TwoOclock;
} else {
# We're past two oclock, next two oclock is tomorrow (+86400s)
return $TwoOclock+86400;
}
}
if(scalar(@ARGV)) {
# called from vdr
die "Wrong parameter count\n" if(scalar(@ARGV) != 5);
die "$PROC_ALARM missing" if(!-e $PROC_ALARM);
my($Next, $Delta, $Channel, $Recording, $UserShutdown) = @ARGV;
setAlarm($Next);
PowerOff();
} else {
# called from cmdline
$next = `svdrpsend.pl next abs`;
if($next =~ /550 No active timers/) {
setAlarm(0);
PowerOff();
} elsif($next =~ /250 \d+ (\d+)/) {
setAlarm($1);
PowerOff();
} else {
PowerOff();
}
}
Alles anzeigen