Skip to content

Instantly share code, notes, and snippets.

@opello
Created June 17, 2013 20:44
Show Gist options
  • Save opello/5800212 to your computer and use it in GitHub Desktop.
Save opello/5800212 to your computer and use it in GitHub Desktop.
Fix GRUB 2.00 prefix= variables to make it relocatable. Execute at the base of the prefix after it's been copied to the new destination. e.g. rsync -a user@host:dev/install/grub/ ./grub; cd grub; ./fix-prefix.sh; ./bin/grub-install ...
#!/bin/sh
for f in $(grep -r '^prefix="' . | cut -d: -f 1); do
sed -r -i 's#^prefix=".*#prefix="'$PWD'"#g' $f
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment