0

How does the Ubuntu Install disk verify its own integrity after boot and before install?

I'm very familiar with the process to do a manual check of the integrity of a Linux distro's .iso file with a cryptographic hash stored in a (hopefully signed) digest file like SHA256SUMS using a command like

sha256sum --check SHA256SUMS

But I've also seen that, When installing Ubuntu via CD or USB drive, it can verify its own integrity!

How does this actually work, internally? What tools are used? Where is the sourcecode for this check?

1 Answers1

1

I believe what you are referring to is handled by Casper.

When the ISO boots the service casper.casper-md5check.service is run. This service calls the binary casper-md5check. The arguments to the binary tell it to verify checksums defined in /cdrom/md5sum.txt.

The results of the verification are written to /run/casper-md5check.json.

The service is fairly new. The verification used to run from a script in the initramfs.

I'm not sure what part of the ISO build process creates the md5sum.txt file.