~ubuntu-branches/ubuntu/vivid/parted/vivid

« back to all changes in this revision

Viewing changes to tests/gpt-header-munge

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2014-07-30 13:16:15 UTC
  • mfrom: (7.2.34 sid)
  • Revision ID: package-import@ubuntu.com-20140730131615-6uy87mosal6722s6
Tags: 3.2-1
* New upstream release.
* Drop currently-unused build-dependency on po4a (thanks, Johannes
  Schauer).

Show diffs side-by-side

added added

removed removed

Lines of Context:
107
107
    }
108
108
 
109
109
  # Save a copy of the CRC, then zero that field, bytes 16..19:
110
 
  my $orig_crc = unpack ('L', substr ($buf, 16, 4));
 
110
  my $orig_crc = unpack ('L<', substr ($buf, 16, 4));
111
111
  substr ($buf, 16, 4) = "\0" x 4;
112
112
 
113
113
  # Compute CRC32 of header: it'd better match.
133
133
 
134
134
  # Compute CRC of primary partition array and put it in substr ($pri, 88, 4)
135
135
  my $pa_crc = partition_array_crc $pri_or_backup, $n_pe, $in;
136
 
  substr ($$buf, 88, 4) = pack ('L', $pa_crc);
 
136
  substr ($$buf, 88, 4) = pack ('L<', $pa_crc);
137
137
 
138
138
  # In the backup header, we must also set the 8-byte "Partition entries
139
139
  # starting LBA number" field to reflect our new value of $n_pe.
151
151
  # slot into which we'll store the result.
152
152
  substr ($$buf, 16, 4) = "\0" x 4;
153
153
  my $crc = crc32($$buf);
154
 
  substr ($$buf, 16, 4) = pack ('L', $crc);
 
154
  substr ($$buf, 16, 4) = pack ('L<', $crc);
155
155
}
156
156
 
157
157
sub usage ($)