help-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: grub --batch not returning exit code to calling shell?


From: Felix Zielcke
Subject: Re: grub --batch not returning exit code to calling shell?
Date: Tue, 10 Nov 2009 10:42:28 +0100

Am Dienstag, den 10.11.2009, 11:35 +0200 schrieb Amit Dor-Shifer:
> reposting, +bug-grub.
> Any takers?
> 
> <shell>
> cm.stargate ~ # cat /tmp/grub.inst
> root (hd1,0)
> setup --prefix=/no/such/place (hd1)
> cm.stargate ~ # cat /tmp/grub.inst |grub --batch --device-map
> /tmp/device_map.grub
> 
> 
>     GNU GRUB  version 0.97  (640K lower / 7168K upper memory)
> 
> [ Minimal BASH-like line editing is supported.  For the first word,
> TAB
>    lists possible command completions.  Anywhere else TAB lists the
> possible
>    completions of a device/filename. ]
> grub> root (hd1,0)
> Filesystem type is ext2fs, partition type 0x83
> grub> setup --prefix=/no/such/place (hd1)
> Checking if "/no/such/place/stage1" exists... no
> 
> Error 15: File not found
> grub> cm.stargate ~ # echo $?
> 0
> </shell>
> 
> I expected grub to return the error code (15), or at least indicate
> through its return code that something went wrong.
> How can I get a real exit code from grub?
> 10x,
> Amit
> 

Just use grub2.
There you won't have the problem that a failing command still returns an
exit code of 0
It just doestn't have anymore that broken grub shell.

-- 
Felix Zielcke
Proud Debian Maintainer and GNU GRUB developer





reply via email to

[Prev in Thread] Current Thread [Next in Thread]