mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-06-23 21:34:18 +08:00
Add support for netboot
This includes building a tftp root and using it with qemu.
This commit is contained in:
parent
a35e6e0ca3
commit
41b51f692a
6
Makefile
6
Makefile
@ -13,6 +13,12 @@ live:
|
||||
rm -f $(BUILD)/livedisk.iso
|
||||
$(MAKE) $(BUILD)/livedisk.iso
|
||||
|
||||
netboot:
|
||||
-$(FUMOUNT) $(BUILD)/filesystem/ || true
|
||||
-$(FUMOUNT) /tmp/redox_installer/ || true
|
||||
rm -rf $(BUILD)/livedisk.iso $(BUILD)/tftproot
|
||||
$(MAKE) $(BUILD)/tftproot
|
||||
|
||||
popsicle: $(BUILD)/livedisk.iso
|
||||
popsicle-gtk $(BUILD)/livedisk.iso
|
||||
|
||||
|
||||
@ -21,9 +21,16 @@ $(BUILD)/livedisk.iso: $(HOST_FSTOOLS) $(REPO_TAG)
|
||||
FILESYSTEM_SIZE=$(shell $(INSTALLER) --filesystem-size -c $(FILESYSTEM_CONFIG)); \
|
||||
fi && \
|
||||
truncate -s "$$FILESYSTEM_SIZE"m $@.partial
|
||||
umask 002 && $(INSTALLER) $(INSTALLER_OPTS) -c $(FILESYSTEM_CONFIG) --live $@.partial
|
||||
umask 002 && $(INSTALLER) $(INSTALLER_OPTS) -c $(FILESYSTEM_CONFIG) --write-bootloader="$(BUILD)/bootloader-live.efi" --live $@.partial
|
||||
mv $@.partial $@
|
||||
|
||||
$(BUILD)/tftproot: $(HOST_FSTOOLS) $(REPO_TAG) $(BUILD)/livedisk.iso
|
||||
rm -r $(BUILD)/tftproot || true
|
||||
mkdir $(BUILD)/tftproot
|
||||
cp $(BUILD)/bootloader-live.efi $(BUILD)/tftproot/bootloader-live.efi
|
||||
ln -s ../livedisk.iso $(BUILD)/tftproot/redox-live.img
|
||||
cp redox.ipxe $(BUILD)/tftproot/redox.ipxe
|
||||
|
||||
$(BUILD)/filesystem.img: $(HOST_FSTOOLS) $(REPO_TAG)
|
||||
mkdir -p $(BUILD)
|
||||
-$(FUMOUNT) $(BUILD)/filesystem/ || true
|
||||
|
||||
14
mk/qemu.mk
14
mk/qemu.mk
@ -2,6 +2,7 @@
|
||||
|
||||
QEMU=SDL_VIDEO_X11_DGAMOUSE=0 qemu-system-$(QEMU_ARCH)
|
||||
QEMUFLAGS=-d guest_errors -name "Redox OS $(ARCH)"
|
||||
netboot?=no
|
||||
|
||||
ifeq ($(ARCH),i686)
|
||||
audio?=ac97
|
||||
@ -148,14 +149,19 @@ else
|
||||
QEMUFLAGS+=-device e1000,netdev=net0,id=nic0
|
||||
endif
|
||||
|
||||
EXTRANETARGS=
|
||||
ifeq ($(netboot),yes)
|
||||
EXTRANETARGS+=,tftp=$(BUILD)/tftproot,bootfile=redox.ipxe
|
||||
endif
|
||||
|
||||
ifneq ($(bridge),)
|
||||
QEMUFLAGS+=-netdev bridge,br=$(bridge),id=net0
|
||||
else ifeq ($(net),redir)
|
||||
# port 8080 and 8083 - webservers
|
||||
# port 64126 - our gdbserver implementation
|
||||
QEMUFLAGS+=-netdev user,id=net0,hostfwd=tcp::8080-:8080,hostfwd=tcp::8083-:8083,hostfwd=tcp::64126-:64126
|
||||
QEMUFLAGS+=-netdev user,id=net0,hostfwd=tcp::8080-:8080,hostfwd=tcp::8083-:8083,hostfwd=tcp::64126-:64126$(EXTRANETARGS)
|
||||
else
|
||||
QEMUFLAGS+=-netdev user,id=net0 -object filter-dump,id=f1,netdev=net0,file=$(BUILD)/network.pcap
|
||||
QEMUFLAGS+=-netdev user,id=net0$(EXTRANETARGS) -object filter-dump,id=f1,netdev=net0,file=$(BUILD)/network.pcap
|
||||
endif
|
||||
endif
|
||||
|
||||
@ -236,6 +242,10 @@ qemu-deps:$(FIRMWARE)
|
||||
|
||||
qemu-deps:$(QEMU_KERNEL)
|
||||
|
||||
ifeq ($(netboot),yes)
|
||||
qemu-deps: $(BUILD)/tftproot
|
||||
endif
|
||||
|
||||
qemu-deps: $(PFLASH0)
|
||||
|
||||
ifneq ($(PFLASH1),)
|
||||
|
||||
5
redox.ipxe
Normal file
5
redox.ipxe
Normal file
@ -0,0 +1,5 @@
|
||||
#!ipxe
|
||||
|
||||
kernel bootloader-live.efi
|
||||
initrd redox-live.img
|
||||
boot
|
||||
Loading…
Reference in New Issue
Block a user