无忧启动论坛

 找回密码
 注册
搜索
系统gho:最纯净好用系统下载站广告联系 微信:wuyouceo QQ:184822951
查看: 6367|回复: 16
打印 上一主题 下一主题

[求助] GRUB2 如何启动 U 盘上的 Win10 启动文件

[复制链接]
跳转到指定楼层
1#
发表于 2020-10-25 23:34:38 | 显示全部楼层 |只看大图 回帖奖励 |倒序浏览 |阅读模式
安装好优麒麟后,硬盘以GRUB2的形式启动,如下是启动硬盘上的 Windows 系统(相关段落):
  1. ### BEGIN /etc/grub.d/30_os-prober ###
  2. menuentry 'Windows Boot Manager (在 /dev/sda2)' --class windows --class os $menuentry_id_option 'osprober-efi-DAD3-AEBD' {
  3.         insmod part_gpt
  4.         insmod fat
  5.         set root='hd0,gpt2'
  6.         if [ x$feature_platform_search_hint = xy ]; then
  7.           search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  DAD3-AEBD
  8.         else
  9.           search --no-floppy --fs-uuid --set=root DAD3-AEBD
  10.         fi
  11.         chainloader /EFI/Microsoft/Boot/bootmgfw.efi
  12. }
  13. set timeout_style=menu
  14. if [ "${timeout}" = 0 ]; then
  15.   set timeout=10
  16. fi
  17. ### END /etc/grub.d/30_os-prober ###
复制代码

U 盘是优麒麟的安装 U 盘,U盘上也同时 COPY 有支持 Win10 的启动文件:

bootmgr
bootmgr.efi
<boot>
<efi>


请问:U盘 GRUB2 菜单该如何创建才可以启动U盘上的 bootmgr 或 bootmgr.efi ?
请问:U盘 GRUB2 菜单该如何创建才可以启动U盘上的 bootmgr 或 bootmgr.efi ?
请问:U盘 GRUB2 菜单该如何创建才可以启动U盘上的 bootmgr 或 bootmgr.efi ?



附上优麒麟的 U 盘启动菜单 U:\boot\grub\grub.cfg:
  1. set timeout=30

  2. loadfont unicode

  3. set menu_color_normal=white/black
  4. set menu_color_highlight=black/light-gray

  5. menuentry "Ubuntu Kylin" {
  6.         set gfxpayload=keep
  7.         linux        /casper/vmlinuz file=/cdrom/preseed/ubuntu.seed locale=zh_CN keyboard-configuration/layoutcode?=cn maybe-ubiquity quiet splash ---
  8.         initrd        /casper/initrd
  9. }
  10. menuentry "Ubuntu Kylin (safe graphics)" {
  11.         set gfxpayload=keep
  12.         linux        /casper/vmlinuz nomodeset file=/cdrom/preseed/ubuntu.seed locale=zh_CN keyboard-configuration/layoutcode?=cn maybe-ubiquity quiet splash ---
  13.         initrd        /casper/initrd
  14. }
  15. menuentry "OEM install (for manufacturers)" {
  16.         set gfxpayload=keep
  17.         linux        /casper/vmlinuz file=/cdrom/preseed/ubuntu.seed locale=zh_CN keyboard-configuration/layoutcode?=cn only-ubiquity oem-config/enable=true quiet splash ---
  18.         initrd        /casper/initrd
  19. }
  20. grub_platform
  21. if [ "$grub_platform" = "efi" ]; then
  22. menuentry 'Boot from next volume' {
  23.         exit
  24. }
  25. menuentry 'UEFI Firmware Settings' {
  26.         fwsetup
  27. }
  28. fi
复制代码


2#
 楼主| 发表于 2020-10-25 23:39:56 | 显示全部楼层
我的意思其实是将 优麒麟 的系统 ISO 文件写到 U 盘后,再将 Win10 系统 ISO 文件内文件复制到 U 盘下,然后修改启动菜单,让 U 盘支持安装 优麒麟 的同时也支持安装 Win10 系统。
现在给这个 修改启动菜单 给难住了!
回复

使用道具 举报

3#
 楼主| 发表于 2020-10-25 23:55:29 | 显示全部楼层

我是提问,并没有分享。菜单源码 是提供给我解答的高手参考的。

点评

哦!不好意思,  详情 回复 发表于 2020-10-26 00:11
回复

使用道具 举报

4#
 楼主| 发表于 2020-10-26 22:36:19 | 显示全部楼层
我想要完整示例的,谁能帮忙解答?
回复

使用道具 举报

5#
 楼主| 发表于 2020-10-27 22:46:13 | 显示全部楼层
my9823 发表于 2020-10-27 19:58
你的U盘有没有分区,还是只有一个分区?分区类型是什么?因为grub2是模块化的,用什么功能加载什么模块。

U 盘是新 U 盘,没有量产分区什么的!
2# 表述的很明白,优麒麟 ISO 写入 U 盘后是 FAT32 格式的,与 Windows 10 是相同的格式。
以这样的话,应该需要加载哪种模块?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1 )

闽公网安备 35020302032614号

GMT+8, 2024-5-10 05:24

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表