~vdupras/duskbsd-qemu

43722dd3e068029694c23b86724d6cbaf24b3749 — Virgil Dupras 8 months ago 008055e
Include duskbsd as submodule

This way, it's easier to keep duskbsd and duskos in sync. This implied quite a
rework of the top level makefile.
5 files changed, 30 insertions(+), 18 deletions(-)

M .gitignore
M .gitmodules
M Makefile
M README.md
A usr/src/sys
M .gitignore => .gitignore +2 -1
@@ 1,4 1,5 @@
*.img
*.bin
*.tgz
/usr
/duskbsd
/_sys

M .gitmodules => .gitmodules +3 -0
@@ 1,3 1,6 @@
[submodule "duskos"]
	path = duskos
	url = https://git.sr.ht/~vdupras/duskos
[submodule "duskbsd"]
	path = usr/src/sys
	url = https://git.sr.ht/~vdupras/duskbsd

M Makefile => Makefile +24 -16
@@ 7,28 7,40 @@ KERNEL = usr/src/obj/sys/arch/$(ARCH)/compile/$(CONFTGTNAME)/netbsd
JOBS = 4
BUILDSH = ./build.sh -U -u -O ./obj -j $(JOBS) -a $(ARCH) -m $(MACHINE)
KEXEC = duskos/netbsd/kexec
TARBALLS = src.tgz syssrc.tgz sharesrc.tgz gnusrc.tgz

.PHONY: all
all: $(KERNEL) fat.img

usr/src/build.sh:
	curl https://cdn.netbsd.org/pub/NetBSD/NetBSD-9.3/source/sets/src.tgz | tar zx
$(TARBALLS):
	wget https://cdn.netbsd.org/pub/NetBSD/NetBSD-9.3/source/sets/$@

usr/src/sys:
	curl https://cdn.netbsd.org/pub/NetBSD/NetBSD-9.3/source/sets/syssrc.tgz | tar zx

usr/src/share:
	curl https://cdn.netbsd.org/pub/NetBSD/NetBSD-9.3/source/sets/sharesrc.tgz | tar zx
duskos/README.md:
	git submodule init
	git submodule update

usr/src/external/gpl3:
	curl https://cdn.netbsd.org/pub/NetBSD/NetBSD-9.3/source/sets/gnusrc.tgz | tar zx
usr/src/sys/README.md:
	git submodule init
	git submodule update

usr/src/sys/README.md: | usr/src/sys
	rm -rf usr/src/sys
	cd usr/src && git clone https://git.sr.ht/~vdupras/duskbsd sys
usr/src/build.sh: | $(TARBALLS) usr/src/sys/README.md
	mv usr/src/sys _sys
	tar zxf src.tgz
	tar zxf syssrc.tgz
	tar zxf sharesrc.tgz
	tar zxf gnusrc.tgz
	mv usr/src/sys usr/src/netbsdsys
	mv _sys usr/src/sys

usr/src/obj/tools: usr/src/build.sh | usr/src/share usr/src/external/gpl3 usr/src/sys/README.md
	# Building the cross-compiling tooling requires the real NetBSD kernel
	# because there are some hardcoded paths to arches I've removed in there and
	# if they're not there, tooling compilation fails :(
	mv usr/src/sys _sys
	mv usr/src/netbsdsys usr/src/sys
	cd usr/src && $(BUILDSH) tools
	mv usr/src/sys usr/src/netbsdsys
	mv _sys usr/src/sys

$(CONFTGT): $(CONF) | usr/src/sys/README.md
	cp $(CONF) $(CONFTGT)


@@ 39,10 51,6 @@ $(KERNEL): $(CONFTGT) $(shell find usr/src/sys) usr/src/obj/tools
mbr.bin: mbr.asm
	nasm -o $@ mbr.asm

duskos/README.md:
	git submodule init
	git submodule update

$(KEXEC): | duskos/README.md
	$(MAKE) -C duskos/netbsd kexec


M README.md => README.md +0 -1
@@ 20,7 20,6 @@ built by including Dusk OS as a git submodule.
## Requirements

* POSIX system with CC and Make
* curl
* git
* [mtools][mtools]
* qemu-system-i386

A usr/src/sys => usr/src/sys +1 -0
@@ 0,0 1,1 @@
Subproject commit ccd15485f84b6c66ac793f6a3886683e24f446df