[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to suppress the error message "no such device" during execution
From: |
Jordan Uggla |
Subject: |
Re: How to suppress the error message "no such device" during execution of a configuration file |
Date: |
Mon, 20 Feb 2012 12:26:48 -0800 |
On Mon, Feb 20, 2012 at 8:26 AM, Arbiel Perlacremaz
<address@hidden> wrote:
> Regarding your last point, I know the 'ls' command displays the list of
> disks and partitions on the screen, but I don't know how to direct it to
> return this information into a variable, so I could do a loop on it to
> generate the entrymenue commands, and I don't know either how to read the
> properties (as the label) of a partition out the path to it.
insmod regexp
for device in (*); do
if probe --set=label --label "$device"; then
menuentry "Boot from label $label" "$device" "$label" {
root="$2"
# $2 in this context is the second argument we passed to the
menuentry function.
label="$3"
linux /path/to/vmlinuz kernel arguments here root=LABEL="$label"
initrd /path/to/initrd
}
fi
done
>
> Arbiel
>
A lot of the features I just used are unfortunately poorly documented,
or not documented at all. If you'd be interested in helping out with
documenting them in docs/grub.texi that would be *highly* appreciated
:)
--
Jordan Uggla (Jordan_U on irc.freenode.net)