summaryrefslogtreecommitdiffstats
path: root/.root/boot/efi/grub-workaround.sh
diff options
context:
space:
mode:
authorjustanothercatgirl <sotov2070@gmail.com>2024-03-10 20:38:25 +0300
committerjustanothercatgirl <sotov2070@gmail.com>2024-03-10 20:57:57 +0300
commitdad11ba32a578ddc6f156201a2bc03af6d20ee5f (patch)
treee5d8c838e71bffe8994e988a71a004c10f40dc0a /.root/boot/efi/grub-workaround.sh
parentb99a645e1a877fc31ab84d0b7f848dcaa049a51c (diff)
added systemwide files to .root directory
For more information, check .root/README.md
Diffstat (limited to '.root/boot/efi/grub-workaround.sh')
-rwxr-xr-x.root/boot/efi/grub-workaround.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/.root/boot/efi/grub-workaround.sh b/.root/boot/efi/grub-workaround.sh
new file mode 100755
index 0000000..97ded5b
--- /dev/null
+++ b/.root/boot/efi/grub-workaround.sh
@@ -0,0 +1,25 @@
+#/bin/sh
+
+set -e
+
+if [ $UID -ne 0 ]; then
+ echo script must be run as root
+ exit 1
+fi
+
+if [ $# -lt 2 ]; then
+ CFG_PATH=/boot/efi/archlinux/x86_64-efi/grub/grub.cfg
+else
+ CFG_PATH="$1"
+fi
+
+echo -e '\x1b[91;1m WRITING CONFIG TO \x1b[96m'${CFG_PATH}'\x1b[91m!\x1b[0m'
+
+if ! [ -f "${CFG_PATH}" ]; then
+ echo "invalid path"
+ exit 1
+fi
+
+echo substituting
+sed -i 's/root=ZFS=/zfs=zfsroot/g' "${CFG_PATH}"
+echo done