diff options
author | Damien Zammit <damien@zamaudio.com> | 2023-07-03 10:18:22 +0000 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-07-03 13:40:09 +0200 |
commit | c3b3053b9e8ac3c9f70cbe12f884ab8ca69dd991 (patch) | |
tree | 6f1b22534ba93ff543080ae050f89761677f4598 /rumpdisk/main.c | |
parent | f214d0723240cbbe0f1ccb90af8d1b0bb095837f (diff) | |
download | hurd-c3b3053b9e8ac3c9f70cbe12f884ab8ca69dd991.tar.gz hurd-c3b3053b9e8ac3c9f70cbe12f884ab8ca69dd991.tar.bz2 hurd-c3b3053b9e8ac3c9f70cbe12f884ab8ca69dd991.zip |
rumpusbdisk: Add USB mass storage translator
This adds a second binary target to compile in
the rump USB stack instead of SATA/IDE using conditional
ifdefs to mostly share the code between the two translators.
This can be tested by running qemu with a USB3 controller as follows:
-drive if=none,id=usbstick,format=raw,file=/path/to/disk.img \
-device qemu-xhci \
-device usb-storage,drive=usbstick \
NB: /path/to/disk.img can be a block device on the host.
Then call grub module rumpusbdisk.static instead of rumpdisk.static
and pass ' root=part:X:device:sd0 noide' as gnumach parameters,
where X is the partition number of / within the disk/image.
Caveats: netdde seems to exhibit a bug when running 'ifdown /dev/eth0'
simultaneously to running the rumpusbdisk translator, due to
the two devices sharing the same IRQ.
Message-Id: <20230703101815.925760-1-damien@zamaudio.com>
Diffstat (limited to 'rumpdisk/main.c')
-rw-r--r-- | rumpdisk/main.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/rumpdisk/main.c b/rumpdisk/main.c index 64065c6c..ca166274 100644 --- a/rumpdisk/main.c +++ b/rumpdisk/main.c @@ -32,6 +32,12 @@ #include <pthread.h> #include <mach.h> +#ifdef _RUMP_SATA +#define RUMPNAME "rumpdisk" +#else +#define RUMPNAME "rumpusbdisk" +#endif + mach_port_t bootstrap_resume_task = MACH_PORT_NULL; static const struct argp_option options[] = { @@ -128,7 +134,7 @@ main (int argc, char **argv) } rump_register_block (); - machdev_trivfs_init (argc, argv, bootstrap_resume_task, "rumpdisk", "/dev/rumpdisk", &bootstrap); + machdev_trivfs_init (argc, argv, bootstrap_resume_task, RUMPNAME, "/dev/" RUMPNAME, &bootstrap); /* Make sure we will not swap out, in case we drive the disk used for swapping. */ |