修改自定义 live iso 的 initrd 时出现问题

修改自定义 live iso 的 initrd 时出现问题

我正在尝试定制 LUbuntu Live CD (22.04.2),按照以下说明进行操作https://help.ubuntu.com/community/LiveCDCustomization。我想要做的一些事情,例如删除“安装 LUbuntu”桌面图标,需要修改 initrd 中打包的脚本。如果我不接触 initrd,我可以解压 iso 文件,解压 filesystem.squashfs,重新打包 filesystem.squashfs,并使用 xorriso 重建 iso,这样就可以了。但是,如果我尝试通过 unmkinitramfs 修改 initrd,然后按照说明将其重新打包,则生成的 iso 开始启动,我会看到 grub 菜单,然后是 LUbuntu 屏幕,但随后屏幕变黑,我收到消息“无法找到包含实时文件系统的介质”。

我一直使用的脚本的要点如下:
https://gist.github.com/plynch-se/6113a2770fd30ee52d61191c7814d648

我怀疑问题不在于新的 initrd 文件本身,而在于 xorriso 的一些选项,现在 initrd 已经改变,这些选项需要有所不同,但我不确定。我使用的 xorriso 命令基本上是这样的(部分基于原始 iso 生成,如您在要点中看到的): xorriso -outdev custom.iso -map /root/tmp/custom_iso / -- -volid Lubuntu 22.04.2 LTS amd64 -boot_image grub grub2_mbr=mbr.img -boot_image any partition_table=on -boot_image any partition_cyl_align=off -boot_image any partition_offset=16 -boot_image any mbr_force_bootable=on -append_partition 2 28732ac11ff8d211ba4b00a0c93ec93b EFI.img -boot_image any appended_part_as=gpt -boot_image any iso_mbr_part_type=a2a0d0ebe5b9334487c068b6b72699c7 -boot_image any cat_path=/boot.catalog -boot_image grub bin_path=/boot/grub/i386-pc/eltorito.img -boot_image any platform_id=0x00 -boot_image any emul_type=no_emulation -boot_image any load_size=2048 -boot_image any boot_info_table=on -boot_image grub grub2_boot_info=on -boot_image any next -boot_image any efi_path=--interval:appended_partition_2:all:: -boot_image any platform_id=0xef -boot_image any emul_type=no_emulation -boot_image any load_size=5154816

我对最后的 load_size 数字感到怀疑,所以我也尝试了“load_size=full”,但没有帮助。

非常欢迎提出建议。我现在没有主意了。

相关内容