Eu tenho um problema ao inicializar um Deepin ISO com o grub2 do USB. Eu tenho tentado consertar o problema por quase uma semana agora. Aqui está o grub.cfg
# GLEE USB GRUB2 Configuration
# Required with MBR for GUI
if [ "${grub_platform}" = "pc" ]; then
insmod vbe
fi
# Required with EFI for GUI and to prevent "No video mode set" error
if [ "${grub_platform}" = "efi" ]; then
insmod efi_gop
fi
# Keep the same graphic mode for kernel booting (passed as vga=)
# other values are "text" or any gfxmode value
set gfxpayload=keep
# Enable GUI
#GRUB_FONT=/boot/grub/fonts/unicode.pf2
if loadfont /boot/grub/fonts/unicode.pf2 ; then
insmod gfxterm
terminal_output gfxterm
fi
#EFI: special characters (lines composing menu frame)
#replaced by '?' in text _fallback_ text mode if absent
# (useless if gfxterm is not enabled or if GUI theme loading success)
#loadfont ascii
insmod png
set theme=${prefix}/themes/Vimix_+_Atomic/theme.txt
set isopath=/boot/iso
# Required to have these available in other configfile files
export theme
export isopath
# Menu!
if [ -e ${isopath}/antergos ]; then
menuentry "Antergos >" --class antergos {
configfile "${prefix}/inc-antergos.cfg"
}
fi
if [ -e ${isopath}/antix ]; then
menuentry "antiX >" --class antix {
configfile "${prefix}/inc-antix.cfg"
}
fi
if [ -e ${isopath}/arch ]; then
menuentry "Arch Linux >" --class arch {
configfile "${prefix}/inc-arch.cfg"
}
fi
if [ -e ${isopath}/bodhi ]; then
menuentry "Bodhi Linux >" --class bodhi {
configfile "${prefix}/inc-bodhi.cfg"
}
fi
if [ -e ${isopath}/centos ]; then
menuentry "CentOS >" --class centos {
configfile "${prefix}/inc-centos.cfg"
}
fi
if [ -e ${isopath}/clonezilla ]; then
menuentry "Clonezilla >" --class clonezilla {
configfile "${prefix}/inc-clonezilla.cfg"
}
fi
if [ -e ${isopath}/debian ]; then
menuentry "Debian >" --class debian {
configfile "${prefix}/inc-debian.cfg"
}
fi
if [ -e ${isopath}/deepin ]; then
menuentry "Deepin >" --class deepin {
configfile "${prefix}/inc-deepin.cfg"
}
fi
if [ -e ${isopath}/doudoulinux ]; then
menuentry "DoudouLinux>" --class doudoulinux {
configfile "${prefix}/inc-doudoulinux.cfg"
}
fi
if [ -e ${isopath}/elementary ]; then
menuentry "elementary OS >" --class elementary {
configfile "${prefix}/inc-elementary.cfg"
}
fi
if [ -e ${isopath}/fedora ]; then
menuentry "Fedora >" --class fedora {
configfile "${prefix}/inc-fedora.cfg"
}
fi
if [ -e ${isopath}/gparted ]; then
menuentry "GParted >" --class gparted {
configfile "${prefix}/inc-gparted.cfg"
}
fi
if [ -e ${isopath}/grml ]; then
menuentry "Grml >" --class grml {
configfile "${prefix}/inc-grml.cfg"
}
fi
if [ -e ${isopath}/ipxe ]; then
menuentry "iPXE >" --class ipxe {
configfile "${prefix}/inc-ipxe.cfg"
}
fi
if [ -e ${isopath}/kali ]; then
menuentry "Kali >" --class kali {
configfile "${prefix}/inc-kali.cfg"
}
fi
if [ -e ${isopath}/linux-mint ]; then
menuentry "Linux Mint >" --class linux-mint {
configfile "${prefix}/inc-linux-mint.cfg"
}
fi
if [ -e ${isopath}/manjaro ]; then
menuentry "Manjaro >" --class manjaro {
configfile "${prefix}/inc-manjaro.cfg"
}
fi
if [ -e ${isopath}/netrunner ]; then
menuentry "Netrunner >" --class netrunner {
configfile "${prefix}/inc-netrunner.cfg"
}
fi
if [ -e ${isopath}/porteus ]; then
menuentry "Porteus >" --class porteus {
configfile "${prefix}/inc-porteus.cfg"
}
fi
if [ -e ${isopath}/rhel ]; then
menuentry "Red Hat Enterprise Linux >" --class rhel {
configfile "${prefix}/inc-rhel.cfg"
}
fi
if [ -e ${isopath}/sabayon ]; then
menuentry "Sabayon >" --class sabayon {
configfile "${prefix}/inc-sabayon.cfg"
}
fi
if [ -e ${isopath}/sysrescd ]; then
menuentry "System RescueCD >" --class sysrescd {
configfile "${prefix}/inc-sysrescd.cfg"
}
fi
if [ -e ${isopath}/tails ]; then
menuentry "Tails >" --class tails {
configfile "${prefix}/inc-tails.cfg"
}
fi
if [ -e ${isopath}/ubuntu ]; then
menuentry "Ubuntu >" --class ubuntu {
configfile "${prefix}/inc-ubuntu.cfg"
}
fi
if [ -e ${isopath}/ubuntumate ]; then
menuentry "Ubuntu MATE >" --class ubuntumate {
configfile "${prefix}/inc-ubuntumate.cfg"
}
fi
if [ -e ${isopath}/xubuntu ]; then
menuentry "Xubuntu >" --class xubuntu {
configfile "${prefix}/inc-xubuntu.cfg"
}
fi
if [ -e /KERNEL ]; then
menuentry "OpenELEC >" --class openelec {
configfile "${prefix}/inc-openelec.cfg"
}
fi
menuentry "Shutdown" --class shutdown {
halt
}
menuentry "Restart" --class restart {
reboot
}
Agora, o ISO que estou tentando inicializar é "Deepin", o menuentry é
if [ -e ${isopath}/deepin ]; then
menuentry "Deepin >" --class deepin {
configfile "${prefix}/inc-deepin.cfg"
}
fi
Aqui está o arquivo de configuração para inc-deepin.cfg
# Deepin
if cpuid -l; then
menuentry "Deepin Live 15.5 amd64" --class deepin {
set isoname="deepin-15.5-amd64.iso"
set isofile="${isopath}/deepin/${isoname}"
echo "Using ${isoname}..."
loopback loop $isofile
linux (loop)/live/vmlinuz boot=live iso-scan/ask_second_pass=true findiso=${isofile}
initrd (loop)/live/initrd.lz
}
Esta configuração funciona (testada 3-4 vezes) com o grub2 do Ubuntu, que é o bootloader padrão que vem com o Ubuntu (usei isso para testar se o problema é com o script em si ou não). (adicionando o menuentry (Deepin) ao arquivo 40_custom em /etc/grub.d.
Quando a configuração acima é usada com a inicialização via USB, ela gera o erro abaixo
error: out of memory
error: syntax error
error: Incorrect command
error: syntax error
Este erro também ocorre ao tentar inicializar com o memdisk. Como posso consertar isso?
What I think so far...
'
GRUB_TARGET="--target=x86_64-efi --efi-directory=${MOUNT_POINT}
--removable"
GRUB2_INSTALL="grub2-install"
MOUNT_POINT=/media/microsoft10/MMI
PARTITION=/dev/sdb1
sudo ${GRUB2_INSTALL} ${GRUB_TARGET}
--boot-directory=${MOUNT_POINT}/boot ${PARTITION}'