【问题标题】:How to create a iso file by grub-mkrescue and assign its label?如何通过 grub-mkrescue 创建 iso 文件并分配其标签?
【发布时间】:2016-09-03 03:21:13
【问题描述】:

我正在尝试通过 grub-mkrescue 创建一个 iso 可引导文件。但我需要分配iso的标签。 阅读手册页后,我猜这是一个正确的命令行,但失败了。

grub-mkrescue -o "my_arch.iso" -- -volid=MY_ARCH my_iso_dir

它会显示错误:

xorriso 1.4.2 : RockRidge filesystem manipulator, libburnia project.

Drive current: -outdev 'stdio:my_arch.iso'
Media current: stdio file, overwriteable
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 19.1g free
Added to ISO image: directory '/'='/tmp/grub.ZoYEzy'
xorriso : UPDATE : 613 files added in 1 seconds
xorriso : FAILURE : -as mkisofs: Unrecognized option '-volid=MY_ARCH'
xorriso : UPDATE : 613 files added in 1 seconds
xorriso : aborting : -abort_on 'FAILURE' encountered 'FAILURE'

根据'info grub-mkrescue'文档:

  All arguments not explicitly listed as 'grub-mkrescue' options are
passed on directly to 'xorriso' in 'mkisofs' emulation mode.  Options
passed to 'xorriso' will normally be interpreted as 'mkisofs' options;
if the option '--' is used, then anything after that will be interpreted
as native 'xorriso' options.

   Non-option arguments specify additional source directories.  This is
commonly used to add extra files to the image:

【问题讨论】:

    标签: grub2


    【解决方案1】:

    xorriso 的 -as mkisofs 仿真理解

    -V MY_ARCH
    

    或

    -volid MY_ARCH
    

    但不是

    -volid=MY_ARCH
    

    进一步注意,您显然使用的是中间 C 版本 grub-mkrescue 不符合您引用的文档。 这个版本需要 '--' 作为 grub-mkrescue 选项之间的分隔符 和 xorriso -as mkisofs 选项。

    但是如果你在旧的 grub-mkrescue shell 脚本的参数中有'--' 或当前的 grub-mkrescue C 程序,那么您将退出 mkisofs 仿真。这将为您赢得一条错误消息

    xorriso : FAILURE : Not a known command:  'my_iso_dir'
    

    【讨论】:

    • 我相信 grub-mkrescue 是 C 版本。我不是很好理解。 C 版本的正确完整命令行是什么?
    • 是的,您当前的程序版本是临时软件意外。您的命令行与此版本匹配。目前唯一的问题是 -volid 和 MY_ARCH 之间的“=”字符。在将来升级 GRUB 之后,您将不得不省略 '--' 参数。
    猜你喜欢
    • 1970-01-01
    • 2019-02-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-12-31
    • 1970-01-01
    • 1970-01-01
    • 2014-06-04
    相关资源
    最近更新 更多