grub-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] New command checktime


From: Bean
Subject: Re: [PATCH] New command checktime
Date: Mon, 11 Aug 2008 19:06:11 +0800

On Mon, Aug 11, 2008 at 2:04 AM, Marco Gerards <address@hidden> wrote:
> Hi,
>
> Bean <address@hidden> writes:
>
>> I implement this command for grub4dos some time ago, now it's ported to 
>> grub2.
>>
>> Usage:
>>
>>   checktime min hour day_of_month month day_of_week
>
> Personally I would prefer it if it worked a bit more GRUB2/bash like.
> So can you make this variables?
>
> For example:
>
> if ($WEEKDAY = Sunday); then
>  ...
> fi
>
> The same can be done for all week number, day number, year, etc, etc.
>
> The advantage of this is that many users are familiar with such syntax
> and it will give them more control.  Furthermore, this is what I
> intended with the scripting support in the first place.  So can you
> please follow such scheme?

Hi,

As suggested by marco, this patch replaces the crontab command with
variable hook. Now you can retrive current date/time with variable
$YEAR, $MONTH, $DAY, $HOUR, $MINUTE, $SECOND and $WEEKDAY.

2008-08-11  Bean  <address@hidden>

        * conf/i386-pc.rmk (pkglib_MODULES): Add datetime.mod and date.mod.
        (datetime_mod_SOURCES): New macro.
        (datetime_mod_CFLAGS): Likewise.
        (datetime_mod_LDFLAGS): Likewise.
        (date_mod_SOURCES): Likewise.
        (date_mod_CFLAGS): Likewise.
        (date_mod_LDFLAGS): Likewise.

        * conf/i386-coreboot.rmk (pkglib_MODULES): Add datetime.mod and 
date.mod.
        (datetime_mod_SOURCES): New macro.
        (datetime_mod_CFLAGS): Likewise.
        (datetime_mod_LDFLAGS): Likewise.
        (date_mod_SOURCES): Likewise.
        (date_mod_CFLAGS): Likewise.
        (date_mod_LDFLAGS): Likewise.

        * conf/i386-ieee1275.rmk (pkglib_MODULES): Add datetime.mod and 
date.mod.
        (datetime_mod_SOURCES): New macro.
        (datetime_mod_CFLAGS): Likewise.
        (datetime_mod_LDFLAGS): Likewise.
        (date_mod_SOURCES): Likewise.
        (date_mod_CFLAGS): Likewise.
        (date_mod_LDFLAGS): Likewise.

        * conf/i386-efi.rmk (pkglib_MODULES): Add datetime.mod and date.mod.
        (datetime_mod_SOURCES): New macro.
        (datetime_mod_CFLAGS): Likewise.
        (datetime_mod_LDFLAGS): Likewise.
        (date_mod_SOURCES): Likewise.
        (date_mod_CFLAGS): Likewise.
        (date_mod_LDFLAGS): Likewise.

        * conf/x86_64-efi.rmk (pkglib_MODULES): Add datetime.mod and date.mod.
        (datetime_mod_SOURCES): New macro.
        (datetime_mod_CFLAGS): Likewise.
        (datetime_mod_LDFLAGS): Likewise.
        (date_mod_SOURCES): Likewise.
        (date_mod_CFLAGS): Likewise.
        (date_mod_LDFLAGS): Likewise.

        * commands/date.c: New file.

        * commands/datetime.c: Likewise.

        * include/grub/datetime.h: Likewise.

        * include/grub/i386/cmos.h: Likewise.

        * kern/i386/datetime.c: Likewise.

        * kern/efi/datetime.c: Likewise.

-- 
Bean

Attachment: date_3.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]