Skip to content

Commit

Permalink
tools/ci: Install genromfs instead building it from source code
Browse files Browse the repository at this point in the history
Signed-off-by: Xiang Xiao <[email protected]>
  • Loading branch information
xiaoxiang781216 committed Feb 11, 2023
1 parent e5b1482 commit d667c5c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 22 deletions.
20 changes: 10 additions & 10 deletions tools/ci/cibuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -209,16 +209,16 @@ function elf-toolchain {
}

function gen-romfs {
add_path "${tools}"/genromfs/usr/bin

if [ ! -f "${tools}/genromfs/usr/bin/genromfs" ]; then
git clone https://bitbucket.org/nuttx/tools.git "${tools}"/nuttx-tools
cd "${tools}"/nuttx-tools
tar zxf genromfs-0.5.2.tar.gz -C "${tools}"
cd "${tools}"/genromfs-0.5.2
make install PREFIX="${tools}"/genromfs
cd "${tools}"
rm -rf nuttx-tools
if ! type genromfs &> /dev/null; then
case ${os} in
Darwin)
brew tap PX4/px4
brew install genromfs
;;
Linux)
apt-get install -y genromfs
;;
esac
fi
}

Expand Down
13 changes: 1 addition & 12 deletions tools/ci/docker/linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,12 @@ RUN apt-get update -qq && DEBIAN_FRONTEND="noninteractive" apt-get install -y -q
RUN mkdir /tools
WORKDIR /tools

RUN mkdir -p /tools/nuttx-tools
RUN curl -s -L https://bitbucket.org/nuttx/tools/get/9ad3e1ee75c7.tar.gz \
| tar -C nuttx-tools --strip-components=1 -xz

RUN mkdir bloaty -p \
&& git clone --depth 1 --branch v1.1 https://github.com/google/bloaty bloaty \
&& cd bloaty \
&& cmake -DCMAKE_SYSTEM_PREFIX_PATH=/tools/bloaty \
&& make install

RUN cd nuttx-tools \
&& mkdir genromfs \
&& tar -C genromfs --strip-components=1 -xf genromfs-0.5.2.tar.gz \
&& cd genromfs \
&& make install PREFIX=/tools/genromfs

# Install Rust and targets supported from NuttX
ENV RUST_HOME=/tools/rust
ENV CARGO_HOME=$RUST_HOME/cargo
Expand Down Expand Up @@ -235,6 +225,7 @@ RUN apt-get update -qq && DEBIAN_FRONTEND="noninteractive" apt-get install -y -q
gcc \
gcc-avr \
gcc-multilib \
genromfs \
gettext \
git \
lib32z1-dev \
Expand Down Expand Up @@ -298,8 +289,6 @@ WORKDIR /tools
# Pull in the tools we just built for nuttx
COPY --from=nuttx-tools /tools/bloaty/ bloaty/
ENV PATH="/tools/bloaty/bin:$PATH"
COPY --from=nuttx-tools /tools/genromfs/ /tools/genromfs/
ENV PATH="/tools/genromfs/usr/bin:$PATH"

# Pull in the Rust toolchain including supported targets
COPY --from=nuttx-tools /tools/rust/ /tools/rust/
Expand Down

0 comments on commit d667c5c

Please sign in to comment.