-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Ruoqing He <[email protected]>
- Loading branch information
1 parent
369a561
commit ea3a3b1
Showing
7 changed files
with
84 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Build rootfs with sshd and Rust related packages ready | ||
# --------------------------------------------------------- | ||
FROM --platform=linux/riscv64 riscv64/ubuntu:22.04 AS rootfs_builder | ||
Check warning on line 3 in Dockerfile.riscv64_rootfs GitHub Actions / build-riscvFROM --platform flag should not use a constant value
|
||
|
||
ARG RUST_TOOLCHAIN="1.75.0" | ||
ENV PATH="$PATH:/root/.cargo/bin" | ||
COPY build_container.sh /opt/src/scripts/build.sh | ||
RUN /opt/src/scripts/build.sh | ||
|
||
# Finalize | ||
# --------------------------------------------------------- | ||
FROM ubuntu:22.04 AS final | ||
|
||
ARG OUTPUT=/output | ||
ARG ROOTFS_DIR=/opt/rootfs | ||
|
||
COPY --from=rootfs_builder / $ROOTFS_DIR | ||
|
||
COPY riscv64/rootfs_finalize.sh /opt/src/scripts/finalize.sh | ||
RUN /opt/src/scripts/finalize.sh | ||
|
||
ENV ROOTFS_DIR=$ROOTFS_DIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ set -ex | |
|
||
apt-get update | ||
|
||
QEMU_TAG=v9.0.2 | ||
QEMU_TAG=v9.1.0 | ||
OUTPUT=/output | ||
mkdir $OUTPUT | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env bash | ||
set -ex | ||
|
||
apt-get update | ||
|
||
DEBIAN_FRONTEND="noninteractive" apt-get install --no-install-recommends -y \ | ||
qemu-utils | ||
|
||
TMP_MOUNT_DIR=tmp_mount_dir | ||
ROOTFS_DIR=/opt/rootfs | ||
EXTRACT_DIR=/to_extract | ||
|
||
# Move rootfs into image with raw format | ||
qemu-img create $EXTRACT_DIR/rootfs.img 5G && mkfs.ext4 $EXTRACT_DIR/rootfs.img | ||
mkdir $TMP_MOUNT_DIR | ||
# This operation need `privileged` docker container | ||
mount -o loop $EXTRACT_DIR/rootfs.img $TMP_MOUNT_DIR | ||
mv $ROOTFS_DIR/* $TMP_MOUNT_DIR | ||
umount $TMP_MOUNT_DIR | ||
rmdir $TMP_MOUNT_DIR | ||
|
||
mv /root/.ssh $EXTRACT_DIR | ||
chmod 777 $EXTRACT_DIR/.ssh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters