From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1aGk65-0000W6-I7 for mharc-grub-devel@gnu.org; Wed, 06 Jan 2016 04:09:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56756) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGk62-0000TF-W7 for grub-devel@gnu.org; Wed, 06 Jan 2016 04:09:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aGk5x-0004Vp-Qa for grub-devel@gnu.org; Wed, 06 Jan 2016 04:09:34 -0500 Received: from mail-lf0-x22d.google.com ([2a00:1450:4010:c07::22d]:33911) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGk5x-0004Vk-FJ for grub-devel@gnu.org; Wed, 06 Jan 2016 04:09:29 -0500 Received: by mail-lf0-x22d.google.com with SMTP id y184so309134170lfc.1 for ; Wed, 06 Jan 2016 01:09:29 -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:content-transfer-encoding; bh=185NTWTYTwAfmtUW2wG+0x52bHijE2npdmhkD89W7PY=; b=GAGM94/Mxw7yfYfufFQDjXtIH4NuRrxlEf63DryTwgudc3P46piQ24HsOwIVADuvLd vD8kITISNT3AZPtdW+Hg22pyrahI7ezrf2FBoqDvbzE9rM3MQIaU0TANNJXj2sKhYM0R LWoJvecZo0NdOME6i48WNMNAEkeDDeTZEGyoac4+F5jrhJpwGdKYppW+Q12PV+FLZ7kx KGPSpHON1WoXQsA4/6AGBEtrHLKF9Z/yVOjxKijHXK5kuAwDmLoZ1La+i6gimiOyLb/G VwZcD2vA4xb6ORkzoL6Y5gdDz993QSTWNgP+8WED8ETluXkhTzL2+aplZqc4/PsUB6fH D0mw== X-Received: by 10.25.165.133 with SMTP id o127mr26085061lfe.105.1452071368517; Wed, 06 Jan 2016 01:09:28 -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 130sm13028673lff.31.2016.01.06.01.09.27 for (version=TLSv1/SSLv3 cipher=OTHER); Wed, 06 Jan 2016 01:09:27 -0800 (PST) Subject: Re: reporting amount of available memory (and acting on it) from grub? To: The development of GNU GRUB References: <877fjnum67.fsf@alice.fifthhorseman.net> From: Andrei Borzenkov Message-ID: <568CD9C7.5050401@gmail.com> Date: Wed, 6 Jan 2016 12:09:27 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <877fjnum67.fsf@alice.fifthhorseman.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::22d 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: Wed, 06 Jan 2016 09:09:35 -0000 06.01.2016 11:50, Daniel Kahn Gillmor пишет: > Hi grub folks-- > > Is there a way that a grub script (or the grub commandline) can report > the amount of available memory? > > It seems like it would be useful in situations like a liveCD or bootable > image that might want to warn the user up front if the available RAM is > smaller than the advertised minimum. (e.g. Tails or debirf) > > Currently, when systems boot with less memory than their minimums, they > often end up with a kernel dump or something similarly unintelligible to > most users. A well-crafted grub configfile for such an image could > provide the user with something more understandable, or at least warn > the user before continuing that the available memory is believed to be > inadequate. > > I could also imagine a use case like an automated boot process that > selects some x86_64 kernel or boot options on machines with > 4GiB of > RAM and plain x86 for machines with less. > > any pointers to how to do this? > Look at lsmmap; in principle, it could be extended to report totals and set value to variable, or another command added.