Last active
December 21, 2015 04:39
-
-
Save kylefeng28/6250768 to your computer and use it in GitHub Desktop.
A simple script to put in /etc/grub.d/ which makes iso files show up in your grub. This allows you to boot from iso files and use those for reinstalling your computer instead of using an external disk. :) You may need to alter variables to match your platform and the partition containing the iso files needs to be mounted during installation from…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#Written by Remco Haszing: https://plus.google.com/u/0/101152546828331333610/ | |
#Original post: https://plus.google.com/101152546828331333610/posts/8iaeaqd7hhz | |
for iso in /opt/iso/*.iso; do | |
if [ "`isoinfo -f -i $iso | grep '/CASPER/VMLINUZ.EFI;1'`" == "" ]; then | |
vmlinuz=vmlinuz | |
else | |
vmlinuz=vmlinuz.efi | |
fi | |
iso=`basename $iso` | |
echo Found iso $iso >&2 | |
cat <<EOF | |
menuentry "$iso" { | |
loopback loop (hd0,1)/$iso | |
linux (loop)/casper/$vmlinuz boot=casper iso-scan/filename=/$iso file=(loop)/preseed/ubuntu.seed | |
initrd (loop)/casper/initrd.lz | |
} | |
EOF | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Maybe you should include as a comment that this script was written by Remco Haszing
(https://plus.google.com/u/0/101152546828331333610)