diff options
author | 2017-04-25 03:31:15 -0700 | |
---|---|---|
committer | 2017-05-22 06:48:08 +0000 | |
commit | bb756eebdac6fd24e8919e2c43f7d2c8c4091f59 (patch) | |
tree | ca11e03542edf2d8f631efeca5e1626d211107e3 /qemu/roms/ipxe/src/util/padimg.pl | |
parent | a14b48d18a9ed03ec191cf16b162206998a895ce (diff) |
Adding qemu as a submodule of KVMFORNFV
This Patch includes the changes to add qemu as a submodule to
kvmfornfv repo and make use of the updated latest qemu for the
execution of all testcase
Change-Id: I1280af507a857675c7f81d30c95255635667bdd7
Signed-off-by:RajithaY<rajithax.yerrumsetty@intel.com>
Diffstat (limited to 'qemu/roms/ipxe/src/util/padimg.pl')
-rwxr-xr-x | qemu/roms/ipxe/src/util/padimg.pl | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/qemu/roms/ipxe/src/util/padimg.pl b/qemu/roms/ipxe/src/util/padimg.pl deleted file mode 100755 index 4421aaf4b..000000000 --- a/qemu/roms/ipxe/src/util/padimg.pl +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/perl -w - -use strict; -use warnings; -use Getopt::Long; -use Fcntl; - -my $verbosity = 0; -my $blksize = 512; -my $byte = 0; - -my %opts = ( - 'verbose|v+' => sub { $verbosity++; }, - 'quiet|q+' => sub { $verbosity--; }, - 'blksize|s=o' => sub { $blksize = $_[1]; }, - 'byte|b=o' => sub { $byte = $_[1]; }, -); - -Getopt::Long::Configure ( 'bundling', 'auto_abbrev' ); -GetOptions ( %opts ) or die "Could not parse command-line options\n"; - -while ( my $filename = shift ) { - die "$filename is not a file\n" unless -f $filename; - my $oldsize = -s $filename; - my $padsize = ( ( -$oldsize ) % $blksize ); - my $newsize = ( $oldsize + $padsize ); - next unless $padsize; - if ( $verbosity >= 1 ) { - printf "Padding %s from %d to %d bytes with %d x 0x%02x\n", - $filename, $oldsize, $newsize, $padsize, $byte; - } - if ( $byte ) { - sysopen ( my $fh, $filename, ( O_WRONLY | O_APPEND ) ) - or die "Could not open $filename for appending: $!\n"; - syswrite $fh, ( chr ( $byte ) x $padsize ) - or die "Could not append to $filename: $!\n"; - close ( $fh ); - } else { - truncate $filename, $newsize - or die "Could not resize $filename: $!\n"; - } - die "Failed to pad $filename\n" - unless ( ( ( -s $filename ) % $blksize ) == 0 ); -} |