[PATCH] ISO Scan: Use volume set id instead of volume id for some wrong images.

Some RHEL ISO images store the infomation of volume id in the location of volume set id mistakenly. But it's better to support those ISO images since they're already public available. For details, please see: isoinfo -d -i rhel-server-6.5-ppc64-dvd.iso CD-ROM is in ISO 9660 format System id: PPC Volume id: RED_HAT Volume set id: RHEL_6.5 ppc64 Publisher id: Data preparer id: Application id: RHEL_6.5 ppc64 Copyright File id: Abstract File id: Bibliographic File id: Volume set size is: 1 Volume set sequence number is: 1 Logical block size is: 2048 Volume size is: 1634718 Joliet with UCS level 3 found Signed-off-by: Mark Wu <wudxw@linux.vnet.ibm.com> --- src/kimchi/isoinfo.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/kimchi/isoinfo.py b/src/kimchi/isoinfo.py index 8d423ad..b7315e0 100644 --- a/src/kimchi/isoinfo.py +++ b/src/kimchi/isoinfo.py @@ -235,7 +235,16 @@ class IsoImage(object): raise IsoFormatError("KCHISO0006E", {'filename': self.path}) if vd_ident != 'CD001' or vd_ver != 1: raise IsoFormatError("KCHISO0007E", {'filename': self.path}) - self.volume_id = vol_id + if vol_id.strip() == 'RED_HAT': + # Some RHEL ISO images store the infomation of volume id in the + # location of volume set id mistakenly. + self.volume_id = self._get_volume_set_id(data) + else: + self.volume_id = vol_id + + def _get_volume_set_id(self, data): + # The index is picked from ISO-9660 specification. + return data[190: 318] def _get_iso_data(self, offset, size): if self.remote: -- 1.8.4.2

Reviewed-by: Royce Lv<lvroyce@linux.vnet.ibm.com> On 2014年03月12日 14:30, Mark Wu wrote:
Some RHEL ISO images store the infomation of volume id in the location of volume set id mistakenly. But it's better to support those ISO images since they're already public available. For details, please see:
isoinfo -d -i rhel-server-6.5-ppc64-dvd.iso CD-ROM is in ISO 9660 format System id: PPC Volume id: RED_HAT Volume set id: RHEL_6.5 ppc64 Publisher id: Data preparer id: Application id: RHEL_6.5 ppc64 Copyright File id: Abstract File id: Bibliographic File id: Volume set size is: 1 Volume set sequence number is: 1 Logical block size is: 2048 Volume size is: 1634718 Joliet with UCS level 3 found
Signed-off-by: Mark Wu <wudxw@linux.vnet.ibm.com> --- src/kimchi/isoinfo.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/kimchi/isoinfo.py b/src/kimchi/isoinfo.py index 8d423ad..b7315e0 100644 --- a/src/kimchi/isoinfo.py +++ b/src/kimchi/isoinfo.py @@ -235,7 +235,16 @@ class IsoImage(object): raise IsoFormatError("KCHISO0006E", {'filename': self.path}) if vd_ident != 'CD001' or vd_ver != 1: raise IsoFormatError("KCHISO0007E", {'filename': self.path}) - self.volume_id = vol_id + if vol_id.strip() == 'RED_HAT': + # Some RHEL ISO images store the infomation of volume id in the + # location of volume set id mistakenly. + self.volume_id = self._get_volume_set_id(data) + else: + self.volume_id = vol_id + + def _get_volume_set_id(self, data): + # The index is picked from ISO-9660 specification. + return data[190: 318]
def _get_iso_data(self, offset, size): if self.remote:

Reviewed-by: Shu Ming <shuming@linux.vnet.ibm.com> 2014/3/12 14:30, Mark Wu:
Some RHEL ISO images store the infomation of volume id in the location of volume set id mistakenly. But it's better to support those ISO images since they're already public available. For details, please see:
isoinfo -d -i rhel-server-6.5-ppc64-dvd.iso CD-ROM is in ISO 9660 format System id: PPC Volume id: RED_HAT Volume set id: RHEL_6.5 ppc64 Publisher id: Data preparer id: Application id: RHEL_6.5 ppc64 Copyright File id: Abstract File id: Bibliographic File id: Volume set size is: 1 Volume set sequence number is: 1 Logical block size is: 2048 Volume size is: 1634718 Joliet with UCS level 3 found
Signed-off-by: Mark Wu <wudxw@linux.vnet.ibm.com> --- src/kimchi/isoinfo.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/kimchi/isoinfo.py b/src/kimchi/isoinfo.py index 8d423ad..b7315e0 100644 --- a/src/kimchi/isoinfo.py +++ b/src/kimchi/isoinfo.py @@ -235,7 +235,16 @@ class IsoImage(object): raise IsoFormatError("KCHISO0006E", {'filename': self.path}) if vd_ident != 'CD001' or vd_ver != 1: raise IsoFormatError("KCHISO0007E", {'filename': self.path}) - self.volume_id = vol_id + if vol_id.strip() == 'RED_HAT': + # Some RHEL ISO images store the infomation of volume id in the + # location of volume set id mistakenly. + self.volume_id = self._get_volume_set_id(data) + else: + self.volume_id = vol_id + + def _get_volume_set_id(self, data): + # The index is picked from ISO-9660 specification. + return data[190: 318]
def _get_iso_data(self, offset, size): if self.remote:

Applied. Thanks. Regards, Aline Manera
participants (4)
-
Aline Manera
-
Mark Wu
-
Royce Lv
-
Shu Ming