From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1NWIth-0005Ul-PO for mharc-grub-devel@gnu.org; Sat, 16 Jan 2010 19:21:41 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NWItf-0005U8-ON for grub-devel@gnu.org; Sat, 16 Jan 2010 19:21:39 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NWItb-0005R8-Pl for grub-devel@gnu.org; Sat, 16 Jan 2010 19:21:39 -0500 Received: from [199.232.76.173] (port=55978 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NWItb-0005Qu-KT for grub-devel@gnu.org; Sat, 16 Jan 2010 19:21:35 -0500 Received: from moutng.kundenserver.de ([212.227.17.10]:54233) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NWItb-0004On-24 for grub-devel@gnu.org; Sat, 16 Jan 2010 19:21:35 -0500 Received: from [10.3.2.5] (ip-62-143-98-148.unitymediagroup.de [62.143.98.148]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0Lx5jt-1NurAd0Eqf-017CC7; Sun, 17 Jan 2010 01:21:34 +0100 Message-ID: <4B52580A.3000704@web.de> Date: Sun, 17 Jan 2010 01:21:30 +0100 From: edgar.soldin@web.de User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 MIME-Version: 1.0 To: The development of GNU GRUB References: <4B4F88B0.8060009@web.de> <9dd6c8711001161548y24d7f872n213081fbef30ba7e@mail.gmail.com> In-Reply-To: <9dd6c8711001161548y24d7f872n213081fbef30ba7e@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V01U2FsdGVkX19uhncxKyizJTWVdmCJtxRmt0u8HfoLNwAMkuM zCVIHD28ZfoHWkYn0XYfm+ZQCRJB0qY+0y8/kXqaALFaF2sqz2 mr06W2LwYwnER+XaAmxrg== X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: lua 'grub.run' does not return message text 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: Sun, 17 Jan 2010 00:21:39 -0000 thanks .. I am gonna double check this. Are their other undocumented variables like grub_errmsg. Where should I look for documentation? I'd also look at the source if necessary. About what I am doing. I found the listiso scripts http://ubuntuforums.org/showthread.php?t=1288604 while trying to get them up and running they silently died because of missing modules. Essentially I wanted to parse lsmod. Because that's currently not possible I simply check if insmod fails or not. Do you have an idea on how to parse grub.run output in the current state of the lua module? Thanks again .. ede On 17.01.2010 00:48, Jordan Uggla wrote: > On Thu, Jan 14, 2010 at 1:12 PM, wrote: >> When I run >> >> err,msg = grub.run("ls") >> >> only the variable err is filled with the exit code. >> msg is still nil .. I saw documentation that grub.run is supposed to return >> the output in the second variable. > > In the latest bzr ( pushed a few minutes ago ) the interface matches > what is documented in http://grub.enbug.org/LUASupport . Be careful > though, it's only the error message that is returned, not the output > of "ls". And an error message is only returned if there is an error. > For example: > > errno, err_msg = grub.run( "ls /boot") --Outputs "grub/" > print( errno, err_msg ) -- Outputs "0 nil" > > errno, err_msg = grub.run( "ls /boot/nonexistent" ) -- Outputs nothing > print( errno, err_msg ) -- Outputs "5 file not found" > > If you want to actually list and store devices / files from lua you > should use grub.enum_device() and grub.enum_file() . >