Skip to content

Commit

Permalink
upgrades FsGuard to be compatible with core-image
Browse files Browse the repository at this point in the history
  • Loading branch information
taukakao committed Jul 12, 2024
1 parent d1e99f6 commit 428880a
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 42 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/vib-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: vanilla-os/[email protected].0
- uses: vanilla-os/[email protected].4
with:
recipe: 'recipe.yml'
plugins: 'Vanilla-OS/vib-fsguard:v1.4'
plugins: 'Vanilla-OS/vib-fsguard:v1.5.3'

- uses: actions/upload-artifact@v4
with:
Expand Down
38 changes: 0 additions & 38 deletions includes.container/usr/sbin/init

This file was deleted.

37 changes: 37 additions & 0 deletions includes.container/usr/share/init.d/010-fsguard.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash

function failed() {
/.system/usr/bin/plymouth quit
local squashfs="/.system/boot/fswarn.squash"
mount -t tmpfs -o rw,size=1G tmpfs /tmp
local tmp="/tmp"
chmod 0755 "$tmp"
unsquashfs -q -L -follow -d /tmp "$squashfs"
mount --rbind /dev "$tmp/dev"

local 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}'\''')
clear
tput cnorm
echo -e "\033[1;0H"
chroot "$tmp" /bin/bash -c "convert -resize $resolution -background black -gravity center -extent $resolution /verification_failed.png bgra:/dev/fb0"
echo -e "\033[999;0H"
read -sn1 input
if [[ "$input" == "c" ]]; then
echo -e "\033[1;0H"
chroot "$tmp" /bin/bash -c "convert -resize $resolution -background black -gravity center -extent $resolution /continue_confirm.png bgra:/dev/fb0"
echo -e "\033[999;0H"
read -sn1 input
if [[ "$input" == "y" ]]; then
return
else
poweroff -f
fi
else
poweroff -f
fi
}

/usr/sbin/FsGuard verify "/.system/FsGuard/filelist"
if [[ $? -ne 0 ]]; then
failed
fi
5 changes: 3 additions & 2 deletions recipe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ stages:
args:
DEBIAN_FRONTEND: noninteractive
runs:
- echo 'APT::Install-Recommends "1";' > /etc/apt/apt.conf.d/01norecommends
commands:
- echo 'APT::Install-Recommends "1";' > /etc/apt/apt.conf.d/01norecommends

modules:
- name: init-setup
Expand Down Expand Up @@ -103,7 +104,7 @@ stages:
commands:
- rm -rf /FsGuard
- rm -f ./minisign.pub ./minisign.key
- chmod +x /usr/sbin/init
- chmod +x /usr/share/init.d/010-fsguard.sh

- name: cleanup2
type: shell
Expand Down

0 comments on commit 428880a

Please sign in to comment.