Recovery Toolkit

Recovery ToolKit is a collection of scripts and files that make modifying the internal disk a breeze

Recovery Environment

To let the toolkit make adjustments to the storage of the RT device we have to boot onto a Windows 8.0 recovery environment. If you plan to do these you should first turn off any bit-locker encryption on the RT device.

Prepared recovery images that include the scripts and files are provided below. The base image is 500MiB but has to be supplied with an install file to apply. These are separated to the recovery image. Different regions are there to give the correct language, keyboard and culture options. Different regions should work on the hardware.

Booting Recovery

Booting into the recovery mode is done by following these steps

  • Switch off your device

  • Press and hold the volume down button

  • Press the power button

  • Release the volume down button after the surface logo appears

  • Wait about 2-3 minutes for the recovery environment to load (depending on usb stick speed)

Once loaded up in recovery you are asked to select a language and keyboard layout, do so. Proceed to then select the Troubleshoot and Advanced Options to get a CMD window. Execute the following command in the terminal window.

X:\Windows\System32>D:
D:\>menu.cmd

You will be greeted with a verification question that bit-locker is turned off. Once confirmed you are presented with the main menu.

Using the Toolkit

[MAIN MENU]
==========================
1 | AUTOMATED INSTALLS
2 | PARTITIONING
3 | INSTALL
4 | BOOT
5 | UNLOCK

You can navigate the menu's by entering the number of the corresponding menu item. 0 will always bring you up in the menu tree.

Automated Installs

[AUTOMATED INSTALLS]
WARNING, THESE WIPE THE ENTIRE DISK
0 | UP
==========================
1 | WINDOWS 8.0
2 | WINDOWS 10

In automated installs you can wipe, automatically partition and install a .wim file that was put in the sources folder of the recovery. For Windows 8.0 this file is named Install.wim, these should also come with a CreatePartitions-UEFI.txt file to partition the disk with. Windows 10 only requires a file named Install_10_15035.wim and uses the /sources diskpart script.

Partitioning

[PARTITIONING]
WARNING, THESE WIPE THE ENTIRE DISK
0 | UP
==========================
1 | CREATEPARTITIONS-UEFI (IF INSTALL PRESENT)
2 | 512K
3 | 4K

Partitioning automates the wiping and partitioning of your device. It can format using the CreatePartitions-UEFI.txt in the sources folder or use the 2 default scripts provided in the Scripts folder. 4K is there because it was provided in the original source. Normally no 4K disks are used in known devices.

Installs

[INSTALLS]
WARNING, THESE WIPE THE INSTALLED OS
0 | UP
==========================
1 | INSTALL WINDOWS RT 8.0
2 | INSTALL WINDOWS RT 10

Installs executes dism with an .wim image out of the sources folder on the recovery disk. Respectively called Install.wim and Install_10_15035.wim.

Boot

[BOOT]
0 | UP
==========================
1 | COPY RECOVERY EFI
2 | COPY ESP EFI
3 | SCAN AND ADD BOOT DEVICES
4 | COPY GRUB AS BOOT (EXPERIMENTAL)

Under boot you can copy over the boot EFI files to be able to boot Windows RT, add installed windows version to the boot manager and copy a broken copy of grub over to the efi partition and put it as boot manager instead. Using the copy efi options will copy a version of the windows boot manager to the S partition. This is necessary to boot any windows version. Windows 8.0 is happy with the recovery efi. Windows 10 requires a espefi for reasons. The grub is version 2.02 and is the only non windows environment the surface has booted in. The grub install comes with a config that has quite a flew automatic boot discovery options and basic actions. The grub config is unable currently to boot windows itself, so it makes it useless in that sense. Only do this if you intend to use or modify the configuration.

Unlock

[UNLOCK]
0 | UP
==========================
1 | SET TESTSIGNING MODE
2 | APPLY SECUREBOOT SIGNING WORKAROUND

Under unlock you can apply bcdedit commands for testsigning and the secureboot soft disable to allow our self signed binaries.