-
-
Notifications
You must be signed in to change notification settings - Fork 353
/
transform_32_into_64.sh
executable file
·67 lines (54 loc) · 2.69 KB
/
transform_32_into_64.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/env bash
set -o errexit
set -o pipefail
set -o nounset
set -o xtrace
SCRIPTS="$(cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P)"
. ${SCRIPTS}/envvars.sh
set_version_variables
#Load VMMaker, used to convert images from 32 to 64 bits
mkdir -p vmmaker && cd vmmaker
wget https://github.com/pharo-project/pharo-32to64-converter/releases/download/v1.0.0/vmmaker-image.zip
unzip vmmaker-image.zip
../../bootstrap/scripts/getPharoVM.sh 60
wget http://files.pharo.org/sources/PharoV50.sources
cd ..
#We convert all files that are not full image (Pharo7.0-${IMAGE_KIND}-32bit-${HASH}.*)
for f in ${PHARO_NAME_PREFIX}-*-32bit-*.zip; do
unzip "$f"
IMAGEFILENAME=$(find . -iname *.image -maxdepth 1)
IMAGENAME=${IMAGEFILENAME%.*}
if [ -f "${IMAGENAME}.image" ]
then
mv "${IMAGENAME}.image" tempconversion.image
touch "${IMAGENAME}.changes"
mv "${IMAGENAME}.changes" tempconversion.changes
IMAGE_KIND=$(echo "$f" | cut -d '-' -f 3)
HASH=$(echo "$f" | head -n 1 | cut -d '-' -f 5 | cut -d '.' -f 1)
./vmmaker/pharo ./vmmaker/generator.image eval "[Spur32to64BitBootstrap new bootstrapImage: '../tempconversion.image'] on: AssertionFailure do: [ :fail | fail resumeUnchecked: nil ]"
mv "tempconversion-64.image" "${PHARO_NAME_PREFIX}-${IMAGE_KIND}-64bit-$HASH.image"
mv "tempconversion-64.changes" "${PHARO_NAME_PREFIX}-${IMAGE_KIND}-64bit-$HASH.changes"
zip ${PHARO_NAME_PREFIX}-${IMAGE_KIND}-64bit-$HASH.zip ${PHARO_NAME_PREFIX}-${IMAGE_KIND}-64bit-$HASH.*
fi
rm -f *.image *.changes *.sources
done
#We convert full image file (Pharo7.0-32bit-${HASH}.*)
for f in ${PHARO_NAME_PREFIX}-32bit-*.zip; do
unzip "$f"
IMAGENAME=${f%.*}
cp "${IMAGENAME}.image" tempconversion.image
touch tempconversion.changes
cp "${IMAGENAME}.changes" tempconversion.changes
HASH=$(find $f | head -n 1 | cut -d '-' -f 4 | cut -d '.' -f 1)
./vmmaker/pharo ./vmmaker/generator.image eval "[Spur32to64BitBootstrap new bootstrapImage: '../tempconversion.image'] on: AssertionFailure do: [ :fail | fail resumeUnchecked: nil ]"
mv "tempconversion-64.image" "${PHARO_NAME_PREFIX}-64bit-$HASH.image"
mv "tempconversion-64.changes" "${PHARO_NAME_PREFIX}-64bit-$HASH.changes"
# fix the display size in the image header (position 40 [zero based], 24 for 32-bit image)
# in older versions we must use octal representation
printf "\231\002\320\003" > displaySize.bin
dd if="displaySize.bin" of="${PHARO_NAME_PREFIX}-64bit-$HASH.image" bs=1 seek=40 count=4 conv=notrunc
PHARO_SOURCES_PREFIX=$(echo "${PHARO_NAME_PREFIX}" | cut -d'-' -f 1 | cut -d'.' -f 1-2)
zip ${PHARO_NAME_PREFIX}-64bit-$HASH.zip ${PHARO_NAME_PREFIX}-64bit-$HASH.* ${PHARO_SOURCES_PREFIX}*.sources pharo.version
rm -f *.image *.changes *.sources
done
rm -rf vmmaker