a529628app 2023-06-25 10:19 采纳率: 0%
浏览 24

refind引导primeos

请问refind引导器要怎么引导prime os?prime的文件结构似乎与phoneix os不同,grub配置的我也看不懂,能不能告诉我一下要怎么配置refind 的menuentry

环境:i5-3570+p8h61 已安装win7+10+deepin+prime+fyde

尝试过将菜单编写成这样:

menuentry "PrimeOS" {
    icon /EFI/refind/icons/os_linux.png
    volume 1403579b-f076-49cf-936a-037ea38ac7b2
    loader /android/kernel
    initrd /android/initrd.img
    options "quiet root=/dev/ram0 androidboot.selinux=permissive buildvariant=userdebug src=/android vga=788 i8042.nokbd=1"
}

,但最终无法进入系统,会卡在detecting prime os……命令行界面
prime os文件目录:

img


prime os efi文件目录:

img

prime 的grub引导:

# $1 Title
# $2... Kernel cmdline
function add_entry {
    menuentry "PrimeOS $1" "$@" --class android-x86 {
        shift 2
        set root=$android
        linux $kdir/kernel root=/dev/ram0 androidboot.selinux=permissive buildvariant=userdebug $src $@
        initrd $kdir/initrd.img
    }
}

# $1 EFI to chainload
# $2 OS name
# $3 Class
function add_os_if_exists {
    # Is there a better way to find ESP?
    for d in hd0,gpt1 hd0,gpt2 hd1,gpt1 hd1,gpt2 hd0,msdos1 hd0,msdos2 hd1,msdos1 hd1,msdos2; do
        if [ "($d)$1" != "$cmdpath/$bootefi" -a -e ($d)$1 ]; then
            menuentry "$2 at $d ->" "$d" "$1" --class "$3" {
                set root=$2
                chainloader ($root)$3
            }
            break
        fi
    done
}

if [ -s $prefix/grubenv ]; then
    load_env
fi

if [ "$grub_cpu" = "i386" ]; then
    set bootefi=bootia32.efi
    set grub=grubia32
else
    set bootefi=BOOTx64.EFI
    set grub=grubx64
fi

if [ -z "$src" -a -n "$isofile" ]; then
    set src=iso-scan/filename=$isofile
fi

search --no-floppy --set android -f $kdir/kernel
export android bootefi grub kdir live src

# Create main menu
add_entry "$live" quiet

# Add other OSes boot loaders if exist
add_os_if_exists /EFI/fedora/${grub}.efi Fedora fedora
add_os_if_exists /EFI/centos/${grub}.efi CentOS centos
add_os_if_exists /EFI/ubuntu/${grub}.efi Ubuntu ubuntu
add_os_if_exists /EFI/debian/${grub}.efi Debian debian
add_os_if_exists /EFI/linuxmint/${grub}.efi "Linux Mint" linuxmint
add_os_if_exists /EFI/Microsoft/Boot/bootmgfw.efi Windows windows

if [ -s ($android)$kdir/install.img ]; then
    add_entry "Installation" INSTALL=1
fi

submenu "Advanced options -> " {
    add_entry "$debug_mode - DEBUG Mode" DEBUG=2
    add_entry "$live - No Setup Wizard" quiet SETUPWIZARD=0
    add_entry "$live - No Hardware Acceleration" quiet nomodeset HWACCEL=0
    if [ -s ($android)$kdir/install.img ]; then
        add_entry "Auto Install to specified harddisk" AUTO_INSTALL=0
        add_entry "Auto Update" AUTO_INSTALL=update
    fi
    add_os_if_exists /EFI/BOOT/$bootefi "UEFI OS"
    add_os_if_exists /EFI/BOOT/fallback.efi "UEFI Fallback"
    if [ "$grub_cpu" != "i386" ]; then
        add_os_if_exists /EFI/BOOT/fallback_x64.efi "UEFI Fallback"
        menuentry "Reboot" { reboot }
        menuentry "Poweroff" { halt }
        menuentry "UEFI BIOS Setup" { fwsetup }
    fi
}

for d in $cmdpath $prefix; do
    if [ -f $d/custom.cfg ]; then
        source $d/custom.cfg
    fi
done

  • 写回答

2条回答 默认 最新

  • wybarcelona 2023-06-26 11:18
    关注

    参考我这篇文章 :https://wybarcelona.blog.csdn.net/article/details/115771698?spm=1001.2014.3001.5502

    内容在 “ubuntu引导配置”小节

    特别注意Volume的赋值以及位置,我的那篇文章都有说明

    img

    评论

报告相同问题?

问题事件

  • 创建了问题 6月25日