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/Makefile | |
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/Makefile')
-rw-r--r-- | rumpdisk/Makefile | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/rumpdisk/Makefile b/rumpdisk/Makefile index b59aaf9a..0b496963 100644 --- a/rumpdisk/Makefile +++ b/rumpdisk/Makefile @@ -15,7 +15,9 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -RUMPLIBS=rump rumpuser rumpdev rumpdev_disk rumpdev_pci rumpvfs rumpdev_ahcisata rumpdev_piixide rumpdev_ata +RUMPLIBS=rump rumpuser rumpdev rumpdev_disk rumpdev_pci rumpvfs +RUMPSATA=rumpdev_ahcisata rumpdev_piixide rumpdev_ata +RUMPUSB=rumpdev_usb rumpdev_pci_usbhc rumpdev_umass RUMPEXTRA=rumpdev_scsipi # If we have a configured tree, include the configuration so that we @@ -29,14 +31,25 @@ RUMPLIBS += rumpvfs_nofifofs endif dir := rumpdisk -makemode := server +makemode := servers SRCS = main.c block-rump.c LCLHDRS = block-rump.h ioccom-rump.h -target = rumpdisk -OBJS = $(SRCS:.c=.o) +targets = rumpdisk rumpusbdisk HURDLIBS = machdev ports trivfs shouldbeinlibc iohelp ihash fshelp -LDLIBS += -lpthread -lpciaccess -ldl -LDLIBS += -Wl,--whole-archive $(RUMPLIBS:%=-l%_pic) -Wl,--no-whole-archive $(RUMPEXTRA:%=-l%_pic) +LDLIBS += -lpthread -lpciaccess -ldl $(RUMPEXTRA:%=-l%_pic) \ + -Wl,--whole-archive $(RUMPLIBS:%=-l%_pic) -Wl,--no-whole-archive + +%.disk.o: %.c + $(CC) $(CFLAGS) $(CPPFLAGS) -D_RUMP_SATA -c $< -o $@ +rumpdisk-OBJS = $(SRCS:.c=.disk.o) +rumpdisk-LDLIBS += -Wl,--whole-archive $(RUMPSATA:%=-l%_pic) -Wl,--no-whole-archive +rumpdisk rumpdisk.static: $(rumpdisk-OBJS) $(HURDLIBS:%=-l%) + +%.usb.o: %.c + $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ +rumpusbdisk-OBJS = $(SRCS:.c=.usb.o) +rumpusbdisk-LDLIBS += -Wl,--whole-archive $(RUMPUSB:%=-l%_pic) -Wl,--no-whole-archive +rumpusbdisk rumpusbdisk.static: $(rumpusbdisk-OBJS) $(HURDLIBS:%=-l%) include ../Makeconf |