diff --git a/.github/workflows/vib-build.yml b/.github/workflows/vib-build.yml index 056c9ad..b6ffc76 100644 --- a/.github/workflows/vib-build.yml +++ b/.github/workflows/vib-build.yml @@ -25,10 +25,10 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: vanilla-os/vib-gh-action@v0.7.0 + - uses: vanilla-os/vib-gh-action@v0.7.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: diff --git a/includes.container/usr/sbin/init b/includes.container/usr/sbin/init deleted file mode 100755 index dd2655d..0000000 --- a/includes.container/usr/sbin/init +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash - -function failed() { - /.system/usr/bin/plymouth quit - squashfs="/.system/boot/fswarn.squash" - mount -t tmpfs -o rw,size=1G tmpfs /tmp - tmp="/tmp" - chmod 0755 "$tmp" - unsquashfs -q -L -follow -d /tmp /.system/boot/fswarn.squash - mount --rbind /dev $tmp/dev - - 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 -exec /usr/lib/systemd/systemd "$@" diff --git a/includes.container/usr/share/init.d/010-fsguard.sh b/includes.container/usr/share/init.d/010-fsguard.sh new file mode 100644 index 0000000..4143f97 --- /dev/null +++ b/includes.container/usr/share/init.d/010-fsguard.sh @@ -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 diff --git a/recipe.yml b/recipe.yml index 1e5bb42..54936b0 100644 --- a/recipe.yml +++ b/recipe.yml @@ -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 @@ -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