Skip to content

Conversation

@valiko-ua
Copy link
Contributor

Fix #100: Try shasum first.

@valiko-ua valiko-ua force-pushed the checksum-failure-on-ubuntu25 branch from 0441ce9 to 65d4744 Compare November 22, 2025 12:57
@valiko-ua valiko-ua changed the title Fix CHECKSUMS verification with sha256sum on Ubuntu 25.10 fix #100: CHECKSUMS verification with sha256sum fails on Ubuntu 25.10 Nov 22, 2025
@pimlie
Copy link
Owner

pimlie commented Nov 29, 2025

Are you sure this change works correctly? Can't remember why exactly but I know I added the debs count check on purpose (which this PR would remove)

@valiko-ua valiko-ua force-pushed the checksum-failure-on-ubuntu25 branch from 65d4744 to f081b3c Compare November 30, 2025 13:47
@valiko-ua
Copy link
Contributor Author

valiko-ua commented Nov 30, 2025

Are you sure this change works correctly? Can't remember why exactly but I know I added the debs count check on purpose (which this PR would remove)

I tested the fix on Ubuntu 25.10 many times: it works correctly.

I also investigated how shasum and sha256sum work on Ubuntu 24 under WSL: shasum works there as well.

Of course it would be nice if it was tested on other OS's but I don't have other Linuxes to test.

Even if this PR will cause checksum verification failure on some OS, people may file a bug and temporarily use -ns switch.

@valiko-ua
Copy link
Contributor Author

@pimlie Alternatively, to be very cautious, we could use your old approach (check count) for sha256sum and sha1sum and new approach (check exit code) for shasum. If some OS does not have shasum, old approach will be used.
But this will clutter the script of course.

@valiko-ua
Copy link
Contributor Author

We cannot use counting with shasum because it now uses all entries (4 for sha256 and 4 for sha1):

$ shasum --ignore-missing -c CHECKSUMS 2>>dbg.txt | tee -a dbg.txt | wc -l
8

$ shasum --ignore-missing -c CHECKSUMS 2>>dbg.txt | tee -a dbg.txt
linux-headers-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: OK
linux-headers-6.17.8-061708_6.17.8-061708.202511132139_all.deb: OK
linux-image-unsigned-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: OK
linux-modules-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: OK
linux-headers-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: OK
linux-headers-6.17.8-061708_6.17.8-061708.202511132139_all.deb: OK
linux-image-unsigned-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: OK
linux-modules-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: OK

@valiko-ua valiko-ua force-pushed the checksum-failure-on-ubuntu25 branch from f081b3c to 729f164 Compare November 30, 2025 14:44
@pimlie
Copy link
Owner

pimlie commented Nov 30, 2025

IIRC the issue is with the --ignore-missing arg which means that if we expect to download 4 deb files, but somehow one of them was not download or deleted or moved, then shasum will just return ok if the remaining 3 deb files return ok.

So the wc -l was there to make sure that if we expect 4 deb files, we also get 4 valid signatures and not less then 4 due to missing deb files.

@valiko-ua
Copy link
Contributor Author

@pimlie I've just made this test with missing files.
Indeed, with option --ignore-missing the verification succeeds even if some file is missing, but later installation error is reported:

$ sudo ./ubuntu-mainline-kernel.sh -d -i 6.17.8
Downloading index from kernel.ubuntu.com
Will download 6 files from https://kernel.ubuntu.com/~kernel-ppa/mainline/v6.17.8/
Downloading amd64/linux-headers-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: 100%   
Downloading amd64/linux-headers-6.17.8-061708_6.17.8-061708.202511132139_all.deb: 100%   
Downloading amd64/linux-image-unsigned-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: 100%   
Downloading amd64/linux-modules-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: 100%   
Downloading amd64/CHECKSUMS: 100%   
Downloading amd64/CHECKSUMS.gpg: 100%   
..... signature check here .....
Signature of checksum file has been successfully verified
linux-headers-6.17.8-061708_6.17.8-061708.202511132139_all.deb: OK
linux-image-unsigned-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: OK
linux-modules-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: OK
linux-headers-6.17.8-061708_6.17.8-061708.202511132139_all.deb: OK
linux-image-unsigned-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: OK
linux-modules-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: OK
Checksums of deb files have been successfully verified with shasum
Installing 4 packages
dpkg: error: cannot access archive 'linux-headers-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb': No such file or directory
Installation failed.
Uninstall this kernel and rerun with --debug to see error details.

If I remove the option --ignore-missing then verification fails, as expected:

$ sudo ./ubuntu-mainline-kernel.sh -d -i 6.17.8
Downloading index from kernel.ubuntu.com
Will download 6 files from https://kernel.ubuntu.com/~kernel-ppa/mainline/v6.17.8/
Downloading amd64/linux-headers-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: 100%   
Downloading amd64/linux-headers-6.17.8-061708_6.17.8-061708.202511132139_all.deb: 100%   
Downloading amd64/linux-image-unsigned-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: 100%   
Downloading amd64/linux-modules-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: 100%   
Downloading amd64/CHECKSUMS: 100%   
Downloading amd64/CHECKSUMS.gpg: 100%   
..... signature check here .....
Signature of checksum file has been successfully verified
shasum: linux-headers-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: No such file or directory
linux-headers-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: FAILED open or read
linux-headers-6.17.8-061708_6.17.8-061708.202511132139_all.deb: OK
linux-image-unsigned-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: OK
linux-modules-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: OK
shasum: linux-headers-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: No such file or directory
linux-headers-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: FAILED open or read
linux-headers-6.17.8-061708_6.17.8-061708.202511132139_all.deb: OK
linux-image-unsigned-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: OK
linux-modules-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: OK
shasum: WARNING: 2 listed files could not be read
Abort, shasum returned an error 1

So both ways work but the latter one is cleaner in my opinion.
Do you remember why option --ignore-missing was added? Maybe remove it?

@valiko-ua
Copy link
Contributor Author

valiko-ua commented Nov 30, 2025

Just for the reference, output of sha256sum, sha1sum and shasum on Ubuntu 25.10:

$ l
-rw-r--r--  1       1121 Nov 30 18:31 CHECKSUMS
-rw-r--r--  1        488 Nov 30 18:31 CHECKSUMS.gpg
-rw-r--r--  1    3894696 Nov 30 18:31 linux-headers-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb
-rw-r--r--  1   14425064 Nov 30 18:31 linux-headers-6.17.8-061708_6.17.8-061708.202511132139_all.deb
-rw-r--r--  1   17100992 Nov 30 18:31 linux-image-unsigned-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb
-rw-r--r--  1  165253312 Nov 30 18:31 linux-modules-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb

$ sha256sum -c CHECKSUMS 2>>dbg.txt
linux-headers-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: FAILED
linux-headers-6.17.8-061708_6.17.8-061708.202511132139_all.deb: FAILED
linux-image-unsigned-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: FAILED
linux-modules-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: FAILED
linux-headers-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: OK
linux-headers-6.17.8-061708_6.17.8-061708.202511132139_all.deb: OK
linux-image-unsigned-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: OK
linux-modules-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: OK

$ echo $?
1

$ sha1sum -c CHECKSUMS 2>>dbg.txt
linux-headers-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: OK
linux-headers-6.17.8-061708_6.17.8-061708.202511132139_all.deb: OK
linux-image-unsigned-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: OK
linux-modules-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: OK
linux-headers-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: FAILED
linux-headers-6.17.8-061708_6.17.8-061708.202511132139_all.deb: FAILED
linux-image-unsigned-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: FAILED
linux-modules-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: FAILED

$ echo $?
1

$ shasum -c CHECKSUMS 2>>dbg.txt
linux-headers-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: OK
linux-headers-6.17.8-061708_6.17.8-061708.202511132139_all.deb: OK
linux-image-unsigned-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: OK
linux-modules-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: OK
linux-headers-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: OK
linux-headers-6.17.8-061708_6.17.8-061708.202511132139_all.deb: OK
linux-image-unsigned-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: OK
linux-modules-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: OK

$ echo $?
0

$ mv linux-headers-6.17.8-061708_6.17.8-061708.202511132139_all.deb linux-headers-6.17.8-061708_6.17.8-061708.202511132139_all.deb__

$ l
-rw-r--r--  1       1121 Nov 30 18:31 CHECKSUMS
-rw-r--r--  1        488 Nov 30 18:31 CHECKSUMS.gpg
-rw-r--r--  1    3894696 Nov 30 18:31 linux-headers-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb
-rw-r--r--  1   14425064 Nov 30 18:31 linux-headers-6.17.8-061708_6.17.8-061708.202511132139_all.deb__
-rw-r--r--  1   17100992 Nov 30 18:31 linux-image-unsigned-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb
-rw-r--r--  1  165253312 Nov 30 18:31 linux-modules-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb

$ sha256sum -c CHECKSUMS 2>>dbg.txt
linux-headers-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: FAILED
linux-headers-6.17.8-061708_6.17.8-061708.202511132139_all.deb: FAILED open or read
linux-image-unsigned-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: FAILED
linux-modules-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: FAILED
linux-headers-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: OK
linux-headers-6.17.8-061708_6.17.8-061708.202511132139_all.deb: FAILED open or read
linux-image-unsigned-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: OK
linux-modules-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: OK

$ echo $?
1

$ sha1sum -c CHECKSUMS 2>>dbg.txt
linux-headers-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: OK
linux-headers-6.17.8-061708_6.17.8-061708.202511132139_all.deb: FAILED open or read
linux-image-unsigned-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: OK
linux-modules-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: OK
linux-headers-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: FAILED
linux-headers-6.17.8-061708_6.17.8-061708.202511132139_all.deb: FAILED open or read
linux-image-unsigned-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: FAILED
linux-modules-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: FAILED

$ echo $?
1

$ shasum -c CHECKSUMS 2>>dbg.txt
linux-headers-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: OK
linux-headers-6.17.8-061708_6.17.8-061708.202511132139_all.deb: FAILED open or read
linux-image-unsigned-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: OK
linux-modules-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: OK
linux-headers-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: OK
linux-headers-6.17.8-061708_6.17.8-061708.202511132139_all.deb: FAILED open or read
linux-image-unsigned-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: OK
linux-modules-6.17.8-061708-generic_6.17.8-061708.202511132139_amd64.deb: OK

$ echo $?
1

@valiko-ua
Copy link
Contributor Author

Maybe we should preserve old behavior for systems where shasum is not available (is there any?).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Installation fails on Ubuntu 25.10 on checksum verification

2 participants