Pino Toscano
2014-May-09 09:01 UTC
[Libguestfs] [PATCH 1/2] tests/syslinux: factorize search for mbr.bin
--- tests/syslinux/test-syslinux.pl | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/tests/syslinux/test-syslinux.pl b/tests/syslinux/test-syslinux.pl index d86c095..8a227d4 100755 --- a/tests/syslinux/test-syslinux.pl +++ b/tests/syslinux/test-syslinux.pl @@ -29,13 +29,20 @@ my $bootloader = $ENV{BOOTLOADER} || "syslinux"; my $disk = "$bootloader-guest.img"; # Find prerequisites. -my $mbr = "/usr/share/syslinux/mbr.bin"; -unless (-f $mbr) { - $mbr = "/usr/lib/syslinux/mbr.bin"; - unless (-f $mbr) { - print "$0: mbr.bin (from SYSLINUX) not found, skipping test\n"; - exit 77; - } +my $mbr; +my @mbr_paths = ( + "/usr/share/syslinux/mbr.bin", + "/usr/lib/syslinux/mbr.bin" +); +foreach my $m (@mbr_paths) { + if (-f $m) { + $mbr = $m; + last; + } +} +if (not length ($mbr)) { + print "$0: mbr.bin (from SYSLINUX) not found, skipping test\n"; + exit 77; } print "mbr: $mbr\n"; -- 1.9.0
Pino Toscano
2014-May-09 09:01 UTC
[Libguestfs] [PATCH 2/2] tests/syslinux: add new syslinux 6+ path of mbr.bin
Reported in https://bugs.debian.org/746748. --- tests/syslinux/test-syslinux.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/syslinux/test-syslinux.pl b/tests/syslinux/test-syslinux.pl index 8a227d4..a0db963 100755 --- a/tests/syslinux/test-syslinux.pl +++ b/tests/syslinux/test-syslinux.pl @@ -32,7 +32,8 @@ my $disk = "$bootloader-guest.img"; my $mbr; my @mbr_paths = ( "/usr/share/syslinux/mbr.bin", - "/usr/lib/syslinux/mbr.bin" + "/usr/lib/syslinux/mbr.bin", + "/usr/lib/syslinux/mbr/mbr.bin" ); foreach my $m (@mbr_paths) { if (-f $m) { -- 1.9.0
Richard W.M. Jones
2014-May-09 09:55 UTC
Re: [Libguestfs] [PATCH 1/2] tests/syslinux: factorize search for mbr.bin
On Fri, May 09, 2014 at 11:01:49AM +0200, Pino Toscano wrote:> --- > tests/syslinux/test-syslinux.pl | 21 ++++++++++++++------- > 1 file changed, 14 insertions(+), 7 deletions(-) > > diff --git a/tests/syslinux/test-syslinux.pl b/tests/syslinux/test-syslinux.pl > index d86c095..8a227d4 100755 > --- a/tests/syslinux/test-syslinux.pl > +++ b/tests/syslinux/test-syslinux.pl > @@ -29,13 +29,20 @@ my $bootloader = $ENV{BOOTLOADER} || "syslinux"; > my $disk = "$bootloader-guest.img"; > > # Find prerequisites. > -my $mbr = "/usr/share/syslinux/mbr.bin"; > -unless (-f $mbr) { > - $mbr = "/usr/lib/syslinux/mbr.bin"; > - unless (-f $mbr) { > - print "$0: mbr.bin (from SYSLINUX) not found, skipping test\n"; > - exit 77; > - } > +my $mbr; > +my @mbr_paths = ( > + "/usr/share/syslinux/mbr.bin", > + "/usr/lib/syslinux/mbr.bin" > +); > +foreach my $m (@mbr_paths) { > + if (-f $m) { > + $mbr = $m; > + last; > + } > +} > +if (not length ($mbr)) {unless (defined $mbr) {> + print "$0: mbr.bin (from SYSLINUX) not found, skipping test\n"; > + exit 77; > } > print "mbr: $mbr\n";ACK w/ that change. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top
Richard W.M. Jones
2014-May-09 09:55 UTC
Re: [Libguestfs] [PATCH 2/2] tests/syslinux: add new syslinux 6+ path of mbr.bin
On Fri, May 09, 2014 at 11:01:50AM +0200, Pino Toscano wrote:> Reported in https://bugs.debian.org/746748. > --- > tests/syslinux/test-syslinux.pl | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/tests/syslinux/test-syslinux.pl b/tests/syslinux/test-syslinux.pl > index 8a227d4..a0db963 100755 > --- a/tests/syslinux/test-syslinux.pl > +++ b/tests/syslinux/test-syslinux.pl > @@ -32,7 +32,8 @@ my $disk = "$bootloader-guest.img"; > my $mbr; > my @mbr_paths = ( > "/usr/share/syslinux/mbr.bin", > - "/usr/lib/syslinux/mbr.bin" > + "/usr/lib/syslinux/mbr.bin", > + "/usr/lib/syslinux/mbr/mbr.bin" > ); > foreach my $m (@mbr_paths) { > if (-f $m) { > -- > 1.9.0ACK. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW
Seemingly Similar Threads
- [extlinux] mbr.bin starts windows?
- [PATCH] isohybrid: Generate MBR even when in EFI mode
- [PATCH] Update diag/mbr instruction to match the current filename.
- [PATCH 0/3] v2: mbr: Ctrl-key press forces load from first hard disk
- Report: Acer Travelmat stupid MBR check