Skip to content

Instantly share code, notes, and snippets.

@alexanderzjs
Last active May 19, 2022 07:25
Show Gist options
  • Save alexanderzjs/56ad1a182f591a17727a72919f0e1224 to your computer and use it in GitHub Desktop.
Save alexanderzjs/56ad1a182f591a17727a72919f0e1224 to your computer and use it in GitHub Desktop.
Multiboot USB with rEFInd x86_64 UEFI

Multiboot USB with rEFInd (Please star it if it helps you!!!)

This gist is for x86_64 (amd64) architecture and UEFI boot mode!

Suppose you have 3 partitions: 1. EFI partition (FAT32); 2. macOS partition (Mac OS Extended); 3. WinPE and multiple Linux distros partition (FAT32).

  1. EFI partition should have: a. rEFInd's files: bootx64.efi, refind.conf and icons folder; b. WinPE's boot files: bcd and bootx64.efi (bcd file needs to be modified according to your WinPE's boot.sdi and boot.wim)

  2. macOS patition should have your macOS image file.

  3. WinPE and multiple Linux distros partition should have different folders to include the ISO and their bootloaders. Normally, bootloaders for linux distros can be extracted from their ISO files, but some Debian based installers (Debian and Kali) need to be downloaded from their corresponding mirror sites, e.g. https://mirrors.XXX.debain.org/debian/dists/Debian11.1/main/installer-amd64/current/images/hd-media/.

menuentry "macOS Big Sur" {
    icon \EFI\boot\icons\os_cata.png
    volume "Install macOS Big Sur" # This is the label of the second partition
    loader \System\Library\CoreServices\boot.efi
}

menuentry "Windows 10 PE x86_64" {
    icon \EFI\boot\icons\os_win8.png
    loader \EFI\microsoft\boot\bootx64.efi
}

menuentry "Ubuntu 20.04.3 amd64" {
    icon /EFI/boot/icons/os_ubuntu.png
    volume "OS" # This is the label of the third partition
    loader /ubuntu/vmlinuz # extracted from the installer ISO
    initrd /ubuntu/initrd # extracted from the installer ISO
    options "boot=casper iso-scan/filename=/ubuntu/ubuntu-20.04.3-live-server-amd64.iso quiet"
}

menuentry "Fedora 35 x86_64" {
    icon /EFI/boot/icons/os_fedora.png
    volume "OS"
    loader /fedora/vmlinuz # extracted from the installer ISO
    initrd /fedora/initrd.img # extracted from the installer ISO
    options "inst.repo=hd:LABEL=OS:/fedora/Fedora-Server-dvd-x86_64-35-1.2.iso noeject ---"
}

menuentry "OpenSUSE Leap 15.3" {
    icon /EFI/boot/icons/os_suse.png
    volume "OS"
    loader /opensuseleap15.3/linux # extracted from the installer ISO
    initrd /opensuseleap15.3/initrd # extracted from the installer ISO
    options "splash=silent quiet root=live:CDLABEL=openSUSE_Leap_15.3_KDE_Live rd.live.image iso-scan/filename=/opensuseleap15.3/openSUSE-Leap-15.3-KDE-Live-x86_64-Media.iso"
}

menuentry "Arch Linux x86_64" {
    icon /EFI/boot/icons/os_arch.png
    volume "OS"
    loader /arch/vmlinuz-linux # extracted from the installer ISO
    initrd /arch/initramfs-linux.img /arch/intel-ucode.img # extracted from the installer ISO
    options "img_dev=/dev/disk/by-label/OS img_loop=arch/archlinux-2021.05.01-x86_64.iso"
}

menuentry "Gentoo amd64 minimal" {
    icon /EFI/boot/icons/os_gentoo.png
    volume "OS"
    loader /gentoo/gentoo # extracted from the installer ISO
    initrd /gentoo/gentoo.igz # extracted from the installer ISO
    options "root=/dev/ram0 init=/linuxrc dokeymap looptype=squashfs loop=/image.squashfs cdroot initrd=/gentoo/gentoo.igz isoboot=/gentoo/install-amd64-minimal-20210526T214502Z.iso"    
}

menuentry "Clonezilla 2.7.1-22 amd64" {
    icon /EFI/boot/icons/os_clover.png
    volume "OS"
    loader /clonezilla/vmlinuz # extracted from the installer ISO
    initrd /clonezilla/initrd.img # extracted from the installer ISO
    options "boot=live live-config toram=filesystem.squashfs findiso=/clonezilla/clonezilla-live-2.7.1-22-amd64.iso"
}

menuentry "Debian 11.1 amd64" {
    icon /EFI/boot/icons/os_debian.png
    volume "OS"
    loader /debian11.1/vmlinuz # This is NOT extracted from the installer ISO
    initrd /debian11.1/initrd.gz # This is NOT extracted from the installer ISO
    options "findiso=/debian11.1/debian-live-11.1.0-amd64-standard.iso"
}

menuentry "Red hat enterprise linux 8.4 x86_64" {
    icon /EFI/boot/icons/os_centos.png
    volume "OS"
    loader /rhel8.4/vmlinuz # extracted from the installer ISO
    initrd /rhel8.4/initrd.img # extracted from the installer ISO
    options "inst.repo=hd:LABEL=OS:/rhel8.4/rhel-8.4-x86_64-boot.iso noeject ---"
}

menuentry "SUSE linux enterprise 15.3 SP3 x86_64" {
    icon /EFI/boot/icons/os_suse.png
    volume "OS"
    loader /sle15.3sp3/linux # extracted from the installer ISO
    initrd /sle15.3sp3/initrd # extracted from the installer ISO 
    options "splash=silent quiet rd.live.image install=hd:/sle15.3sp3/SLE-15-SP3-Online-x86_64-GM-Media1.iso"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment