3

I have a problem when booting a Deepin ISO image with GRUB 2 from USB. I have been trying to fix the problem for almost a week now. Here is the grub.cfg file:

# 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
}

Now, the ISO image I am trying to boot is "Deepin", and the menuentry is:

if [ -e ${isopath}/deepin ]; then
menuentry "Deepin >" --class deepin {
  configfile "${prefix}/inc-deepin.cfg"
}
fi

Here is the configuration file for 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
}

This setup works (tested 3-4 times already) with Ubuntu's GRUB 2, which is the default bootloader that comes with Ubuntu (I used this to test if the problem is with the script itself or not (by adding the menuentry (Deepin) to 40_custom file in directory /etc/grub.d.)

When the above setup is used with booting on USB, it spits out the error below:

error: out of memory
error: syntax error
error: Incorrect command
error: syntax error

This error also occurs when trying to boot with memdisk. How can I fix this?

What I think so far...

  1. The problem may not be related to the size or the RAM. As this setup works when using Ubuntu's GRUB for testing and fail when using with USB to boot the ISO image.

  2. As Deepin OS is based on Debian, I assume the booting configuration file is the same with Debian.

  3. I used this command when installing GRUB to USB:

    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}
    
5
  • 1
    Did you find a solution to this? I also got the exact error. Commented Nov 9, 2019 at 18:37
  • Nope. I`ve given up on this ages ago Commented Nov 24, 2019 at 12:01
  • For menu entry "Deepin Live 15.5 amd64", you can execute those commands manually in the GRUB shell (press 'C' to enter it when the GRUB menu is shown). This will provide more information about what exactly causes the error(s). For instance, "out of memory" may come from "loopback loop $isofile". Fedora has, allegedly, had this problem since version 33 - GRUB shipped within Fedora since 33+ to 36 - "the 'loopback' command generates errors ... out of memory..."* Commented Jul 23, 2022 at 16:40
  • I ran into it with Fedora 36 (KDE spin). Perhaps the underlying reason is the same? No, I haven't found a solution or workaround yet. Commented Jul 23, 2022 at 16:43
  • @PeterMortensen Is it possible that the image you are booting is not a ISO9660 but some kind of hybriddisk image? Commented Jul 23, 2022 at 17:05

0

You must log in to answer this question.

Browse other questions tagged .