my_buildctl : arm64 support
This commit is contained in:
parent
ee8bfc4d7e
commit
9d64a47bc9
17
functions.sh
17
functions.sh
|
@ -263,7 +263,20 @@ get_podman_volume_path () {
|
||||||
# Execute buildctl directly from the web
|
# Execute buildctl directly from the web
|
||||||
my_buildctl () {
|
my_buildctl () {
|
||||||
opts=$(echo -n "$@")
|
opts=$(echo -n "$@")
|
||||||
curl -sSLf https://github.com/moby/buildkit/releases/download/v0.9.3/buildkit-v0.9.3.linux-amd64.tar.gz |
|
|
||||||
|
if [[ $(uname -i) == 'aarch64' ]]; then
|
||||||
|
buildkitarch='arm64'
|
||||||
|
memfd_create='279'
|
||||||
|
elif [[ $(uname -i) == 'x86_64' ]]; then
|
||||||
|
buildkitarch='amd64'
|
||||||
|
memfd_create='319'
|
||||||
|
else
|
||||||
|
# defaults to amd64
|
||||||
|
buildkitarch='amd64'
|
||||||
|
memfd_create='319'
|
||||||
|
fi
|
||||||
|
|
||||||
|
curl -sSLf https://github.com/moby/buildkit/releases/download/v0.9.3/buildkit-v0.9.3.linux-${buildkitarch}.tar.gz |
|
||||||
tar xOz bin/buildctl |
|
tar xOz bin/buildctl |
|
||||||
python3 -c "
|
python3 -c "
|
||||||
import ctypes, os;
|
import ctypes, os;
|
||||||
|
@ -271,7 +284,7 @@ from sys import stdin;
|
||||||
l = ctypes.CDLL(None);
|
l = ctypes.CDLL(None);
|
||||||
s = l.syscall;
|
s = l.syscall;
|
||||||
e = stdin.buffer.read();
|
e = stdin.buffer.read();
|
||||||
f = s(319, '', 1);
|
f = s(${memfd_create}, '', 1);
|
||||||
os.write(f, e);
|
os.write(f, e);
|
||||||
p = '/proc/self/fd/%d' % f;
|
p = '/proc/self/fd/%d' % f;
|
||||||
myargs='${opts}';
|
myargs='${opts}';
|
||||||
|
|
|
@ -9,15 +9,6 @@ ensure_not_root
|
||||||
|
|
||||||
buildfolder=/tmp/synapse-$$
|
buildfolder=/tmp/synapse-$$
|
||||||
|
|
||||||
if [[ $(uname -i) == 'aarch64' ]]; then
|
|
||||||
buildkitarch='arm64'
|
|
||||||
elif [[ $(uname -i) == 'x86_64' ]]; then
|
|
||||||
buildkitarch='amd64'
|
|
||||||
else
|
|
||||||
# defaults to amd64
|
|
||||||
buildkitarch='amd64'
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! podman image exists localhost/matrixdotorg/synapse:${synapse_version}; then
|
if ! podman image exists localhost/matrixdotorg/synapse:${synapse_version}; then
|
||||||
mkdir ${buildfolder} &&
|
mkdir ${buildfolder} &&
|
||||||
curl -sSfL -- "https://github.com/matrix-org/synapse/archive/refs/tags/${synapse_version}.tar.gz" | \tar xz --strip-components 1 -C ${buildfolder}/ && {
|
curl -sSfL -- "https://github.com/matrix-org/synapse/archive/refs/tags/${synapse_version}.tar.gz" | \tar xz --strip-components 1 -C ${buildfolder}/ && {
|
||||||
|
|
Loading…
Reference in a new issue