0

In an automated process an iso file is created with mkisofs. Even, as the original data is excactly the same, the resulting iso files are not the same (their md5sum changes). Since I rsync --checksum the result, I dislike that the "same iso" is of course retransferred every time. I expect mostly timestamps to be the main difference.

Is there some libfaketime buildin switch to generate an iso via mkisofs that would indeed be the same.

I do not know if only timestamps matter? I have compared the resulting iso files with their xxd isofile output like this:

diff --side-by-side  --suppress-common-lines <(xxd a.iso) <(xxd b.iso )

and there seem to be only 51 lines representing 16 Bytes (so roughly 800 Bytes of difference) in the else exact same file.

The command used to generate this iso in question is roughly this:

genisoimage -o "file.iso" -b isolinux/isolinux.bin \
    -c isolinux/boot.cat -no-emul-boot \
    -boot-load-size 4 -boot-info-table \
    -J -R -v -T -V 'CDLABEL' "datadir/"

BS: Am I missing a command line parameer switch with rsync that does checksumming for ~1MB chunks of big files, as to prevent the retransfer when as in my case only some 800 bytes differ?

  • rsync usually checks parts of files to optimise updates, but not if they are both apparently local (eg on nfs). Add --no-W to force it. There is a libfaketime and faketime utility to emulate the system clock by using LD_PRELOAD (if not setuid). – meuh Mar 13 at 16:46
  • Hi, I just published a new version of schilytools. The included enhanced mkisofs includes support for reproducible time stamps. See the updated answer. – schily Mar 27 at 12:31
0

First an important note: Do not use genisoimage as it is a defective variant of a mkisofs from May 2004.

In the time up to May 2007, plenty of Debian specific bugs have been added and since then it is dead.

The important thing to know here is that genisoimage creates defective filesystem images that at some time may no longer be accepted by your OS...

The official mkisofs is however still actively maintained and fixed plenty of non-Debian specific bugs on August 2006. There are currently no known bugs.

Now to your problem: You are using -R (Rock Rigde) and this adds UNIX like timestamps to the files meta data. This is problem number 1....

The other problem is that the ISO-9660 filesystem super block (officially called primary_descriptor) contains the creation date and the modification date. The latter can be controlled via the option -modification-date.

If you believe this is a really needed feature, I could add a similar option for the creation date. Then you however still would need an option to tell the Rock Ridge formatting part to use the modification date of the files instead of the time of the last read access.

Frequently updated versions of the original source are part of the schilytools tarball that can be retrieved from: http://sourceforge.net/projects/schilytools/files/

The currently latest schilytools tarball introduced support for reporducible ISO-9660 filesystem images. Please fetch/compile/install schily-2020-03-27.tar.bz2.

There are a few new options:

  • -noatime tells mkisofs to archive the modification time as atime.

  • -creation-date sets the creation date in the PVD

  • -expiration-date sets the expiration date in the PVD

  • -effective-date sets the effective date in the PVD

  • -reproducible-date sets all times except for -effective-date and -noatimein addition.

This works for vanilla ISO-9660 filesystem images as well as for images that contain Rock Ridge and UDF. See the recent man page at: http://schilytools.sourceforge.net/man/man8/mkisofs.8.html

Your updated command line would look this way:

mkisofs -b isolinux/isolinux.bin \
  -c isolinux/boot.cat -no-emul-boot \
  -boot-load-size 4 -boot-info-table \
  -J -R -v -T -V 'CDLABEL' \
  -reproducible-date=20200327 "datadir/" > file.iso
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.