-
Notifications
You must be signed in to change notification settings - Fork 3
/
chkboot-initcpio
executable file
·28 lines (23 loc) · 986 Bytes
/
chkboot-initcpio
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env bash
# chkboot-initcpio: on Arch Linux (and possibly other systems with mkinitcpio), copy this
# to '/usr/lib/initcpio/install/chkboot', then add 'chkboot' to the end
# of the 'HOOKS' array, and rerun mkinitcpio to generate with this included
#
# author: ju (ju at heisec dot de)
# contributors: inhies, prurigro
#
# license: GPLv2
build() {
echo "Updating chkboot hashes of your boot files..."
#TEST TO SEE IF BOOT FILES WERE MODIFIED WITHOUT THE USER'S ACKNOWLEDGEMENT (BY RUNNING 'chkboot') AND ALERT THEM IF IT HAS BEEN
chkboot-check
if [ "$?" = 1 ]; then echo -e "\n### WARNING: Previously modified files were not acknowledged ###"; echo "### Check the issues log at ${CHANGES_LOG} for details ###"; fi
#RUN CHKBOOT TO UPDATE THE HASHES WITHOUT CREATING THE ALERT FILE
chkboot -u
sync
}
help() {
cat <<HELPEOF
Update the the collection of hashes for files on the boot partition
HELPEOF
}