Unverified Commit b63ddc08 authored by Kroese's avatar Kroese Committed by GitHub
Browse files

feat: Detect hybrid .iso images (#937)

parent 24aaae61
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -662,7 +662,12 @@ esac
if [ -f "$BOOT" ] && [ -s "$BOOT" ]; then
  case "${BOOT,,}" in
    *".iso" )
        if [[ "${HYBRID:-}" == [Yy]* ]]; then
        if [[ "${BOOT_MODE:-}" == "windows"* ]]; then
          hybrid="0000"
        else
          hybrid=$(head -c 512 "$BOOT" | tail -c 2 | xxd -p)
        fi
        if [[ "$hybrid" != "0000" ]]; then
          DISK_OPTS+=$(addMedia "$BOOT" "usb" "$BOOT_INDEX" "0x5")
        else
          DISK_OPTS+=$(addMedia "$BOOT" "$MEDIA_TYPE" "$BOOT_INDEX" "0x5")
+3 −6
Original line number Diff line number Diff line
@@ -72,6 +72,7 @@ detectType() {

  local file="$1"
  local result=""
  local hybrid=""

  [ ! -f "$file" ] && return 1
  [ ! -s "$file" ] && return 1
@@ -88,13 +89,9 @@ detectType() {

  if [[ "${file,,}" == *".iso" ]]; then

    result=$(head -c 512 "$file" | tail -c 2 | xxd -p)
    hybrid=$(head -c 512 "$file" | tail -c 2 | xxd -p)

    if [[ "$result" != "0000" ]]; then
      [ -z "${HYBRID:-}" ] && HYBRID="Y"
    fi

    if [[ "${HYBRID:-}" != [Yy]* ]]; then
    if [[ "$hybrid" != "0000" ]]; then

      result=$(isoinfo -f -i "$file" 2>/dev/null)