-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add warning when fsguard fails
- Loading branch information
1 parent
f98bd7c
commit 76d69d6
Showing
4 changed files
with
42 additions
and
12 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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 |
---|---|---|
@@ -1,3 +1,35 @@ | ||
#!/bin/bash | ||
|
||
function failed() { | ||
#tput civis | ||
squashfs="/.system/boot/fswarn.squash" | ||
tmp="$(mktemp -d)" | ||
chmod 0755 "$tmp" | ||
mount -t squashfs -o loop $squashfs $tmp 2> /dev/null > /dev/null | ||
mount --rbind /dev $tmp/dev 2> /dev/null > /dev/null | ||
|
||
resolution=$(chroot "$tmp" /bin/bash -c '/usr/sbin/fbset | /bin/grep "mode " | /bin/sed "s/\"//g" | /bin/sed "s/-0//g" | /usr/bin/gawk '\''BEGIN{FS=" "}; {print $2}'\''') | ||
chroot $tmp /bin/bash -c "convert -resize $resolution -background black -gravity center -extent $resolution /verification_failed.png bgra:/dev/fb0" | ||
tput civis | ||
read -sn1 input | ||
if [[ "$input" == "c" ]]; then | ||
tput cnorm | ||
chroot $tmp /bin/bash -c "convert -resize $resolution -background black -gravity center -extent $resolution /continue_confirm.png bgra:/dev/fb0" | ||
tput civis | ||
read -sn1 input | ||
if [[ "$input" == "y" ]]; then | ||
return | ||
else | ||
poweroff -f | ||
fi | ||
else | ||
poweroff -f | ||
fi | ||
tput cnorm | ||
} | ||
|
||
/usr/sbin/FsGuard verify /.system/FsGuard/filelist | ||
if [[ $? -ne 0 ]]; then | ||
failed | ||
fi | ||
exec /usr/lib/systemd/systemd "$@" |
This file contains 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,9 @@ | ||
name: fswarn | ||
type: shell | ||
commands: | ||
- mkdir -p /boot/ | ||
- cp /sources/fswarn-x86_64.squash /boot/fswarn.squash | ||
source: | ||
type: tar | ||
url: https://github.com/Vanilla-OS/fswarn/releases/download/v1.0-1/fswarn.tar.xz | ||
checksum: 52f66710132138c21b81b56cb2d6edc7e59ad6eef4a4065b81af0f852d827dab |
This file contains 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