Strip comments from checksums files passed to "shaXsum -c"
authorRaphaël Hertzog <hertzog@debian.org>
Sat, 24 Feb 2018 16:19:37 +0000 (17:19 +0100)
committerRaphaël Hertzog <hertzog@debian.org>
Sat, 24 Feb 2018 16:19:37 +0000 (17:19 +0100)
As reported in #796474, the busybox implementation of the various
shaXsum command fails when it encounters comment lines that it
can't parse. This fixes the 'verify-checksums' boot parameter.

Thanks: Andreas Heinlein for the report
Closes: #856482

components/0030-verify-checksums

index dd1c8f8..4453558 100755 (executable)
@@ -51,7 +51,7 @@ Verify_checksums ()
                                        echo "Checking ${_CHECKSUM}..." > "${_TTY}"
 
                                        # Verify checksums
-                                       /bin/${_DIGEST}sum -c "${_CHECKSUM}" < "${_TTY}" > "${_TTY}"
+                                       grep -v '^#' "${_CHECKSUM}" | /bin/${_DIGEST}sum -c > "${_TTY}"
                                        _RETURN="${?}"
 
                                        # Stop after first verification