New grub-mkrescue-sed.sh mode "gpt_appended"

This commit is contained in:
Thomas Schmitt 2016-12-25 10:52:14 +01:00
parent 85c51dbcef
commit fa3ee61e3a

View File

@ -32,9 +32,14 @@ echo >&2
# If you add xorrisofs option -part_like_isohybrid then no gap fillig APM
# partition will emerge.
#
# Mode "gpt_appended" represents the same layout as "mbr_only" by GPT rather
# than by MBR partition table. It differs from "original" by the fact that
# option -partition_offset 16 is implied and that the first partition may
# be used to mount the ISO 9660 filesystem.
#
# These modes avoid duplicate storing of the EFI system partition "efi.img"
# by xorrisofs option -e "--interval:appended_partition_${partno}:all::"
# which is new to xorriso-1.4.3 with timestamp after 2015.12.30.175951.
# which is new to xorriso-1.4.4.
# If "_copy" is appended to the mode name, then the file /efi.img will
# appear in the ISO 9660 filesystem and traditional -e "/efi.img" is used.
#
@ -50,8 +55,9 @@ echo >&2
# "mjg" = ESP in MBR+GPT+APM, with HFS+
# "mbr_only" = ESP in MBR, without HFS+
# "mbr_hfs" = ESP in MBR, HFS+ in APM
# "gpt_appended" = ESP in GPT
# $mode"_copy" = one of above modes, ESP in ISO and as appended partition
# "original" = pass arguments unchanged
# "original" = pass arguments unchanged (i.e. no mountable ISO partition)
mode="mjg"
if test -n "$MKRESCUE_SED_MODE"
then
@ -228,6 +234,25 @@ then
-e "s/--protective-msdos-label/$protective/" \
)
elif test x"$mode" = xgpt_appended
then
# Exchange arguments for no-HFS MBR-only layout
efi_tmp_name=grub-mkrescue-sed-efi-img.$$
mv "$dir"/efi.img /tmp/$efi_tmp_name
x=$(echo " $*" | sed \
-e "s/-efi-boot-part --efi-boot-image/-no-pad -append_partition 2 0xef \/tmp\/$efi_tmp_name -appended_part_as_gpt -partition_offset 16/" \
-e "s/--efi-boot efi\.img/-eltorito-alt-boot -e --interval:appended_partition_2:all:: -no-emul-boot/" \
-e "s/-hfsplus .*CoreServices\/boot.efi//" \
)
elif test x"$mode" = xgpt_appended_copy
then
# Exchange arguments for no-HFS MBR-only layout
x=$(echo " $*" | sed \
-e "s/-efi-boot-part --efi-boot-image/-no-pad -append_partition 2 0xef \/tmp\/$(basename "$dir")\/efi.img -appended_part_as_gpt -partition_offset 16/" \
-e "s/-hfsplus .*CoreServices\/boot.efi//" \
)
elif test x"$mode" = xoriginal
then
# Pass arguments unchanged