Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

riscv64: Mount tmpfs to support unit-tests expecting /tmp #117

Merged
merged 2 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion riscv64/build_finalize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ apt-get update

DEBIAN_FRONTEND="noninteractive" apt-get install --no-install-recommends -y \
openssh-client libslirp-dev libfdt-dev libglib2.0-dev libssl-dev \
libpixman-1-dev netcat
libpixman-1-dev

# Modify fstab to mount `tmpfs` during boot
# See: https://wiki.qemu.org/Documentation/9p_root_fs#Let's_start_the_Installation
echo 'tmpfs /tmp tmpfs rw,nosuid,nodev,size=524288k,nr_inodes=204800 0 0' >> $ROOTFS_DIR/etc/fstab
TimePrinciple marked this conversation as resolved.
Show resolved Hide resolved

# Setup container ssh config
yes "" | ssh-keygen -P ""
Expand Down
7 changes: 4 additions & 3 deletions riscv64/start_in_qemu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@ cp -a $WORKDIR $ROOTFS_DIR/root

HOST=riscv-qemu

while ! nc -z localhost 2222; do
echo "Dialing qemu-system-riscv64..."
sleep 1
echo "Testing SSH connectivity to $HOST..."
while ! ssh -o ConnectTimeout=3 $HOST exit; do
echo "$HOST is not ready..."
done

# Issue command
COMMAND=$@
echo "$HOST is ready, forwarding command: $COMMAND"
ssh $HOST "export PATH=\"\$PATH:/root/.cargo/bin\" && cd workdir && $COMMAND"
Loading