Move kernel to cookbook recipe

This commit is contained in:
Jeremy Soller 2022-07-24 09:02:48 -06:00
parent c475f1a17d
commit 5b0822f893
No known key found for this signature in database
GPG key ID: E988B49EE78A7FB1
17 changed files with 21 additions and 56 deletions

4
.gitmodules vendored
View file

@ -14,10 +14,6 @@
path = isolinux path = isolinux
url = https://gitlab.redox-os.org/redox-os/isolinux.git url = https://gitlab.redox-os.org/redox-os/isolinux.git
branch = master branch = master
[submodule "kernel"]
path = kernel
url = https://gitlab.redox-os.org/redox-os/kernel.git
branch = master
[submodule "rust"] [submodule "rust"]
path = rust path = rust
url = https://gitlab.redox-os.org/redox-os/rust.git url = https://gitlab.redox-os.org/redox-os/rust.git

View file

@ -16,8 +16,6 @@ clean:
cd cookbook && ./clean.sh cd cookbook && ./clean.sh
cargo clean --manifest-path cookbook/pkgutils/Cargo.toml cargo clean --manifest-path cookbook/pkgutils/Cargo.toml
cargo clean --manifest-path installer/Cargo.toml cargo clean --manifest-path installer/Cargo.toml
cargo clean --manifest-path kernel/Cargo.toml
cargo clean --manifest-path kernel/syscall/Cargo.toml
cargo clean --manifest-path redoxfs/Cargo.toml cargo clean --manifest-path redoxfs/Cargo.toml
-$(FUMOUNT) build/filesystem/ || true -$(FUMOUNT) build/filesystem/ || true
rm -rf build rm -rf build
@ -37,7 +35,6 @@ update:
"$$(cargo run --manifest-path ../installer/Cargo.toml -- --list-packages -c ../filesystem.toml)" "$$(cargo run --manifest-path ../installer/Cargo.toml -- --list-packages -c ../filesystem.toml)"
cargo update --manifest-path cookbook/pkgutils/Cargo.toml cargo update --manifest-path cookbook/pkgutils/Cargo.toml
cargo update --manifest-path installer/Cargo.toml cargo update --manifest-path installer/Cargo.toml
cargo update --manifest-path kernel/Cargo.toml
cargo update --manifest-path redoxfs/Cargo.toml cargo update --manifest-path redoxfs/Cargo.toml
fetch: fetch:
@ -52,9 +49,6 @@ include mk/prefix.mk
# Bootloader recipes # Bootloader recipes
include mk/bootloader.mk include mk/bootloader.mk
# Kernel recipes
include mk/kernel.mk
# Filesystem recipes # Filesystem recipes
include mk/initfs.mk include mk/initfs.mk
include mk/filesystem.mk include mk/filesystem.mk
@ -111,7 +105,7 @@ env: prefix FORCE
bash bash
gdb: FORCE gdb: FORCE
gdb build/kernel.sym --eval-command="target remote localhost:1234" gdb cookbook/recipes/kernel/build/kernel.sym --eval-command="target remote localhost:1234"
# An empty target # An empty target
FORCE: FORCE:

View file

@ -11,6 +11,7 @@ acid = {}
coreutils = {} coreutils = {}
ion = {} ion = {}
ipcd = {} ipcd = {}
kernel = {}
ptyd = {} ptyd = {}
# User settings # User settings

View file

@ -21,6 +21,7 @@ gnu-make = {}
installer = {} installer = {}
ion = {} ion = {}
ipcd = {} ipcd = {}
kernel = {}
netdb = {} netdb = {}
netstack = {} netstack = {}
netsurf = {} netsurf = {}

View file

@ -54,6 +54,7 @@ ion = {}
ipcd = {} ipcd = {}
jansson = {} jansson = {}
jeremy = {} jeremy = {}
kernel = {}
keyboard-sfx = {} keyboard-sfx = {}
lci = {} lci = {}
libc-bench = {} libc-bench = {}

View file

@ -70,6 +70,7 @@ ion = {}
ipcd = {} ipcd = {}
jansson = {} jansson = {}
keyboard-sfx = {} keyboard-sfx = {}
kernel = {}
lci = {} lci = {}
libc-bench = {} libc-bench = {}
libffi = {} libffi = {}

View file

@ -7,9 +7,10 @@ prompt = false
# Package settings # Package settings
[packages] [packages]
ipcd = {}
ptyd = {}
drivers = {} drivers = {}
ipcd = {}
kernel = {}
ptyd = {}
# User settings # User settings
[users.root] [users.root]

View file

@ -17,6 +17,7 @@ gcc = {}
gnu-binutils = {} gnu-binutils = {}
gnu-make = {} gnu-make = {}
ipcd = {} ipcd = {}
kernel = {}
netdb = {} netdb = {}
netstack = {} netstack = {}
netutils = {} netutils = {}

View file

@ -21,6 +21,7 @@ gnu-make = {}
installer = {} installer = {}
ion = {} ion = {}
ipcd = {} ipcd = {}
kernel = {}
netdb = {} netdb = {}
netstack = {} netstack = {}
netutils = {} netutils = {}

View file

@ -19,6 +19,7 @@ gnu-make = {}
installer = {} installer = {}
ion = {} ion = {}
ipcd = {} ipcd = {}
kernel = {}
netdb = {} netdb = {}
netstack = {} netstack = {}
netutils = {} netutils = {}

@ -1 +1 @@
Subproject commit 17aca2f42e0ea60d72dcc00404376da209d2da5b Subproject commit bce519a90b1e39397d9c5a321fc4dc34a8808083

1
kernel

@ -1 +0,0 @@
Subproject commit b5a930170627e4d33b9a0eac1c61dd1d44a131e4

View file

@ -30,10 +30,11 @@ build/bootloader-live.efi: bootloader/build/$(EFI_TARGET)/bootloader-live.efi
mkdir -p build mkdir -p build
cp -v $< $@ cp -v $< $@
bootloader-coreboot/build/bootloader: build/kernel_coreboot #TODO: update coreboot bootloader/kernel
env --unset=RUST_TARGET_PATH --unset=RUSTUP_TOOLCHAIN --unset=XARGO_RUST_SRC \ # bootloader-coreboot/build/bootloader: build/kernel_coreboot
$(MAKE) -C bootloader-coreboot clean build/bootloader KERNEL="$(ROOT)/$<" # env --unset=RUST_TARGET_PATH --unset=RUSTUP_TOOLCHAIN --unset=XARGO_RUST_SRC \
# $(MAKE) -C bootloader-coreboot clean build/bootloader KERNEL="$(ROOT)/$<"
build/coreboot.elf: bootloader-coreboot/build/bootloader #
mkdir -p build # build/coreboot.elf: bootloader-coreboot/build/bootloader
cp -v $< $@ # mkdir -p build
# cp -v $< $@

View file

@ -42,13 +42,8 @@ endif
# Automatic variables # Automatic variables
ROOT=$(CURDIR) ROOT=$(CURDIR)
export RUST_COMPILER_RT_ROOT=$(ROOT)/rust/src/llvm-project/compiler-rt export RUST_COMPILER_RT_ROOT=$(ROOT)/rust/src/llvm-project/compiler-rt
export RUST_TARGET_PATH=$(ROOT)/kernel/targets
export XARGO_RUST_SRC=$(ROOT)/rust/src export XARGO_RUST_SRC=$(ROOT)/rust/src
## Kernel variables
KTARGET=$(ARCH)-unknown-kernel
KBUILD=build/kernel
## Userspace variables ## Userspace variables
export TARGET=$(ARCH)-unknown-redox export TARGET=$(ARCH)-unknown-redox
BUILD=build/userspace BUILD=build/userspace

View file

@ -1,4 +1,4 @@
build/filesystem.bin: prefix filesystem.toml build/bootloader.bin build/kernel build/initfs.img build/filesystem.bin: prefix filesystem.toml build/bootloader.bin build/initfs.img
cargo build --manifest-path cookbook/Cargo.toml --release cargo build --manifest-path cookbook/Cargo.toml --release
cargo build --manifest-path installer/Cargo.toml --release cargo build --manifest-path installer/Cargo.toml --release
cargo build --manifest-path redoxfs/Cargo.toml --release cargo build --manifest-path redoxfs/Cargo.toml --release
@ -15,7 +15,6 @@ build/filesystem.bin: prefix filesystem.toml build/bootloader.bin build/kernel b
pgrep redoxfs pgrep redoxfs
cp -v filesystem.toml build/filesystem/filesystem.toml cp -v filesystem.toml build/filesystem/filesystem.toml
cp -v build/bootloader.bin build/filesystem/bootloader cp -v build/bootloader.bin build/filesystem/bootloader
cp -v build/kernel build/filesystem/kernel
mkdir -v build/filesystem/pkg mkdir -v build/filesystem/pkg
cp -v cookbook/build/id_ed25519.pub.toml build/filesystem/pkg/id_ed25519.pub.toml cp -v cookbook/build/id_ed25519.pub.toml build/filesystem/pkg/id_ed25519.pub.toml
#TODO cp -r $(ROOT)/$(PREFIX_INSTALL)/$(TARGET)/include build/filesystem/include #TODO cp -r $(ROOT)/$(PREFIX_INSTALL)/$(TARGET)/include build/filesystem/include

View file

@ -1,10 +0,0 @@
build/libkernel.a: kernel/Cargo.lock kernel/Cargo.toml kernel/src/* kernel/src/*/* kernel/src/*/*/* kernel/src/*/*/*/*
export PATH="$(PREFIX_PATH):$$PATH" && \
cd kernel && \
cargo rustc --lib --target=$(ROOT)/kernel/targets/$(KTARGET).json --release -- -C soft-float -C debuginfo=2 -C lto --emit link=../$@
build/kernel: kernel/linkers/$(ARCH).ld mk/kernel_ld.sh build/libkernel.a
export PATH="$(PREFIX_PATH):$$PATH" && \
$(ROOT)/mk/kernel_ld.sh $(LD) --gc-sections -z max-page-size=0x1000 -T $< -o $@.all build/libkernel.a && \
$(OBJCOPY) --only-keep-debug $@.all $@.sym && \
$(OBJCOPY) --strip-debug $@.all $@

View file

@ -1,17 +0,0 @@
#!/usr/bin/env bash
set -ex
LD="$1"
shift
if "${LD}" -z use-gs-for-tls 2>&1 |
grep "warning: -z use-gs-for-tls ignored" &> /dev/null
then
echo "Please update your prefix:" >&2
echo " rm -rf prefix" >&2
echo " make prefix" >&2
exit 1
fi
exec "${LD}" -z use-gs-for-tls "$@"