Browse Source

Always update the PnP checksum, even if the ident string is not being set.

tags/v0.9.3
Michael Brown 18 years ago
parent
commit
028bc034e4
1 changed files with 6 additions and 4 deletions
  1. 6
    4
      src/util/makerom.pl

+ 6
- 4
src/util/makerom.pl View File

88
 				= pack('v', oct($pci_device_id)) if ($pci_device_id);
88
 				= pack('v', oct($pci_device_id)) if ($pci_device_id);
89
 		}
89
 		}
90
 	}
90
 	}
91
-	if ($pnp_hdr_offset > 0 and defined($identoffset)) {
92
-		# Point to device id string at end of ROM image
93
-		substr($$romref, $pnp_hdr_offset+PNP_DEVICE_OFF, 2)
94
-			= pack('v', $identoffset);
91
+	if ($pnp_hdr_offset > 0) {
92
+		if (defined($identoffset)) {
93
+			# Point to device id string at end of ROM image
94
+			substr($$romref, $pnp_hdr_offset+PNP_DEVICE_OFF, 2)
95
+				= pack('v', $identoffset);
96
+		}
95
 		substr($$romref, $pnp_hdr_offset+PNP_CHKSUM_OFF, 1) = "\x00";
97
 		substr($$romref, $pnp_hdr_offset+PNP_CHKSUM_OFF, 1) = "\x00";
96
 		my $sum = unpack('%8C*', substr($$romref, $pnp_hdr_offset,
98
 		my $sum = unpack('%8C*', substr($$romref, $pnp_hdr_offset,
97
 			PNP_HDR_SIZE));
99
 			PNP_HDR_SIZE));

Loading…
Cancel
Save