d9754bf9e0f70b218f6157fa78a5977db5431e7d
[pti/rtp.git] /
1 From 9a2832b8269a5c4e6610dbb80b46a0368f7e898b Mon Sep 17 00:00:00 2001
2 From: Jackie Huang <jackie.huang@windriver.com>
3 Date: Tue, 1 Aug 2023 16:09:29 +0800
4 Subject: [PATCH 3/9] dockerfiles: add stx-lat-tool_arm64.Dockerfile
5
6 Add stx-lat-tool_arm64.Dockerfile from stx-lat-tool.Dockerfile
7 and made the following adjustments:
8 * amd64 -> arm64
9 * corei7-64 -> cortexa57
10 * x86_64 -> aarch64
11
12 Test Plan:
13 PASS: run ./stx-init-env --rebuild on x86-64 host
14 PASS: run ./stx-init-env --rebuild on arm64 host
15 PASS: build-pkgs on x86-64 host
16 PASS: build-image on x86-64 host
17 PASS: build-pkgs on arm64 host
18 PASS: build-image on arm64 host
19 PASS: Deploy AIO-SX on x86-64 target
20 PASS: Deploy AIO-SX on arm64 target
21 PASS: Deploy AIO-DX on x86-64 target
22 PASS: Deploy AIO-DX on arm64 target
23
24 Story: 2010739
25 Task: 48002
26
27 Depends-On: https://review.opendev.org/c/starlingx/tools/+/890268
28
29 Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
30 Change-Id: Idd10ed519c97b44f1053ed30854dad6a0013052a
31 ---
32  stx/dockerfiles/stx-lat-tool_arm64.Dockerfile | 80 +++++++++++++++++++
33  1 file changed, 80 insertions(+)
34  create mode 100644 stx/dockerfiles/stx-lat-tool_arm64.Dockerfile
35
36 diff --git a/stx/dockerfiles/stx-lat-tool_arm64.Dockerfile b/stx/dockerfiles/stx-lat-tool_arm64.Dockerfile
37 new file mode 100644
38 index 0000000..6b249c2
39 --- /dev/null
40 +++ b/stx/dockerfiles/stx-lat-tool_arm64.Dockerfile
41 @@ -0,0 +1,80 @@
42 +# Copyright (c) 2023 Wind River Systems, Inc.
43 +#
44 +# Licensed under the Apache License, Version 2.0 (the "License");
45 +# you may not use this file except in compliance with the License.
46 +# You may obtain a copy of the License at
47 +#
48 +#     http://www.apache.org/licenses/LICENSE-2.0
49 +#
50 +# Unless required by applicable law or agreed to in writing, software
51 +# distributed under the License is distributed on an "AS IS" BASIS,
52 +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
53 +# See the License for the specific language governing permissions and
54 +# limitations under the License.
55 +
56 +FROM debian:bullseye
57 +
58 +MAINTAINER Jackie Huang <jackie.huang@windriver.com>
59 +
60 +ARG STX_MIRROR_URL=https://mirror.starlingx.windriver.com/mirror
61 +ARG LAT_BINARY_RESOURCE_PATH=${STX_MIRROR_URL}/lat-sdk/lat-sdk-20231206
62 +
63 +# Update certificates
64 +RUN apt-get -y update && apt-get -y install --no-install-recommends ca-certificates && update-ca-certificates
65 +
66 +# Install necessary packages
67 +RUN apt-get -y update && apt-get --no-install-recommends -y install \
68 +        openssh-client \
69 +        python3 \
70 +        python3-pip \
71 +        xz-utils \
72 +        file \
73 +        bzip2 \
74 +        procps \
75 +        tini \
76 +        wget \
77 +        locales-all \
78 +        python3-yaml \
79 +        rsync \
80 +        cpio \
81 +        vim \
82 +        && \
83 +        apt-get clean && \
84 +        rm -rf /var/lib/apt/lists/* && \
85 +        mkdir -p /opt/LAT/SDK && \
86 +        pip3 install pycryptodomex requests_toolbelt
87 +
88 +# Insert pubkey of the package repository
89 +COPY stx/toCOPY/builder/pubkey.rsa /opt/LAT/
90 +
91 +# Prepare executables
92 +COPY stx/toCOPY/lat-tool/lat/ /opt/LAT/lat
93 +
94 +# Fix the hardcoded env_script name in the lat-sdk for arm64
95 +# For x86_64, it's environment-setup-corei7-64-wrs-linux
96 +# For arm64, it's environment-setup-cortexa57-wrs-linux
97 +RUN sed -i 's/corei7-64/cortexa57/' /opt/LAT/lat/latd
98 +
99 +# Download & install LAT SDK.
100 +RUN wget --quiet ${LAT_BINARY_RESOURCE_PATH}/lat-sdk.sh --output-document=/opt/LAT/AppSDK.sh && \
101 +    chmod +x /opt/LAT/AppSDK.sh && \
102 +    /opt/LAT/AppSDK.sh -d /opt/LAT/SDK -y && \
103 +    rm -f /opt/LAT/AppSDK.sh
104 +
105 +# Fix: Use Debian CDN address for geo-frendly servers
106 +RUN sed -i 's/ftp.cn.debian.org/deb.debian.org/g' /opt/LAT/SDK/sysroots/aarch64-wrlinuxsdk-linux/usr/lib/python3.11/site-packages/genimage/debian_constant.py
107 +
108 +# Fix: Align DEFAULT_INITRD_NAME with our custom names
109 +RUN sed -i 's/debian-initramfs-ostree-image/starlingx-initramfs-ostree-image/g' /opt/LAT/SDK/sysroots/aarch64-wrlinuxsdk-linux/usr/lib/python3.11/site-packages/genimage/debian_constant.py
110 +
111 +# Fix: Align kernel with custom starlingx kernel
112 +RUN sed -i 's/linux-image-arm64/linux-image-stx-arm64/g' /opt/LAT/SDK/sysroots/aarch64-wrlinuxsdk-linux/usr/lib/python3.11/site-packages/genimage/debian_constant.py
113 +
114 +RUN sed -i 's/Wind River Linux Graphics development .* ostree/StarlingX ostree/g' /opt/LAT/SDK/sysroots/cortexa57-wrs-linux/boot/efi/EFI/BOOT/grub.cfg
115 +
116 +# Add vimrc
117 +COPY stx/toCOPY/common/vimrc.local /etc/vim/vimrc.local
118 +RUN chmod 0644 /etc/vim/vimrc.local
119 +
120 +ENTRYPOINT ["/usr/bin/tini", "--"]
121 +CMD ["/opt/LAT/lat/latd"]
122 -- 
123 2.30.2
124