Merge "Fix aarch64/arm64 support for MicroStack"

This commit is contained in:
Zuul 2021-09-07 08:42:08 +00:00 committed by Gerrit Code Review
commit 42a50992ed
2 changed files with 24 additions and 21 deletions

View File

@ -15,7 +15,11 @@ environment:
PYTHONPATH: $PYTHONPATH:/usr/lib/python3.8:/usr/lib/python3/dist-packages:$SNAP/usr/lib/python3.8:$SNAP/lib/python3.8/site-packages:$SNAP/usr/lib/python3/dist-packages PYTHONPATH: $PYTHONPATH:/usr/lib/python3.8:/usr/lib/python3/dist-packages:$SNAP/usr/lib/python3.8:$SNAP/lib/python3.8/site-packages:$SNAP/usr/lib/python3/dist-packages
PYTHONWARNINGS: ignore PYTHONWARNINGS: ignore
# Needed by a targetcli dependency. # Needed by a targetcli dependency.
GI_TYPELIB_PATH: $SNAP/usr/lib/x86_64-linux-gnu/girepository-1.0 GI_TYPELIB_PATH: $SNAP/usr/lib/$SNAP_ARCH-linux-gnu/girepository-1.0
architectures:
- build-on: amd64
- build-on: arm64
system-usernames: system-usernames:
snap_daemon: shared snap_daemon: shared
@ -35,6 +39,12 @@ layout:
bind: $SNAP/usr/share/libvirt bind: $SNAP/usr/share/libvirt
/usr/share/qemu: /usr/share/qemu:
bind: $SNAP/usr/share/qemu bind: $SNAP/usr/share/qemu
# For UEFI Support, bindmount the OVMF and AAVMF directories
# appropriately. UEFI support is required for aarch64.
/usr/share/OVMF:
bind: $SNAP/usr/share/OVMF
/usr/share/AAVMF:
bind: $SNAP/usr/share/AAVMF
# Keystone really wants to look here for its fernet keys for some reason # Keystone really wants to look here for its fernet keys for some reason
/etc/keystone/fernet-keys: /etc/keystone/fernet-keys:
bind: $SNAP_COMMON/fernet-keys bind: $SNAP_COMMON/fernet-keys
@ -739,20 +749,6 @@ parts:
# patch --batch --forward --strip 1 --input ../project/patches/nova/nova_log_error.patch # patch --batch --forward --strip 1 --input ../project/patches/nova/nova_log_error.patch
organize: organize:
lib/python3.8/site-packages/openstack_dashboard/local/local_settings.py.example: lib/python3.8/site-packages/openstack_dashboard/local/local_settings.py lib/python3.8/site-packages/openstack_dashboard/local/local_settings.py.example: lib/python3.8/site-packages/openstack_dashboard/local/local_settings.py
override-build: |
snapcraftctl build
rm $SNAPCRAFT_PART_INSTALL/pyvenv.cfg
--strip 1 \
--input "$patch"
echo
done
# Now that everything is built, let's disable user site-packages
# as stated in PEP-0370
# sed -i usr/lib/python3.8/site.py -e 's/^ENABLE_USER_SITE = None$/ENABLE_USER_SITE = False/'
# Uncomment the below line for better python-libvirt debugging output.
# patch --batch --forward --strip 1 --input ../project/patches/nova/nova_log_error.patch
organize:
lib/python3.8/site-packages/openstack_dashboard/local/local_settings.py.example: lib/python3.8/site-packages/openstack_dashboard/local/local_settings.py
override-build: | override-build: |
snapcraftctl build snapcraftctl build
rm $SNAPCRAFT_PART_INSTALL/pyvenv.cfg rm $SNAPCRAFT_PART_INSTALL/pyvenv.cfg
@ -772,7 +768,6 @@ parts:
etc/*.ini: etc/keystone/ etc/*.ini: etc/keystone/
etc/*.json: etc/keystone/ etc/*.json: etc/keystone/
etc/*.templates: etc/keystone/ etc/*.templates: etc/keystone/
filesets: filesets:
etc: etc:
- etc/keystone/* - etc/keystone/*
@ -1088,6 +1083,12 @@ parts:
- librtmp1 - librtmp1
- libssh-4 - libssh-4
- libwind0-heimdal - libwind0-heimdal
# UEFI Support, required on arm64
- on arm64:
- qemu-efi-aarch64
- qemu-efi-arm
- on amd64:
- ovmf
build-packages: build-packages:
- acpica-tools - acpica-tools
- libaio-dev - libaio-dev
@ -1131,7 +1132,7 @@ parts:
- --disable-bsd-user - --disable-bsd-user
- --disable-vhost-user - --disable-vhost-user
- --enable-system - --enable-system
- --target-list=x86_64-softmmu - --target-list=x86_64-softmmu,aarch64-softmmu
- --disable-xen - --disable-xen
override-build: | override-build: |
dpkg-source --before-build . dpkg-source --before-build .
@ -1240,7 +1241,7 @@ parts:
# for the child processes they spawn since the environment variables are not passed down to children by default after execve(2). # for the child processes they spawn since the environment variables are not passed down to children by default after execve(2).
# `readelf -d /snap/microstack/current/usr/libexec/virt-aa-helper` should return something like: # `readelf -d /snap/microstack/current/usr/libexec/virt-aa-helper` should return something like:
# (RUNPATH) Library runpath: [/snap/microstack/current/usr/lib:/snap/microstack/current/usr/lib/x86_64-linux-gnu:...] # (RUNPATH) Library runpath: [/snap/microstack/current/usr/lib:/snap/microstack/current/usr/lib/x86_64-linux-gnu:...]
- LDFLAGS: '$LDFLAGS -Wl,-rpath=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/lib -Wl,-rpath=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/lib/x86_64-linux-gnu -Wl,-rpath=/snap/$SNAPCRAFT_PROJECT_NAME/current/lib -Wl,-rpath=/lib/x86_64-linux-gnu -Wl,-rpath=/lib/' - LDFLAGS: '$LDFLAGS -Wl,-rpath=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/lib -Wl,-rpath=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/lib/$SNAPCRAFT_ARCH_TRIPLET -Wl,-rpath=/snap/$SNAPCRAFT_PROJECT_NAME/current/lib -Wl,-rpath=/lib/$SNAPCRAFT_ARCH_TRIPLET -Wl,-rpath=/lib/'
override-build: | override-build: |
dpkg-source --before-build . dpkg-source --before-build .
logger `echo -n $PWD` logger `echo -n $PWD`
@ -1442,7 +1443,7 @@ parts:
# see LP: #1882994 # see LP: #1882994
rm $SNAPCRAFT_PART_INSTALL/bin/python3 rm $SNAPCRAFT_PART_INSTALL/bin/python3
rm $SNAPCRAFT_PART_INSTALL/bin/python rm $SNAPCRAFT_PART_INSTALL/bin/python
rm $SNAPCRAFT_PART_INSTALL/lib/python3.8/site-packages/netifaces.cpython-38-x86_64-linux-gnu.so rm $SNAPCRAFT_PART_INSTALL/lib/python3.8/site-packages/netifaces.cpython-38-$SNAPCRAFT_ARCH_TRIPLET.so
# Launch script # Launch script
launch: launch:
@ -1558,7 +1559,6 @@ parts:
lma-build-prep: lma-build-prep:
plugin: nil plugin: nil
source: ""
build-packages: build-packages:
- dirmngr - dirmngr
override-build: | override-build: |

View File

@ -24,6 +24,8 @@ limitations under the License.
""" """
import json import json
import platform
from time import sleep from time import sleep
from os import path from os import path
from pathlib import Path from pathlib import Path
@ -869,7 +871,8 @@ class GlanceSetup(Question):
env = dict(**_env) env = dict(**_env)
env['VER'] = '0.4.0' env['VER'] = '0.4.0'
env['IMG'] = 'cirros-{VER}-x86_64-disk.img'.format(**env) env['ARCH'] = platform.machine()
env['IMG'] = 'cirros-{VER}-{ARCH}-disk.img'.format(**env)
cirros_path = '{SNAP_COMMON}/images/{IMG}'.format(**env) cirros_path = '{SNAP_COMMON}/images/{IMG}'.format(**env)