-
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.
riscv64: Replace
9p
rootfs with virtio-blk
The new dev-riscv image will contain a `rootfs.img` to be used as `virtio-blk`. Effectively resolve the problems encountered while running unit-tests of `linux-loader` and `vm-memory`. Signed-off-by: Ruoqing He <[email protected]>
- Loading branch information
1 parent
24bf6da
commit e24510d
Showing
2 changed files
with
45 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/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 | ||
# Enable docker builx to transfer into container | ||
chmod 777 $EXTRACT_DIR/.ssh |