请问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文件目录:
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
参考我这篇文章 :https://wybarcelona.blog.csdn.net/article/details/115771698?spm=1001.2014.3001.5502
内容在 “ubuntu引导配置”小节
特别注意Volume的赋值以及位置,我的那篇文章都有说明
Refind是一款功能强大的引导管理工具,可用于引导多个操作系统。对于PrimeOS,您可以使用以下配置来在Refind菜单中添加一个条目:
apache
Copy
menuentry "PrimeOS" {
icon /EFI/refind/icons/os_android.png
volume 1403579b-f076-49cf-936a-037ea38ac7b2
loader /EFI/prime/kernel
initrd /EFI/prime/initrd.img
options "root=/dev/ram0 androidboot.selinux=permissive buildvariant=userdebug vga=791 quiet SRC=/EFI/prime"
}
上面的代码所做的操作是:
设置菜单项的名称为“PrimeOS”。
指定菜单项的图标为Refind自带的Android图标。
指定PrimeOS所在的分区UUID。
指定内核文件的路径为“/EFI/prime/kernel”。
指定初始化文件的路径为“/EFI/prime/initrd.img”。
指定内核的启动选项,包括根设备、SELinux、构建选项、分辨率、静默模式等。
请注意,其中“/EFI/prime”是PrimeOS的根目录,您需要根据PrimeOS实际安装位置进行修改。
在Refind配置文件中添加上述代码后,保存并重启计算机,您应该可以在Refind菜单中看到一个名为“PrimeOS”的条目。选择该条目后,系统应该可以正常引导到PrimeOS。
Share
Like
回答整理自chatgpt,如果有帮助麻烦采纳一下,谢谢啦!