From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1aMtWe-0000a4-Dw for mharc-grub-devel@gnu.org; Sat, 23 Jan 2016 03:26:28 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49932) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMtWb-0000ZL-LK for grub-devel@gnu.org; Sat, 23 Jan 2016 03:26:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMtWY-00035f-Ds for grub-devel@gnu.org; Sat, 23 Jan 2016 03:26:25 -0500 Received: from mail-lb0-x235.google.com ([2a00:1450:4010:c04::235]:33666) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMtWY-00035T-56 for grub-devel@gnu.org; Sat, 23 Jan 2016 03:26:22 -0500 Received: by mail-lb0-x235.google.com with SMTP id x4so52889422lbm.0 for ; Sat, 23 Jan 2016 00:26:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type; bh=IA9ktHIYiGlYKmcaUHCQb3L7nfDiO7s5ml1mtTGPNMU=; b=s5vq9gjGn+2zVWpxyNIbgwobKjqSHFUFMVPPntHc9jC1znWD1tV8qoxl2rskXdLphQ i9eDVLWpQzVt0Lud33LjE+z8MtT/JyEMIf2yYvUfvOZAaLP28XkJXmRxDK82obz8OHTg NFztvjgo8XEf8ble49wZTpM0kl74aFB1A+RPneVrxWy6pMkvAkz1n7vcgbvXjztli+VC 4/wQpQ5t96iuQV7k/EgrG8VcUb2YwhGsqIPkDJFdzKMz1UIb7Z/edi+TNNdTSxLcc8lA pdZ2ItSjkx+E/VvwLrdINGK3iewxqPjCmWu7MqUUt5I7acEhWogDdgvjcMu5wjKt2Ma5 IvJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type; bh=IA9ktHIYiGlYKmcaUHCQb3L7nfDiO7s5ml1mtTGPNMU=; b=HkPz4dmxyFMgCBsWeKtH50j1/n3T/n2tixxUWcYu0hWteyjp4zMN8Z6yaZUlrAf910 J3XxEMdd1BsMR5IC7ASIVO26mgh/eLmngPX/qgmdGImqY3wX3ejwt+LVcjyFIvejWT4C Fu1oH8rKBCyM0yeu3E4Zqsp1ajiH83/GdQcuYo9nLahonrSFKbmjuDfQDWYY446XOE0Z xy+IvMd8DuiUHG96ghQ+iiIIXEdvkpCBTpXQBETDd8qYkBPL7k4uDZ1HvPFQ5hnL3IIz MC66eaC+dJLNl4dPEG/w6VIegwlGfpJhPSIEXwEDUN5xjanM7n+zqG8YMkLcjgQtLeR5 gKhg== X-Gm-Message-State: AG10YOSoKjUhJX/0F5IMjHLaSE4nWJ/pDQXGmj//gPSldBrY1m3b4eDwiDWtTfDWkPzOtA== X-Received: by 10.112.148.131 with SMTP id ts3mr2842780lbb.102.1453537581138; Sat, 23 Jan 2016 00:26:21 -0800 (PST) Received: from [192.168.1.41] (ppp91-76-25-247.pppoe.mtu-net.ru. [91.76.25.247]) by smtp.gmail.com with ESMTPSA id q76sm1355174lfd.41.2016.01.23.00.26.19 for (version=TLSv1/SSLv3 cipher=OTHER); Sat, 23 Jan 2016 00:26:20 -0800 (PST) Subject: Re: [PATCH] [RFC] Add exitcode support To: grub-devel@gnu.org References: <20150818173044.GA2020@fluid.dannf> <56A27D9F.7040403@gmail.com> From: Andrei Borzenkov X-Enigmail-Draft-Status: N1110 Message-ID: <56A3392B.5070008@gmail.com> Date: Sat, 23 Jan 2016 11:26:19 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <56A27D9F.7040403@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="NnTUF4nwVLMldA6B4daGLjTh7tCXvhS2a" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c04::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: Sat, 23 Jan 2016 08:26:26 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --NnTUF4nwVLMldA6B4daGLjTh7tCXvhS2a Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 22.01.2016 22:06, Vladimir '=CF=86-coder/phcoder' Serbinenko =D0=BF=D0=B8= =D1=88=D0=B5=D1=82: > On 18.08.2015 21:17, Ben Hildred wrote: >> Let's assume for a minute that I have compiled grub as a multiboot ima= ge >> and have called it from another bootloader, say iPXE.Now iPXE assumes >> that any false return is an error. What happens when grub returns with= >> exit next, does iPXE get a true or false? What about exit fred where >> fred is not defined by any platform? What if I do an exit config which= >> is only defined for coreboot? > Neither multiboot nor coreboot have any return semantics. The situation= > with current platforms is as follows: > No return/exit semantics at all or machine shutdown: > i386_coreboot, i386_qemu, i386_multiboot, mips_qemu_mips, mips_loongson= > no-args exit: > *-ieee1275, i386-pc, mips-arc > Xen semantics (crash vs poweroff): > *-xen > EFI semantics: > *-efi > Unix-like semantics: > arm-uboot, emu >=20 > Emu is of no real interest and I have no idea what Uboot does with > return code but I suppose nothing. >=20 > This leaves us only with xen and EFI semantics. Xen is enough of outlie= r > to handle it separately. So only EFI is remaining. >=20 > On i386-pc the default behaviour of exit is to try next boot entry. EFI= > should probably do the same. What is the current behaviour of grub_exit= > and what is the value in returning EFI_SUCCESS ? Currently it returns EFI_SUCCESS that tells firmware boot manager to return to menu and stop attempting to load further boot options. I.e. this is directly opposite to what i386-pc. OTOH I still find it useful to be able to explicitly return to boot menu from GRUB (or EFI Shell for that matter). > Can we have returncode-aware command to be EFI-specific? >=20 I'm fine with changing default EFI exit code to be not EFI_SUCCESS (but this should be commented in sources) and to have fwmenu (similar to fwsetup) that explicitly returns EFI_SUCCESS. --NnTUF4nwVLMldA6B4daGLjTh7tCXvhS2a Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iEYEARECAAYFAlajOSsACgkQR6LMutpd94zyiwCbBpQiI/WGMXiuGuxAg1aKO6gQ b6kAn0meIGW5I4A38keogPbquhHZzJES =Ai7A -----END PGP SIGNATURE----- --NnTUF4nwVLMldA6B4daGLjTh7tCXvhS2a--