Skip to content

Commit

Permalink
Fix urls and guest additions
Browse files Browse the repository at this point in the history
  • Loading branch information
xdissent committed Jan 4, 2017
1 parent 1de5491 commit 72e4b6d
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 26 deletions.
23 changes: 13 additions & 10 deletions control/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ install_packages() {
}

download_cross_compiler() {
url="http://landley.net/aboriginal/downloads/binaries/cross-compiler-i686.tar.bz2"
url="http://landley.net/aboriginal/downloads/binaries/cross-compiler-i686.tar.gz"
archive=`basename "${url}"`
log "Downloading cross compiler archive from ${url} to ${ievms_home}/${archive}"
if [[ ! -e "${archive}" ]] && ! curl -L "${url}" -o "${archive}"
Expand All @@ -31,9 +31,9 @@ download_cross_compiler() {
}

extract_cross_compiler() {
cross_compiler=`basename "${archive}" .tar.bz2`
cross_compiler=`basename "${archive}" .tar.gz`
log "Extracting cross compiler archive from ${archive} to ${ievms_home}/${cross_compiler}"
if [[ ! -e "${cross_compiler}" ]] && ! tar -jxf "${archive}"
if [[ ! -e "${cross_compiler}" ]] && ! tar -zxf "${archive}"
then
fail "Failed to extract ${archive} to ${ievms_home}/${cross_compiler} using 'tar', error code ($?)"
fi
Expand All @@ -46,7 +46,7 @@ download_kernel() {
if [[ ! -e "${archive}" ]] && ! curl -L "${url}" -o "${archive}"
then
fail "Failed to download ${url} to ${ievms_home}/${archive} using 'curl', error code ($?)"
fi
fi
}

extract_kernel() {
Expand All @@ -55,7 +55,7 @@ extract_kernel() {
if [[ ! -e "${kernel_src}" ]] && ! tar -jxf "${archive}"
then
fail "Failed to extract ${archive} to ${ievms_home}/${kernel_src} using 'tar', error code ($?)"
fi
fi
}

configure_kernel() {
Expand All @@ -82,7 +82,7 @@ download_iso() {
if [[ ! -e "${archive}" ]] && ! curl -L "${url}" -o "${archive}"
then
fail "Failed to download ${url} to ${ievms_home}/${archive} using 'curl', error code ($?)"
fi
fi
}

extract_iso() {
Expand All @@ -91,7 +91,7 @@ extract_iso() {
if [[ ! -e "${iso}" ]] && ! unzip "${archive}"
then
fail "Failed to extract ${archive} to ${ievms_home}/${iso} using 'unzip', error code ($?)"
fi
fi
}

unpack_iso() {
Expand All @@ -118,10 +118,13 @@ extract_initrd() {
copy_scripts() {
log "Copying scripts"
cp "/vagrant/control/stage2" "${initrd}/scripts/"
cp "/vagrant/control/xp.reg" "${initrd}/scripts/"
cp "/vagrant/control/xpsw.reg" "${initrd}/scripts/"
cp "/vagrant/control/xpusr.reg" "${initrd}/scripts/"
cp "/vagrant/control/xpvboxga.bat" "${initrd}/scripts/"
cp "/vagrant/control/deuac.reg" "${initrd}/scripts/"
cp "/vagrant/control/reuac.reg" "${initrd}/scripts/"
cp "/vagrant/control/vboxga.bat" "${initrd}/scripts/"
cp "/vagrant/control/vsint.cer" "${initrd}/scripts/"
cp "/vagrant/control/ievms.xml" "${initrd}/scripts/"
cp "/vagrant/control/ievms.bat" "${initrd}/scripts/"
cp "/vagrant/control/isolinux.cfg" "${remaster_iso}/isolinux.cfg"
Expand All @@ -143,7 +146,7 @@ compress_initrd() {
pack_iso() {
iso_out="/vagrant/ievms-control.iso"
log "Packing ievms ISO from ${remaster_iso} to ${iso_out}"
if ! genisoimage -o "${iso_out}" -b isolinux.bin -c boot.cat -p "ievms" -no-emul-boot -boot-load-size 4 -boot-info-table -V "IEVMS" -cache-inodes -r -J -l -joliet-long "${remaster_iso}"
if ! genisoimage -o "${iso_out}" -b isolinux.bin -c boot.cat -p "ievms" -no-emul-boot -boot-load-size 4 -boot-info-table -V "IEVMS" -cache-inodes -r -J -l -joliet-long "${remaster_iso}"
then
fail "Failed to pack ${remaster_iso} to ${iso_out} using 'genisoimage', error code ($?)"
fi
Expand All @@ -164,4 +167,4 @@ unpack_iso
extract_initrd
copy_scripts
compress_initrd
pack_iso
pack_iso
7 changes: 5 additions & 2 deletions control/stage2
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ fi

if [ -d /disk/WINDOWS ]
then
reged -IC /disk/WINDOWS/system32/config/system HKEY_LOCAL_MACHINE\\SYSTEM /scripts/xp.reg
reged -IC /disk/WINDOWS/system32/config/software HKEY_LOCAL_MACHINE\\SOFTWARE /scripts/xpsw.reg
reged -IC /disk/Documents\ and\ Settings/IEUser/NTUSER.DAT HKEY_USERS\\S-1-5-21-776561741-308236825-1417001333-1003 /scripts/xpusr.reg
cp /scripts/xpvboxga.bat /disk/Documents\ and\ Settings/All\ Users/Start\ Menu/Programs/Startup/
else
reged -IC /disk/Windows/System32/config/SOFTWARE HKEY_LOCAL_MACHINE\\SOFTWARE /scripts/deuac.reg

Expand All @@ -25,9 +27,10 @@ else
cp /scripts/vboxga.bat /disk/ProgramData/Microsoft/Windows/Start\ Menu/Programs/StartUp/
fi

cp /scripts/vsint.cer /disk/vsint.cer
cp /scripts/reuac.reg /disk/reuac.reg
cp /scripts/ievms.xml /disk/ievms.xml
cp /scripts/ievms.bat /disk/ievms.bat
fi
umount /disk 2>/dev/null
poweroff
poweroff
5 changes: 3 additions & 2 deletions control/vboxga.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
cd /d D:\
cd \cert
VBoxCertUtil.exe add-trusted-publisher oracle-vbox.cer --root oracle-vbox.cer
VBoxCertUtil.exe add-trusted-publisher vbox-sha1.cer --root C:\vsint.cer
del C:\vsint.cer
cd \
VBoxWindowsAdditions.exe /S
regedit.exe /S C:\reuac.reg
Expand All @@ -12,4 +13,4 @@ schtasks.exe /run /tn ievms
timeout /t 30
del C:\Users\IEUser\ievms.bat
shutdown.exe /s /t 00
del %0
del %0
Binary file added control/vsint.cer
Binary file not shown.
Binary file removed control/xp.reg
Binary file not shown.
Binary file added control/xpsw.reg
Binary file not shown.
Binary file added control/xpusr.reg
Binary file not shown.
4 changes: 4 additions & 0 deletions control/xpvboxga.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cd /d D:\
VBoxWindowsAdditions.exe /S
shutdown.exe /s /t 00
del %0
29 changes: 17 additions & 12 deletions ievms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set -o pipefail
# ## Global Variables

# The ievms version.
ievms_version="0.3.1"
ievms_version="0.3.2"

# Options passed to each `curl` command.
curl_opts=${CURL_OPTS:-""}
Expand Down Expand Up @@ -163,10 +163,10 @@ check_ext_pack() {

# Download and install `unar` from Google Code.
install_unar() {
local url="http://theunarchiver.googlecode.com/files/unar1.5.zip"
local url="http://unarchiver.c3.cx/downloads/unar1.10.1.zip"
local archive=`basename "${url}"`

download "unar" "${url}" "${archive}" "fbf544d1332c481d7d0f4e3433fbe53b"
download "unar" "${url}" "${archive}" "d548661e4b6c33512074df81e39ed874"

unzip "${archive}" || fail "Failed to extract ${ievms_home}/${archive} to ${ievms_home}/, unzip command returned error code $?"

Expand All @@ -188,7 +188,7 @@ wait_for_shutdown() {
while true ; do
log "Waiting for ${1} to shutdown..."
sleep "${sleep_wait}"
VBoxManage showvminfo "${1}" | grep "State:" | grep -q "powered off" && return 0 || true
VBoxManage showvminfo "${1}" | grep "State:" | grep -q "powered off" && sleep "${sleep_wait}" && return 0 || true
done
}

Expand All @@ -210,7 +210,7 @@ find_iso() {
iso=$dev_iso
else
iso="${ievms_home}/ievms-control-${ievms_version}.iso"
download "ievms control ISO" "${url}" "${iso}" "6699cb421fc2f56e854fd3f5e143e84c"
download "ievms control ISO" "${url}" "${iso}" "1fe3f95e0731bbcba949564cf9bbe28a"
fi
}

Expand Down Expand Up @@ -344,6 +344,7 @@ build_ievm() {
unset archive
unset unit
local prefix="IE"
local suffix=""
local version="${1}"
case $1 in
6|7|8)
Expand Down Expand Up @@ -371,6 +372,7 @@ build_ievm() {
;;
EDGE)
prefix="MS"
suffix="_preview"
version="Edge"
os="Win10"
unit="8"
Expand All @@ -382,14 +384,14 @@ build_ievm() {
local def_archive="${vm/ - /_}.zip"
archive=${archive:-$def_archive}
unit=${unit:-"11"}
local ova=`basename "${archive/_/ - }" .zip`.ova
local ova="`basename "${archive/_/ - }" .zip`${suffix}.ova"

local url
if [ "${os}" == "Win10" ]
then
url="https://az792536.vo.msecnd.net/vms/VMBuild_20150801/VirtualBox/MSEdge/Mac/Microsoft%20Edge.Win10.For.Mac.VirtualBox.zip"
url="https://az792536.vo.msecnd.net/vms/VMBuild_20160802/VirtualBox/MSEdge/MSEdge.Win10_RS1.VirtualBox.zip"
else
url="http://virtualization.modern.ie/vhd/IEKitV1_Final/VirtualBox/OSX/${archive}"
url="https://az412801.vo.msecnd.net/vhd/IEKitV1_Final/VirtualBox/OSX/${archive}"
fi

local md5
Expand All @@ -399,9 +401,9 @@ build_ievm() {
IE8_Win7.zip) md5="21b0aad3d66dac7f88635aa2318a3a55" ;;
IE9_Win7.zip) md5="58d201fe7dc7e890ad645412264f2a2c" ;;
IE10_Win8.zip) md5="cc4e2f4b195e1b1e24e2ce6c7a6f149c" ;;
MSEdge_Win10.zip) md5="c1011b491d49539975fb4c3eeff16dae" ;;
MSEdge_Win10.zip) md5="467d8286cb8cbed90f0761c3566abdda" ;;
esac

log "Checking for existing OVA at ${ievms_home}/${ova}"
if [[ ! -f "${ova}" ]]
then
Expand All @@ -427,14 +429,15 @@ build_ievm() {

log "Tagging VM with ievms version"
VBoxManage setextradata "${vm}" "ievms" "{\"version\":\"${ievms_version}\"}"

log "Creating clean snapshot"
VBoxManage snapshot "${vm}" take clean --description "The initial VM state"
fi
}

# Build the IE6 virtual machine.
build_ievm_ie6() {
boot_auto_ga "IE6 - WinXP"
set_xp_password "IE6 - WinXP"
shutdown_xp "IE6 - WinXP"
}
Expand All @@ -445,6 +448,7 @@ build_ievm_ie7() {
then
boot_auto_ga "IE7 - Vista"
else
boot_auto_ga "IE7 - WinXP"
set_xp_password "IE7 - WinXP"
install_ie_xp "IE7 - WinXP" "http://download.microsoft.com/download/3/8/8/38889dc1-848c-4bf2-8335-86c573ad86d9/IE7-WindowsXP-x86-enu.exe" "ea16789f6fc1d2523f704e8f9afbe906"
fi
Expand All @@ -456,6 +460,7 @@ build_ievm_ie8() {
then
boot_auto_ga "IE8 - Win7"
else
boot_auto_ga "IE8 - WinXP"
set_xp_password "IE8 - WinXP"
install_ie_xp "IE8 - WinXP" "http://download.microsoft.com/download/C/C/0/CC0BD555-33DD-411E-936B-73AC6F95AE11/IE8-WindowsXP-x86-ENU.exe" "616c2e8b12aaa349cd3acb38bf581700"
fi
Expand All @@ -473,7 +478,7 @@ build_ievm_ie10() {
boot_auto_ga "IE10 - Win8"
else
boot_auto_ga "IE10 - Win7"
install_ie_win7 "IE10 - Win7" "http://download.microsoft.com/download/8/A/C/8AC7C482-BC74-492E-B978-7ED04900CEDE/IE10-Windows6.1-x86-en-us.exe" "0f14b2de0b3cef611b9c1424049e996b"
install_ie_win7 "IE10 - Win7" "https://raw.githubusercontent.com/kbandla/installers/master/MSIE/IE10-Windows6.1-x86-en-us.exe" "0f14b2de0b3cef611b9c1424049e996b"
fi
}

Expand Down

0 comments on commit 72e4b6d

Please sign in to comment.