Friday 17 May 2013

Google Search Results Open in New Window/Tab

If you are logged into google you can have search results open in a new tab (or window if you are still that type of person).

Do a quick search for anything. I always tend to use "test". or click this link

https://www.google.ca/#newwindow=1&output=search&sclient=psy-ab&q=test&oq=test&gs_l=hp.3..35i39j0i20j0l2.52020.52380.0.53350.4.4.0.0.0.0.225.728.0j2j2.4.0...0.0...1c.1.14.psy-ab.J-L_OgPCqlY&pbx=1&bav=on.2,or.r_cp.r_qf.&bvm=bv.46751780,d.aWM&fp=4e534f89523cc3fa&biw=1366&bih=706

Click on the cog in the right hand quadrant of the web page.

Click "Search settings"

The search settings page will open.

Scroll down a bit to "Where results open" and click the box next to:

"Open each selected item in a new browser window"

Click "Save"

That's it.

Now when you search Google will open the clicked link in a new tab/window.

I love this because it allows me to keep my search results opened and see the referred to pages in a new tab.


Friday 3 May 2013

The Utility Shed - Syslinux, Refind, Gummiboot, Grub4Dos & Windows Installs.

The Utility Shed is a 32 gig USB Thumb Drive that is meant to be an all encompassing multi-boot utility drive. To get everything to work the way I wanted it to I have had to use various boot loaders including Syslinux, Grub4Dos, Refind and Gummiboot.

Notes

All ISOs will be copied at the end so they remain contiguous. If you get an error saying a disk is not contiguous on the disk it means it is fragmented. In order to get around this use WinContig. ou can get it here:
     http://wincontig.mdtzone.it/en/

Sometimes you will not be able to get enough space to make an ISO file contiguous. If this occurs you can take all ISOs off the key, defragment the thumb drive, run wincontig on it, and then place the ISOs back one at a time. Running wincontig after each file is placed

If you want to use this on a regular hard drive you will have to force the install of syslinux using the -f option, and be sure to leave 2 megs at the start of the hard drive. If using a gpt formatted hard drive you will have to use dd to write the alternate gpt mbr to the start of the hard drive. (If you are really interested in this leave a comment and I will go into more detail)

Supported ISOs

Currently it supports installation of the following operating systems:
      Arch Linux, Windows 8 x64 (UEFI and BIOS mode), Windows 8 x32, and all versions of Windows 7.

The booting of various live cd's is also available including:
      Mint, Parted Magic, Kolibros, Windows 7peV8 and Windows 7peV4.

The configuration files also include options to load various utility discs such as:
      AVG Rescue CD, Hiren's Boot CD, Paragon Hard Disk Manager, Ultimate Boot CD & KonBoot.

Format Drive

First we will format our thumb drive.

Microsoft's way of formatting thumb drives is not conducive to the mapping Grub4Dos uses. MS will only create full volumes without a partition. This is easy to create in linux so we will burn Parted Magic to cd and boot from it to format out drive.

     ***If you know how to create partitions on a thumb drive using windows or a thrid party application that runs in windows please leave a comment. It is probably obvious but I can't figure it out in windows 8.

You can download parted magic from their website.
     http://partedmagic.com/doku.php?id=downloads#.UXRWPLXrxw0

Once booted open Partition Editor and use the pull down on the right to choose your thumb drive.

Choose Device then Create Partition Table and Apply.

Highlight the unallocated line and select new.

Change the gfile system to fat32

Type in a label that is less 11 characters and has no spaces. I used UtilityShed

Click Add then Apply. A warning will come up that you will loss all your data, click apply.

Click Close.

Right click your newly created partition and click Manage Flags and select boot then close.

Close Gparted and reboot back to windows

***Once I rebooted into windows my drive was not allocated a drive letter. If this occurs to you simply open computer management, go to disk management, right click the drive and change drive letter. I'm almost positive this will not happen to you. I was playing with parted in windows and delete the volume letter so that is probably why it occurred to me.

Install Syslinux

On your thumb drive create the folder structure \boot\syslinux\

Next you are going to need to download syslinux 5.01
     https://www.kernel.org/pub/linux/utils/boot/syslinux/5.xx/syslinux-5.01.zip

Once downloaded extract it and open a command prompt as Administrator. Navigate in command prompt down to the syslinux-5.01\win64 directory (or win32 if you are running 32 bit windows).

***From here on I will assume windows 64 bit. You will need to adjust instructions for 32 bit if you use 32 bit windows or a 32 bit computer.

At the command prompt run the following command (do not forget to change X to the drive letter assigned to your thumb drive):
     syslinux64.exe -d /boot/syslinux -m -a -i X:

Using Windows Explorer open the \syslinux-5.01\com32 directory and search for *.c32 (Make sure you are searching sub-directories also). Select all except the ldlinux.c32 file and copy them to the \boot\syslinux\ folder on your thumb drive. (You will probably not use most of these modules so if you know which ones you will never use feel free to either delete them or not copy them at all.)

Create the folder \boot\memdisk on your thumb drive

Copy the memdisk file from the \syslinux-5.01\memdisk\ folder to the \boot\memdisk\ folder on the thumb drive.

Create the Syslinux.cfg file in \boot\syslinux\ and copy everything between the begins and ends lines into it:

-----Syslinux.cfg begins-----
UI vesamenu.c32
PROMPT 0
TIMEOUT 0

#root menu
MENU TITLE Welcome to the Utilty Shed
MENU BACKGROUND ../background/RedPower.jpg
MENU RESOLUTION 720 400
MENU WIDTH 78
MENU HEIGHT 26
MENU MARGIN 0

DEFAULT pmagic

LABEL pmagic
MENU LABEL Parted Magic
TEXT HELP
Use to partition, resize and move hard drive partitions. Also useful for
general purpose computing.
ENDTEXT
LINUX ../memdisk/memdisk
INITRD ../isos/pmagic_2013_02_28.iso
APPEND iso

LABEL winpe
MENU LABEL Windows 7 PE SE ver.8
TEXT HELP
Windows Live Disc for hacking,rescue operations and entertainment.
Load with Grub4Dos if fails
ENDTEXT
LINUX ../memdisk/memdisk
INITRD ../isos/Win7PE_SEV8.ISO
APPEND iso

LABEL mint64
MENU LABEL Mint 64bit
TEXT HELP
General purpose Linux disto.
ENDTEXT
LINUX ../grub/grub.exe --config-file="find --set-root /boot/grub/mint64.lst configfile /boot/grub/mint64.lst"


#submenu 0
MENU BEGIN
MENU TITLE The Utility Shed's tools

LABEL avg
MENU LABEL AVG Rescue CD
TEXT HELP
Live Cd to remove viruses. Don't forget to update
ENDTEXT
LINUX ../memdisk/memdisk
INITRD ../isos/avg_arl_cdi_all_120_120823a5411.iso
APPEND iso

LABEL ubcd
MENU LABEL Ultimate Boot CD
TEXT HELP
Dos based applications for hardware diagnostics and system repair.
Also includes parted magic
ENDTEXT
LINUX ../memdisk/memdisk
INITRD ../isos/ubcd520.iso
APPEND iso

LABEL hirens
MENU LABEL Hiren's Boot CD
TEXT HELP
More applications for system rescue, diagnostics, recovery, and anything else
needed to work on computers.
ENDTEXT
LINUX ../memdisk/memdisk
INITRD ../isos/Hirens.Boot.CD.15.2.iso
APPEND iso

LABEL paragon
MENU LABEL Paragon Hard Disk Manager
TEXT HELP
Partition management and various hard drive utilities
ENDTEXT
LINUX ../memdisk/memdisk
INITRD ../isos/parbootcd.iso
APPEND iso

LABEL stbmc
MENU LABEL Share The Box Linux
TEXT HELP
Shares all drives on the computer as Windows Shares (SMB). Use with caution!
ENDTEXT
LINUX ../memdisk/memdisk
INITRD ../isos/STBmc.iso
APPEND iso

LABEL back1
MENU LABEL Back
TEXT HELP
Back to previous menu
ENDTEXT
MENU EXIT

MENU END

#submenu 1
MENU BEGIN
MENU TITLE The Utility Shed's 32-bit & alternate versions of live cds

LABEL mint32
MENU LABEL Mint 32bit
TEXT HELP
General purpose Linux disto.
ENDTEXT
LINUX ../grub/grub.exe --config-file="find --set-root /boot/grub/mint32.lst configfile /boot/grub/mint32.lst"

LABEL winpev4
MENU LABEL Windows 7 PE SE ver.4
TEXT HELP
Similiar to above with less tools but should load quicker in smaller ram
environments. Load with Grub4Dos if fails.
ENDTEXT
LINUX ../memdisk/memdisk
INITRD ../isos/win7PE_SEV4Tools.ISO
APPEND iso

LABEL back2
MENU LABEL Back
TEXT HELP
Back to previous menu
ENDTEXT
MENU EXIT

MENU END


#submenu 2
MENU BEGIN
MENU TITLE The Utility Shed's interesting oddities

LABEL kolibrios
MENU LABEL Kolibri OS
TEXT HELP
Small OS capable of running some dos programs. Look in kolprograms at root
of key for more that are not included on image.
ENDTEXT
LINUX ../memdisk/memdisk
INITRD ../isos/kolibri.iso
APPEND iso

#######not working
#LABEL androidasus
#MENU LABEL Android 4.0 for Asus Laptops
#TEXT HELP
#Android 4.0 ICS built for Asus Laptops but may work with other systems.
#For x86 architecture only.
#ENDTEXT
#LINUX ../memdisk/memdisk
#INITRD ../isos/android-4.0-RC2-asus_laptop.iso
#APPEND iso
#######

#######not working
#LABEL android42
#MENU LABEL Android 4.2 developers build
#TEXT HELP
#Android 4.2 developers build generic for x86 architecture
#ENDTEXT
#LINUX ../memdisk/memdisk
#INITRD ../isos/android-4.2-20130228.iso
#APPEND iso
#######

LABEL back3
MENU LABEL Back
TEXT HELP
Back to previous menu
ENDTEXT
MENU EXIT

MENU END


#submenu 3
MENU BEGIN Install ISOs
MENU TITLE The Utility Shed's install options

LABEL arch_iso
MENU LABEL Arch Linux Setup 32 and 64 bit
TEXT HELP
Install Arch 32 or 64 bit. Also boots to a live linux CLI.
ENDTEXT
LINUX ../memdisk/memdisk
INITRD ../isos/archlinux-2013.04.01-dual.iso
APPEND iso

LABEL archnetboot
MENU LABEL Arch Linux Netboot Environment
TEXT HELP
Boots the Arch live media directly over a network. It will boot into a menu
with a list of available mirrors. Expect a long delay while image downloads
ENDTEXT
KERNEL ../isos/ipxe.lkrn

LABEL test
MENU LABEL Install Windows
LINUX ../grub/grub.exe --config-file="find --set-root /boot/grub/winstall.lst configfile /boot/grub/winstall.lst"
#COM32 chain.c32 ntldr=../grub/grldr --config-file="find --set-root /boot/grub/winstall.lst configfile /boot/grub/winstall.lst"

LABEL back4
MENU LABEL Back
TEXT HELP
Back to previous menu
ENDTEXT
MENU EXIT

MENU END


#submenu 4
MENU BEGIN Alternate Boot Loaders, Hard Drives and Power options
MENU TITLE The Utility Shed's boot loaders, hard drives and power options

LABEL konboot
MENU LABEL konBOOT
TEXT HELP
Boot Windows and Linux without a password
ENDTEXT
LINUX ../grub/grub.exe --config-file="find --set-root /boot/grub/konboot.lst configfile /boot/grub/konboot.lst"

LABEL grub4dos
MENU LABEL Load ISOs with Grub 4 Dos
TEXT HELP
Alternate boot loader. Some OS's fail above because on low ram systems.
Check here to see if they can be booted by grub4dos.
ENDTEXT
LINUX ../grub/grub.exe --config-file="find --set-root /boot/grub/menu.lst configfile /boot/grub/menu.lst"

#######Works - another way to load grub4dos
#LABEL main menu
#MENU LABEL Main Menu
#BOOT /boot/grub/grldr
########

LABEL boot1sthd
MENU LABEL Boot 1st Hard Drive (non EFI)
TEXT HELP
Boot the 1st hard drive on the system as defined by the bios.
ENDTEXT
COM32 chain.c32
APPEND hd0

LABEL boot2ndhd
MENU LABEL Boot 2nd Hard Drive (non EFI)
TEXT HELP
Boot the 2nd hard drive on the system as defined by the bios. To boot more hard drives
change the append number to hd2 for the 3rd drive, hd3 for the 4th hard drive, etc.
ENDTEXT
COM32 chain.c32
APPEND hd1

LABEL reboot
MENU LABEL Reboot Computer
TEXT HELP
Reboots the system.
ENDTEXT
COM32 reboot.c32

LABEL cmdprompt
MENU LABEL Syslinux Command Prompt
MENU QUIT

LABEL back5
MENU LABEL Back
TEXT HELP
Back to previous menu
ENDTEXT
MENU EXIT

MENU END
-----Syslinux.cfg ends-----

As you can see not all stanza's are working and some point to .lst files that boot using Grub4Dos. If you know of working syslinux stanzas for anything listed that is not booting using syslinux please comment below. If you have stanzas for any isos not listed here please feel free to add them to the comments also. Only those that work will be approved.

Install Grub4Dos

Create the folder \boot\grub\ on the thumbdrive.

Now download grub4dos but not the old default version that is around. We need a couple of features that are only offered in Chenall's version. (If I could remember why I would list the reasons here but I can't so you will just have to trust me.)

Grab it here
     https://grub4dos-chenall.googlecode.com/files/grub4dos-0.4.5c-2013-04-19.7z

Unzip the file using 7zip or winrar and navigate to the folder where the files were extracted.

Copy all files except:
     COPYING
     Get_Source_of_This_Build.txt
     grub.pif  <---this is the grub shortcut and not required
     grub4dos_r340.diff

     And do not copy the  following folders:
     docs
     sample

and move them to \boot\grub\

Create the file menu.lst and place it in \boot\grub\ and copy everything between the begins and ends lines into it:

-----Menu.lst begins-----
color red/black black/red green/black red/black
timeout 30

title Win7PEV8
 map /boot/isos/win7PE_SEV8.ISO (hd32)
 chainloader (hd0,0)+1
 map --hook
 chainloader (hd32)
 boot

title Win7PEV4 Tools
 map /boot/isos/win7PE_SEV4Tools.ISO (hd32)
 chainloader (hd0,0)+1
 map --hook
 chainloader (hd32)
 boot

title Mint 14 32-bit
 find --set-root /boot/isos/linuxmint-14.1-cinnamon-dvd-32bit.iso
 map /boot/isos/linuxmint-14.1-cinnamon-dvd-32bit.iso (0xff) || map --mem /boot/isos/linuxmint-14.1-cinnamon-dvd-32bit.iso (0xff)
 map --hook
 root (0xff)
 kernel /casper/vmlinuz file=/cdrom/preseed/mint.seed noprompt boot=casper iso-scan/filename=/boot/isos/linuxmint-14.1-cinnamon-dvd-32bit.iso noeject noprompt --
 initrd /casper/initrd.lz

title Mint 14 64-bit
 find --set-root /boot/isos/linuxmint-14.1-cinnamon-dvd-64bit.iso
 map /boot/isos/llinuxmint-14.1-cinnamon-dvd-64bit.iso (0xff) || map --mem /boot/isos/linuxmint-14.1-cinnamon-dvd-64bit.iso (0xff)
 map --hook
 root (0xff)
 kernel /casper/vmlinuz file=/cdrom/preseed/mint.seed noprompt boot=casper iso-scan/filename=/boot/isos/linuxmint-14.1-cinnamon-dvd-64bit.iso noeject noprompt --
 initrd /casper/initrd.lz

title Paragon Hard Disk Manager
 map /boot/isos/parbootcd.iso (hd32)
 chainloader (hd0,0)+1
 map --hook
 chainloader (hd32)
 boot

title Share the Box
 find --set-root /boot/isos/STBmc.iso
 map --mem /boot/isos/STBmc.iso (hd32)
 map --hook
 map --status
 chainloader (hd32)

title Ultimate Boot CD 5.20
 find --set-root /boot/isos/ubcd520.iso
 map /boot/isos/ubcd511.iso (hd32)
 map --hook
 chainloader (hd32)

title Kon-Boot v2.0
 map --mem /boot/isos/kon-bootFloppy.img (fd0)
 map --hook
 chainloader (fd0)+1
 map (hd1) (hd0)
 map --hook
 rootnoverify (fd0)

title Install Windows 7 64-bit\nThis will install any edition of Windows 64-bit to your hard disk
 debug off
 set MYISO=Win7Hx64.iso
 dd if=()/boot/firadisk/au.xml of=()/AutoUnattend.xml
 dd if=()/boot/firadisk/spaces.txt of=()/boot/firadisk/ISONAME.CMD
 write ()/boot/firadisk/ISONAME.CMD SET MYISO=\\boot\\isos\\win\\%MYISO%\r\n
 map --mem (md)0x800+4 (99)
 map /boot/isos/win/%MYISO% (0xff)
 map (hd0) (hd1)
 map (hd1) (hd0)
 map --hook
 write (99) [FiraDisk]\nStartOptions=cdrom,vmem=find:/boot/isos/win/%MYISO%;\n\0
 chainloader (0xff)/BOOTMGR || chainloader (0xff)

title Install Windows 8 64-bit\nThis will install Windows 8 64-bit to your hard disk
 debug off
 set MYISO=Win8Px64.iso
 dd if=()/boot/firadisk/auWin8.xml of=()/AutoUnattend.xml
 dd if=()/boot/firadisk/spaces.txt of=()/boot/firadisk/ISONAME.CMD
 write ()/boot/firadisk/ISONAME.CMD SET MYISO=\\boot\\isos\\win\\%MYISO%\r\n
 map --mem (md)0x800+4 (99)
 map /boot/isos/win/%MYISO% (0xff)
 map (hd0) (hd1)
 map (hd1) (hd0)
 map --hook
 write (99) [FiraDisk]\nStartOptions=cdrom,vmem=find:/boot/isos/win/%MYISO%;\n\0
 chainloader (0xff)/BOOTMGR || chainloader (0xff)

title Install Windows 8 32-bit\nThis will install Windows 8 32-bit to your hard disk
 debug off
 set MYISO=Win8Px32.iso
 dd if=()/boot/firadisk/auWin8.xml of=()/AutoUnattend.xml
 dd if=()/boot/firadisk/spaces.txt of=()/boot/firadisk/ISONAME.CMD
 write ()/boot/firadisk/ISONAME.CMD SET MYISO=\\boot\\isos\\win\\%MYISO%\r\n
 map --mem (md)0x800+4 (99)
 map /boot/isos/win/%MYISO% (0xff)
 map (hd0) (hd1)
 map (hd1) (hd0)
 map --hook
 write (99) [FiraDisk]\nStartOptions=cdrom,vmem=find:/boot/isos/win/%MYISO%;\n\0
 chainloader (0xff)/BOOTMGR || chainloader (0xff)

title Install Windows - Boot from any Windows 7 or prior ISO to install Windows
# find the ISO folder by looking for a marker file
 debug off
 find --set-root /boot/isos/win/Win8Px64.iso
 clear
 echo
# list all files in the /boot/isos/win/ folder so the user can see them
 ls ()/boot/isos/win/
 echo
# Ask user which iso they want (name is converted to uppercase as /u is specified)
 set /p /u ask=Enter iso filename WITH NO .ISO EXTENSION (e.g. Win7Pro32 ) :
 if "%ask%"=="" echo No iso file specified! && configfile /boot/grub/menu.lst
 clear
# check if user entered a valid filename with no ISO extension!
 ls /boot/isos/win/%ask%.iso || echo Cannot find /boot/isos/win/%ask%.iso !!! && pause --wait=3 && configfile (bd)/boot/grub/menu.lst
 echo Loading /boot/isos/win/%ask%.iso - please wait ...
#set root drive to USB stick
 find --set-root /boot/firadisk/loadiso.cmd
 map --mem (md)0x800+4 (99)
 dd if=()/boot/firadisk/au.xml of=()/AutoUnattend.xml
 dd if=()/boot/firadisk/spaces.txt of=()/boot/firadisk/ISONAME.CMD
 write ()/boot/firadisk/ISONAME.CMD SET MYISO=\\boot\\isos\\win\\%ask%.iso\r\n
 find --set-root /boot/isos/win/%ask%.iso
#run the grub4dos map command and specify the iso file we want to load
 map /boot/isos/win/%ask%.iso (0xff)
 map (hd0) (hd1)
 map (hd1) (hd0)
 map --hook
#Specify the same iso file for when firadisk runs in winpe
 find --set-root /boot/firadisk/loadiso.cmd
 write (99) [FiraDisk]\nStartOptions=cdrom,vmem=find:/boot/isos/win/%ask%.iso;\n\0
 chainloader (0xff)/BOOTMGR || chainloader (0xff)
 clear

title Main Menu
 chainloader (hd0)+1
 rootnoverify (hd0)

title Boot from 1st Hard Disk \nBoot from MBR of first hard disk and remove the USB drive
 map (hd0) (hd1)
 map (hd1) (hd0)
 map --hook
 chainloader (hd0)+1
 rootnoverify (hd0)

title Boot 2nd HD
 chainloader (hd1)+1
 rootnoverify (hd1)

title Reboot
 reboot

title Halt
 halt

title Command-line
 commandline
-----Menu.lst ends-----

Most items available for boot from syslinux are available in the menu also. The reason we install grub4dos is later we will need it to run firadisk so we can install windows 7 or 8 in bios mode. Grub4dos is also needed to boot konboot and mint. Again if anyone has a working syslinux stanzas for these please comment below and I will test them out.

Since Kon-boot and Linux Mint need to be booted with grub4dos it is easier to create a .lst file for each of these. This makes it seamless to boot these from Syslinux through grub4dos.

Create the file konboot.lst and place it in \boot\grub\ and copy everything between the begins and ends lines into it:

-----konboot.lst begins-----
color red/black black/red green/black red/black
timeout 0

title Kon-Boot v2.0
 map --mem /boot/isos/kon-bootFloppy.img (fd0)
 map --hook
 chainloader (fd0)+1
 map (hd1) (hd0)
 map --hook
 rootnoverify (fd0)
-----konboot.lst ends-----

Create the file mint64.lst and place it in \boot\grub\ and copy everything between the begins and ends lines into it:

-----mint64.lst begins-----
color red/black black/red green/black red/black
timeout 0

title Mint 14 64-bit
 find --set-root /boot/isos/linuxmint-14.1-cinnamon-dvd-64bit.iso
 map /boot/isos/llinuxmint-14.1-cinnamon-dvd-64bit.iso (0xff) || map --mem /boot/isos/linuxmint-14.1-cinnamon-dvd-64bit.iso (0xff)
 map --hook
 root (0xff)
 kernel /casper/vmlinuz file=/cdrom/preseed/mint.seed noprompt boot=casper iso-scan/filename=/boot/isos/linuxmint-14.1-cinnamon-dvd-64bit.iso noeject noprompt --
 initrd /casper/initrd.lz
-----mint64.lst ends----

Create the file mint32.lst and place it in \boot\grub\ and copy everything between the begins and ends lines into it:

-----mint32.lst begins-----
color red/black black/red green/black red/black
timeout 0

title Mint 14 32-bit
 find --set-root /boot/isos/linuxmint-14.1-cinnamon-dvd-32bit.iso
 map /boot/isos/linuxmint-14.1-cinnamon-dvd-32bit.iso (0xff) || map --mem /boot/isos/linuxmint-14.1-cinnamon-dvd-32bit.iso (0xff)
 map --hook
 root (0xff)
 kernel /casper/vmlinuz file=/cdrom/preseed/mint.seed noprompt boot=casper iso-scan/filename=/boot/isos/linuxmint-14.1-cinnamon-dvd-32bit.iso noeject noprompt --
 initrd /casper/initrd.lz
-----mint32.lst ends----

***Since most computers are 64 bit I haven't bothered to put Linux Mint 32bit on my thumb drive, but I have provided all the stanzas and information so you can if you wish.

Install Firadisk

Most if not all of what we are about to do comes from http://www.rmprepusb.com/tutorials/firawiniso. All I have done is change some folders around to keep our root directory less cluttered and adjusted the .lst files to suit my directory structure. We are basically doing manually what RMPrepusb does with its program.

Download FiraISO from here
     http://www.rmprepusb.com/documents/rmprepusb-beta-versions/Tut43_FiraIso.zip?attred

Unzip the file and navigate to the extracted folder.

Copy the FiraDisk Folder and the AutoUnattend.xml file to the root of the thumbdrive. IE: X:\ where X is the letter assigned to your thumb drive.

In order for the disk to run properly we will have to add our win8 key to the auWin8.xml file. If you do not have a key or wish to do generic installs and add the key later you can get temporary keys from
     http://www.microsoft.com/oem/en/installation/downloads/Pages/Windows-8-ADK.aspx#fbid=lTRGagl2HLE

Go to the default product keys tab and mark down the one you need.

Navigate to the \FiraDisk\ folder on the thumb drive and right click auWin8.xml file and open with notepad.

Place the key in the appropriate place in the file.

<UserData>
<AcceptEula>true</AcceptEula>
<ProductKey>
<Key>put key here</Key>
</ProductKey>
</UserData>

Note there are two places to put the key. Put the same key in each place. There is already a key there but it does not work and needs to be replaced.

On a side note any windows 7 disc placed in the \boot\isos\win\ directory will show up when you choose the   "Install Windows - Boot from any Windows 7 or prior ISO to install Windows" stanza in the menu.lst or winstall.lst.

As before we will create a .lst file for windows installs so we can boot from syslinux through grub4dos rather than having to go through two menus.

Create the file winstall.lst and place it in \boot\grub\ and copy everything between the begins and ends lines into it:

----winstall.lst begins-----
# version 2012-07-02 for Windows 8 SERVER and earlier OS's

#       NORMAL     HIGHLIGHT     HELPTEXT        HEADING    in pairs consisting of foreground/background
color red/black black/red green/black red/black

# display this heading
write (md)0x220+1 !BAT\necho -n -P:0000 $[0004]--- Windows install ---                                    \0
initscript (md)0x220+1

title Install Windows 7 64-bit\nThis will install any edition of Windows 64-bit to your hard disk
 debug off
 set MYISO=Win7Hx64.iso
 dd if=()/firadisk/au.xml of=()/AutoUnattend.xml
 dd if=()/firadisk/spaces.txt of=()/firadisk/ISONAME.CMD
 write ()/firadisk/ISONAME.CMD SET MYISO=\\boot\\isos\\win\\%MYISO%\r\n
 map --mem (md)0x800+4 (99)
 map /boot/isos/win/%MYISO% (0xff)
 map (hd0) (hd1)
 map (hd1) (hd0)
 map --hook
 write (99) [FiraDisk]\nStartOptions=cdrom,vmem=find:/boot/isos/win/%MYISO%;\n\0
 chainloader (0xff)/BOOTMGR || chainloader (0xff)

title Install Windows 8 64-bit\nThis will install Windows 8 64-bit to your hard disk
 debug off
 set MYISO=Win8Px64.iso
 dd if=()/firadisk/auWin8.xml of=()/AutoUnattend.xml
 dd if=()/firadisk/spaces.txt of=()/firadisk/ISONAME.CMD
 write ()/firadisk/ISONAME.CMD SET MYISO=\\boot\\isos\\win\\%MYISO%\r\n
 map --mem (md)0x800+4 (99)
 map /boot/isos/win/%MYISO% (0xff)
 map (hd0) (hd1)
 map (hd1) (hd0)
 map --hook
 write (99) [FiraDisk]\nStartOptions=cdrom,vmem=find:/boot/isos/win/%MYISO%;\n\0
 chainloader (0xff)/BOOTMGR || chainloader (0xff)

title Install Windows 8 32-bit\nThis will install Windows 8 32-bit to your hard disk
 debug off
 set MYISO=Win8Px86.iso
 dd if=()/firadisk/auWin8.xml of=()/AutoUnattend.xml
 dd if=()/firadisk/spaces.txt of=()/firadisk/ISONAME.CMD
 write ()/firadisk/ISONAME.CMD SET MYISO=\\boot\\isos\\win\\%MYISO%\r\n
 map --mem (md)0x800+4 (99)
 map /boot/isos/win/%MYISO% (0xff)
 map (hd0) (hd1)
 map (hd1) (hd0)
 map --hook
 write (99) [FiraDisk]\nStartOptions=cdrom,vmem=find:/boot/isos/win/%MYISO%;\n\0
 chainloader (0xff)/BOOTMGR || chainloader (0xff)

title Install Windows - Boot from any Windows 7 or prior ISO to install Windows
# find the ISO folder by looking for a marker file
 debug off
 find --set-root /boot/isos/win/Win8Px64.iso
 clear
 echo
# list all files in the /boot/isos/win/ folder so the user can see them
 ls ()/boot/isos/win/
 echo
# Ask user which iso they want (name is converted to uppercase as /u is specified)
 set /p /u ask=Enter iso filename WITH NO .ISO EXTENSION (e.g. Win7Pro32 ) :
 if "%ask%"=="" echo No iso file specified! && configfile /boot/grub/menu.lst
 clear
# check if user entered a valid filename with no ISO extension!
 ls /boot/isos/win/%ask%.iso || echo Cannot find /boot/isos/win/%ask%.iso !!! && pause --wait=3 && configfile (bd)/boot/grub/menu.lst
 echo Loading /boot/isos/win/%ask%.iso - please wait ...
#set root drive to USB stick
 find --set-root /boot/firadisk/loadiso.cmd
 map --mem (md)0x800+4 (99)
 dd if=()/firadisk/au.xml of=()/AutoUnattend.xml
 dd if=()/firadisk/spaces.txt of=()/firadisk/ISONAME.CMD
 write ()/firadisk/ISONAME.CMD SET MYISO=\\boot\\isos\\win\\%ask%.iso\r\n
 find --set-root /boot/isos/win/%ask%.iso
#run the grub4dos map command and specify the iso file we want to load
 map /boot/isos/win/%ask%.iso (0xff)
 map (hd0) (hd1)
 map (hd1) (hd0)
 map --hook
#Specify the same iso file for when firadisk runs in winpe
 find --set-root /firadisk/loadiso.cmd
 write (99) [FiraDisk]\nStartOptions=cdrom,vmem=find:/boot/isos/win/%ask%.iso;\n\0
 chainloader (0xff)/BOOTMGR || chainloader (0xff)
 clear

title Main Menu
 chainloader (hd0)+1
 rootnoverify (hd0)

title Boot from 1st Hard Disk \nBoot from MBR of first hard disk and remove the USB drive
 map (hd0) (hd1)
 map (hd1) (hd0)
 map --hook
 chainloader (hd0)+1
 rootnoverify (hd0)

title Reboot
 reboot

title Halt
 halt

title Command-line
 commandline
-----winstall.lst ends-----

Background

The Syslinux.cfg file points to a background file. To make this work create the folder \boot\background\ and place a file of your choice there and change the background name to match your file.

As you can see I use one called RedPower.jpg. If you want to use the image below click here.


This completes the legacy bios part of the Utility Shed. If you do not require EFI compatibility you can consider yourself done. If you wish to continue you will end up with a thumb drive that can be booted via EFI and install windows 8 in efi mode.

This concludes part 1. See part 2 for the EFI part of this tutorial

Install Windows 8 EFI Setup

The first thing we will do is make the thumb drive able to install Windows 8 in efi mode.

To do this we will mount the windows 8 iso. I'm using 64 bit, if you want 32 bit adjust the instructions accordingly.

On windows 8 you can just double click the iso and it will mount. On any other version of windows you can extract it using winrar or 7zip. If you extract the iso from here on the root of the iso will be the folder you extract the iso to.

Navigate to the root of the windows iso and go into the boot directory.

Copy all the files in the directory over to \boot\ on the thumb drive.

Create a folder call efi at the root of your thumb drive. ie. X:\efi\ where X: is the drive letter assigned to your thumbdrive.

Go to the root of the windows iso and enter the efi directory.

Copy the microsoft directory to the \efi\ directory of your thumb drive.

Go to the root of the windows iso and copy the following files and directories to the root of your thumb drive:


autorun.inf
bootmgr
bootmgr.efi
setup.exe
\sources
\support


If you wish to have it boot automatically when in efi mode to the windows setup then you can move the \efi\boot directory from the root of the windows iso to the \efi\ directory of the thumb drive. My personal preference is to install rEFInd as my default efi boot loader and then boot the windows setup from there.

Install rEFInd

Create the directory \efi\refind\ on your thumb drive.

Download the rEFInd binaries from sourceforge
     http://downloads.sourceforge.net/project/refind/0.6.8/refind-bin-0.6.8.zip

Extract the file and navigate to the \refind-bin-0.6.8\refind-bin-0.6.8\refind\ directory.

Copy all the files except the refind.conf-sample file to the \efi\refind\ directory on the thumb drive.


Create the file refind.conf and place it in \efi\refind\ and copy everything between the begins and ends lines into it:

-----refind.conf begins-----

#
# refind.conf
# Configuration file for the rEFInd boot menu
#

# Timeout in seconds for the main menu screen. Setting the timeout to 0
# disables automatic booting (i.e., no timeout).
#
timeout 0

# Hide user interface elements for personal preference or to increase
# security:
#  banner      - the rEFInd title banner (built-in or loaded via "banner")
#  label       - boot option text label in the menu
#  singleuser  - remove the submenu options to boot Mac OS X in single-user
#                or verbose modes; affects ONLY MacOS X
#  safemode    - remove the submenu option to boot Mac OS X in "safe mode"
#  hwtest      - the submenu option to run Apple's hardware test
#  arrows      - scroll arrows on the OS selection tag line
#  hints       - brief command summary in the menu
#  editor      - the options editor (+, F2, or Insert on boot options menu)
#  all         - all of the above
# Default is none of these (all elements active)
#
#hideui singleuser
#hideui all

# Set the name of a subdirectory in which icons are stored. Icons must
# have the same names they have in the standard directory. The directory
# name is specified relative to the main rEFInd binary's directory. If
# an icon can't be found in the specified directory, an attempt is made
# to load it from the default directory; thus, you can replace just some
# icons in your own directory and rely on the default for others.
# Default is "icons".
#
#icons_dir myicons

# Use a custom title banner instead of the rEFInd icon and name. The file
# path is relative to the directory where refind.efi is located. The color
# in the top left corner of the image is used as the background color
# for the menu screens. Currently uncompressed BMP images with color
# depths of 24, 8, 4 or 1 bits are supported, as well as PNG images.
#
#banner hostname.bmp
#banner mybanner.png

# Custom images for the selection background. There is a big one (144 x 144)
# for the OS icons, and a small one (64 x 64) for the function icons in the
# second row. If only a small image is given, that one is also used for
# the big icons by stretching it in the middle. If only a big one is given,
# the built-in default will be used for the small icons.
#
# Like the banner option above, these options take a filename of an
# uncompressed BMP image file with a color depth of 24, 8, 4, or 1 bits,
# or a PNG image. The PNG format is required if you need transparency
# support (to let you "see through" to a full-screen banner).
#
#selection_big   selection-big.bmp
#selection_small selection-small.bmp

# Set the font to be used for all textual displays in graphics mode.
# The font must be a PNG file with alpha channel transparency. It must
# contain ASCII characters 32-126 (space through tilde), inclusive, plus
# a glyph to be displayed in place of characters outside of this range,
# for a total of 96 glyphs. Only monospaced fonts are supported. Fonts
# may be of any size, although large fonts can produce display
# irregularities.
# The default is rEFInd's built-in font, Luxi Mono Regular 12 point.
#
#font myfont.png

# Use text mode only. When enabled, this option forces rEFInd into text mode.
# Passing this option a "0" value causes graphics mode to be used. Pasing
# it no value or any non-0 value causes text mode to be used.
# Default is to use graphics mode.
#
#textonly

# Set the EFI text mode to be used for textual displays. This option
# takes a single digit that refers to a mode number. Mode 0 is normally
# 80x25, 1 is sometimes 80x50, and higher numbers are system-specific
# modes. Mode 1024 is a special code that tells rEFInd to not set the
# text mode; it uses whatever was in use when the program was launched.
# If you specify an invalid mode, rEFInd pauses during boot to inform
# you of valid modes.
# CAUTION: On VirtualBox, and perhaps on some real computers, specifying
# a text mode and uncommenting the "textonly" option while NOT specifying
# a resolution can result in an unusable display in the booted OS.
# Default is 1024 (no change)
#
#textmode 2

# Set the screen's video resolution. Pass this option either:
#  * two values, corresponding to the X and Y resolutions
#  * one value, corresponding to a GOP (UEFI) video mode
# Note that not all resolutions are supported. On UEFI systems, passing
# an incorrect value results in a message being shown on the screen to
# that effect, along with a list of supported modes. On EFI 1.x systems
# (e.g., Macintoshes), setting an incorrect mode silently fails. On both
# types of systems, setting an incorrect resolution results in the default
# resolution being used. A resolution of 1024x768 usually works, but higher
# values often don't.
# Default is "0 0" (use the system default resolution, usually 800x600).
#
#resolution 1024 768
#resolution 3

# Launch specified OSes in graphics mode. By default, rEFInd switches
# to text mode and displays basic pre-launch information when launching
# all OSes except OS X. Using graphics mode can produce a more seamless
# transition, but displays no information, which can make matters
# difficult if you must debug a problem. Also, on at least one known
# computer, using graphics mode prevents a crash when using the Linux
# kernel's EFI stub loader. You can specify an empty list to boot all
# OSes in text mode.
# Valid options:
#   osx     - Mac OS X
#   linux   - A Linux kernel with EFI stub loader
#   elilo   - The ELILO boot loader
#   grub    - The GRUB (Legacy or 2) boot loader
#   windows - Microsoft Windows
# Default value: osx
#
#use_graphics_for osx,linux

# Which non-bootloader tools to show on the tools line, and in what
# order to display them:
#  shell           - the EFI shell (requires external program; see rEFInd
#                    documentation for details)
#  gptsync         - the (dangerous) gptsync.efi utility (requires external
#                    program; see rEFInd documentation for details)
#  apple_recovery  - boots the Apple Recovery HD partition, if present
#  mok_tool        - makes available the Machine Owner Key (MOK) maintenance
#                    tool, MokManager.efi, used on Secure Boot systems
#  about           - an "about this program" option
#  exit            - a tag to exit from rEFInd
#  shutdown        - shuts down the computer (a bug causes this to reboot
#                    EFI systems)
#  reboot          - a tag to reboot the computer
# Default is shell,apple_recovery,mok_tool,about,shutdown,reboot
#
showtools shell, mok_tool, reboot, shutdown, exit

# Directories in which to search for EFI drivers. These drivers can
# provide filesystem support, give access to hard disks on plug-in
# controllers, etc. In most cases none are needed, but if you add
# EFI drivers and you want rEFInd to automatically load them, you
# should specify one or more paths here. rEFInd always scans the
# "drivers" and "drivers_{arch}" subdirectories of its own installation
# directory (where "{arch}" is your architecture code); this option
# specifies ADDITIONAL directories to scan.
# Default is to scan no additional directories for EFI drivers
#
#scan_driver_dirs EFI/tools/drivers,drivers

# Which types of boot loaders to search, and in what order to display them:
#  internal      - internal EFI disk-based boot loaders
#  external      - external EFI disk-based boot loaders
#  optical       - EFI optical discs (CD, DVD, etc.)
#  hdbios        - BIOS disk-based boot loaders
#  biosexternal  - BIOS external boot loaders (USB, eSATA, etc.)
#  cd            - BIOS optical-disc boot loaders
#  manual        - use stanzas later in this configuration file
# Note that the legacy BIOS options require firmware support, which is
# not present on all computers.
# On UEFI PCs, default is internal,external,optical,manual
# On Macs, default is internal,hdbios,external,biosexternal,optical,cd,manual
#
scanfor internal,external,optical,manual,biosexternal,hdbios,cd

# Delay for the specified number of seconds before scanning disks.
# This can help some users who find that some of their disks
# (usually external or optical discs) aren't detected initially,
# but are detected after pressing Esc.
# The default is 0.
#
#scan_delay 5

# When scanning volumes for EFI boot loaders, rEFInd always looks for
# Mac OS X's and Microsoft Windows' boot loaders in their normal locations,
# and scans the root directory and every subdirectory of the /EFI directory
# for additional boot loaders, but it doesn't recurse into these directories.
# The also_scan_dirs token adds more directories to the scan list.
# Directories are specified relative to the volume's root directory. This
# option applies to ALL the volumes that rEFInd scans UNLESS you include
# a volume name and colon before the directory name, as in "myvol:/somedir"
# to scan the somedir directory only on the filesystem named myvol. If a
# specified directory doesn't exist, it's ignored (no error condition
# results). The default is to scan the "boot" directory in addition to
# various hard-coded directories.
#
#also_scan_dirs boot,ESP2:EFI/linux/kernels
#also_scan_dirs /efi/shells

# Partitions to omit from scans. You must specify a volume by its
# label, which you can obtain in an EFI shell by typing "vol", from
# Linux by typing "blkid /dev/{devicename}", or by examining the
# disk's label in various OSes' file browsers.
# The default is "Recovery HD".
#
#dont_scan_volumes "Recovery HD"

# Directories that should NOT be scanned for boot loaders. By default,
# rEFInd doesn't scan its own directory or the EFI/tools directory.
# You can "blacklist" additional directories with this option, which
# takes a list of directory names as options. You might do this to
# keep EFI/boot/bootx64.efi out of the menu if that's a duplicate of
# another boot loader or to exclude a directory that holds drivers
# or non-bootloader utilities provided by a hardware manufacturer. If
# a directory is listed both here and in also_scan_dirs, dont_scan_dirs
# takes precedence. Note that this blacklist applies to ALL the
# filesystems that rEFInd scans, not just the ESP, unless you precede
# the directory name by a filesystem name, as in "myvol:EFI/somedir"
# to exclude EFI/somedir from the scan on the myvol volume but not on
# other volumes.
#
#dont_scan_dirs ESP:/EFI/boot,EFI/Dell

# Files that should NOT be included as EFI boot loaders (on the
# first line of the display). If you're using a boot loader that
# relies on support programs or drivers that are installed alongside
# the main binary or if you want to "blacklist" certain loaders by
# name rather than location, use this option. Note that this will
# NOT prevent certain binaries from showing up in the second-row
# set of tools. Most notably, MokManager.efi is in this blacklist,
# but will show up as a tool if present in certain directories. You
# can control the tools row with the showtools token.
# The default is shim.efi,TextMode.efi,ebounce.efi,GraphicsConsole.efi,MokManager.efi,HashTool.efi,HashTool-signed.efi
#
dont_scan_files shim.efi,MokManager.efi,bootmgr.efi,winstallx64.efi

# Scan for Linux kernels that lack a ".efi" filename extension. This is
# useful for better integration with Linux distributions that provide
# kernels with EFI stub loaders but that don't give those kernels filenames
# that end in ".efi", particularly if the kernels are stored on a
# filesystem that the EFI can read. When uncommented, this option causes
# all files in scanned directories with names that begin with "vmlinuz"
# or "bzImage" to be included as loaders, even if they lack ".efi"
# extensions. The drawback to this option is that it can pick up kernels
# that lack EFI stub loader support and other files. Passing this option
# a "0" value causes kernels without ".efi" extensions to NOT be scanned;
# passing it alone or with any other value causes all kernels to be scanned.
# Default is to NOT scan for kernels without ".efi" extensions.
#
scan_all_linux_kernels

# Set the maximum number of tags that can be displayed on the screen at
# any time. If more loaders are discovered than this value, rEFInd shows
# a subset in a scrolling list. If this value is set too high for the
# screen to handle, it's reduced to the value that the screen can manage.
# If this value is set to 0 (the default), it's adjusted to the number
# that the screen can handle.
#
#max_tags 0

# Set the default menu selection.  The available arguments match the
# keyboard accelerators available within rEFInd.  You may select the
# default loader using:
#  - A digit between 1 and 9, in which case the Nth loader in the menu
#    will be the default.
#  - Any substring that corresponds to a portion of the loader's title
#    (usually the OS's name or boot loader's path).
#
#default_selection 1

# Include a secondary configuration file within this one. This secondary
# file is loaded as if its options appeared at the point of the "include"
# token itself, so if you want to override a setting in the main file,
# the secondary file must be referenced AFTER the setting you want to
# override. Note that the secondary file may NOT load a tertiary file.
#
#include manual.conf

# Sample manual configuration stanzas. Each begins with the "menuentry"
# keyword followed by a name that's to appear in the menu (use quotes
# if you want the name to contain a space) and an open curly brace
# ("{"). Each entry ends with a close curly brace ("}"). Common
# keywords within each stanza include:
#
#  volume    - identifies the filesystem from which subsequent files
#              are loaded. You can specify the volume by label or by
#              a number followed by a colon (as in "0:" for the first
#              filesystem or "1:" for the second).
#  loader    - identifies the boot loader file
#  initrd    - Specifies an initial RAM disk file
#  icon      - specifies a custom boot loader icon
#  ostype    - OS type code to determine boot options available by
#              pressing Insert. Valid values are "MacOS", "Linux",
#              "Windows", and "XOM". Case-sensitive.
#  graphics  - set to "on" to enable graphics-mode boot (useful
#              mainly for MacOS) or "off" for text-mode boot.
#              Default is auto-detected from loader filename.
#  options   - sets options to be passed to the boot loader; use
#              quotes if more than one option should be passed or
#              if any options use characters that might be changed
#              by rEFInd parsing procedures (=, /, #, or tab).
#  disabled  - use alone or set to "yes" to disable this entry.
#
# Note that you can use either DOS/Windows/EFI-style backslashes (\)
# or Unix-style forward slashes (/) as directory separators. Either
# way, all file references are on the ESP from which rEFInd was
# launched.
# Use of quotes around parameters causes them to be interpreted as
# one keyword, and for parsing of special characters (spaces, =, /,
# and #) to be disabled. This is useful mainly with the "options"
# keyword. Use of quotes around parameters that specify filenames is
# permissible, but you must then use backslashes instead of slashes,
# except when you must pass a forward slash to the loader, as when
# passing a root= option to a Linux kernel.

# Below are several sample boot stanzas. All are disabled by default.
# Find one similar to what you need, copy it, remove the "disabled" line,
# and adjust the entries to suit your needs.

# A sample entry for a Linux 3.3 kernel with its new EFI boot stub
# support on a filesystem called "KERNELS". This entry includes
# Linux-specific boot options and specification of an initial RAM disk.
# Note uses of Linux-style forward slashes, even in the initrd
# specification. Also note that a leading slash is optional in file
# specifications.
menuentry Linux {
icon EFI/refind/icons/os_linux.icns
volume KERNELS
loader bzImage-3.3.0-rc7
initrd initrd-3.3.0.img
options "ro root=UUID=5f96cafa-e0a7-4057-b18f-fa709db5b837"
disabled
}

# A sample entry for loading Ubuntu using its standard name for
# its GRUB 2 boot loader. Note uses of Linux-style forward slashes
menuentry Ubuntu {
loader /EFI/ubuntu/grubx64.efi
icon /EFI/refined/icons/os_linux.icns
disabled
}

# A minimal ELILO entry, which probably offers nothing that
# auto-detection can't accomplish.
menuentry "ELILO" {
loader \EFI\elilo\elilo.efi
disabled
}

# Like the ELILO entry, this one offers nothing that auto-detection
# can't do; but you might use it if you want to disable auto-detection
# but still boot Windows....
menuentry "Windows 7" {
loader \EFI\Microsoft\Boot\bootmgfw.efi
disabled
}

# EFI shells are programs just like boot loaders, and can be
# launched in the same way. You can pass a shell the name of a
# script that it's to run on the "options" line. The script
# could initialize hardware and then launch an OS, or it could
# do something entirely different.
menuentry "Windows via shell script" {
icon \EFI\refind\icons\os_win.icns
loader \EFI\tools\shell.efi
options "fs0:\EFI\tools\launch_windows.nsh"
disabled
}

# Mac OS is normally detected and run automatically; however,
# if you want to do something unusual, a manual boot stanza may
# be the way to do it. This one does nothing very unusual, but
# it may serve as a starting point. Note that you'll almost
# certainly need to change the "volume" line for this example
# to work.
menuentry "My Mac OS X" {
icon \EFI\refind\icons\os_mac.icns
volume "OS X boot"
loader \System\Library\CoreServices\boot.efi
disabled
}

menuentry "Windows 8 Install" {
loader \efi\boot\winstallx64.efi
}

-----refinds.conf ends----

As you can see the last stanza of the refind.conf calls a winstallx64.efi. This is how refind will load the windows efi setup.

Create the directory \efi\boot\ on the thumb drive.

Go back to the root of the windows iso and go into the \efi\boot\ directory.

Copy the bootx64.efi file and place it into the \efi\boot\ directory of the thumb drive.

Rename it to winstallx64.efi

To make an icon show up in refind for this go to the \efi\refind\icons\ directory and copy the  os_win.icns file and paste it into the \efi\boot\ directory of the thumb drive. Rename the icon to winstallx64.icns

In order to make refind the efi default boot for the drive go to the \efi\refind\ directory of the thumb drive and move the drivers_x64 folder and the refind_x64.efi file to the \efi\boot\ directory of the thumb drive.

Copy the icons folder and refind.conf file from the \efi\refind\ directory to the \efi\boot\ directory.

Rename the refind_x64.efi to bootx64.efi.

In order to have a nice icon on the splash screen for rEFInd one has to be specified. I use this one.

Here are two version named for the thumb drive.




http://i.imgur.com/CA41pfS.png


Rename this one to refind_ia32.png and place it in the \efi\refind\ directory.





http://i.imgur.com/CA41pfS.png


Rename this one to bootx64.png and place it in the \efi\boot\ directory.

That's it for the installation of rEFInd. Now when the thumb drive is booted in EFI mode it will boot to rEFInd, from there the options to boot the windows install, refind 32 bit, or leagcy boot options (aka Syslinux) will be presented. rEFInd will also search for EFI  options on the hard drives of the computer it is booted on.

Install Shells

Create the directory \efi\tools\ on the thumb drive

There are four possible shells. A version 1 & 2 for 32 bit computers and the same for 64 bit computers. On my computer I use version 1 64 bit cause it is the only one that will run. If version 2 will run on your computer use it since it has a few more features and is newer.

Shell 2.0 64 bit
     https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2/ShellBinPkg/UefiShell/X64/Shell.efi

Shell 1.0 64 bit
     https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2/EdkShellBinPkg/FullShell/X64/Shell_Full.efi

Shell 2.0 32 bit
     https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2/ShellBinPkg/UefiShell/Ia32/Shell.efi

Shell 1.0 32 bit
    https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2/EdkShellBinPkg/FullShell/Ia32/Shell_Full.efi

Once you find which one works for you name it shell.efi and copy it to \efi\tools\ on yoru thumb drive.

The shell will automatically be found by rEFInd and a terminal icon will show up on the second row of the boot screen along with reboot, shutdown, and quit.

Install Gummiboot

This step is optional. If you do not want to install Gummiboot skip to the copy ISOs section.

***I installed it due to an issue of compatibility between Arch and rEFInd. Turns out it was a separate issue with Arch but I include it here since it is easy to install and may be required at some point.

Create the directory \efi\gummiboot on the thumb drive.

Download Gummiboot from here. This version may be out of date as it is a binary. I could not find an official binary package from the Gummiboot developer:
     http://www.rodsbooks.com/efi-bootloaders/gummiboot-6.tgz

Extract it with winrar or 7zip, navigate to the gummiboot-6\boot\efi\gummiboot\ directory and copy the gummiboot.efi file to the \efi\gummiboot\ directory on the thumbdrive.

Gummiboot only searches for the Window's boot manager and UEFI shell. All other required entries will be placed in a directory and loaded from there.

To create loader files for Gummiboot start by making the directory \loader\ at the root of the thumb drive.

In this folder we will create the file loader.conf. This is the main configuration file for Gummiboot and only supports two options. A timeout and a default selection.

Copy the contents between begins and ends into the file create above

-----loader.conf begins-----

default  refind
timeout  30
-----loader.conf ends-----

change the default as required.

Now create the folder \loader\entries\ on the root of the thumb drive.

Each entry gets its own .conf file.

To load rEFind create the file refind.conf in the \loader\entries\ directory of the thumb drive.

Copy the contents between begins and ends into the file create above.

-----refind.conf begins-----
title Refind 64
efi /EFI/boot/bootx64.efi
-----refind.conf ends-----

We use bootx64.efi because we set it as the default efi boot loader. Gummiboot will also search for this by default but will label it the default boot loade.r

My arch.conf looks like this:

-----arch.conf begins-----

title          Arch Linux
linux          /vmlinuz-linux
initrd         /initramfs-linux.img
options        root=UUID=974122b2-b91d-4099-8aad-e5c77b1f7709 ro
-----arch.conf ends-----

You would have to adjust the options to match your UUID of your boot drive in order for this to work.

Copy the ISOs

Create the folders \boot\isos\ and \boot\isos\win\ on the thumb drive

Copy the following ISOs to the \boot\isos\ folder:

     pmagic_2013_02_28.iso
     Win7PE_SEV8.ISO
     avg_arl_cdi_all_120_120823a5411.iso
     ubcd520.iso
     Hirens.Boot.CD.15.2.iso
     parbootcd.iso                <----Paragon Hard Disk Manager
     STBmc.iso       <----My own version of TinyCore. If you would like it leave a comment.
     win7PE_SEV4Tools.ISO
     kolibri.iso
     archlinux-2013.04.01-dual.iso
     ipxe.lkrn           <----Arch linux network boot

     linuxmint-14.1-cinnamon-dvd-64bit.iso
     kon-bootFLOPPY.img


Now place your windows isos in the \boot\isos\win\ folder of the thumb drive. You will have to rename them as follows or change the grub4dos menu.lst and winstall.lst to reflect you naming choices.

Here's a list of iso's names I used:

Win8Px64.ISO
Win8Px86.ISO
Win7Hx64.ISO


****If you decide to not name the iso's as above you will have to change the corresponding stanza in the appropriate configuration file.

Conclusion

That's it for now. Hope this helps someone. If you see a big error just comment to let me know.

If this helped at all please leave a thanks in the comments.

If you want to use t

Friday 25 January 2013

I have a fair amount of music and enjoy many different types. Lately I've been finding music using youtube. Two of my favorite youtube artist I've found are Pomplamoose and Lauren O'Connell.

An example of each



Friday 7 December 2012

Grub2, Grub4Dos: Config files

Iso booting is awesome. Make a thumbdrive bootable with syslinux/isolinux. Load on grub2 and grub4dos then just place your favorite livecd's iso on the drive and boot from it.

For more information check out Reboot.Pro

Just for reference here are my config files for Syslinux, Grub2 and Grub4Dos

grub.cfg

<------------------------------------------------------->

 timeout=0
default=1

insmod part_gpt
insmod part_msdos
insmod fat
insmod ext2
insmod memdisk
insmod jpeg
insmod gfxterm
insmod efi_gop

loadfont /efi/grub/fonts/unicode.pf2
set gfxmode=auto
set gfxmode=keep
terminal_output gfxterm
terminal gfxterm

use_bg=true
background_image /efi/grub/themes/RedPower.jpg

set menu_color_normal=black/black
set menu_color_highlight=light-red/black
set color_normal=red/black
set timeout=5

menuentry 'Parted Magic LiveCD'{
loopback loop /isos/pmagic_2012_10_10.iso
linux (loop)/pmagic/bzImage iso_filename="/isos/pmagic_2012_10_10.iso" directory=/isos edd=off load_ramdisk=1 prompt_ramdisk=0 rw loglevel=9 max_loop=256 vmalloc=288MiB
initrd (loop)/pmagic/initrd.img
}

menuentry 'BackBox 64bit LiveCD' {
set isofile="/isos/backbox-3.0-i386.iso"
loopback loop /isos/backbox-3.0-amd64.iso
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/isos/backbox-3.0-amd64.iso noprompt noeject
initrd (loop)/casper/initrd.gz
}

menuentry 'Mint Cinnamon 64bit LiveCD' {
set isofile="/isos/linuxmint-13-cinnamon-dvd-64bit.iso"
loopback loop /isos/linuxmint-13-cinnamon-dvd-64bit.iso
linux (loop)/casper/vmlinuz file=/cdrom/preseed/mint.seed boot=casper initrd=initrd.lz iso-scan/filename=/isos/linuxmint-13-cinnamon-dvd-64bit.iso noeject noprompt splash --
initrd (loop)/casper/initrd.lz
}

menuentry 'ArchBoot LiveCD 64bit 2012-10-1' {
loopback loop /isos/archlinux-2012.10-1-archboot-dual.iso
linux (loop)/boot/vmlinuz_x86_64 acpi=off
initrd (loop)/boot/initramfs_x86_64.img
}

submenu 'Utilities and 32bit' {

menuentry 'ArchBoot LiveCD 32bit 2012-10-1' {
loopback loop /isos/archlinux-2012.10-1-archboot-dual.iso
linux (loop)/boot/vmlinuz_32 acpi=off
initrd (loop)/boot/initramfs_32.img
}

menuentry 'BackBox 32bit LiveCD' {
set isofile="/isos/backbox-3.0-i386.iso"
loopback loop /isos/backbox-3.0-i386.iso
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/isos/backbox-3.0-i386.iso noprompt noeject
initrd (loop)/casper/initrd.gz
}

menuentry 'Other Live CDs'{
linux /EFI/grub4dos/grub.exe --config-file="/EFI/grub4dos/menu.lst"
}

}

menuentry 'Refind' {
exit
}

menuentry 'Restart' {
        reboot
}

menuentry 'Shutdown' {
        halt
}

<---------------------------------------------------------------------->

menu.lst

<------------------------------------------------------------------------->


color green/black black/green green/black green/black
timeout 30

title Win7PE User
 map /isos/win7PE_SEV4User.ISO (hd32)
 chainloader (hd0,0)+1
 map --hook
 chainloader (hd32)
 boot

title Win7PE Tools
 map /isos/win7PE_SEV4Tools.ISO (hd32)
 chainloader (hd0,0)+1
 map --hook
 chainloader (hd32)
 boot

title Boot 1st HD
 chainloader (hd0)+1
 rootnoverify (hd0)

title Boot 2nd HD
 chainloader (hd1)+1
 rootnoverify (hd1)

title Boot 3rd HD
 chainloader (hd2)+1
 rootnoverify (hd2)

title Kon-Boot v2.0
 map --mem /isos/kon-bootFloppy.img (fd0)
 map --hook
 chainloader (fd0)+1
 map (hd1) (hd0)
 map --hook
 rootnoverify (fd0)

title Share the Box
 find --set-root /isos/STBmc.iso
 map --mem /isos/STBmc.iso (hd32)
 map --hook
 map --status
 chainloader (hd32)

title Ultimate Boot CD 5.11
 find --set-root /isos/ubcd511.iso
 map /isos/ubcd511.iso (hd32)
 map --hook
 chainloader (hd32)

title G4L
 find --set-root /isos/g4l-v0.37.iso
 map /isos/g4l-v0.37.iso (0xff)
 map --hook
 chainloader (0xff)

title Main Menu
 chainloader (hd0)+1

title Reboot
 reboot

title Halt
 halt

title Command-line
 commandline

<----------------------------------------------------------->

syslinux.cfg

<------------------------------------------------------------>

UI menu.32
Prompt 0

MENU TITLE Boot Menu
TIMEOUT 20
Default Grub2

label Grub2
menu label Grub2
COM32 chain.c32
append file=/boot/grub/i386-pc/boot.img

label Grub4Dos
menu label Grub4Dos
kernel /EFI/grub4dos/grub.exe

<------------------------------------------------------------->

Thursday 6 December 2012

Bash Script: Random File Sync

A simple bash script I wrote.

It will randomly sync files from a source directory to a destination directory.

Features:

  • Prompt for megabytes to move; defaults to 4 GB.
  • Prompt for a source destination.
  • Searches all sub-folders in source directory for files
  • Prompt for a destination directory.
  • Option to delete some, all or none of the files in destination directory.
  • If "none" is typed. No files are deleted.
  • If "all" is typed. All files and folders in destination directory are deleted.
  • If "some" is typed. User is prompted for megabytes to delete. This then becomes the amount of megabytes moved.
  • Files are randomly deleted from destination directory.
  • Files are chosen at random from source directory and moved to destination directory.
Why:

This was written because I could not find a media player that would sync a directory to a directory. I mount my Android phone via sshfs to a folder in my home directory and wanted to randomly sync music files to it from my server. My music collection is quite large and going though it can be laborious. This program suits my needs. It can delete songs at random from my phone and replace them; or it can add files to my phone if I want increase the amount of music on it; or it can completely rebuild the music directory.

Limitations:
  • No error checking. If you enter a wrong parameter it will probably just error out.
  • No auto-completion when choosing directories. You must know where your file are coming from and going to.
  • Does not check if there is enough room in the destination folder. Sshfs (the version I use at least) does not support the checking of free space on a mounted directory. There is some code commented out at the bottom of the script to perform this action for regular directories. It was not tested very much so it may work for you, it may not.
  • Default values are set for me. Change them in the script to your preferences.
Usage:

Create a text file and copy the code below to it.
Save file into a folder you have permission to work in
From the command line type: 

chmod +x foo

where foo is the name you saved the file under.

To run the script from the command line type:

./foo

while in the directory you saved the file in.