All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: grub-devel@gnu.org
Subject: Re: Proposition for Add-on
Date: Mon, 02 Dec 2013 04:59:17 +0100	[thread overview]
Message-ID: <529C0595.8020101@gmail.com> (raw)
In-Reply-To: <6ED1B54066274C3FB1D6D7611122D749@xps>

[-- Attachment #1: Type: text/plain, Size: 3490 bytes --]

On 02.12.2013 01:11, Michel Benoit wrote:
> Hi!
> 
> I’ve d develop an internal command for grub to help the administrators
> of pool of dual boot machine.
> 
> The problem: We have class with near 100 computers in dual boot, under
> windows we have a maintenance period in the night to automatically
> install update. For that, in grub we put Windows has the default
> menu-entry.
> 
> The only time the computers are in linux, is when a student is using it.
> It's not a good time to install update. To install update, security
> patch, or other package, i was forced to pass computer by computer.
> 
No neede to write a module for this. Just do:
insmod datehook
if [ $HOUR -ge 4 -a $HOUR -lt 6 ]; then
  default=linux
else
  default=windows
fi
> 
> To get a period for the maintenance in linux, i wrote a simple module
> for grub that select the default menu-entry depending of the time of the
> day.
> 
> ex. :
> 
>    I set the period from 4am to 6am with the default boot to linux.
>    So i can put a script in the crontab at 4h05 to install the update.
>    (you have to put a shutdown -r command in Windows task scheduler at
> 4.00 am. And use a wake on lan for computer that are down)
> 
> Is it possible to integrate in in the distribution of grub, if you think
> it could help other user.
> 
> -------------------------------------------------------------------------------------------------------------------------------------------------------------
> 
> 
> The principal module grub-core/commands/select_by_time.c
> 
> The configuration file, two option
> 
>        the simple version /etc/grub.d/98_select_by_time
> 
>                    In 98_select_by_time, you select the period of time
> and the menuentry for that period, you can use many period of time. It
> use the 24 hours time format notation without colon.
> 
>        ex:
> 
>            # from 4 am to 6 am select item 3 as default
>            select_by_time 0400 0600 3
>            # and from 11h25 pm to midnight select item 5 as default
>            select_by_time 2325 2400 5
> 
>       or
> 
>        the more complete /etc/grub.d/99_select_by_time, that use the
> config file /boot/grub/select_by_time.cfg
>        With this version you don't have to know the position of the
> operating system in grub.cfg (menuitem).
> 
>        exemple of select_by_time.cfg
> 
>            select_default Windows
>            select_by_time 5:00 6:00 ubuntu           # maintenance period
>            select_by_time 13:00 15:00 ubuntu       # linux course
>            select_by_time 19:00 2308 "Linux 3.2.0-23-generic"    # specific
> 
> –--------------------------------------------------------------------------------------
> 
> 
> Right now, we are using select_by_time with 98_select_by_time, and we
> save a lot of days of work.
> If you think it could be helpful for other administrator, could you put
> it in a future grub distribution (the source code is very simple).
> The 99_select_by_time is optional, it's just more easy to use.
> 
> Thank's
> 
> ------------------------------------------------------
> Michel Benoit (morph1853)
> Technicien Systèmes Ordinés
> Dep. Informatique
> Université de Sherbooke
> michel.benoit@usherbrooke.ca
> 
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 291 bytes --]

      parent reply	other threads:[~2013-12-02  3:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-02  0:11 Proposition for Add-on Michel Benoit
2013-12-02  0:28 ` SevenBits
2013-12-02  3:59 ` Vladimir 'φ-coder/phcoder' Serbinenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=529C0595.8020101@gmail.com \
    --to=phcoder@gmail.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.