Boot an EFI-based Linux kernel on your Surface RT.
Most people use UEFI shell to chainload an EFI linux kernel. Using UEFI shell gives the option to easily specify and modify the kernel command line.
Place UEFI shell onto your bootable USB drive (as efi/boot/bootarm.efi) and place the zImage and the tegra30-microsoft-surface-rt-efi.dtb files onto the root of your usb drive.
You will need to create a startup script for UEFI shell:
# add initrd=<initrd.img-filename> if you want to boot a ramdisk image
# replace console=tty0 with console=ttyS0,115200 if you want serial output on UART A
zImage dtb=tegra30-microsoft-surface-rt-efi.dtb root=/dev/mmcblk1p2 console=tty0 cpuidle.off=1
# shutdown if something went wrong
You may want to change the line that begins with
zImage. It is the kernel command line.
root=/dev/mmcblk1p2is the second partition of the sdcard, change this if you want to use a different device/partition. RPI OS is a recommended distro, as it runs smooth
root=/dev/mmcblk0p2is a location set to internal storage (eMMC) second partition, set it to this after cloning the installation over to internal storage.
root=/dev/sda2is a second partition for USB only boot, set it to this if you want to USB boot only
With the USB drive set up, a distro installed and secure boot disabled, you are ready to boot linux.
- 1.Shut the device off
- 2.Plug in your USB drive
- 3.Boot from the USB
- 1.Hold the volume down button
- 2.Press the power button for a second
- 3.Wait until the surface logo appears
- 4.Release volume down
- 4.You should see kernel logs onscreen (after a short while (15 seconds), wait for 1 minute if nothing happens try again)
With the method shown above, you will need your USB always on hand to boot linux. You can also install these boot files on the internal storage.
The easiest method is to just clean the windows boot files from the EFI partition, and replace them with the contents of your USB drive.
This will make you unable to boot Windows!
It is possible to make Windows and Linux dual-boot. For example, you can use GRUB.
Replace the contents of your startup.nsh on the USB with the following:
cp fs1:\efi/boot/bootarm.efi fs1:\efi/boot/bootarm.efi.backup >> log.txt
cp efi/boot/bootarm.efi fs1:\efi/boot/bootarm.efi >> log.txt
cp tegra30-microsoft-surface-rt-efi.dtb fs1: >> log.txt
cp zImage fs1: >> log.txt
cp startup-system.nsh fs1:\startup.nsh >> log.txt
After booting, it will copy the devicetree, zImage and the startup-system.nsh over to the EFI partition on the internal storage. Fill your startup-system.nsh with the linux boot commands. (The commands you normally have in your startup.nsh)
This method is also useful for updating the device tree and zImage, if you already have existing linux files there.