From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1OT9u0-0004OU-Q0 for mharc-grub-devel@gnu.org; Mon, 28 Jun 2010 04:41:17 -0400 Received: from [140.186.70.92] (port=42024 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OT9tq-00046c-Rj for grub-devel@gnu.org; Mon, 28 Jun 2010 04:41:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OT9hT-000623-Cu for grub-devel@gnu.org; Mon, 28 Jun 2010 04:28:20 -0400 Received: from mail-ww0-f41.google.com ([74.125.82.41]:54065) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OT9hT-00061q-61 for grub-devel@gnu.org; Mon, 28 Jun 2010 04:28:19 -0400 Received: by wwf26 with SMTP id 26so2699009wwf.0 for ; Mon, 28 Jun 2010 01:28:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :x-enigmail-version:content-type; bh=kulpX13BPliHi3kPF52nG1IO/yJmlwkwtPzIfpDf8v0=; b=gU+xAZ8eb1HrfMaeesV4iTYx44/MlGV5mhrOVHAbwC6VNs1pS7Eut175AIlH0GRZJa adKWgSf+j0vbcdbB7XCrzGzlWsUlT/rV7B8I2Kj863HibAvN/jOZWYAVvaKAXdIBNYpq mm23kLDcVF//kCq7+yMrQe5Sp/w8F/A5aHLRs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type; b=sh2IgRS78bWHs2/8LBVWgUoFXGKNrxSUxCpCvzjqzkwRQNGzn1u99Nx9lI67PoL5iV FxwottjBda10KFIs/Ng6CciKQzVCehwaxh9k8dAKeWxG3tzcSVFB2Av5eBh2lzC30CXA ChWgZp9aGOeOfMp/Q2yNPV2xRtDOSj1q//trQ= Received: by 10.216.90.3 with SMTP id d3mr3346199wef.110.1277713692308; Mon, 28 Jun 2010 01:28:12 -0700 (PDT) Received: from debian.bg45.phnet (gprs55.swisscom-mobile.ch [193.247.250.55]) by mx.google.com with ESMTPS id k13sm4311860wed.35.2010.06.28.01.28.07 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 28 Jun 2010 01:28:10 -0700 (PDT) Message-ID: <4C285D14.9040808@gmail.com> Date: Mon, 28 Jun 2010 10:28:04 +0200 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100515 Icedove/3.0.4 MIME-Version: 1.0 To: grub-devel@gnu.org References: <4BF92009.2030803@gmail.com> <20100620045258.GA1083@math.berkeley.edu> In-Reply-To: <20100620045258.GA1083@math.berkeley.edu> X-Enigmail-Version: 1.0.1 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enigD1F38BF0C27578DA4A4A78D7" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: Vendor power-on button X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 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, 28 Jun 2010 08:41:11 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigD1F38BF0C27578DA4A4A78D7 Content-Type: multipart/mixed; boundary="------------020400090509020805050908" This is a multi-part message in MIME format. --------------020400090509020805050908 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 06/20/2010 06:52 AM, Paul Vojta wrote: > On Sun, May 23, 2010 at 02:31:05PM +0200, Vladimir '??-coder/phcoder' S= erbinenko wrote: > =20 >> Hello, all. I've just merged vendor power-on button support into >> mainline. Here is extract from manual: >> =20 > [snip] > > =20 >> If you have a laptop which has a similar feature could you figure your= >> address and contribute? >> =20 > I have a Dell XPS M1330, and GRUB_BUTTON_CMOS_ADDRESS=3D85:3 works also= for me. > > However, I do have one question. > > I have it set up now to boot directly into Linux when I use the main po= wer-on > button, and I use the auxiliary button to get a boot menu, defaulting > to Windows. But when I boot Windows using that button, it starts up > a MediaDirect setup screen (in addition to regular Windows). Would it = be > possible to (optionally) clear the vendor power-on button bit in the > cmos before booting? > =20 Please try the attached patch. And add: GRUB_BUTTON_CMOS_CLEAN=3Dyes > --Paul Vojta, vojta@math.berkeley.edu > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel > > =20 --=20 Regards Vladimir '=CF=86-coder/phcoder' Serbinenko --------------020400090509020805050908 Content-Type: text/x-diff; name="cmosclean.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="cmosclean.diff" =3D=3D=3D modified file 'commands/i386/cmostest.c' --- commands/i386/cmostest.c 2010-05-22 18:28:09 +0000 +++ commands/i386/cmostest.c 2010-06-28 08:24:28 +0000 @@ -22,20 +22,32 @@ #include =20 static grub_err_t -grub_cmd_cmostest (struct grub_command *cmd __attribute__ ((unused)), - int argc, char *argv[]) +parse_args (int argc, char *argv[], int *byte, int *bit) { - int byte, bit; char *rest; =20 if (argc !=3D 1) return grub_error (GRUB_ERR_BAD_ARGUMENT, "Address required."); =20 - byte =3D grub_strtoul (argv[0], &rest, 0); + *byte =3D grub_strtoul (argv[0], &rest, 0); if (*rest !=3D ':') return grub_error (GRUB_ERR_BAD_ARGUMENT, "Address required."); =20 - bit =3D grub_strtoul (rest + 1, 0, 0); + *bit =3D grub_strtoul (rest + 1, 0, 0); + + return GRUB_ERR_NONE; +} + +static grub_err_t +grub_cmd_cmostest (struct grub_command *cmd __attribute__ ((unused)), + int argc, char *argv[]) +{ + int byte, bit; + grub_err_t err; + + err =3D parse_args (argc, argv, &byte, &bit); + if (err) + return err; =20 if (grub_cmos_read (byte) & (1 << bit)) return GRUB_ERR_NONE; @@ -43,7 +55,22 @@ return grub_error (GRUB_ERR_TEST_FAILURE, "false"); } =20 -static grub_command_t cmd; +static grub_err_t +grub_cmd_cmosclean (struct grub_command *cmd __attribute__ ((unused)), + int argc, char *argv[]) +{ + int byte, bit; + grub_err_t err; + + err =3D parse_args (argc, argv, &byte, &bit); + if (err) + return err; + + grub_cmos_write (byte, grub_cmos_read (byte) & (~(1 << bit))); + return GRUB_ERR_NONE; +} + +static grub_command_t cmd, cmd_clean; =20 =0C GRUB_MOD_INIT(cmostest) @@ -51,9 +78,13 @@ cmd =3D grub_register_command ("cmostest", grub_cmd_cmostest, "cmostest BYTE:BIT", "Test bit at BYTE:BIT in CMOS."); + cmd_clean =3D grub_register_command ("cmosclean", grub_cmd_cmosclean, + "cmosclean BYTE:BIT", + "Clean bit at BYTE:BIT in CMOS."); } =20 GRUB_MOD_FINI(cmostest) { grub_unregister_command (cmd); + grub_unregister_command (cmd_clean); } =3D=3D=3D modified file 'util/grub-mkconfig.in' --- util/grub-mkconfig.in 2010-06-28 00:39:49 +0000 +++ util/grub-mkconfig.in 2010-06-28 08:26:35 +0000 @@ -254,6 +254,7 @@ GRUB_HIDDEN_TIMEOUT_BUTTON \ GRUB_TIMEOUT_BUTTON \ GRUB_BUTTON_CMOS_ADDRESS \ + GRUB_BUTTON_CMOS_CLEAN \ GRUB_DISTRIBUTOR \ GRUB_CMDLINE_LINUX \ GRUB_CMDLINE_LINUX_DEFAULT \ =3D=3D=3D modified file 'util/grub.d/00_header.in' --- util/grub.d/00_header.in 2010-06-17 15:01:17 +0000 +++ util/grub.d/00_header.in 2010-06-28 08:25:59 +0000 @@ -253,6 +253,12 @@ make_timeout "${GRUB_HIDDEN_TIMEOUT}" "${GRUB_TIMEOUT}" fi =20 +if [ "x$GRUB_BUTTON_CMOS_ADDRESS" !=3D "x" ] && [ "x$GRUB_BUTTON_CMOS_CL= EAN" !=3D "xyes" ]; then + cat <