From 22c4d3b601c68d1f6aaa6e256d3c520720f83843 Mon Sep 17 00:00:00 2001 From: Ralph Ronnquist Date: Mon, 12 Jun 2023 02:05:24 +1000 Subject: [PATCH] Tested combinations. --- packiso.sh | 30 +++++++++++++++++------------- vm.sh | 27 ++++++++++++++++++++------- 2 files changed, 37 insertions(+), 20 deletions(-) diff --git a/packiso.sh b/packiso.sh index 0111fa5..0f1ed45 100755 --- a/packiso.sh +++ b/packiso.sh @@ -17,9 +17,16 @@ if [ ! -d $ISOTREE ] ; then # Determine start and size of first parition X=( $(sfdisk -l -ostart,sectors bootimage.raw | tail -n 2) ) dd if=bootimage.raw of=$P1 skip=${X[0]} count=${X[1]} - echo "# Add isolinux boot loader" - mcopy -i $P1 kernel/usr/lib/ISOLINUX/isolinux.bin ::/ - mcopy -i $P1 kernel/usr/lib/ISOLINUX/isohdppx.bin ::/ + echo "# Set up the isolinux boot loader" + mkdir -p $ISOTREE/boot/syslinux/bios + cp kernel/usr/lib/syslinux/modules/bios/* $ISOTREE/boot/syslinux/bios + mv $ISOTREE/boot/syslinux/bios/ldlinux.c32 $ISOTREE/ + cp kernel/usr/lib/ISOLINUX/isolinux.bin $ISOTREE/ + mcopy -i $P1 ::/syslinux.cfg $ISOTREE/ + mcopy -i $P1 ::/bootmenu.cfg $ISOTREE/ + mcopy -i $P1 ::/splash.png $ISOTREE/ + mcopy -i $P1 ::/vmlinuz $ISOTREE/ + mcopy -i $P1 ::/initrd.gz $ISOTREE/ fi [ ! -r $ISO ] || rm $ISO @@ -34,7 +41,7 @@ XORRISO=( -volset_id "$(date +"Tiniest %Y-%m-%d %H:%M:%S")" -publisher "Ralph (rrq) Ronnquist" -application_id "Hybrid Multi Mode Disk Image" - -system_id "Tiniest Linux HMMDI" + -system_id "Tiniest Linux" #-copyright_file copyright.txt #-abstract_file abstract.txt #-biblio_file biblio.txt @@ -42,19 +49,16 @@ XORRISO=( #-application_use path #-out_charset "UTF8" ?? -uid 0 -gid 0 -) -BOOT1=( - -boot_image any cat_path=/catalog -append_partition 2 0xef ${P1} + -boot_image next cat_path=/catalog + -boot_image any system_area=kernel/usr/lib/ISOLINUX/isohdppx.bin + -boot_image any bin_path=/isolinux.bin + -boot_image any boot_info_table=on + -boot_image any next -boot_image any efi_path=--interval:appended_partition_2:all::/EFI/BOOT/bootx64.efi - #-boot_image isolinux system_area=kernel/usr/lib/ISOLINUX/isohdppx.bin - -boot_image and part_like_isohybrid=on - # -boot_image any -# bin_path=--interval:appended_partition_2:all::/isolinux.bin + -boot_image any next ) -XORRISO=( "${XORRISO[@]}" "${BOOT1[@]}" ) -#for A in "${XORRISO[@]}" ; do echo "$A" ; done xorriso "${XORRISO[@]}" diff --git a/vm.sh b/vm.sh index d3f535d..f6304aa 100755 --- a/vm.sh +++ b/vm.sh @@ -2,19 +2,32 @@ # # QEMU setup for trial VM -BOOT="-boot menu=on" -[ -z "$EFI" ] || BOOT="-bios /usr/share/OVMF/OVMF_CODE.fd" - -[ -d disk.raw ] || dd if=/dev/zero of=disk.raw bs=1G count=0 seek=8 +if [ -z "$ISO" ] ; then + if [ -z "$EFI" ] ; then + BOOT="-boot menu=on" + DISK2="-drive index=1,id=boot,media=disk,format=raw,file=bootimage.raw" + else + BOOT="-bios /usr/share/OVMF/OVMF_CODE.fd" + DISK2="-drive index=1,id=boot,media=disk,format=raw,file=bootimage.raw" + fi +else + if [ -z "$EFI" ] ; then + BOOT="-boot menu=on" + DISK2="-drive index=1,id=boot,media=cdrom,format=raw,file=tiniest.iso" + else + BOOT="-bios /usr/share/OVMF/OVMF_CODE.fd" + DISK2="-drive index=1,id=boot,media=disk,format=raw,file=tiniest.iso" + fi +fi +[ -d disk.raw ] || dd if=/dev/zero of=disk.raw bs=1G count=0 seek=8 ARGS=( - -m 2G -M pc,accel=kvm -cpu host + -m 2G -M pc,accel=kvm -cpu host -vga qxl -serial mon:stdio -echr 0x1c # Using ^\ as meta character - -vga qxl $BOOT -drive index=0,id=disk,media=disk,format=raw,file=disk.raw - -drive index=1,id=boot,media=disk,format=raw,file=bootimage.raw + $DISK2 ) exec qemu-system-x86_64 ${ARGS[@]} -- 2.39.2