Merge upstream changes as of April 29th

This commit is contained in:
Michael Marineau 2015-07-31 15:41:48 -07:00
commit c7c750ecc2
267 changed files with 6019 additions and 1963 deletions

View file

@ -29,3 +29,4 @@ fi
"@builddir@/grub-fs-tester" ext2
"@builddir@/grub-fs-tester" ext3
"@builddir@/grub-fs-tester" ext4
"@builddir@/grub-fs-tester" ext4_metabg

View file

@ -46,6 +46,6 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
exit 0;;
esac
if [ "$(echo hello | "${grubshell}" --boot=fd --mkrescue-arg="--compress=xz --fonts= --locales= --themes=")" != "Hello World" ]; then
if [ "$(echo hello | "${grubshell}" --boot=fd --mkrescue-arg="--compress=xz --fonts= --locales= --themes= -no-pad")" != "Hello World" ]; then
exit 1
fi

1
tests/file_filter/file Normal file
View file

@ -0,0 +1 @@
Hello, user!

BIN
tests/file_filter/file.gz Normal file

Binary file not shown.

Binary file not shown.

BIN
tests/file_filter/file.lzop Normal file

Binary file not shown.

Binary file not shown.

BIN
tests/file_filter/file.xz Normal file

Binary file not shown.

Binary file not shown.

BIN
tests/file_filter/keys Normal file

Binary file not shown.

BIN
tests/file_filter/keys.pub Normal file

Binary file not shown.

View file

@ -0,0 +1,6 @@
trust /keys.pub
set check_signatures=enforce
cat /file.gz
cat /file.xz
cat /file.lzop
set check_signatures=

76
tests/file_filter_test.in Normal file
View file

@ -0,0 +1,76 @@
#! /bin/sh
# Copyright (C) 2014 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
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see <http://www.gnu.org/licenses/>.
set -e
grubshell=@builddir@/grub-shell
. "@builddir@/grub-core/modinfo.sh"
filters="gzio xzio lzopio verify"
modules="cat mpi"
for mod in $(cut -d ' ' -f 2 "@builddir@/grub-core/crypto.lst" | sort -u); do
modules="$modules $mod"
done
for file in file.gz file.xz file.lzop file.gz.sig file.xz.sig file.lzop.sig keys.pub; do
files="$files /$file=@srcdir@/tests/file_filter/$file"
done
# GRUB cat command adds extra newline after file
result="Hello, user!
Hello, user!
Hello, user!"
out="$("${grubshell}" --modules="$modules $filters" --files="$files" "@srcdir@/tests/file_filter/test.cfg")"
if [ "$out" != "$result" ]; then
echo LOCAL FAIL
echo "$out"
exit 1
fi
# Taken from netboot_test
case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
# PLATFORM: emu is different
*-emu)
exit 0;;
# PLATFORM: Flash targets
i386-qemu | i386-coreboot | mips-qemu_mips | mipsel-qemu_mips)
exit 0;;
# FIXME: currently grub-shell uses only -kernel for loongson
mipsel-loongson)
exit 0;;
# FIXME: no rtl8139 support
i386-multiboot)
exit 0;;
# FIXME: We don't fully support netboot on ARC
*-arc)
exit 0;;
# FIXME: Many QEMU firmware have no netboot capability
*-efi | i386-ieee1275 | powerpc-ieee1275 | sparc64-ieee1275)
exit 0;;
esac
out="$("${grubshell}" --boot=net --modules="$modules $filters" --files="$files" "@srcdir@/tests/file_filter/test.cfg")"
if [ "$out" != "$result" ]; then
echo NET FAIL
echo "$out"
exit 1
fi
exit 0

67
tests/grub_cmd_test.in Normal file
View file

@ -0,0 +1,67 @@
#! /bin/bash
# create a randome file
empty="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 1
non_empty="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 1
cat >$non_empty <<EOF
hello world!
EOF
. "@builddir@/grub-core/modinfo.sh"
if [ x"${grub_modinfo_platform}" = xemu ]; then
grub_empty="(host)$empty"
grub_non_empty="(host)$non_empty"
grub_dir="(host)${TMPDIR:-/tmp}"
else
grub_empty="/boot/empty"
grub_non_empty="/boot/non_empty"
grub_dir="/boot/grub"
fi
outfile="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 1
@builddir@/grub-shell --files=$grub_empty=$empty --files=$grub_non_empty=$non_empty>$outfile <<EOF
if ! test -f $grub_empty; then
echo FAIL1
fi
if ! test -e $grub_empty; then
echo FAIL2
fi
if test -d $grub_empty; then
echo FAIL3
fi
if ! test -d $grub_dir; then
echo FAIL4
fi
if test -s $grub_empty; then
echo FAIL5
fi
if ! test -s $grub_non_empty; then
echo FAIL6
fi
if test -f $grub_empty -a foo = bar; then
echo FAIL7
fi
if test -e $grub_empty -a foo = bar; then
echo FAIL8
fi
if test -s $grub_non_empty -a foo = bar; then
echo FAIL9
fi
if test -d $grub_dir -a foo = bar; then
echo FAIL10
fi
EOF
rm -f "$empty" "$non_empty"
if grep FAIL "$outfile" > /dev/null 2>&1; then
echo "GRUB test command file tests failed."
cat "$outfile"
exit 1
else
rm -f "${outfile}"
exit 0
fi

View file

@ -15,5 +15,10 @@ if ! which mkfs.ntfs >/dev/null 2>&1; then
exit 77
fi
if ! which setfattr >/dev/null 2>&1; then
echo "setfattr not installed; cannot test ntfs."
exit 77
fi
"@builddir@/grub-fs-tester" ntfs
"@builddir@/grub-fs-tester" ntfscomp
"@builddir@/grub-fs-tester" ntfscomp

View file

@ -0,0 +1,52 @@
menu hshift 9
menu width 58
menu begin desktop
include stdmenu.cfg
menu hshift 13
menu width 49
menu label Alternative desktop environments
menu title Desktop environment menu
label mainmenu-kde
menu label ^Back..
text help
Higher level options install the GNOME desktop environment
endtext
menu exit
menu begin kde-desktop
include stdmenu.cfg
menu label ^KDE
menu title KDE desktop boot menu
text help
Select the 'K Desktop Environment' for the Desktop task
endtext
label mainmenu-kde
menu label ^Back..
menu exit
include kde/menu.cfg
menu end
menu begin lxde-desktop
include stdmenu.cfg
menu label ^LXDE
menu title LXDE desktop boot menu
text help
Select the 'Lightweight X11 Desktop Environment' for the Desktop task
endtext
label mainmenu-lxde
menu label ^Back..
menu exit
include lxde/menu.cfg
menu end
menu begin xfce-desktop
include stdmenu.cfg
menu label ^Xfce
menu title Xfce desktop boot menu
text help
Select the 'Xfce lightweight desktop environment' for the Desktop task
endtext
label mainmenu-xfce
menu label ^Back..
menu exit
include xfce/menu.cfg
menu end
menu end

View file

@ -0,0 +1,3 @@
label menu
kernel vesamenu.c32
config isolinux.cfg

View file

@ -0,0 +1,12 @@
foreground=0xFFFFFF
background=0x958490
screen-colour=0x270A1E
hidden-timeout=2
label normal=Normal
append normal=
label driverupdates=Use driver update disc
append driverupdates=debian-installer/driver-update=true
applies driverupdates=live live-install
label oem=OEM install (for manufacturers)
append oem=oem-config/enable=true
applies oem=live live-install install

View file

@ -0,0 +1,6 @@
# D-I config version 2.0
include menu.cfg
default vesamenu.c32
prompt 0
timeout 50
ui gfxboot bootlogo

View file

@ -0,0 +1,23 @@
menu hshift 13
menu width 49
menu margin 8
menu title Installer boot menu
include stdmenu.cfg
include txt.cfg
include gtk.cfg
menu begin advanced
menu title Advanced options
include stdmenu.cfg
label mainmenu
menu label ^Back..
menu exit
include adtxt.cfg
include adgtk.cfg
menu end
label help
menu label ^Help
text help
Display help screens; type 'menu' at boot prompt to return to this menu
endtext
config prompt.cfg

View file

@ -0,0 +1,3 @@
[po4a_langs] ar bn ca cs da de es eu fi fr gl hu id it ja ka ko ku lv nb nl pl pt pt_BR ru sk sv ta tr vi zh_CN zh_TW
[po4a_paths] po/help.pot $lang:po/$lang.po
[type:docbook] help.xml

View file

@ -0,0 +1,16 @@
prompt 1
display f1.txt
timeout 50
include menu.cfg
include exithelp.cfg
f1 f1.txt
f2 f2.txt
f3 f3.txt
f4 f4.txt
f5 f5.txt
f6 f6.txt
f7 f7.txt
f8 f8.txt
f9 f9.txt
f0 f10.txt

View file

@ -0,0 +1,4 @@
label rescue
menu label ^Rescue mode
kernel /install/vmlinuz
append vga=788 initrd=/install/initrd.gz rescue/enable=true -- quiet

View file

@ -0,0 +1,15 @@
menu background splash.png
menu color title * #FFFFFFFF *
menu color border * #00000000 #00000000 none
menu color sel * #ffffffff #76a1d0ff *
menu color hotsel 1;7;37;40 #ffffffff #76a1d0ff *
menu color tabmsg * #ffffffff #00000000 *
menu color help 37;40 #ffdddd00 #00000000 none
menu vshift 12
menu rows 10
menu helpmsgrow 15
# The command line must be at least one line from the bottom.
menu cmdlinerow 16
menu timeoutrow 16
menu tabmsgrow 18
menu tabmsg Press ENTER to boot or TAB to edit a menu entry

View file

@ -0,0 +1,19 @@
default live
label live
menu label ^Try Ubuntu without installing
kernel /casper/vmlinuz
append file=/cdrom/preseed/ubuntu.seed boot=casper initrd=/casper/initrd.lz quiet splash --
label live-install
menu label ^Install Ubuntu
kernel /casper/vmlinuz
append file=/cdrom/preseed/ubuntu.seed boot=casper only-ubiquity initrd=/casper/initrd.lz quiet splash --
label check
menu label ^Check disc for defects
kernel /casper/vmlinuz
append boot=casper integrity-check initrd=/casper/initrd.lz quiet splash --
label memtest
menu label Test ^memory
kernel /install/mt86plus
label hd
menu label ^Boot from first hard disk
localboot 0x80

View file

@ -0,0 +1,236 @@
background_image '@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux'/'splash.png'
# D-I config version 2.0
# UNSUPPORTED command 'menu hshift 13'
# UNSUPPORTED command 'menu width 49'
# UNSUPPORTED command 'menu margin 8'
# UNSUPPORTED command 'menu title Installer boot menu'
# UNSUPPORTED command 'menu color title * #FFFFFFFF *'
# UNSUPPORTED command 'menu color border * #00000000 #00000000 none'
# UNSUPPORTED command 'menu color sel * #ffffffff #76a1d0ff *'
# UNSUPPORTED command 'menu color hotsel 1;7;37;40 #ffffffff #76a1d0ff *'
# UNSUPPORTED command 'menu color tabmsg * #ffffffff #00000000 *'
# UNSUPPORTED command 'menu color help 37;40 #ffdddd00 #00000000 none'
# UNSUPPORTED command 'menu vshift 12'
# UNSUPPORTED command 'menu rows 10'
# UNSUPPORTED command 'menu helpmsgrow 15'
# The command line must be at least one line from the bottom.
# UNSUPPORTED command 'menu cmdlinerow 16'
# UNSUPPORTED command 'menu timeoutrow 16'
# UNSUPPORTED command 'menu tabmsgrow 18'
# UNSUPPORTED command 'menu tabmsg Press ENTER to boot or TAB to edit a menu entry'
set timeout=5
default='vesamenu.c32'
menuentry 'Try Ubuntu without installing' --hotkey 't' --id 'live' {
if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
linux$linux_suffix '/'/'/casper/vmlinuz' file=/cdrom/preseed/ubuntu.seed boot=casper initrd=/casper/initrd.lz quiet splash --
initrd$linux_suffix '/'/'/casper/initrd.lz'
}
menuentry 'Install Ubuntu' --hotkey 'i' --id 'live-install' {
if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
linux$linux_suffix '/'/'/casper/vmlinuz' file=/cdrom/preseed/ubuntu.seed boot=casper only-ubiquity initrd=/casper/initrd.lz quiet splash --
initrd$linux_suffix '/'/'/casper/initrd.lz'
}
menuentry 'Check disc for defects' --hotkey 'c' --id 'check' {
if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
linux$linux_suffix '/'/'/casper/vmlinuz' boot=casper integrity-check initrd=/casper/initrd.lz quiet splash --
initrd$linux_suffix '/'/'/casper/initrd.lz'
}
menuentry 'Test memory' --hotkey 'm' --id 'memtest' {
if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
linux$linux_suffix '/'/'/install/mt86plus'
}
menuentry 'Boot from first hard disk' --hotkey 'b' --id 'hd' {
# File (host)/@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux/gtk.cfg not found
# UNSUPPORTED command 'menu begin advanced'
# UNSUPPORTED command 'menu title Advanced options'
# UNSUPPORTED command 'menu color title * #FFFFFFFF *'
# UNSUPPORTED command 'menu color border * #00000000 #00000000 none'
# UNSUPPORTED command 'menu color sel * #ffffffff #76a1d0ff *'
# UNSUPPORTED command 'menu color hotsel 1;7;37;40 #ffffffff #76a1d0ff *'
# UNSUPPORTED command 'menu color tabmsg * #ffffffff #00000000 *'
# UNSUPPORTED command 'menu color help 37;40 #ffdddd00 #00000000 none'
# UNSUPPORTED command 'menu vshift 12'
# UNSUPPORTED command 'menu rows 10'
# UNSUPPORTED command 'menu helpmsgrow 15'
# The command line must be at least one line from the bottom.
# UNSUPPORTED command 'menu cmdlinerow 16'
# UNSUPPORTED command 'menu timeoutrow 16'
# UNSUPPORTED command 'menu tabmsgrow 18'
# UNSUPPORTED command 'menu tabmsg Press ENTER to boot or TAB to edit a menu entry'
root=hd0;
chainloader +1;
}
menuentry 'Back..' --hotkey 'b' --id 'mainmenu' {
# UNSUPPORTED command 'menu exit'
# File (host)/@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux/adgtk.cfg not found
# UNSUPPORTED command 'menu end'
# UNSUPPORTED entry type 0
true;
}
menuentry 'Help' --hotkey 'h' --id 'help' {
# UNSUPPORTED command 'ui gfxboot bootlogo'
#'@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux'/'prompt.cfg' (host)@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux/prompt.cfg:
background_image '@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux/'/'splash.png'
# UNSUPPORTED command 'display f1.txt'
# UNSUPPORTED command 'menu hshift 13'
# UNSUPPORTED command 'menu width 49'
# UNSUPPORTED command 'menu margin 8'
# UNSUPPORTED command 'menu title Installer boot menu'
# UNSUPPORTED command 'menu color title * #FFFFFFFF *'
# UNSUPPORTED command 'menu color border * #00000000 #00000000 none'
# UNSUPPORTED command 'menu color sel * #ffffffff #76a1d0ff *'
# UNSUPPORTED command 'menu color hotsel 1;7;37;40 #ffffffff #76a1d0ff *'
# UNSUPPORTED command 'menu color tabmsg * #ffffffff #00000000 *'
# UNSUPPORTED command 'menu color help 37;40 #ffdddd00 #00000000 none'
# UNSUPPORTED command 'menu vshift 12'
# UNSUPPORTED command 'menu rows 10'
# UNSUPPORTED command 'menu helpmsgrow 15'
# The command line must be at least one line from the bottom.
# UNSUPPORTED command 'menu cmdlinerow 16'
# UNSUPPORTED command 'menu timeoutrow 16'
# UNSUPPORTED command 'menu tabmsgrow 18'
# UNSUPPORTED command 'menu tabmsg Press ENTER to boot or TAB to edit a menu entry'
set timeout=5
default='live'
menuentry 'Try Ubuntu without installing' --hotkey 't' --id 'live' {
if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
linux$linux_suffix '/'/'/casper/vmlinuz' file=/cdrom/preseed/ubuntu.seed boot=casper initrd=/casper/initrd.lz quiet splash --
initrd$linux_suffix '/'/'/casper/initrd.lz'
}
menuentry 'Install Ubuntu' --hotkey 'i' --id 'live-install' {
if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
linux$linux_suffix '/'/'/casper/vmlinuz' file=/cdrom/preseed/ubuntu.seed boot=casper only-ubiquity initrd=/casper/initrd.lz quiet splash --
initrd$linux_suffix '/'/'/casper/initrd.lz'
}
menuentry 'Check disc for defects' --hotkey 'c' --id 'check' {
if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
linux$linux_suffix '/'/'/casper/vmlinuz' boot=casper integrity-check initrd=/casper/initrd.lz quiet splash --
initrd$linux_suffix '/'/'/casper/initrd.lz'
}
menuentry 'Test memory' --hotkey 'm' --id 'memtest' {
if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
linux$linux_suffix '/'/'/install/mt86plus'
}
menuentry 'Boot from first hard disk' --hotkey 'b' --id 'hd' {
# File (host)/@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux//gtk.cfg not found
# UNSUPPORTED command 'menu begin advanced'
# UNSUPPORTED command 'menu title Advanced options'
# UNSUPPORTED command 'menu color title * #FFFFFFFF *'
# UNSUPPORTED command 'menu color border * #00000000 #00000000 none'
# UNSUPPORTED command 'menu color sel * #ffffffff #76a1d0ff *'
# UNSUPPORTED command 'menu color hotsel 1;7;37;40 #ffffffff #76a1d0ff *'
# UNSUPPORTED command 'menu color tabmsg * #ffffffff #00000000 *'
# UNSUPPORTED command 'menu color help 37;40 #ffdddd00 #00000000 none'
# UNSUPPORTED command 'menu vshift 12'
# UNSUPPORTED command 'menu rows 10'
# UNSUPPORTED command 'menu helpmsgrow 15'
# The command line must be at least one line from the bottom.
# UNSUPPORTED command 'menu cmdlinerow 16'
# UNSUPPORTED command 'menu timeoutrow 16'
# UNSUPPORTED command 'menu tabmsgrow 18'
# UNSUPPORTED command 'menu tabmsg Press ENTER to boot or TAB to edit a menu entry'
root=hd0;
chainloader +1;
}
menuentry 'Back..' --hotkey 'b' --id 'mainmenu' {
# UNSUPPORTED command 'menu exit'
# File (host)/@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux//adgtk.cfg not found
# UNSUPPORTED command 'menu end'
# UNSUPPORTED entry type 0
true;
}
menuentry 'Help' --hotkey 'h' --id 'help' {
#'@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux/'/'prompt.cfg' (host)@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux/prompt.cfg:
syslinux_configfile -r '/'/'/' -c '@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux/'/'' '@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux/'/'prompt.cfg'
}
menuentry 'menu' --id 'menu' {
# UNSUPPORTED command 'f1 f1.txt'
# UNSUPPORTED command 'f2 f2.txt'
# UNSUPPORTED command 'f3 f3.txt'
# UNSUPPORTED command 'f4 f4.txt'
# UNSUPPORTED command 'f5 f5.txt'
# UNSUPPORTED command 'f6 f6.txt'
# UNSUPPORTED command 'f7 f7.txt'
# UNSUPPORTED command 'f8 f8.txt'
# UNSUPPORTED command 'f9 f9.txt'
# UNSUPPORTED command 'f0 f10.txt'
#'@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux/'/'isolinux.cfg' (host)@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux/isolinux.cfg:
background_image '@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux//'/'splash.png'
# D-I config version 2.0
# UNSUPPORTED command 'menu hshift 13'
# UNSUPPORTED command 'menu width 49'
# UNSUPPORTED command 'menu margin 8'
# UNSUPPORTED command 'menu title Installer boot menu'
# UNSUPPORTED command 'menu color title * #FFFFFFFF *'
# UNSUPPORTED command 'menu color border * #00000000 #00000000 none'
# UNSUPPORTED command 'menu color sel * #ffffffff #76a1d0ff *'
# UNSUPPORTED command 'menu color hotsel 1;7;37;40 #ffffffff #76a1d0ff *'
# UNSUPPORTED command 'menu color tabmsg * #ffffffff #00000000 *'
# UNSUPPORTED command 'menu color help 37;40 #ffdddd00 #00000000 none'
# UNSUPPORTED command 'menu vshift 12'
# UNSUPPORTED command 'menu rows 10'
# UNSUPPORTED command 'menu helpmsgrow 15'
# The command line must be at least one line from the bottom.
# UNSUPPORTED command 'menu cmdlinerow 16'
# UNSUPPORTED command 'menu timeoutrow 16'
# UNSUPPORTED command 'menu tabmsgrow 18'
# UNSUPPORTED command 'menu tabmsg Press ENTER to boot or TAB to edit a menu entry'
set timeout=5
default='vesamenu.c32'
menuentry 'Try Ubuntu without installing' --hotkey 't' --id 'live' {
if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
linux$linux_suffix '/'/'/casper/vmlinuz' file=/cdrom/preseed/ubuntu.seed boot=casper initrd=/casper/initrd.lz quiet splash --
initrd$linux_suffix '/'/'/casper/initrd.lz'
}
menuentry 'Install Ubuntu' --hotkey 'i' --id 'live-install' {
if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
linux$linux_suffix '/'/'/casper/vmlinuz' file=/cdrom/preseed/ubuntu.seed boot=casper only-ubiquity initrd=/casper/initrd.lz quiet splash --
initrd$linux_suffix '/'/'/casper/initrd.lz'
}
menuentry 'Check disc for defects' --hotkey 'c' --id 'check' {
if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
linux$linux_suffix '/'/'/casper/vmlinuz' boot=casper integrity-check initrd=/casper/initrd.lz quiet splash --
initrd$linux_suffix '/'/'/casper/initrd.lz'
}
menuentry 'Test memory' --hotkey 'm' --id 'memtest' {
if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
linux$linux_suffix '/'/'/install/mt86plus'
}
menuentry 'Boot from first hard disk' --hotkey 'b' --id 'hd' {
# File (host)/@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux///gtk.cfg not found
# UNSUPPORTED command 'menu begin advanced'
# UNSUPPORTED command 'menu title Advanced options'
# UNSUPPORTED command 'menu color title * #FFFFFFFF *'
# UNSUPPORTED command 'menu color border * #00000000 #00000000 none'
# UNSUPPORTED command 'menu color sel * #ffffffff #76a1d0ff *'
# UNSUPPORTED command 'menu color hotsel 1;7;37;40 #ffffffff #76a1d0ff *'
# UNSUPPORTED command 'menu color tabmsg * #ffffffff #00000000 *'
# UNSUPPORTED command 'menu color help 37;40 #ffdddd00 #00000000 none'
# UNSUPPORTED command 'menu vshift 12'
# UNSUPPORTED command 'menu rows 10'
# UNSUPPORTED command 'menu helpmsgrow 15'
# The command line must be at least one line from the bottom.
# UNSUPPORTED command 'menu cmdlinerow 16'
# UNSUPPORTED command 'menu timeoutrow 16'
# UNSUPPORTED command 'menu tabmsgrow 18'
# UNSUPPORTED command 'menu tabmsg Press ENTER to boot or TAB to edit a menu entry'
root=hd0;
chainloader +1;
}
menuentry 'Back..' --hotkey 'b' --id 'mainmenu' {
# UNSUPPORTED command 'menu exit'
# File (host)/@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux///adgtk.cfg not found
# UNSUPPORTED command 'menu end'
# UNSUPPORTED entry type 0
true;
}
menuentry 'Help' --hotkey 'h' --id 'help' {
# UNSUPPORTED command 'ui gfxboot bootlogo'
#'@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux//'/'prompt.cfg' (host)@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux/prompt.cfg:
syslinux_configfile -r '/'/'/' -c '@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux//'/'' '@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux//'/'prompt.cfg'
}
}
}

16
tests/syslinux_test.in Normal file
View file

@ -0,0 +1,16 @@
#!/bin/sh
set -e
outfile="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 1
"@builddir@/grub-syslinux2cfg" -r "@abs_top_srcdir@/tests/syslinux/ubuntu10.04" "@abs_top_srcdir@/tests/syslinux/ubuntu10.04/isolinux/isolinux.cfg" -o "$outfile"
echo "$outfile"
if ! diff -u "$outfile" "@builddir@/tests/syslinux/ubuntu10.04_grub.cfg"; then
echo "Mismatch in ubuntu10.04"
exit 1;
fi
exit 0

View file

@ -1,7 +1,7 @@
#! /bin/bash
# create a randome file
file=`mktemp`
file="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 1
cat >$file <<EOF
hello world!
EOF
@ -15,12 +15,12 @@ else
fi
outfile1=`mktemp`
outfile1="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 1
@builddir@/grub-shell --files=/boot/grub/file=$file >$outfile1 <<EOF
sha512sum $grub_file
EOF
outfile2=`mktemp`
outfile2="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 1
sha512sum $file >$outfile2
SHA1=`cat $outfile1 | tr -d '\n' | cut -f1 -d\ `

View file

@ -102,7 +102,7 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE +
# OS LIMITATION: Linux oopses with >=32768K
MAXBLKSIZE=$((16384*1024))
;;
x"lvm_raid4" | x"lvm_raid5" | x"lvm_raid6")
x"lvm_raid1"* | x"lvm_raid4" | x"lvm_raid5" | x"lvm_raid6")
# OS LIMITATION: Linux crashes with less than 16384
MINBLKSIZE=16384
# Could go further but what's the point?
@ -166,7 +166,7 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE +
x"zfs_raidz" | x"zfs_stripe" | x"zfs_mirror" | xbtrfs_raid0 \
| xbtrfs_raid1 | x"mdraid"*"_raid4" | x"mdraid"*"_raid5" \
| x"mdraid"*"_linear" \
| x"mdraid"*"_raid10" | xlvm_mirror1 | xlvm_mirrorall)
| x"mdraid"*"_raid10" | xlvm_raid1* | xlvm_mirror1 | xlvm_mirrorall)
MINDEVICES=2
MAXDEVICES=7
;;
@ -199,7 +199,7 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE +
case x$fs in
# RAID 1 has to work with even one device of the set.
xzfs_mirror | x"mdraid"*"_raid1" | xlvm_mirrorall)
xzfs_mirror | x"mdraid"*"_raid1" | xlvm_mirrorall | xlvm_raid1all)
NEED_IMAGES_N=1;;
# Degrade raidz by removing 3 devices
xzfs_raidz3)
@ -210,7 +210,7 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE +
# Degrade raidz and btrfs RAID1 by removing one device
xbtrfs_raid1 | xbtrfs_raid10 | xzfs_raidz | x"mdraid"*"_raid4" \
| x"mdraid"*"_raid5" | x"mdraid"*"_raid10" | xlvm_mirror1 \
| x"lvm_raid4" | x"lvm_raid5")
| x"lvm_raid1" | x"lvm_raid4" | x"lvm_raid5")
NEED_IMAGES_N=$((NDEVICES-1));;
*)
NEED_IMAGES_N=$NDEVICES;;
@ -283,7 +283,7 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE +
#FSLABEL="g;/_é莭莽😁кит u"
;;
# FS LIMITATION: reiserfs, extN and jfs label is at most 16 UTF-8 characters
x"reiserfs_old" | x"reiserfs" | x"ext2" | xext2_old | x"ext3" | x"ext4" | x"lvm"* | x"mdraid"* | x"jfs" | x"jfs_caseins")
x"reiserfs_old" | x"reiserfs" | x"ext"* | x"lvm"* | x"mdraid"* | x"jfs" | x"jfs_caseins")
FSLABEL="g;/éт 莭😁";;
# FS LIMITATION: No underscore, space, semicolon, slash or international characters in UFS* in label. Limited to 32 UTF-8 characters
x"ufs1" | x"ufs1_sun" | x"ufs2")
@ -730,10 +730,15 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE +
lvcreate -l "$((NDEVICES*7*LVMBLKMUL))" -n testvol grub_test
elif [ x$fs = xlvm_stripe ] ; then
lvcreate -l "$((NDEVICES*7*LVMBLKMUL))" -i "$NDEVICES" -n testvol grub_test
elif [ x$fs = xlvm_mirror1 ] ; then
lvcreate -m 1 -l "$((NDEVICES*2*LVMBLKMUL))" -n testvol grub_test
elif [ x$fs = xlvm_mirror1 ] || [ x$fs = xlvm_raid1 ] ; then
lvcreate -m 1 -l "$((NDEVICES*2*LVMBLKMUL))" --type "${fs/lvm_/}" -n testvol grub_test
elif [ x$fs = xlvm_mirrorall ] ; then
lvcreate -m "$((NDEVICES-1))" -l "$((6*LVMBLKMUL))" -n testvol grub_test
lvcreate -m "$((NDEVICES-1))" -l "$((6*LVMBLKMUL))" --type mirror -n testvol grub_test
elif [ x$fs = xlvm_raid1all ] ; then
# Until version 2.02.103 LVM counts metadata segments
# twice when checking available space. Reduce segment
# count to work around it.
lvcreate -m "$((NDEVICES-1))" -l "$((6*LVMBLKMUL - 1))" --type raid1 -n testvol grub_test
elif [ x$fs = xlvm_raid4 ] || [ x$fs = xlvm_raid5 ]; then
lvcreate -l "$(((NDEVICES-1) * 5*LVMBLKMUL))" -i "$((NDEVICES-1))" --type "${fs/lvm_/}" -n testvol grub_test
elif [ x$fs = xlvm_raid6 ]; then
@ -748,6 +753,10 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE +
MKE2FS_DEVICE_SECTSIZE=$SECSIZE "mkfs.ext2" -r 0 -b $BLKSIZE -L "$FSLABEL" -q "${LODEVICES[0]}"
MOUNTFS=ext2
;;
xext4_metabg)
MKE2FS_DEVICE_SECTSIZE=$SECSIZE "mkfs.ext4" -O meta_bg,^resize_inode -b $BLKSIZE -L "$FSLABEL" -q "${LODEVICES[0]}"
MOUNTFS=ext4
;;
xext*)
MKE2FS_DEVICE_SECTSIZE=$SECSIZE "mkfs.$fs" -b $BLKSIZE -L "$FSLABEL" -q "${LODEVICES[0]}" ;;
xxfs)
@ -991,6 +1000,7 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE +
fi
sleep 1;
done
UMOUNT_TIME=$(date -u "+%Y-%m-%d %H:%M:%S")
sleep 1
vgchange -a n grub_test
;;
@ -1002,6 +1012,7 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE +
fi
sleep 1;
done
UMOUNT_TIME=$(date -u "+%Y-%m-%d %H:%M:%S")
sleep 1
mdadm --stop /dev/md/"${fs}_$NDEVICES"
;;
@ -1212,10 +1223,15 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE +
case x$fs in
xiso9660 | xziso9660 | xrockridge | xjoliet | xrockridge_joliet | xiso9660_1999 | xrockridge_1999 | xjoliet_1999 | xrockridge_joliet_1999)
FSTIME="$(date -d "$(echo ${FSUUID} | awk -F - '{ print $1"-"$2"-"$3" "$4":"$5":"$6 ;}')" '+%Y-%m-%d %H:%M:%S')";;
xlvm*|xmdraid*)
# With some abstractions like mdraid flushing to disk
# may be delayed for a long time.
FSTIME="$UMOUNT_TIME";;
*)
FSTIME="$(TZ=UTC ls --time-style="+%Y-%m-%d_%H:%M:%S" -l -d "${FSIMAGES[0]}"|awk '{print $6; }'|sed 's,_, ,g')";;
esac
# With some abstractions like mdraid it may take up to 2 seconds for the data to reach the disks after it was flushed by FS in these tests.
# With some abstractions like mdraid computing of UMOUNT_TIME
# is not precise. Account for small difference here.
FSTIMEM1="$(date -d "$FSTIME UTC -1 second" -u "+%Y-%m-%d %H:%M:%S")"
FSTIMEM2="$(date -d "$FSTIME UTC -2 second" -u "+%Y-%m-%d %H:%M:%S")"

View file

@ -349,6 +349,7 @@ fi
if [ x$boot != xnet ] && [ x$boot != xemu ]; then
pkgdatadir="@builddir@" "@builddir@/grub-mkrescue" "--output=${isofile}" "--override-directory=${builddir}/grub-core" \
--rom-directory="${rom_directory}" \
--locale-directory="@srcdir@/po" \
--themes-directory="@srcdir@/themes" \
$mkimage_extra_arg ${mkrescue_args} \
"/boot/grub/grub.cfg=${cfgfile}" "/boot/grub/testcase.cfg=${source}" \
@ -422,11 +423,28 @@ do_trim ()
fi
}
copy_extra_files() {
_destdir="$1"
shift
# FIXME support '=' in file names
for _file in "$@"; do
_target="${_file%=*}"
_source="${_file#*=}"
[ -n "$_source" ] || _source="$_target"
_target="$_destdir/$_target"
_targetdir="$(dirname "$_target")"
[ -d "$_targetdir" ] || mkdir -p "$_targetdir"
cp "$_source" "$_target"
done
}
if [ x$boot = xnet ]; then
netdir=`mktemp -d "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1
pkgdatadir="@builddir@" "@builddir@/grub-mknetdir" "--grub-mkimage=${builddir}/grub-mkimage" "--directory=${builddir}/grub-core" "--net-directory=$netdir" ${mkrescue_args} > /dev/null
cp "${cfgfile}" "$netdir/boot/grub/grub.cfg"
cp "${source}" "$netdir/boot/grub/testcase.cfg"
[ -z "$files" ] || copy_extra_files "$netdir" $files
timeout -s KILL $timeout "${qemu}" ${qemuopts} ${serial_null} -serial file:/dev/stdout -boot n -net "user,tftp=$netdir,bootfile=/boot/grub/${grub_modinfo_target_cpu}-${grub_modinfo_platform}/core.$netbootext" -net nic | cat | tr -d "\r" | do_trim
elif [ x$boot = xemu ]; then
grubdir="$(mktemp -d "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX")"