From 526b9d0afa9ff936b01e3166d8a77f354800ac67 Mon Sep 17 00:00:00 2001 From: Hyeongseok Oh Date: Fri, 10 May 2024 14:52:01 +0900 Subject: [PATCH] [infra] Infra for ubuntu 24.04 (#12978) This commit includes - Dockerfile for ubuntu 24.04 - Rootfs script for ubuntu 24.04 ONE-DCO-1.0-Signed-off-by: Hyeongseok Oh --- .../how-to-cross-build-runtime-for-aarch64.md | 2 +- .../how-to-cross-build-runtime-for-arm.md | 2 +- infra/docker/noble/Dockerfile | 55 +++++++++++++++++++ infra/docker/noble/Dockerfile.aarch64 | 55 +++++++++++++++++++ tools/cross/aarch64/sources.list.bionic | 11 ---- tools/cross/aarch64/sources.list.noble | 11 ++++ tools/cross/arm/sources.list.bionic | 11 ---- tools/cross/arm/sources.list.noble | 11 ++++ tools/cross/install_rootfs.sh | 8 +-- 9 files changed, 138 insertions(+), 28 deletions(-) create mode 100644 infra/docker/noble/Dockerfile create mode 100644 infra/docker/noble/Dockerfile.aarch64 delete mode 100644 tools/cross/aarch64/sources.list.bionic create mode 100644 tools/cross/aarch64/sources.list.noble delete mode 100644 tools/cross/arm/sources.list.bionic create mode 100644 tools/cross/arm/sources.list.noble diff --git a/docs/howto/how-to-cross-build-runtime-for-aarch64.md b/docs/howto/how-to-cross-build-runtime-for-aarch64.md index 69a78f1431d..77579d433cf 100644 --- a/docs/howto/how-to-cross-build-runtime-for-aarch64.md +++ b/docs/howto/how-to-cross-build-runtime-for-aarch64.md @@ -16,7 +16,7 @@ Use `install_rootfs.sh` script to prepare Root File System. You should have `sud $ sudo ./tools/cross/install_rootfs.sh aarch64 ``` - supports `arm`(default) and `aarch64` architecutre for now -- supports `bionic`, `focal`, and `jammy` release +- supports `focal`, `jammy`, and `noble` release To see the options, ``` diff --git a/docs/howto/how-to-cross-build-runtime-for-arm.md b/docs/howto/how-to-cross-build-runtime-for-arm.md index 3819170efa7..954218c1794 100644 --- a/docs/howto/how-to-cross-build-runtime-for-arm.md +++ b/docs/howto/how-to-cross-build-runtime-for-arm.md @@ -14,7 +14,7 @@ Use `install_rootfs.sh` script to prepare Root File System. You should have `sud $ sudo ./tools/cross/install_rootfs.sh arm ``` - supports `arm`(default) and `aarch64` architecutre for now -- supports `bionic`, `focal`, and `jammy` release +- supports `focal`,`jammy`, and `noble` release To see the options, ``` diff --git a/infra/docker/noble/Dockerfile b/infra/docker/noble/Dockerfile new file mode 100644 index 00000000000..0dd20d411dd --- /dev/null +++ b/infra/docker/noble/Dockerfile @@ -0,0 +1,55 @@ +# Copyright (c) 2024 Samsung Electronics Co., Ltd. All Rights Reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM ubuntu:noble + +# Install 'add-apt-repository' +RUN apt-get update && apt-get -qqy install software-properties-common + +# Install tzdata without user input +RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get -qqy install tzdata + +# Build tool +RUN apt-get update && apt-get -qqy install build-essential cmake scons git lcov g++-arm-linux-gnueabihf g++-aarch64-linux-gnu + +# Debian build tool +RUN apt-get update && apt-get -qqy install fakeroot devscripts debhelper python3-all dh-python + +# Install extra dependencies (Caffe, nnkit) +RUN apt-get update && apt-get -qqy install libboost-all-dev libgflags-dev libgoogle-glog-dev libatlas-base-dev libhdf5-dev + +# Additonal tools +RUN apt-get update && \ + apt-get -qqy install doxygen graphviz wget zip unzip python3 python3-pip python3-venv python3-dev hdf5-tools pylint curl +RUN python3 -m pip install yapf==0.22.0 --break-system-packages + +# Install clang-format +RUN apt-get update && apt-get -qqy install clang-format-16 + +# TODO: Install gbs & sdb +# gbs & sdb are not support ubuntu noble yet + +# Setup user ubuntu: give superuser permissions without password +RUN apt-get update && apt-get -qqy install sudo +RUN usermod -aG sudo ubuntu +RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + +# Clean archives (to reduce image size) +RUN apt-get clean -y + +# Set user to ubuntu(1000) +USER ubuntu +WORKDIR /home/ubuntu +RUN python3 -m venv ~/.local +ENV PATH=~/.local/bin:$PATH diff --git a/infra/docker/noble/Dockerfile.aarch64 b/infra/docker/noble/Dockerfile.aarch64 new file mode 100644 index 00000000000..b355b3fedfd --- /dev/null +++ b/infra/docker/noble/Dockerfile.aarch64 @@ -0,0 +1,55 @@ +# Copyright (c) 2024 Samsung Electronics Co., Ltd. All Rights Reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM ubuntu:noble + +# Install tzdata without user input +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -qqy install tzdata + +# Install 'add-apt-repository' +RUN apt-get update && apt-get -qqy install software-properties-common + +# Build tool +RUN apt-get update && apt-get -qqy install build-essential cmake scons git lcov g++-arm-linux-gnueabihf + +# Debian build tool +RUN apt-get update && apt-get -qqy install fakeroot devscripts debhelper python3-all dh-python + +# Install extra dependencies (Caffe, nnkit) +RUN apt-get update && apt-get -qqy install libboost-all-dev libgflags-dev libgoogle-glog-dev libatlas-base-dev libhdf5-dev + +# Additonal tools +RUN apt-get update && \ + apt-get -qqy install doxygen graphviz wget zip unzip python3 python3-pip python3-venv python3-dev hdf5-tools pylint curl +RUN python3 -m pip install yapf==0.22.0 --break-system-packages + +# Install clang-format +RUN apt-get update && apt-get -qqy install clang-format-16 + +# TODO: Install gbs & sdb +# gbs & sdb are not support ubuntu jammy yet + +# Setup user ubuntu: give superuser permissions without password +RUN apt-get update && apt-get -qqy install sudo +RUN usermod -aG sudo ubuntu +RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + +# Clean archives (to reduce image size) +RUN apt-get clean -y + +# Set user to ubuntu(1000) +USER ubuntu +WORKDIR /home/ubuntu +RUN python3 -m venv ~/.local +ENV PATH=~/.local/bin:$PATH diff --git a/tools/cross/aarch64/sources.list.bionic b/tools/cross/aarch64/sources.list.bionic deleted file mode 100644 index 21095574095..00000000000 --- a/tools/cross/aarch64/sources.list.bionic +++ /dev/null @@ -1,11 +0,0 @@ -deb http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted -deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted - -deb http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse -deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse diff --git a/tools/cross/aarch64/sources.list.noble b/tools/cross/aarch64/sources.list.noble new file mode 100644 index 00000000000..cf87df2dc8a --- /dev/null +++ b/tools/cross/aarch64/sources.list.noble @@ -0,0 +1,11 @@ +deb http://ports.ubuntu.com/ubuntu-ports/ noble main restricted universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ noble main restricted universe + +deb http://ports.ubuntu.com/ubuntu-ports/ noble-updates main restricted universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ noble-updates main restricted universe + +deb http://ports.ubuntu.com/ubuntu-ports/ noble-backports main restricted +deb-src http://ports.ubuntu.com/ubuntu-ports/ noble-backports main restricted + +deb http://ports.ubuntu.com/ubuntu-ports/ noble-security main restricted universe multiverse +deb-src http://ports.ubuntu.com/ubuntu-ports/ noble-security main restricted universe multiverse diff --git a/tools/cross/arm/sources.list.bionic b/tools/cross/arm/sources.list.bionic deleted file mode 100644 index 21095574095..00000000000 --- a/tools/cross/arm/sources.list.bionic +++ /dev/null @@ -1,11 +0,0 @@ -deb http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted -deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted - -deb http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse -deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse diff --git a/tools/cross/arm/sources.list.noble b/tools/cross/arm/sources.list.noble new file mode 100644 index 00000000000..cf87df2dc8a --- /dev/null +++ b/tools/cross/arm/sources.list.noble @@ -0,0 +1,11 @@ +deb http://ports.ubuntu.com/ubuntu-ports/ noble main restricted universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ noble main restricted universe + +deb http://ports.ubuntu.com/ubuntu-ports/ noble-updates main restricted universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ noble-updates main restricted universe + +deb http://ports.ubuntu.com/ubuntu-ports/ noble-backports main restricted +deb-src http://ports.ubuntu.com/ubuntu-ports/ noble-backports main restricted + +deb http://ports.ubuntu.com/ubuntu-ports/ noble-security main restricted universe multiverse +deb-src http://ports.ubuntu.com/ubuntu-ports/ noble-security main restricted universe multiverse diff --git a/tools/cross/install_rootfs.sh b/tools/cross/install_rootfs.sh index da2362e586c..78b08bb21b5 100755 --- a/tools/cross/install_rootfs.sh +++ b/tools/cross/install_rootfs.sh @@ -6,7 +6,7 @@ usage() { echo "Usage: $0 [BuildArch] [LinuxCodeName] [--setproxy=IP] [--skipunmount]" echo "BuildArch can be: arm(default), aarch64" - echo "LinuxCodeName - optional, Code name for Linux, can be: bionic, focal, jammy" + echo "LinuxCodeName - optional, Code name for Linux, can be: focal, jammy, noble" echo " default is host codename: ${DISTRIB_CODENAME} (DISTRIB_CODENAME in /etc/lsb-release)" echo "--setproxy=IP - optional, IP is the proxy server IP address or url with portnumber" echo " default no proxy. Example: --setproxy=127.1.2.3:8080" @@ -57,15 +57,15 @@ for i in "$@" ; do __BuildArch=aarch64 __QemuArch=arm64 ;; - bionic) - __LinuxCodeName=bionic - ;; focal) __LinuxCodeName=focal ;; jammy) __LinuxCodeName=jammy ;; + noble) + __LinuxCodeName=noble + ;; --setproxy*) proxyip="${i#*=}" __Apt="Acquire::http::proxy \"http://$proxyip/\";\n"