From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1VnKfY-000579-R6 for mharc-grub-devel@gnu.org; Sun, 01 Dec 2013 22:59:36 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35316) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VnKfS-0004xI-ND for grub-devel@gnu.org; Sun, 01 Dec 2013 22:59:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VnKfK-0004iW-TU for grub-devel@gnu.org; Sun, 01 Dec 2013 22:59:30 -0500 Received: from mail-ea0-x235.google.com ([2a00:1450:4013:c01::235]:49813) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VnKfK-0004hW-Ii for grub-devel@gnu.org; Sun, 01 Dec 2013 22:59:22 -0500 Received: by mail-ea0-f181.google.com with SMTP id m10so8484758eaj.40 for ; Sun, 01 Dec 2013 19:59:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=VYRZJH6N/Lq+ydNdZCLGaxJeTqkSPIvWK/qd2Vr3fnA=; b=Wk/hrIe4npBeby8HhRH1H6te14TL3fc4rf+Lh1v6mYWqE6kNE8dv5ZlOJWDGMMjh5L yJrORazcEmaoQRNCEt8O8y0SEQlQDo2C052ky4ZnTi4ZPgDFvrQvMVxcdi0sQAb/FLP7 YUj2Bdvb6cvHQuHkpy5XtBAwQHiBAgYqg0bEoHwD1y38cHoqKB5aNJ8X5CJK6wHe6xgb 5OuGSeOTSUWvXfyM9hR1dfDyjSy68xZy0dxpLfzFxRC1vGqDoTOqVNEfQjsxc5Kk2jIq KctR19ClWi98rB5pQ/KaUaoFFRCTSoq/aTpw53Ihjown4WcZkY3A/xhaUYR2eZO9Otgj oEZw== X-Received: by 10.15.83.8 with SMTP id b8mr60167074eez.6.1385956761087; Sun, 01 Dec 2013 19:59:21 -0800 (PST) Received: from [192.168.1.16] (85-188.196-178.cust.bluewin.ch. [178.196.188.85]) by mx.google.com with ESMTPSA id 1sm66480504eeg.4.2013.12.01.19.59.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 01 Dec 2013 19:59:19 -0800 (PST) Message-ID: <529C0595.8020101@gmail.com> Date: Mon, 02 Dec 2013 04:59:17 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131005 Icedove/17.0.9 MIME-Version: 1.0 To: grub-devel@gnu.org Subject: Re: Proposition for Add-on References: <6ED1B54066274C3FB1D6D7611122D749@xps> In-Reply-To: <6ED1B54066274C3FB1D6D7611122D749@xps> X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="----enig2MENTXJPGWSWFTWGLCUQC" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c01::235 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Dec 2013 03:59:35 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2MENTXJPGWSWFTWGLCUQC Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 02.12.2013 01:11, Michel Benoit wrote: > Hi! >=20 > I=E2=80=99ve d develop an internal command for grub to help the adminis= trators > of pool of dual boot machine. >=20 > 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. >=20 > The only time the computers are in linux, is when a student is using it= =2E > 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. >=20 No neede to write a module for this. Just do: insmod datehook if [ $HOUR -ge 4 -a $HOUR -lt 6 ]; then default=3Dlinux else default=3Dwindows fi >=20 > 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 th= e > day. >=20 > ex. : >=20 > 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) >=20 > Is it possible to integrate in in the distribution of grub, if you thin= k > it could help other user. >=20 > -----------------------------------------------------------------------= -------------------------------------------------------------------------= ------------- >=20 >=20 > The principal module grub-core/commands/select_by_time.c >=20 > The configuration file, two option >=20 > the simple version /etc/grub.d/98_select_by_time >=20 > 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. >=20 > ex: >=20 > # 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 >=20 > or >=20 > 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). >=20 > exemple of select_by_time.cfg >=20 > select_default Windows > select_by_time 5:00 6:00 ubuntu # maintenance peri= od > select_by_time 13:00 15:00 ubuntu # linux course > select_by_time 19:00 2308 "Linux 3.2.0-23-generic" # spec= ific >=20 > =E2=80=93--------------------------------------------------------------= ------------------------ >=20 >=20 > 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. >=20 > Thank's >=20 > ------------------------------------------------------ > Michel Benoit (morph1853) > Technicien Syst=C3=A8mes Ordin=C3=A9s > Dep. Informatique > Universit=C3=A9 de Sherbooke > michel.benoit@usherbrooke.ca >=20 >=20 > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel >=20 ------enig2MENTXJPGWSWFTWGLCUQC Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (GNU/Linux) Comment: Using GnuPG with Icedove - http://www.enigmail.net/ iF4EAREKAAYFAlKcBZUACgkQmBXlbbo5nOs1oAD+LlE/MQ+i3qpPnMCnq2/8Tadd byxfy+4xdQOIY2mIG70A/RdzpaMmO1KsCrNd8PY+OzrhndWSlmsVnE7i9yVr3Bqc =vpvA -----END PGP SIGNATURE----- ------enig2MENTXJPGWSWFTWGLCUQC--