76bb1b3826cb0cbc98424e95b4117ade061e131a
[pti/rtp.git] /
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
5
6 The default console for arm64 is ttyAMA0, use
7 dpkg-architecture to check the host arch and
8 replace the hardcoded console name.
9
10 Test Plan:
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
19
20 Story: 2010739
21 Task: 48285
22
23 Change-Id: I583172cfd029cbb66acee01d1068100dce020075
24 Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
25 ---
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(+)
30
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
35 @@ -1,6 +1,8 @@
36  #!/usr/bin/make -f
37  #export DH_VERBOSE = 1
38  
39 +export DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH 2>/dev/null)
40 +
41  %:
42         dh $@
43  
44 @@ -8,6 +10,9 @@ override_dh_auto_build:
45         : # Nothing to build
46  
47  override_dh_auto_install:
48 +ifeq ($(DEB_HOST_ARCH),arm64)
49 +       sed -i "s/ttyS0/ttyAMA0/" $(CURDIR)/*.service
50 +endif
51         $(MAKE) SBINDIR=`pwd`/debian/tmp/usr/sbin \
52                 SYSTEMDDIR=`pwd`/debian/tmp/lib/systemd/system install
53  
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
58 @@ -1,15 +1,22 @@
59  #!/usr/bin/make -f
60  #export DH_VERBOSE = 1
61  
62 +export DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH 2>/dev/null)
63 +
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
69  
70  %:
71         dh $@ --with python3 --buildsystem=pybuild
72  
73  override_dh_install:
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
77 +endif
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
85 @@ -1,9 +1,12 @@
86  #!/usr/bin/make -f
87  #export DH_VERBOSE = 1
88  
89 +export DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH 2>/dev/null)
90 +
91  export PYBUILD_NAME=sysinv
92  export PBR_VERSION=1.0.0
93  DEBIAN_DIR := $(CURDIR)/debian/tmp
94 +SYSINV_DIR := $(CURDIR)/sysinv
95  
96  %:
97         dh $@ --with python3 --buildsystem=pybuild
98 @@ -15,6 +18,12 @@ override_dh_auto_test:
99  endif
100  
101  override_dh_install:
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
107 +endif
108         python3 setup.py install -f --install-layout=deb \
109                 --root=$(CURDIR)/debian/tmp
110         python3 setup.py bdist_wheel \
111 -- 
112 2.30.2
113