added serial number parameter (zeroed by default)

This commit is contained in:
img2tab
2018-11-07 11:18:28 +00:00
committed by GitHub
parent 0340e9b4a3
commit f27702d7e4
+19 -9
View File
@@ -2,18 +2,23 @@
# One-Key-Installation of macOS on VirtualBox # One-Key-Installation of macOS on VirtualBox
# (c) img2tab, licensed under GPL2.0 or higher # (c) img2tab, licensed under GPL2.0 or higher
# url: https://github.com/img2tab/okiomov # url: https://github.com/img2tab/okiomov
# version 0.22 # version 0.23
# Requirements: 33.5GB available storage on host # Requirements: 33.5GB available storage on host
# Dependencies: bash>4.0, unzip, wget, dmg2img, VirtualBox>5.2 # Dependencies: bash>4.0, unzip, wget, dmg2img, VirtualBox>5.2
# Personalized the installation by setting these variables: # Personalized the installation by setting these variables:
vmname="Mojave" # name of VirtualBox virtual machine vmname="Mojave" # name of VirtualBox virtual machine
storagesize=22000 # size of target virtual disk image. minimum 22000 storagesize=22000 # size of target virtual disk image. minimum 22000
cpucount=2 # VM CPU cores, minimum 2 cpucount=2 # VM CPU cores, minimum 2
memorysize=4096 # VM RAM in MB, minimum 2048 memorysize=4096 # VM RAM in MB, minimum 2048
gpuvram=128 # VM video RAM in MB, minimum 34 gpuvram=128 # VM video RAM in MB, minimum 34
resolution=1280x800 # display resolution resolution="1280x800" # display resolution
serialnumber="000000000000" # valid serial required for iCloud, iMessage
# structure: PPPYWWUUUCCC - plant, year, week, unique identifier, model
# The whether the serial is valid depends on the device name, below
devicename="MacBookPro11,3"
boardid="Mac-2BD1B31983FE1663"
# welcome message # welcome message
whiteonred="\e[48;2;255;0;0m\e[38;2;255;255;255m" whiteonred="\e[48;2;255;0;0m\e[38;2;255;255;255m"
@@ -30,6 +35,9 @@ The installation requires '${whiteonred}'33.5GB\033[0m of available storage,
The script checks for dependencies and will prompt to install them if unmet. The script checks for dependencies and will prompt to install them if unmet.
For iCloud and iMessage functionality, you will need to provide a valid
Apple serial number. macOS will work without it, but not Apple-connected apps.
Press enter to continue, CTRL-C to exit.' Press enter to continue, CTRL-C to exit.'
read read
@@ -136,11 +144,11 @@ VBoxManage modifyvm "${vmname}" --cpus "${cpucount}" --memory "${memorysize}" \
--boot4 none --firmware efi --rtcuseutc on --usbxhci on --chipset ich9 \ --boot4 none --firmware efi --rtcuseutc on --usbxhci on --chipset ich9 \
--mouse usb --keyboard usb --audio none --mouse usb --keyboard usb --audio none
VBoxManage setextradata "${vmname}" \ VBoxManage setextradata "${vmname}" \
"VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "MacBookPro11,3" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "${devicename}"
VBoxManage setextradata "${vmname}" \ VBoxManage setextradata "${vmname}" \
"VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
VBoxManage setextradata "${vmname}" \ VBoxManage setextradata "${vmname}" \
"VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Mac-2BD1B31983FE1663" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "${boardid}"
VBoxManage setextradata "${vmname}" \ VBoxManage setextradata "${vmname}" \
"VBoxInternal/Devices/smc/0/Config/DeviceKey" \ "VBoxInternal/Devices/smc/0/Config/DeviceKey" \
"ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
@@ -148,6 +156,8 @@ VBoxManage setextradata "${vmname}" \
"VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1 "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1
VBoxManage setextradata "${vmname}" \ VBoxManage setextradata "${vmname}" \
"VBoxInternal2/EfiGraphicsResolution" "${resolution}" "VBoxInternal2/EfiGraphicsResolution" "${resolution}"
VBoxManage setextradata "${vmname}" \
"VBoxInternal/Devices/efi/0/Config/DmiSystemSerial" "${serialnumber}"
# sterr back # sterr back
exec 2>/dev/tty exec 2>/dev/tty