merge merge-mkimage into boottest

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-04-27 10:37:27 +02:00
commit 7fec686e6c
359 changed files with 38948 additions and 10254 deletions

View file

@ -1,7 +1,7 @@
#! /bin/bash -e
# Run GRUB script in a Qemu instance
# Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc.
# Copyright (C) 2009,2010 Free Software Foundation, Inc.
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -55,7 +55,7 @@ Report bugs to <bug-grub@gnu.org>.
EOF
}
boot=bios-hd
boot=hd
qemu=qemu-system-i386
# Check the arguments.
@ -80,9 +80,9 @@ for option in "$@"; do
qemuopts="$qemuopts $qs" ;;
--boot=*)
dev=`echo "$option" | sed -e 's/--boot=//'`
if [ "$dev" = "bios-fd" ] ; then boot=bios-fd;
elif [ "$dev" = "bios-hd" ] ; then boot=bios-hd;
elif [ "$dev" = "bios-cd" ] ; then boot=bios-cd;
if [ "$dev" = "fd" ] ; then boot=fd;
elif [ "$dev" = "hd" ] ; then boot=hd;
elif [ "$dev" = "cd" ] ; then boot=cd;
else
echo "Unrecognized boot method \`$dev'" 1>&2
usage
@ -129,26 +129,24 @@ source /boot/grub/testcase.cfg
halt
EOF
if [ x$boot = xbios-hd ] || [ x$boot = xbios-fd ] || [ x$boot = xbios-cd ]; then
isofile=`mktemp`
grub-mkrescue --output=${isofile} --override-directory=${builddir} \
/boot/grub/grub.cfg=${cfgfile} /boot/grub/testcase.cfg=${source} \
${files} >/dev/null 2>&1
if [ x$boot = xbios-hd ]; then
device=hda
bootdev=c
fi
if [ x$boot = xbios-cd ]; then
device=cdrom
bootdev=d
fi
if [ x$boot = xbios-fd ]; then
device=fda
bootdev=a
fi
${qemu} ${qemuopts} -nographic -serial file:/dev/stdout -monitor file:/dev/null -${device} ${isofile} -boot ${bootdev} | tr -d "\r"
rm -f ${isofile}
isofile=`mktemp`
grub-mkrescue --output=${isofile} --override-directory=${builddir} \
/boot/grub/grub.cfg=${cfgfile} /boot/grub/testcase.cfg=${source} \
${files} >/dev/null 2>&1
if [ x$boot = xhd ]; then
device=hda
bootdev=c
fi
if [ x$boot = xcd ]; then
device=cdrom
bootdev=d
fi
if [ x$boot = xfd ]; then
device=fda
bootdev=a
fi
${qemu} ${qemuopts} -nographic -serial file:/dev/stdout -monitor file:/dev/null -${device} ${isofile} -boot ${bootdev} | tr -d "\r"
rm -f ${isofile}
rm -f ${tmpfile} ${cfgfile}
exit 0