diff --git a/.gitignore b/.gitignore index 378eac2..e3ccede 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -build +/build/ +/prefix/ diff --git a/.gitmodules b/.gitmodules index ea89854..5cecbb9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -22,3 +22,6 @@ [submodule "redoxfs"] path = redoxfs url = https://gitlab.redox-os.org/redox-os/redoxfs.git +[submodule "relibc"] + path = relibc + url = https://gitlab.redox-os.org/redox-os/relibc.git diff --git a/Makefile b/Makefile index 8d7b5d8..fd47a43 100644 --- a/Makefile +++ b/Makefile @@ -40,10 +40,8 @@ fetch: "$$(cargo run --manifest-path ../installer/Cargo.toml -- --list-packages -c ../initfs.toml)" \ "$$(cargo run --manifest-path ../installer/Cargo.toml -- --list-packages -c ../filesystem.toml)" -# Emulation recipes -include mk/qemu.mk -include mk/bochs.mk -include mk/virtualbox.mk +# Cross compiler recipes +include mk/prefix.mk # Kernel recipes include mk/kernel.mk @@ -55,6 +53,11 @@ include mk/filesystem.mk # Disk images include mk/disk.mk +# Emulation recipes +include mk/qemu.mk +include mk/bochs.mk +include mk/virtualbox.mk + # CI image target ci-img: FORCE make INSTALLER_FLAGS= build/harddrive.bin.gz build/harddrive-efi.bin.gz build/livedisk.iso build/livedisk-efi.iso @@ -67,11 +70,12 @@ ci-img: FORCE cd build/img && sha256sum -b * > SHA256SUM # CI packaging target -ci-pkg: FORCE - cd cookbook && ./fetch.sh \ - "$$(cargo run --manifest-path ../installer/Cargo.toml -- --list-packages -c ../ci.toml)" - cd cookbook && ./repo.sh \ - "$$(cargo run --manifest-path ../installer/Cargo.toml -- --list-packages -c ../ci.toml)" +ci-pkg: prefix FORCE + export PATH="$(PREFIX_PATH):$$PATH" && \ + PACKAGES="$$(cargo run --manifest-path installer/Cargo.toml -- --list-packages -c ci.toml)" && \ + cd cookbook && \ + ./fetch.sh "$${PACKAGES}" && \ + ./repo.sh "$${PACKAGES}" # An empty target FORCE: diff --git a/bootloader b/bootloader index 615d9e1..ad8f6a9 160000 --- a/bootloader +++ b/bootloader @@ -1 +1 @@ -Subproject commit 615d9e136512a21cc5fb22b5ab74389e078d3fb7 +Subproject commit ad8f6a97e9205552e1414bb481b3d13ec9ae5fae diff --git a/bootloader-efi b/bootloader-efi index de305ff..555b236 160000 --- a/bootloader-efi +++ b/bootloader-efi @@ -1 +1 @@ -Subproject commit de305ff651b811f2640ea685bbd9f2b12b974f15 +Subproject commit 555b236027a32a87bca273999b008e9534f9f876 diff --git a/ci.toml b/ci.toml index af8dd68..42df909 100644 --- a/ci.toml +++ b/ci.toml @@ -5,88 +5,89 @@ prompt = false [packages] acid = {} -autoconf = {} -automake = {} -bash = {} -binutils = {} +#autoconf = {} +#automake = {} +#bash = {} +#binutils = {} ca-certificates = {} #cargo = {} cleye = {} #cmatrix = {} contain = {} coreutils = {} -curl = {} +#curl = {} dash = {} -diffutils = {} -dosbox = {} +#diffutils = {} +#dosbox = {} drivers = {} #drivers-041 = {} -duktape = {} +#duktape = {} expat = {} extrautils = {} #fd = {} -ffmpeg = {} +#ffmpeg = {} findutils = {} -freedoom = {} -freetype = {} +#freedoom = {} +#freetype = {} game-2048 = {} games = {} -gawk = {} -gcc = {} -generaluser-gs = {} +#gawk = {} +#gcc = {} +#generaluser-gs = {} #gigalomania = {} -git = {} -gnu-binutils = {} -gnu-grep = {} -gnu-make = {} +#git = {} +#gnu-binutils = {} +#gnu-grep = {} +#gnu-make = {} init = {} installer = {} ion = {} ipcd = {} -jansson = {} +#jansson = {} keyboard-sfx = {} -lci = {} +#lci = {} libjpeg = {} liborbital = {} libpng = {} -#libsodium = {} +libsodium = {} logd = {} -lua = {} -mdp = {} -nasm = {} -ncdu = {} -ncurses = {} -ncursesw = {} +#lua = {} +#mdp = {} +#nasm = {} +#ncdu = {} +#ncurses = {} +#ncursesw = {} netdb = {} netstack = {} -netsurf = {} +#netsurf = {} netutils = {} -newlib = {} -newlibtest = {} +#newlib = {} +#newlibtest = {} nulld = {} openssl = {} -openttd = {} -openttd-opengfx = {} -openttd-openmsx = {} +#openttd = {} +#openttd-opengfx = {} +#openttd-openmsx = {} orbdata = {} orbital = {} orbterm = {} orbutils = {} pastel = {} -patch = {} +#patch = {} periodictable = {} #perl = {} pixelcannon = {} pkgutils = {} #powerline = {} -prboom = {} +#prboom = {} ptyd = {} -python = {} +#python = {} randd = {} -readline = {} +#readline = {} redoxfs = {} #redox-ssh = {} relibc = {} +ripgrep = {} rs-nes = {} #rust = {} rust64 = {} @@ -94,19 +95,19 @@ rustual-boy = {} sdl = {} sdl_image = {} sdl_mixer = {} -sed = {} +#sed = {} shellstorm = {} smith = {} sodium = {} #ssh = {} terminfo = {} termplay = {} -timidity = {} +#timidity = {} ttf-hack = {} userutils = {} uutils = {} -vim = {} -vttest = {} -xz = {} +#vim = {} +#vttest = {} +#xz = {} zerod = {} zlib = {} diff --git a/cookbook b/cookbook index 79e8d44..3bcea75 160000 --- a/cookbook +++ b/cookbook @@ -1 +1 @@ -Subproject commit 79e8d44a2e65acb0e74170209d7d551a1b997048 +Subproject commit 3bcea75ac2223757b9529d0d91e78d1401305ce1 diff --git a/filesystem.toml b/filesystem.toml index 41d1356..783c584 100644 --- a/filesystem.toml +++ b/filesystem.toml @@ -16,7 +16,7 @@ ca-certificates = {} #cargo = {} #cleye = {} #cmatrix = {} -#contain = {} +contain = {} coreutils = {} #curl = {} #dash = {} @@ -24,6 +24,7 @@ coreutils = {} #dosbox = {} drivers = {} #duktape = {} +#exampled = {} extrautils = {} #fd = {} #ffmpeg = {} diff --git a/installer b/installer index 33fa0af..49b7a5f 160000 --- a/installer +++ b/installer @@ -1 +1 @@ -Subproject commit 33fa0af5214decdda7cc7ac39407ad18d727583b +Subproject commit 49b7a5f427aaa08c217d784ec4b643d285cce5a8 diff --git a/kernel b/kernel index 054fc41..3b1bf1b 160000 --- a/kernel +++ b/kernel @@ -1 +1 @@ -Subproject commit 054fc41beb82019152bfc5186557aedb4e8b5d2a +Subproject commit 3b1bf1bac1aa21eed53c3465d7b1a470f5922396 diff --git a/mk/filesystem.mk b/mk/filesystem.mk index e31405d..41674b5 100644 --- a/mk/filesystem.mk +++ b/mk/filesystem.mk @@ -1,4 +1,4 @@ -build/filesystem.bin: filesystem.toml build/bootloader build/kernel +build/filesystem.bin: filesystem.toml build/bootloader build/kernel prefix -$(FUMOUNT) build/filesystem/ || true rm -rf $@ $@.partial build/filesystem/ dd if=/dev/zero of=$@.partial bs=1048576 count=256 @@ -8,7 +8,10 @@ build/filesystem.bin: filesystem.toml build/bootloader build/kernel cargo run --manifest-path redoxfs/Cargo.toml --release --bin redoxfs -- $@.partial build/filesystem/ sleep 2 pgrep redoxfs - cp filesystem.toml build/bootloader build/kernel build/filesystem/ + cp $< build/filesystem/filesystem.toml + cp build/bootloader build/filesystem/bootloader + cp build/kernel build/filesystem/kernel + export PATH="$(PREFIX_PATH):$$PATH" && \ cargo run --manifest-path installer/Cargo.toml --release -- $(INSTALLER_FLAGS) -c $< build/filesystem/ sync -$(FUMOUNT) build/filesystem/ || true diff --git a/mk/initfs.mk b/mk/initfs.mk index 8c76dc2..16790db 100644 --- a/mk/initfs.mk +++ b/mk/initfs.mk @@ -1,13 +1,15 @@ -build/initfs.tag: initfs.toml +build/initfs.tag: initfs.toml prefix cd kernel && xargo clean rm -rf build/initfs mkdir -p build/initfs + export PATH="$(PREFIX_PATH):$$PATH" && \ cargo run --manifest-path installer/Cargo.toml -- $(INSTALLER_FLAGS) -c $< build/initfs/ touch $@ -build/initfs_live.tag: initfs_live.toml +build/initfs_live.tag: initfs_live.toml prefix cd kernel && xargo clean rm -rf build/initfs_live mkdir -p build/initfs_live + export PATH="$(PREFIX_PATH):$$PATH" && \ cargo run --manifest-path installer/Cargo.toml -- $(INSTALLER_FLAGS) -c $< build/initfs_live/ touch $@ diff --git a/mk/kernel.mk b/mk/kernel.mk index 6642010..6779b17 100644 --- a/mk/kernel.mk +++ b/mk/kernel.mk @@ -16,6 +16,8 @@ build/kernel: kernel/linkers/$(ARCH).ld build/libkernel.a build/kernel_live: kernel/linkers/$(ARCH).ld build/libkernel_live.a build/live.o $(LD) --gc-sections -z max-page-size=0x1000 -T $< -o $@ build/libkernel_live.a build/live.o + objcopy --only-keep-debug $@ $@.sym + objcopy --strip-debug $@ build/live.o: build/filesystem.bin #TODO: More general use of $(ARCH) diff --git a/mk/prefix.mk b/mk/prefix.mk new file mode 100644 index 0000000..4dba7f1 --- /dev/null +++ b/mk/prefix.mk @@ -0,0 +1,75 @@ +PREFIX=$(ROOT)/prefix + +PREFIX_BINUTILS_PATH=$(PREFIX)/binutils-install/bin +PREFIX_FREESTANDING_PATH=$(PREFIX_BINUTILS_PATH):$(PREFIX)/gcc-freestanding-install/bin +PREFIX_PATH=$(PREFIX_BINUTILS_PATH):$(PREFIX)/gcc-install/bin + +prefix: $(PREFIX)/gcc-install + touch "$@" + +$(PREFIX)/binutils.tar.bz2: + mkdir -p "$(@D)" + wget -O $@.partial "https://gitlab.redox-os.org/redox-os/binutils-gdb/-/archive/master/binutils-gdb-master.tar.bz2" + mv $@.partial $@ + +$(PREFIX)/binutils: $(PREFIX)/binutils.tar.bz2 + mkdir -p "$@.partial" + tar --extract --file "$<" --directory "$@.partial" --strip-components=1 + mv "$@.partial" "$@" + touch "$@" + +$(PREFIX)/binutils-install: $(PREFIX)/binutils + rm -rf "$<-build" "$@" + mkdir -p "$<-build" "$@" + cd "$<-build" && \ + "$