Created
July 2, 2017 20:42
-
-
Save Friz-zy/15b77a1b05a9d44b08c25d3d0e210ec6 to your computer and use it in GitHub Desktop.
Revisions
-
Friz-zy created this gist
Jul 2, 2017 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,39 @@ #!/bin/sh usage () { echo 'Usage : bootable.sh <path to iso> <device for install like /dev/sdb>' echo 'This script install linux bootable iso into first partition of your usb flash drive' echo 'You need root privileges for run this script' exit 0 } if [ `id -u` = 0 ] then usage fi if [ "$#" -ne 2 ] then usage fi mkdir /mnt/iso mkdir /mnt/flash echo "Mounting $1 into /mnt/iso" mount -o loop $1 /mnt/iso echo "Mounting "$2"1 into /mnt/flash" mount "$2"1 /mnt/flash echo "Copying data from iso into flash" cp -a /mnt/iso/. /mnt/flash echo "Installing grub into flash" grub-install --removable --boot-directory=/mnt/flash/boot --efi-directory=/mnt/flash/EFI/BOOT $2 umount /mnt/iso umount /mnt/flash echo "Done!"