forked from rear/rear
-
Notifications
You must be signed in to change notification settings - Fork 0
BCF-6406: [REAR] Improve post-BMR integrity check #77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Anton Bukhvalau (BukhvalauAnton)
merged 4 commits into
develop
from
feature/BCF-6406-rear-improve-post-bmr-integrity-check
Feb 18, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
16 changes: 0 additions & 16 deletions
16
usr/share/rear/checkintegrity/COVE/default/001_compare_binaries.sh
This file was deleted.
Oops, something went wrong.
56 changes: 56 additions & 0 deletions
56
usr/share/rear/checkintegrity/COVE/default/010_verify_checksums.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| # Check md5sum files | ||
|
|
||
| function verify_checksums() { | ||
| local md5sum_files=() | ||
|
|
||
| case "$COVE_CHECK_INTEGRITY" in | ||
| all) | ||
| md5sum_files+=(files.md5sum cove-files.md5sum) | ||
| ;; | ||
| *binaries*) | ||
| md5sum_files+=(cove-files.md5sum) | ||
| ;;& | ||
| *configs*) | ||
| md5sum_files+=(files.md5sum) | ||
| ;; | ||
| esac | ||
|
|
||
| if [ ${#md5sum_files[@]} -eq 0 ]; then | ||
| LogUserOutput "Nothing to check. See COVE_CHECK_INTEGRITY in 'default.conf'." | ||
| return 0 | ||
| fi | ||
|
|
||
| LogUserOutput "Checking if certain restored files are consistent with the recreated system..." | ||
|
|
||
| local all_pass=1 | ||
| for md5sum_file in "${md5sum_files[@]}" ; do | ||
| local path="$VAR_DIR/layout/config/$md5sum_file" | ||
|
|
||
| # Skip when there are no checksums for this file | ||
| if ! test -s "$path"; then | ||
| LogUserOutput "Warning: '$path' not found. Skipped." | ||
| continue | ||
| fi | ||
|
|
||
| LogUserOutput "Verifying checksums from '$path'..." | ||
|
|
||
| local md5sum_stdout | ||
| if ! md5sum_stdout="$( md5sum -c --quiet < "$path" )" ; then | ||
| LogUserOutput "Restored file(s) do not fully match the recreated system." | ||
| LogUserOutput "$( sed -e 's/^/ /' <<< "$md5sum_stdout" )" | ||
| LogUserOutput "Verification failed: checksums do not match for file(s) in '$md5sum_file'." | ||
| all_pass=0 | ||
| else | ||
| LogUserOutput "Verification passed: checksums match in '$md5sum_file'." | ||
| fi | ||
| done | ||
|
|
||
| if [ $all_pass -eq 1 ]; then | ||
| LogUserOutput "" | ||
| LogUserOutput "Verification passed: all checksums match." | ||
| else | ||
| Error "Verification failed: checksums did NOT match." | ||
| fi | ||
| } | ||
|
|
||
| verify_checksums |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.