#!/bin/bash # Rebuild the new Acronis images so that the BIOS (grub-pc) boot works: # the modules must be present on the ISO, otherwise GRUB drops to rescue. set -e SRC=/path/to/pf/acronis/Acronis_Boot_Disk_2024.iso OUT=/path/to/pf/acronis/new W=/root/new2 rm -rf "$W"; mkdir -p "$W" "$OUT" apt-get install -y grub-pc-bin grub-efi-amd64-bin grub-efi-ia32-bin mtools xorriso >/tmp/apt6.log 2>&1 || true build_one() { local name="$1" dir="$2" kernel="$3" initrds="$4" local tree="$W/$name" mkdir -p "$tree/$dir" "$tree/boot/grub/i386-pc" echo "=== $name ($dir)" 7z e -y -o"$tree/$dir" "$SRC" "ACR/$dir/$kernel" $(for i in $initrds; do echo "ACR/$dir/$i"; done) >/dev/null # BIOS menu cat > "$tree/boot/grub/grub.cfg" </dev/null || true # BIOS El Torito image grub-mkrescue -o "$W/$name.base.iso" "$tree" >/tmp/mk2_$name.log 2>&1 xorriso -osirrox on -indev "$W/$name.base.iso" \ -extract /boot/grub/i386-pc/eltorito.img "$tree/boot/grub/i386-pc/eltorito.img" >/dev/null 2>&1 # UEFI image: our x64 GRUB (standalone, embedded config) — only used if someone # boots the ISO straight from firmware; our menu uses loopback instead. cat > "$W/$name.efi.cfg" </dev/null mmd -i "$tree/efi.img" ::/EFI ::/EFI/BOOT mcopy -i "$tree/efi.img" "$W/BOOTX64.EFI" ::/EFI/BOOT/BOOTX64.EFI mkdir -p "$tree/EFI/BOOT" cp -f "$W/BOOTX64.EFI" "$tree/EFI/BOOT/BOOTX64.EFI" xorriso -as mkisofs -R -J -joliet-long -V PARAVIS_ACRONIS -o "$OUT/$name.iso" \ -b boot/grub/i386-pc/eltorito.img -no-emul-boot -boot-load-size 4 -boot-info-table \ -eltorito-alt-boot -e efi.img -no-emul-boot \ "$tree" >/tmp/xor2_$name.log 2>&1 printf " -> %s: %s MB\n" "$name" "$(( $(stat -c %s "$OUT/$name.iso") / 1048576 ))" printf " modules in ISO: " 7z l -ba "$OUT/$name.iso" 2>/dev/null | grep -c 'boot/grub/i386-pc/.*\.mod' || true } build_one ADD ATI2025 dat10.dat "dat11.dat dat12.dat" build_one ABA ADDH12 dat14.dat "dat15.dat dat16.dat" ls -l "$OUT"