-
Notifications
You must be signed in to change notification settings - Fork 61
Support mounting rootfs from virtio-blk via initrd #81
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
base: master
Are you sure you want to change the base?
Conversation
df27770
to
5d4ca98
Compare
Can you refine the testing procedures? I expect to run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we update the README to document support for this feature, including use cases for switching to this rootfs mounting method?
I've updated
|
I plan to merge #82 prior to this pull request, so that we can validate Linux v6.12 (another LTS kernel). |
scripts/build-image.sh
Outdated
if [ ! -f buildroot/.config ]; then | ||
echo "Copying buildroot.config -> buildroot/.config" | ||
cp -f configs/buildroot.config buildroot/.config | ||
else | ||
echo "buildroot/.config already exists, skipping copy" | ||
fi | ||
|
||
if [ ! -f buildroot/busybox.config ]; then | ||
echo "Copying busybox.config -> buildroot/busybox.config" | ||
cp -f configs/busybox.config buildroot/busybox.config | ||
else | ||
echo "buildroot/busybox.config already exists, skipping copy" | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create bash function to avoid duplication.
Rebase the latest |
0794981
to
00a1cf7
Compare
Due to the 1 GiB kernel space limit on RV32-Linux, embedding large root filesystems in the kernel image can be impractical for certain testing scenarios. This commit introduces a script to generate a mountable ext4 rootfs image and modifies the init script to support switching the root filesystem to a virtio-blk device. During boot, the init script checks whether /dev/vda contains a valid rootfs. If so, it switches the root to the virtio-blk device. Otherwise, it falls back to the default initramfs.
Overview
Due to the 1 GiB kernel space limit on RV32-Linux, embedding large root filesystems in the kernel image can be impractical for certain testing scenarios.
This commit introduces a script to generate a mountable ext4 rootfs image and modifies the init script to support switching the root filesystem to a virtio-blk device.
During boot, the init script checks whether
/dev/vda
contains a valid rootfs. If so, it switches the root to the virtio-blk device. Otherwise, it falls back to the default initramfs.Testing Procedures
1. Build Linux kernel and rootfs CPIO
2. Generate external rootfs image
3. Launch the simulator
Expected Output
The console output should indicate that the root filesystem was successfully mounted from
/dev/vda
:References