Multi-booting Windows 10, RPi OS, and Manjaro on a RPi4

As a little side project, I decided to try a proof of concept and dual boot Windows and Manjaro on a RPi4 with a SSD via UEFI and grub, and I am happy to say, it can be made to work.

$ sudo fdisk -l /dev/sda
Disk /dev/sda: 465.66 GiB, 500003004416 bytes, 976568368 sectors
Disk model:                 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 82BD7DB9-65B6-40DA-B187-48AFBD312BB1

Device        Start       End   Sectors  Size Type
/dev/sda1      2048    264191    262144  128M EFI System
/dev/sda2    264192    296959     32768   16M Microsoft reserved
/dev/sda3    296960  62519295  62222336 29.7G Microsoft basic data
/dev/sda4  62519296  70907903   8388608    4G Linux swap
/dev/sda5  70907904 187047935 116140032 55.4G Linux filesystem
$ cat grub.cfg
menuentry "Manjaro on sda1" {
          echo "Manjaro on sda1 booting..."
          insmod part_gpt
          insmod btrfs
          linux (hd0,gpt1)/kernel-linux-rpi4-rc-5.12.rc5-2.efi root=/dev/sda5 rw rootwait console=serial0,115200 console=tty1 selinux=0 plymouth.enable=0 smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 kgdboc=serial0,115200 usbhid.mousepoll=8 audit=0
          initrd (hd0,gpt1)/initramfs-linux-rpi4-rc-5.12.rc5-2.img
          boot
}

menuentry "Manjaro RC5-2 DTB on sda5" {
          echo "Manjaro RC5-2 DTB on sda5 booting..."
          insmod part_gpt
          insmod btrfs
          linux (hd0,gpt5)/@/boot/kernel-linux-rpi4-rc-5.12.rc5-2.efi root=/dev/sda5 rw rootwait snd_bcm2835.enable_hdmi=1 console=serial0,115200 console=tty1 selinux=0 plymouth.enable=0 smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 kgdboc=serial0,115200 usbhid.mousepoll=8 audit=0 vc_mem.mem_base=0x3eb00000 vc_mem.mem_size=0x3ff00000
          devicetree (hd0,gpt5)/@/boot/bcm2711-linux-rpi4-rc-5.12.rc5-2.dtb
          initrd (hd0,gpt5)/@/boot/initramfs-linux-rpi4-rc-5.12.rc5-2.img
          boot
}

menuentry "Windows 10 ARM" {
          echo "Windows 10 ARM booting..."
          insmod part_gpt
          insmod chain
          insmod ntfs
          set root=(hd0,1)
          chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}

menuentry "System shutdown" {
          echo "System shutting down..."
          halt
}

menuentry "System restart" {
          echo "System rebooting..."
          reboot
}

4 Likes

There seems to be an issue with changing the UEFI default settings and Windows ARM booting, if the boot device is determined via boot order. However, it will boot, if you use the UEFI Boot Manager to select the boot drive. I have opened a ticket.

Edit: This patch has now been submitted, no clue, if or when it will be accepted.

Edit 2: The patch has passed the eye test, so hopefully it will make it.

Edit 3: I was given a patched copy of RPI_EFI.fd and it does resolve the Windows ARM not booting issue.

Edit 4: This is the patched RPI_EFI.fd file. It is a link on Discord, I assume you can download it.

Edit 5: The patch has been applied in v1.26

1 Like

I have added Raspberry Pi OS 64.

$ cat /boot/grub/grub.cfg

menuentry "Manjaro dynamic DTB on sda1" {
          echo "Manjaro dynamic DTB on sda1 booting..."
          insmod part_gpt
          insmod btrfs
          linux (hd0,gpt1)/kernel-linux-rpi4-rc-5.12.rc6-1.efi root=/dev/sda5 rw rootwait console=serial0,115200 console=tty1 selinux=0 plymouth.enable=0 smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 kgdboc=serial0,115200 usbhid.mousepoll=8 audit=0
          initrd (hd0,gpt1)/initramfs-linux-rpi4-rc-5.12.rc6-1.img
          boot
}

menuentry "Manjaro RC6-1 static DTB on gpt5" {
          echo "Manjaro RC6-1 static DTB on sda5 booting..."
          insmod part_gpt
          insmod btrfs
          linux (hd0,gpt5)/@/boot/kernel-linux-rpi4-rc-5.12.rc6-1.efi root=/dev/sda5 rw rootwait snd_bcm2835.enable_hdmi=1 console=serial0,115200 console=tty1 selinux=0 plymouth.enable=0 smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 kgdboc=serial0,115200 usbhid.mousepoll=8 audit=0 vc_mem.mem_base=0x3eb00000 vc_mem.mem_size=0x3ff00000
          devicetree (hd0,gpt5)/@/boot/bcm2711-linux-rpi4-rc-5.12.rc6-1.dtb
          initrd (hd0,gpt5)/@/boot/initramfs-linux-rpi4-rc-5.12.rc6-1.img
          boot
}

menuentry "Raspberry Pi OS on sda6" {
          echo "Raspberry Pi OS on sda6 booting..."
          insmod part_gpt
          insmod ext2
          linux (hd0,gpt6)/boot/kernel8.img root=/dev/sda6 rw rootfstype=ext4 rootwait console=serial0,115200 console=tty1 selinux=0 elevator=deadline fsck.repair=yes splash plymouth.ignore-serial-consoles plymouth.enable=0 smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 kgdboc=serial0,115200 usbhid.mousepoll=8 audit=0
          boot
}

menuentry "Windows 10 ARM" {
          echo "Windows 10 ARM booting..."
          insmod part_gpt
          insmod fat
          insmod ntfs
          insmod chain
          set root=(hd0,gpt1)
          chainloader (hd0,gpt1)/EFI/Microsoft/Boot/bootmgfw.efi
}

menuentry "System shutdown" {
          echo "System shutting down..."
          halt
}

menuentry "System restart" {
          echo "System rebooting..."
          reboot
}


Note: Sound does work but for some reason the widget has no volume control. However the playback apps can adjust the volume as well as amixer.

1 Like

I removed Windows ARM, just not my thing, and I doubt the long term viability.

After a bit of wrangling, I added Arch ARM. So now I have Manjaro, Arch and RPi OS 64 installed with room for a forth on my internal SSD (Argon M.2 case).

After using this setup for a while, it does seem to be maintainable and revertible. Each OS has its own local /boot directory in the rootfs partition and all share /boot/efi (sda1), which contains the UEFI files so updates work without breakage. I just need to manually update my grub.cfg and /boot/efi/overlays files, as desired.