Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@ BIN = $(DESTDIR)/usr/bin
DEFAULT = $(DESTDIR)/etc/default
PROFILED = $(DESTDIR)/etc/profile.d
LIB = $(DESTDIR)/usr/lib
LIBEXEC = $(DESTDIR)/usr/libexec
SHARE = $(DESTDIR)/usr/share

all:

install:
install -D -m644 chkboot.conf $(DEFAULT)/chkboot.conf
install -D -m644 chkboot.conf $(DEFAULT)/chkboot
install -D -m755 chkboot $(BIN)/chkboot
install -D -m755 chkboot-check $(BIN)/chkboot-check
install -D -m755 notification/chkboot-profilealert.sh $(PROFILED)/chkboot-profilealert.sh
install -D -m755 notification/chkboot-desktopalert $(BIN)/chkboot-desktopalert
install -D -m755 chkboot-bootcheck $(LIBEXEC)/chkboot/chkboot-bootcheck

install-initcpio: install
install -D -m644 mkinitcpio-hooks/chkboot-initcpio $(LIB)/initcpio/install/chkboot
Expand All @@ -22,6 +24,5 @@ install-pacman: install

install-systemd: install
install -D -m644 chkboot.service $(LIB)/systemd/system/chkboot.service
install -D -m755 chkboot-bootcheck $(LIB)/systemd/scripts/chkboot-bootcheck

.PHONY: all install install-initcpio install-pacman install-systemd
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,11 @@ Run `systemctl --system daemon-reload` and then `systemctl enable chkboot`

### OPTIONAL:

`chkboot-bootcheck` can be installed elsewhere and added to the startup sequence
with another system:
`chkboot-bootcheck` can be added to the startup sequence with another system:

```
install -D -m644 chkboot/chkboot.service /usr/lib/systemd/system/chkboot.service
install -D -m755 chkboot/chkboot-bootcheck /usr/lib/systemd/scripts/chkboot-bootcheck
install -D -m755 chkboot/chkboot-bootcheck /usr/libexec/chkboot/chkboot-bootcheck
```

``chkboot-desktopalert`` notifies the desktop user about the change and can be
Expand Down
2 changes: 1 addition & 1 deletion chkboot
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if [ "$UID" -ne 0 ]; then
exit 1
fi

source /etc/default/chkboot.conf
source /etc/default/chkboot

CURRTIME=`date +"%Y%m%d-%H%M%S"`
BOOTFILES="${CHKBOOT_DATA}/BOOTFILES-$CURRTIME"
Expand Down
6 changes: 3 additions & 3 deletions chkboot-bootcheck
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/usr/bin/env bash

# chkboot-bootcheck: on systemd systems, copy this to /usr/lib/systemd/scripts/ and start the chkboot-boot.service
# on other systems, copy this somewhere it can be acceed during boot and add it to the end of the boot process
# chkboot-bootcheck: copy this to /usr/libexec/chkboot/ and start the chkboot-boot.service
# on other systems, copy this and add it to the end of the boot process
#
# author: ju (ju at heisec dot de)
# contributors: inhies, prurigro
#
# license: GPLv2

source /etc/default/chkboot.conf
source /etc/default/chkboot

chkboot

Expand Down
2 changes: 1 addition & 1 deletion chkboot-check
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# license: GPLv2

source /etc/default/chkboot.conf
source /etc/default/chkboot

if [[ -s "${CHKBOOT_DATA}/${CHANGES_ALERT}" ]]; then
echo -e -n "\e[0;${HIGHLIGHT_COLOUR};47m"
Expand Down
2 changes: 1 addition & 1 deletion chkboot.service
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ After=basic.target

[Service]
Type=oneshot
ExecStart=/usr/lib/systemd/scripts/chkboot-bootcheck
ExecStart=/usr/libexec/chkboot/chkboot-bootcheck

[Install]
WantedBy=multi-user.target
2 changes: 1 addition & 1 deletion notification/chkboot-desktopalert
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
# License: GPLv2 or later

source /etc/default/chkboot.conf
source /etc/default/chkboot

chgfile=${CHKBOOT_DATA}/${CHANGES_ALERT}

Expand Down
2 changes: 1 addition & 1 deletion notification/chkboot-profilealert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# license: GPLv2

source /etc/default/chkboot.conf
source /etc/default/chkboot

# only try to display chkboot changes if the 'proofile' alert style has been selected
if [ ! $(echo "${CHKBOOT_STYLES}" | grep -c "profile") = 0 ]; then
Expand Down
2 changes: 1 addition & 1 deletion pacman-hooks/80-chkboot-check.hook
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ Depends = chkboot
Depends = coreutils
Description = Comparing chkboot hashes...
When = PreTransaction
Exec = /usr/bin/sh -c 'if [ -s /var/lib/chkboot/boot-differences ]; then /usr/bin/echo " ###WARNING### Previously modified boot files not acknowledged"; /usr/bin/echo " ###WARNING### See chkboot log for details"; fi; /usr/lib/systemd/scripts/chkboot-bootcheck && if [ -s /var/lib/chkboot/boot-differences ]; then /usr/bin/echo " ###WARNING### Modified boot files detected since last boot"; /usr/bin/echo " ###WARNING### See chkboot log for details"; fi'
Exec = /usr/bin/sh -c 'if [ -s /var/lib/chkboot/boot-differences ]; then /usr/bin/echo " ###WARNING### Previously modified boot files not acknowledged"; /usr/bin/echo " ###WARNING### See chkboot log for details"; fi; /usr/libexec/chkboot/chkboot-bootcheck && if [ -s /var/lib/chkboot/boot-differences ]; then /usr/bin/echo " ###WARNING### Modified boot files detected since last boot"; /usr/bin/echo " ###WARNING### See chkboot log for details"; fi'