Skip to content

Commit

Permalink
adds grub-mkconfig script that deletes itself
Browse files Browse the repository at this point in the history
This is to prevent users from running this script, since that would brick their system.
  • Loading branch information
taukakao committed Nov 14, 2024
1 parent 0dc951e commit 221efc7
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions includes.container/usr/sbin/grub-mkconfig-replacement
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
set -e
/usr/libexec/grub-mkconfig "$@"
# delete this script so users don't accidentally break their system with it
rm /usr/sbin/grub-mkconfig
3 changes: 3 additions & 0 deletions includes.container/usr/sbin/update-grub-replacement
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
echo please use abroot to update the grub configuration
exit 1
11 changes: 11 additions & 0 deletions modules/41-move-boot-scripts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: move-boot-scripts
type: shell
commands:
- mkdir -p /usr/libexec/
- mv /usr/sbin/grub-mkconfig /usr/libexec/
- mv /usr/sbin/grub-mkconfig-replacement /usr/sbin/grub-mkconfig
- chmod +x /usr/sbin/grub-mkconfig
- mv /usr/sbin/update-grub /usr/libexec/
- mv /usr/sbin/update-grub-replacement /usr/sbin/update-grub
- chmod +x /usr/sbin/update-grub

1 change: 1 addition & 0 deletions recipe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ stages:
- modules/20-ssh.yml
- modules/30-utils.yml
- modules/40-essentials.yml
- modules/41-move-boot-scripts.yml
- modules/50-fs.yml
- modules/60-sound.yml
- modules/70-compression.yml
Expand Down

0 comments on commit 221efc7

Please sign in to comment.