]>
Commit | Line | Data |
---|---|---|
5626056f CW |
1 | #! /bin/bash |
2 | set -e | |
cd838e22 BC |
3 | |
4 | # Run GRUB script in a Qemu instance | |
5 | # Copyright (C) 2010 Free Software Foundation, Inc. | |
6 | # | |
7 | # GRUB is free software: you can redistribute it and/or modify | |
8 | # it under the terms of the GNU General Public License as published by | |
9 | # the Free Software Foundation, either version 3 of the License, or | |
10 | # (at your option) any later version. | |
11 | # | |
12 | # GRUB is distributed in the hope that it will be useful, | |
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | # GNU General Public License for more details. | |
16 | # | |
17 | # You should have received a copy of the GNU General Public License | |
18 | # along with GRUB. If not, see <http://www.gnu.org/licenses/>. | |
19 | ||
20 | cmd='regexp -s version "vm-(.*)" vm-1.2.3; echo $version' | |
21 | v=`echo "$cmd" | @builddir@/grub-shell` | |
22 | if test "$v" != 1.2.3; then echo "error: $cmd" >&2; exit 1; fi | |
23 | ||
24 | cmd='regexp -s 1:version "vm-(.*)" vm-1.2.3; echo $version' | |
25 | v=`echo "$cmd" | @builddir@/grub-shell` | |
26 | if test "$v" != 1.2.3; then echo "error: $cmd" >&2; exit 1; fi | |
27 | ||
28 | cmd='regexp -s 0:match "vm-(.*)" vm-1.2.3; echo $match' | |
29 | v=`echo "$cmd" | @builddir@/grub-shell` | |
30 | if test "$v" != vm-1.2.3; then echo "error: $cmd" >&2; exit 1; fi | |
31 | ||
32 | cmd='regexp -s 2:match "vm-(.*)" vm-1.2.3; echo $match' | |
33 | v=`echo "$cmd" | @builddir@/grub-shell` | |
34 | if test -n "$v"; then echo "error: $cmd" >&2; exit 1; fi | |
35 | ||
36 | cmd='regexp -s match "\\\((.*)\\\)" (hd0,msdos1); echo $match' | |
37 | v=`echo "$cmd" | @builddir@/grub-shell` | |
38 | if test "$v" != "hd0,msdos1"; then echo "error: $cmd" >&2; exit 1; fi | |
39 | ||
40 | cmd='regexp -s match "hd([0-9]+)" hd0; echo $match' | |
41 | v=`echo "$cmd" | @builddir@/grub-shell` | |
42 | if test "$v" != "0"; then echo "error: $cmd" >&2; exit 1; fi |