1 From ad5f1615e2aa6b1029b183b9c062d47e270150ad Mon Sep 17 00:00:00 2001
2 From: Jackie Huang <jackie.huang@windriver.com>
3 Date: Fri, 26 May 2023 17:08:02 +0800
4 Subject: [PATCH 1/2] sysinv: fix the console for arm64
6 The default console for arm64 is ttyAMA0, use
7 dpkg-architecture to check the host arch and
8 replace the hardcoded console name.
11 PASS: build-pkgs on x86-64 host
12 PASS: build-image on x86-64 host
13 PASS: build-pkgs on arm64 host
14 PASS: build-image on arm64 host
15 PASS: Deploy AIO-SX on x86-64 target
16 PASS: Deploy AIO-SX on arm64 target
17 PASS: Deploy AIO-DX on arm64 targets
18 PASS: Deploy std (2+2+2) on arm64 targets
23 Change-Id: I583172cfd029cbb66acee01d1068100dce020075
24 Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
26 config-gate/debian/deb_folder/rules | 5 +++++
27 sysinv/cgts-client/debian/deb_folder/rules | 7 +++++++
28 sysinv/sysinv/debian/deb_folder/rules | 9 +++++++++
29 3 files changed, 21 insertions(+)
31 diff --git a/config-gate/debian/deb_folder/rules b/config-gate/debian/deb_folder/rules
32 index 2f8325067..8346c9b5e 100755
33 --- a/config-gate/debian/deb_folder/rules
34 +++ b/config-gate/debian/deb_folder/rules
37 #export DH_VERBOSE = 1
39 +export DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH 2>/dev/null)
44 @@ -8,6 +10,9 @@ override_dh_auto_build:
47 override_dh_auto_install:
48 +ifeq ($(DEB_HOST_ARCH),arm64)
49 + sed -i "s/ttyS0/ttyAMA0/" $(CURDIR)/*.service
51 $(MAKE) SBINDIR=`pwd`/debian/tmp/usr/sbin \
52 SYSTEMDDIR=`pwd`/debian/tmp/lib/systemd/system install
54 diff --git a/sysinv/cgts-client/debian/deb_folder/rules b/sysinv/cgts-client/debian/deb_folder/rules
55 index d21022388..57c96bf4a 100755
56 --- a/sysinv/cgts-client/debian/deb_folder/rules
57 +++ b/sysinv/cgts-client/debian/deb_folder/rules
60 #export DH_VERBOSE = 1
62 +export DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH 2>/dev/null)
64 export PYBUILD_NAME=cgts-client
65 # (chuck) - workaround for pbr version detection when running install
66 export PBR_VERSION=1.0.0
67 ROOT := $(CURDIR)/debian/tmp
68 +CGTS_DIR := $(CURDIR)/cgtsclient
71 dh $@ --with python3 --buildsystem=pybuild
74 +ifeq ($(DEB_HOST_ARCH),arm64)
75 + sed -i "s/ttyS0/ttyAMA0/" $(CGTS_DIR)/v1/iHost_shell.py \
76 + $(CGTS_DIR)/tests/v1/test_ihost.py
78 python3 setup.py install -f --install-layout=deb \
79 --root=$(CURDIR)/debian/tmp
80 python3 setup.py bdist_wheel \
81 diff --git a/sysinv/sysinv/debian/deb_folder/rules b/sysinv/sysinv/debian/deb_folder/rules
82 index 1f4767bc3..13e800dc2 100755
83 --- a/sysinv/sysinv/debian/deb_folder/rules
84 +++ b/sysinv/sysinv/debian/deb_folder/rules
87 #export DH_VERBOSE = 1
89 +export DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH 2>/dev/null)
91 export PYBUILD_NAME=sysinv
92 export PBR_VERSION=1.0.0
93 DEBIAN_DIR := $(CURDIR)/debian/tmp
94 +SYSINV_DIR := $(CURDIR)/sysinv
97 dh $@ --with python3 --buildsystem=pybuild
98 @@ -15,6 +18,12 @@ override_dh_auto_test:
102 +ifeq ($(DEB_HOST_ARCH),arm64)
103 + sed -i "s/ttyS0/ttyAMA0/" $(SYSINV_DIR)/db/sqlalchemy/models.py \
104 + $(SYSINV_DIR)/conductor/manager.py \
105 + $(SYSINV_DIR)/tests/db/utils.py \
106 + $(SYSINV_DIR)/tests/conductor/test_manager.py
108 python3 setup.py install -f --install-layout=deb \
109 --root=$(CURDIR)/debian/tmp
110 python3 setup.py bdist_wheel \