New qemu version 5.2.0 from MacPorts, compiled on High Sierra.

This commit is contained in:
jief666 2021-04-19 11:21:48 +03:00
parent deeea43b79
commit e9d0f08c8e
54 changed files with 412 additions and 219 deletions

171
Qemu/copy_and_make_portable Executable file
View File

@ -0,0 +1,171 @@
#!/bin/bash
SCRIPT_ABS_FILENAME=`perl -e 'use Cwd "abs_path";print abs_path(shift)' "${BASH_SOURCE[0]}"`
SCRIPT_DIR=`dirname "$SCRIPT_ABS_FILENAME"`
#set -x
#sudo chown -R $(id -F) "$SCRIPT_DIR"
#sudo chmod -R u+w "$SCRIPT_DIR"
if [ -z "$1" ]
then
echo "Usage: $0 executable_file [dest dir] [dylib dir name]"
exit 1
fi
file="$1"
filebasename="$(basename "$file")"
filedir="$(dirname "$file")"
if [ -z "$2" ]
then
dir="."
else
dir="$2"
fi
if [ -z "$3" ]
then
dylib_dir_name="$filebasename".dylibs
else
dylib_dir_name="$3"
fi
process_a_file ()
{
echo '------------------------------------------> Checking file ' \'"$1"\'
#otool -L "$1"
#set -x
if false && [ -L "$1" ]
then
#We don't process symlinks. We'll process the original instead
:
echo Symlink : nothing to do. Process the original instead.
return 1
else
current_file="$1"
local libbasename=`basename "$1"`
#echo libbasename=$libbasename
local libdirname=`dirname "$1"`
#echo libdirname=$libdirname
local destdir="$2"
#cd "$libdirname"
local returnValue=0
local nbline=$(otool -D "$libdirname"/"$libbasename" | wc -l)
if [ $nbline -gt 1 ]
then
local firstline_is_id=1
else
local firstline_is_id=0
fi
while read -r line;
do
# line would be something like "/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)"
#echo line=$line \(firstline_is_id=$firstline_is_id\)
ex='^(.*) \(.*\)$'
if [[ "$line" =~ $ex ]]
then
local dependent_lib_path="${BASH_REMATCH[1]}" #this could be a path starting with @loader_path/
local dependent_lib_realpath="${dependent_lib_path/@loader_path/$filedir}" #this could be a path starting with @loader_path/
#echo dependent_lib_path="$dependent_lib_path"
#echo dependent_lib_realpath="$dependent_lib_realpath"
ex2='^/System/Library/Frameworks/.*$'
ex3='^/usr/lib/.*$'
if ! [[ "$dependent_lib_path" =~ $ex2 ]] && ! [[ "$dependent_lib_path" =~ $ex3 ]]
then
local dependent_lib_basename=$(basename "$dependent_lib_path")
#echo libbasename=$libbasename
if [ $firstline_is_id -eq 1 ]
then
local libabsolutepath=$(cd "$libdirname"; pwd)/"$libbasename"
if [ "$dependent_lib_path" = "$libabsolutepath" ]
then
:
echo already correct
# Do nothing, ID is already correct
else
#CMD="install_name_tool -id "$libabsolutepath" "$libdirname"/"$libbasename""
cmd=()
cmd=( install_name_tool -id "$libabsolutepath" "$libdirname"/"$libbasename" )
#echo issuing cmd : "${cmd[@]}"
"${cmd[@]}"
fi
firstline_is_id=0
else
local dependent_lib_newpath="$destdir"/"$dependent_lib_basename"
#echo Copy and process : "$dependent_lib_realpath" to "$dependent_lib_newpath"
rm -f "$dependent_lib_newpath"
cp "$dependent_lib_realpath" "$dependent_lib_newpath" || exit 1
chmod u+w "$dependent_lib_newpath"
local cd_bak="$(pwd)"
#echo cd "$destdir"
cd "$destdir"
process_a_file "$dependent_lib_basename" .
local ret=$?
cd "$cd_bak"
if ! [ $? -eq 0 ]
then
echo Processing "$dependent_lib_newpath" failed.
return -1
fi
#echo '----------------------------> Back in file ' \'"$1"\'
if [[ "$destdir" == "." ]]
then
local new_lib_relative_path="@loader_path"/"$dependent_lib_basename"
else
local new_lib_relative_path="@loader_path"/"$destdir"/"$dependent_lib_basename"
fi
if [ "$dependent_lib_path" != "$dependent_lib_newpath" ]
then
cmd=()
cmd=( install_name_tool -change "$dependent_lib_path" "$new_lib_relative_path" "$libdirname"/"$libbasename" )
#echo issuing cmd : "${cmd[@]}"
"${cmd[@]}"
fi
fi
else
:
#echo "$libfullpath" failed at =~ $ex2 =~ $ex3
fi
else
:
#echo "$libfullpath" failed at '^(.*) \(.*\)$'
fi
done <<< "$(otool -XL "$libdirname"/"$libbasename")"
fi
}
#otool -L "$file"
cd "$dir"
rm -f "$filebasename"
cp "$file" .
chmod u+w "$filebasename"
mkdir -p "$dir"/"$dylib_dir_name"
process_a_file "$filebasename" "$dylib_dir_name"
#echo $?

View File

@ -1,15 +1,18 @@
#!/bin/bash
SCRIPT_ABS_FILENAME=`LC_ALL=en_US.ISO8859-1 perl -e 'use Cwd "abs_path";print abs_path(shift)' "${BASH_SOURCE[0]}"`
SCRIPT_DIR=`dirname "$SCRIPT_ABS_FILENAME"`
SHELL_PWD=$PWD
cd "$SCRIPT_DIR"
OSTYPE=`uname -s`
#echo $OSTYPE
if [ -z "$1" ]
then
if [ -f "$SCRIPT_DIR"/../Build/Clover/DEBUG_GCC53/X64/CLOVERX64.debug ]
if [ -f ../Build/Clover/DEBUG_GCC53/X64/CLOVERX64.debug ]
then
clover_debug_file="$SCRIPT_DIR"/../Build/Clover/DEBUG_GCC53/X64/CLOVERX64.debug
clover_debug_file=../Build/Clover/DEBUG_GCC53/X64/CLOVERX64.debug
echo Using default file "$clover_debug_file"
else
echo "Usage: $SCRIPT_ABS_FILENAME [Clover debug file]"
@ -40,28 +43,30 @@ fi
echo clover_debug_file="$clover_debug_file"
echo clover_efi_file="$clover_efi_file"
set -x
qemu_path=./qemu_portable-v4.2.0/qemu-system-x86_64
qemu_path=./qemu_portable-v5.2.0/qemu-system-x86_64
#set -x
if [ "$OSTYPE" = "Darwin" ]
then
if ! [ -f ./Qemu/qemu_portable/qemu-system-x86_64 ]
if ! [ -f "$qemu_path" ]
then
echo "You must restore the folder \'qemu_portable\'"
echo "You must restore the folder \'"$(dirname "$qemu_path")"\'"
exit 1
fi
if ! [ -f "$SCRIPT_DIR"/disk_image_gpt.img ]
if ! [ -f ./disk_image_gpt.img ]
then
unzip -o "$SCRIPT_DIR"/disk_image_gpt.img.zip -d "$SCRIPT_DIR"
rm -rf "$SCRIPT_DIR"/__MACOSX
unzip -o ./disk_image_gpt.img.zip -d .
rm -rf ./__MACOSX
fi
if pgrep qemu
then
killall qemu-system-x86_64
fi
> "$SCRIPT_DIR"/serial0_qemu_out.log # empty file without erasing it. Useful for editor for refreshing and reloading.
> ./serial0_qemu_out.log # empty file without erasing it. Useful for editor for refreshing and reloading.
hdiutil attach "$SCRIPT_DIR"/disk_image_gpt.img || exit 1
hdiutil attach ./disk_image_gpt.img || exit 1
shopt -s nocasematch
@ -70,8 +75,7 @@ then
echo ditto "${clover_debug_file%.*}".efi /Volumes/QEMU_EFI/EFI/CLOVER/CLOVERX64.efi
ditto "${clover_debug_file%.*}".efi /Volumes/QEMU_EFI/EFI/CLOVER/CLOVERX64.efi || exit 1
echo ditto "${clover_debug_file%.*}".efi /Volumes/QEMU_EFI/EFI/BOOT/BOOTX64.efi
ditto "${clover_debug_file%.*}".efi /Volumes/QEMU_EFI/EFI/BOOT/BOOTX64.efi || exit 1
#no need to replace BootX64.efi, it's not used in legacy boot
else
: # TODO : if it's a module, has to be copied in Drivers
fi
@ -81,15 +85,16 @@ then
diskutil eject /Volumes/QEMU_EFI || exit 1
sleep 1 # not 100% sure it's needed
set -m
cd "$SCRIPT_DIR"
./qemu_portable/qemu-system-x86_64 \
-L qemu_portable \
cd .
bios_file=("$(dirname "$qemu_path")"/bios*)
"$qemu_path" \
-L "$(dirname "$qemu_path")" \
-m 2048 \
-cpu Penryn \
-bios ./bios.bin-1.13.0 \
-bios "$bios_file" \
-machine q35 \
-device ahci,id=ahi \
-drive format=raw,id=hda,file=./disk_image_gpt.img \
@ -107,8 +112,8 @@ then
image_base_str="CloverX64 : Image base = "
getImageBase() {
[ -f "$SCRIPT_DIR"/serial0_qemu_out.log ] || return 1
grep "$image_base_str" "$SCRIPT_DIR"/serial0_qemu_out.log
[ -f ./serial0_qemu_out.log ] || return 1
grep "$image_base_str" ./serial0_qemu_out.log
return $?
}
@ -121,7 +126,7 @@ then
if [ $count -ge $timeout ]
then
echo Cannot find "\"Clover : Image base = \"" in "$SCRIPT_DIR"/serial0_qemu_out.log after $timeout seconds
echo Cannot find "\"Clover : Image base = \"" in ./serial0_qemu_out.log after $timeout seconds
exit 1
fi

View File

@ -1,6 +1,8 @@
#!/bin/bash
SCRIPT_ABS_FILENAME=`LC_ALL=en_US.ISO8859-1 perl -e 'use Cwd "abs_path";print abs_path(shift)' "${BASH_SOURCE[0]}"`
SCRIPT_DIR=`dirname "$SCRIPT_ABS_FILENAME"`
cd "$SCRIPT_DIR"
OSTYPE=`uname -s`
#echo $OSTYPE
@ -16,32 +18,33 @@ then
echo clover_efi_file="$clover_efi_file"
fi
set -x
qemu_path=./qemu_portable-v4.2.0/qemu-system-x86_64
qemu_path=./qemu_portable-v5.2.0/qemu-system-x86_64
#set -x
if [ "$OSTYPE" = "Darwin" ]
then
if ! [ -f ./Qemu/qemu_portable/qemu-system-x86_64 ]
if ! [ -f "$qemu_path" ]
then
echo "You must restore the folder \'qemu_portable\'"
echo "You must restore the folder \'"$(dirname "$qemu_path")"\'"
exit 1
fi
if ! [ -f "$SCRIPT_DIR"/disk_image_gpt.img ]
if ! [ -f ./disk_image_gpt.img ]
then
unzip -o "$SCRIPT_DIR"/disk_image_gpt.img.zip
rm -rf "$SCRIPT_DIR"/__MACOSX
unzip -o ./disk_image_gpt.img.zip
rm -rf ./__MACOSX
fi
if pgrep qemu
then
killall qemu-system-x86_64
fi
> "$SCRIPT_DIR"/serial0_qemu_out.log # empty file without erasing it. Useful for editor for refreshing and reloading.
> ./serial0_qemu_out.log # empty file without erasing it. Useful for editor for refreshing and reloading.
if ! [ -z "$clover_efi_file" ]
then
hdiutil attach "$SCRIPT_DIR"/disk_image_gpt.img || exit 1
hdiutil attach ./disk_image_gpt.img || exit 1
shopt -s nocasematch
@ -60,18 +63,16 @@ then
diskutil eject /Volumes/QEMU_EFI || exit 1
fi
sleep 1 # not 100% sure it's needed
set -m
cd "$SCRIPT_DIR"
./qemu_portable/qemu-system-x86_64 \
-L qemu_portable \
bios_file=("$(dirname "$qemu_path")"/bios*)
"$qemu_path" \
-L "$(dirname "$qemu_path")" \
-m 2048 \
-cpu Penryn \
-bios ./bios.bin-1.13.0 \
-bios "$bios_file" \
-machine q35 \
-device ahci,id=ahi \
-drive format=raw,id=hda,file=./disk_image_gpt.img \

View File

@ -3,6 +3,7 @@ SCRIPT_ABS_FILENAME=`LC_ALL=en_US.ISO8859-1 perl -e 'use Cwd "abs_path";print ab
SCRIPT_DIR=`dirname "$SCRIPT_ABS_FILENAME"`
#SCRIPT_DIR="$(pwd)" # copy in terminal to be able to copy and paste command from this file
cd "$SCRIPT_DIR"
OSTYPE=`uname -s`
echo $OSTYPE
@ -24,7 +25,6 @@ executable_dirname="${executable_path##*/}"
echo executable_dirname="$executable_dirname"
cd "$SCRIPT_DIR"
if [ "$OSTYPE" = "Linux" ]
then
@ -33,12 +33,22 @@ fi
set -x
qemu_path=./qemu_portable-v4.2.0/qemu-system-x86_64
qemu_path=./qemu_portable-v5.2.0/qemu-system-x86_64
#set -x
if [ "$OSTYPE" = "Darwin" ]
then
if ! [ -f "$qemu_path" ]
then
echo "You must restore the folder \'"$(dirname "$qemu_path")"\'"
exit 1
fi
if ! [ -f ./disk_image_gpt.img ]
then
unzip -o ./disk_image_gpt.img.zip -d .
rm -rf ./__MACOSX
fi
if pgrep qemu
then
@ -46,11 +56,6 @@ then
fi
> ./serial0_qemu_out.log # empty file without erasing it. Useful for editor for refreshing and reloading.
if ! [ -f "$SCRIPT_DIR"/disk_image_gpt.img ]
then
unzip -o "$SCRIPT_DIR"/disk_image_gpt.img.zip
rm -rf "$SCRIPT_DIR"/__MACOSX
fi
hdiutil attach ./disk_image_gpt.img || exit 1
shopt -s nocasematch
@ -73,13 +78,17 @@ then
diskutil eject /Volumes/QEMU_EFI || exit 1
./qemu_portable/qemu-system-x86_64 \
-L qemu_portable \
sleep 1 # not 100% sure it's needed
set -m
bios_file=("$(dirname "$qemu_path")"/bios*)
"$qemu_path" \
-L "$(dirname "$qemu_path")" \
-m 2048 \
-cpu core2duo \
-bios bios.bin-1.13.0 \
-cpu Penryn \
-bios "$bios_file" \
-machine q35 \
-device VGA,vgamem_mb=64,edid=on,xres=1024,yres=768 \
-device ahci,id=ahi \
-drive format=raw,id=hda,file=./disk_image_gpt.img \
-usb \
@ -88,7 +97,9 @@ then
-serial file:./serial0_qemu_out.log \
-nic none \
-gdb tcp::9000 &
[[ $? -eq 0 ]] || exit 1
[[ $? == 0 ]] || exit 1
set +m
# -cdrom "/JiefLand/3.Infos/3.Infos-Mac/MacOs/11.0.20A5343j Big Sur/BigSurInstall.iso" \

Binary file not shown.

View File

@ -0,0 +1,5 @@
2021-04 :
Qemu 5.2.0 :
I got it from a MacPorts installation on High Sierra.
I made it portable with my script copy_and_make_portable
Jief_Machak

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.