summaryrefslogtreecommitdiff
path: root/gfxtest
diff options
context:
space:
mode:
authorSteffen Winterfeldt <wfeldt@opensuse.org>2009-07-08 12:02:59 +0200
committerSteffen Winterfeldt <wfeldt@opensuse.org>2009-07-08 12:02:59 +0200
commit50546c463b7c66d124095e0fa0a46db49574692a (patch)
treeda44444368b17d697806eac363629da26be89d87 /gfxtest
parentec8497fe286dcaf579836e1ce7808dace8d2ce34 (diff)
- improved gfxtest script; removed old test script
- added --version option to gfxboot
Diffstat (limited to 'gfxtest')
-rwxr-xr-xgfxtest181
1 files changed, 22 insertions, 159 deletions
diff --git a/gfxtest b/gfxtest
index 766182c..9f185d0 100755
--- a/gfxtest
+++ b/gfxtest
@@ -15,184 +15,45 @@ function switch_disk {
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-function gfxtest_cdrom {
+function gfxtest_isolinux {
set -f
- ./gfxboot --test --preview --archive $opt_archive -b isolinux --cdrom $gfxboot_args $gfxboot_x_args
+ ./gfxboot -b isolinux --cdrom \
+ --test --preview --archive $opt_archive $gfxboot_args \
+ --test-add-files $add_files --test-rm-files gfxtest.config $rm_files $gfxboot_x_args
set +f
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-function gfxtest_grub {
+function gfxtest_syslinux {
set -f
- ./gfxboot --test --preview --archive $opt_archive -b grub $gfxboot_args $gfxboot_x_args
+ ./gfxboot -b syslinux \
+ --test --preview --archive $opt_archive $gfxboot_args \
+ --test-add-files $add_files --test-rm-files gfxtest.config $rm_files $gfxboot_x_args
set +f
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-function gfxtest_lilo {
+function gfxtest_grub {
set -f
- ./gfxboot --test --preview --archive $opt_archive -b lilo $gfxboot_args $gfxboot_x_args
+ ./gfxboot -b grub \
+ --test --preview --archive $opt_archive $gfxboot_args \
+ --test-add-files $add_files --test-rm-files gfxtest.config $rm_files $gfxboot_x_args
set +f
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-function tst_lilo {
- bin="test/lilo.rpm"
- src="test/$1"
- dst="$tmp/$1"
- img="$tmp/$1.img"
- vm_src=test/vm
- vm_tmp=tmp/$1.vm
-
- rm -rf $dst $vm_tmp
- rm -f $img
-
- mkdir -p $dst/boot
- cp -a $src/* $dst/boot
- cp -a $logo $dst/boot/message
-
- for i in /boot/vmlinuz /boot/initrd ; do
- [ -f $i ] && cp --parents $i $dst
- done
-
- test/hdimg $img
-
- sw 0 mount -oloop=/dev/loop7,offset=32256 $img /mnt
- sw 0 cp -r $dst/* /mnt
- sw 0 losetup /dev/loop6 $img
- sw 0 $bin/sbin/lilo -w -C /mnt/boot/lilo.conf -m /mnt/boot/map
- sw 0 losetup -d /dev/loop6
- sw 0 umount /mnt
-
- if [ "$program" = vmware ] ; then
- # vmware
- cp -a $vm_src $vm_tmp
- perl -pi -e "s/^\s*#\s*(ide1:0.startConnected)/\$1/" $vm_tmp/gfxboot.vmx
- perl -pi -e "s:<floppyimage>:`pwd`/$img:g" $vm_tmp/gfxboot.vmx
- vmware -qx $vm_tmp/gfxboot.vmx
- elif [ "$program" = qemu ] ; then
- # qemu
- $qemu -boot c -hda $img
- elif [ "$program" = bd ] ; then
- # bochs debug wrapper
- bd $img
- elif [ "$program" = bochs ] ; then
- # bochs
- bochs -q 'boot: a' "floppya: image=$img, status=inserted" 'log: /dev/null' 'ata0-master: type=disk, path=/dev/null' 'parport1: enabled=0'
- else
- echo -e "\n*** Error: $program not supported ***\n"
- fi
-}
-
-
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-function tst_grub {
- bin="test/grub.rpm"
- src="test/$1"
- dst="$tmp/$1"
- img="$tmp/$1.img"
- vm_src=test/vm
- vm_tmp=tmp/$1.vm
-
- rm -rf $dst $vm_tmp
- rm -f $img
-
- mkdir -p $dst/boot
- cp -a $src/* $dst/boot
- cp $bin/usr/lib/grub/{fat_stage1_5,stage1,stage2} $dst/boot/grub
- cp -a $logo $dst/boot/message
- for i in /boot/vmlinuz /boot/initrd ; do
- [ -f $i ] && cp --parents $i $dst
- done
-
- sh -c "echo '(hd0) $img' >$dst/boot/grub/device.map"
-
- test/hdimg $img
-
- sw 0 mount -oloop,offset=32256 "$img" /mnt
- sw 0 cp -r $dst/* /mnt
- sw 0 umount /mnt
-
- echo "setup --prefix=/boot/grub (hd0,0) (hd0,0)" | \
- $bin/usr/sbin/grub --batch --config-file=$dst/boot/grub/menu.lst --device-map=$dst/boot/grub/device.map
- echo
-
- if [ "$program" = vmware ] ; then
- # vmware
- #cp -a $vm_src $vm_tmp
- #perl -pi -e "s/^\s*#\s*(ide1:0.startConnected)/\$1/" $vm_tmp/gfxboot.vmx
- #perl -pi -e "s:<floppyimage>:`pwd`/$img:g" $vm_tmp/gfxboot.vmx
- #vmplayer $vm_tmp/gfxboot.vmx
- vm --vm vmplayer --disk $img
- elif [ "$program" = qemu ] ; then
- # qemu
- $qemu -boot c -hda $img
- elif [ "$program" = bd ] ; then
- # bochs debug wrapper
- bd $img
- elif [ "$program" = bochs ] ; then
- # bochs
- bochs -q 'boot: a' "floppya: image=$img, status=inserted" 'log: /dev/null' 'ata0-master: type=disk, path=/dev/null' 'parport1: enabled=0'
- else
- echo -e "\n*** Error: $program not supported \n"
- fi
-}
-
-
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-function tst_syslinux {
- bin="test/syslinux.rpm"
- src="test/$1"
- dst="$tmp/$1"
- img="$tmp/$1.img"
- vm_src=test/vm
- vm_tmp=tmp/$1.vm
- syslx=$bin/usr/bin/syslinux-nomtools
-
- rm -rf $dst $vm_tmp
- rm -f $img*
-
- mkdir -p $dst
- cp -a $src/* $dst
- cp -a $logo $dst/bootlogo
-
- rm -f $dst/*~
- bin/unpack_bootlogo $dst
-
- sw 0 test/mkbootdisk --syslinux=$syslx --out=${img}_ $dst
-
- sw 0 chown --reference=tmp $img*
-
- cp $dst.img_01 $img
-
- if [ "$program" = vmware ] ; then
- # vmware
- cp -a $vm_src $vm_tmp
- perl -pi -e "s/^\s*#\s*(ide1:0.startConnected)/\$1/" $vm_tmp/gfxboot.vmx
- perl -pi -e "s:<floppyimage>:`pwd`/$img:g" $vm_tmp/gfxboot.vmx
- vmware -qx $vm_tmp/gfxboot.vmx
- elif [ "$program" = qemu ] ; then
- # qemu
- $qemu -boot a -fda $img
- elif [ "$program" = bd ] ; then
- # bochs debug wrapper
- bd $img
- elif [ "$program" = bochs ] ; then
- # bochs
- bochs -q 'boot: a' "floppya: image=$img, status=inserted" 'log: /dev/null' 'ata0-master: type=disk, path=/dev/null' 'parport1: enabled=0'
- else
- echo -e "\n*** Error: $program not supported ***\n"
- fi
+function gfxtest_lilo {
+ set -f
+ ./gfxboot -b lilo \
+ --test --preview --archive $opt_archive $gfxboot_args \
+ --test-add-files $add_files --test-rm-files gfxtest.config $rm_files $gfxboot_x_args
+ set +f
}
-
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function usage {
@@ -254,8 +115,6 @@ case "$1" in
*) what="$1" ; shift ;;
esac
-gfxboot_x_args="$@"
-
if [ ! -d "$test_dir/$what" ] ; then
echo "config directory missing: $what"
exit 1
@@ -263,6 +122,8 @@ else
[ -f "$test_dir/$what/gfxtest.config" ] && . "$test_dir/$what/gfxtest.config"
fi
+gfxboot_x_args="$args $@"
+
opt_theme=${opt_theme:-openSUSE}
if [ ! -d "themes/$opt_theme" ] ; then
echo "no such theme: $opt_theme"
@@ -277,6 +138,8 @@ case "$opt_type" in
*) echo "unsupported type: $opt_type" ; exit 1 ;;
esac
+add_files=`echo $test_dir/$what/*`
+
[ -x gfxboot-compile ] || {
echo "error: gfxboot-compile missing. Run 'make' first."
exit 2