[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: boot time



Has anyone else noticed that the 991021 version of pmacpow doesn't seem
to work when specifying an absolute time?

The usage message says:

pmacpow [-u] [-w|e|q] [-d DAY] HH:MM
pmacpow +value[mhd]
        u: RTC is in universal time
        w: only on weekdays
        e: only on weekends
        q: quiet mode
        d: specify day of week (0..6); 0 represents Sunday
        value: time in sec or min or hour or day ahead of current time

However, when I type:
    pmacpow 06:20
it prints:
    will be up again Sat May 11 22:04:05 2002
which appears to be 6 seconds in the future.

Examining the program in the debugger leads me to believe that the logic
in lines 236-257

    236         tmp = strsep(&timestr, ":");
    237         if (tmp && (strlen(tmp) != strlen(argv[optind]))) {
    238                 if (!tmp || !timestr)
    239                         usage();
    240                 hour = atoi(tmp);
    241                 min = atoi(timestr);
    242                 sec = 0;
    243         } else {
    244                 timestr = argv[optind];
    245                 sec = strtol(timestr, &tmp, 10);
    246                 if (tmp) {
    247                         switch (tolower(tmp[0])) {
    248                         case 'd': 
    249                                 sec *= 24;
    250                         case 'h': 
    251                                 sec *= 60;
    252                         case 'm': 
    253                                 sec *= 60;
    254                                 break;
    255                         }
    256                 }
    257         }



doesn't work as intended because strsep modifies both timestr and the
string.  The program doesn't enter the first branch of the if statement
when it should.

The earlier 991019 version works fine, but doesn't support the +value
style of usage.

	Peter Canning

On Tue, 2002-02-26 at 15:25, Philipp Kaeser wrote:
> Hej Benja & Vinai,
> 
> > > Is there any way to make a system boot @ a specific time?
> > If you have MacOS Classic on any of your partitions, you can use the
> > energy saver control panel to set a boot time, then set your favourite
> > bootloader to boot into Linux by default.  There was a linux utility
> > that could set the hardware to do this, without MacOS, but the name or
> > its source do not come to me right now...  It was mentioned waaay back
> > on one of the linuxppc mailing lists ...
> 
> the utility is called 'pmacpow'. there is not much mention of it on google,
> and most links point void; so I have put two older versions online on
> http://www.gubbe.ch/download/pmacpow-tool-991019.tar.gz    and
> http://www.gubbe.ch/download/pmacpow-tool-991021.tar.gz
> 
> Note that a boot time is set only for the very next boot up process,
> in order to have your system boot regularly, it would be needed to
> execute it every time before shutdown.
> in case you write such a script, please let me know - I'd need it too,
> but am (was) too lazy to take care of it until now.
> 
> have fun,
> 
> Philipp Kaeser
> 
> 
> -- 
> To UNSUBSCRIBE, email to debian-powerpc-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> 
> 




-- 
To UNSUBSCRIBE, email to debian-powerpc-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: