Build with filesystem
This commit is contained in:
parent
b33a1e7d95
commit
d7be0fc774
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,3 +2,4 @@ Cargo.lock
|
||||||
build
|
build
|
||||||
target
|
target
|
||||||
initfs/bin
|
initfs/bin
|
||||||
|
filesystem/bin
|
||||||
|
|
64
Makefile
64
Makefile
|
@ -34,6 +34,7 @@ clean:
|
||||||
cargo clean --manifest-path programs/coreutils/Cargo.toml
|
cargo clean --manifest-path programs/coreutils/Cargo.toml
|
||||||
cargo clean --manifest-path schemes/example/Cargo.toml
|
cargo clean --manifest-path schemes/example/Cargo.toml
|
||||||
rm -rf initfs/bin
|
rm -rf initfs/bin
|
||||||
|
rm -rf filesystem/bin
|
||||||
rm -rf build
|
rm -rf build
|
||||||
|
|
||||||
FORCE:
|
FORCE:
|
||||||
|
@ -74,7 +75,7 @@ else
|
||||||
%.list: %
|
%.list: %
|
||||||
objdump -C -M intel -D $< > $@
|
objdump -C -M intel -D $< > $@
|
||||||
|
|
||||||
$(KBUILD)/harddrive.bin: $(KBUILD)/kernel bootloader/$(ARCH)/**
|
$(KBUILD)/harddrive.bin: $(KBUILD)/kernel $(BUILD)/filesystem.bin bootloader/$(ARCH)/**
|
||||||
nasm -f bin -o $@ -D ARCH_$(ARCH) -ibootloader/$(ARCH)/ bootloader/$(ARCH)/harddrive.asm
|
nasm -f bin -o $@ -D ARCH_$(ARCH) -ibootloader/$(ARCH)/ bootloader/$(ARCH)/harddrive.asm
|
||||||
|
|
||||||
qemu: $(KBUILD)/harddrive.bin
|
qemu: $(KBUILD)/harddrive.bin
|
||||||
|
@ -147,44 +148,47 @@ initfs/bin/%: programs/%/Cargo.toml programs/%/src/** $(BUILD)/libstd.rlib
|
||||||
strip $@
|
strip $@
|
||||||
rm $@.d
|
rm $@.d
|
||||||
|
|
||||||
initfs/bin/%: programs/coreutils/Cargo.toml programs/coreutils/src/bin/%.rs $(BUILD)/libstd.rlib
|
|
||||||
mkdir -p initfs/bin
|
|
||||||
$(CARGO) rustc --manifest-path $< --bin $* $(CARGOFLAGS) -o $@
|
|
||||||
strip $@
|
|
||||||
rm $@.d
|
|
||||||
|
|
||||||
initfs/bin/%: schemes/%/Cargo.toml schemes/%/src/** $(BUILD)/libstd.rlib
|
initfs/bin/%: schemes/%/Cargo.toml schemes/%/src/** $(BUILD)/libstd.rlib
|
||||||
mkdir -p initfs/bin
|
mkdir -p initfs/bin
|
||||||
$(CARGO) rustc --manifest-path $< --bin $* $(CARGOFLAGS) -o $@
|
$(CARGO) rustc --manifest-path $< --bin $* $(CARGOFLAGS) -o $@
|
||||||
strip $@
|
strip $@
|
||||||
rm $@.d
|
rm $@.d
|
||||||
|
|
||||||
drivers: \
|
initfs_drivers: \
|
||||||
initfs/bin/ahcid \
|
initfs/bin/ahcid \
|
||||||
initfs/bin/pcid \
|
initfs/bin/pcid \
|
||||||
initfs/bin/ps2d \
|
initfs/bin/ps2d \
|
||||||
initfs/bin/vesad
|
initfs/bin/vesad
|
||||||
|
|
||||||
coreutils: \
|
initfs_schemes: \
|
||||||
initfs/bin/cat \
|
|
||||||
initfs/bin/echo \
|
|
||||||
initfs/bin/env \
|
|
||||||
initfs/bin/ls \
|
|
||||||
initfs/bin/printenv \
|
|
||||||
initfs/bin/pwd \
|
|
||||||
initfs/bin/realpath
|
|
||||||
|
|
||||||
schemes: \
|
|
||||||
initfs/bin/example \
|
initfs/bin/example \
|
||||||
initfs/bin/redoxfs
|
initfs/bin/redoxfs
|
||||||
|
|
||||||
|
filesystem/bin/%: programs/%/Cargo.toml programs/%/src/** $(BUILD)/libstd.rlib
|
||||||
|
mkdir -p filesystem/bin
|
||||||
|
$(CARGO) rustc --manifest-path $< $(CARGOFLAGS) -o $@
|
||||||
|
strip $@
|
||||||
|
rm $@.d
|
||||||
|
|
||||||
|
filesystem/bin/%: programs/coreutils/Cargo.toml programs/coreutils/src/bin/%.rs $(BUILD)/libstd.rlib
|
||||||
|
mkdir -p filesystem/bin
|
||||||
|
$(CARGO) rustc --manifest-path $< --bin $* $(CARGOFLAGS) -o $@
|
||||||
|
strip $@
|
||||||
|
rm $@.d
|
||||||
|
|
||||||
|
coreutils: \
|
||||||
|
filesystem/bin/cat \
|
||||||
|
filesystem/bin/echo \
|
||||||
|
filesystem/bin/env \
|
||||||
|
filesystem/bin/ls \
|
||||||
|
filesystem/bin/printenv \
|
||||||
|
filesystem/bin/pwd \
|
||||||
|
filesystem/bin/realpath
|
||||||
|
|
||||||
$(BUILD)/initfs.rs: \
|
$(BUILD)/initfs.rs: \
|
||||||
initfs/bin/init \
|
initfs/bin/init \
|
||||||
initfs/bin/ion \
|
initfs_drivers \
|
||||||
initfs/bin/login \
|
initfs_schemes
|
||||||
drivers \
|
|
||||||
coreutils \
|
|
||||||
schemes
|
|
||||||
echo 'use collections::BTreeMap;' > $@
|
echo 'use collections::BTreeMap;' > $@
|
||||||
echo 'pub fn gen() -> BTreeMap<&'"'"'static [u8], (&'"'"'static [u8], bool)> {' >> $@
|
echo 'pub fn gen() -> BTreeMap<&'"'"'static [u8], (&'"'"'static [u8], bool)> {' >> $@
|
||||||
echo ' let mut files: BTreeMap<&'"'"'static [u8], (&'"'"'static [u8], bool)> = BTreeMap::new();' >> $@
|
echo ' let mut files: BTreeMap<&'"'"'static [u8], (&'"'"'static [u8], bool)> = BTreeMap::new();' >> $@
|
||||||
|
@ -197,3 +201,17 @@ $(BUILD)/initfs.rs: \
|
||||||
find initfs -type f -o -type l | cut -d '/' -f2- | sort | awk '{printf(" files.insert(b\"%s\", (include_bytes!(\"../../initfs/%s\"), false));\n", $$0, $$0)}' >> $@
|
find initfs -type f -o -type l | cut -d '/' -f2- | sort | awk '{printf(" files.insert(b\"%s\", (include_bytes!(\"../../initfs/%s\"), false));\n", $$0, $$0)}' >> $@
|
||||||
echo ' files' >> $@
|
echo ' files' >> $@
|
||||||
echo '}' >> $@
|
echo '}' >> $@
|
||||||
|
|
||||||
|
$(BUILD)/filesystem.bin: \
|
||||||
|
coreutils \
|
||||||
|
filesystem/bin/ion \
|
||||||
|
filesystem/bin/login
|
||||||
|
rm -rf $@ $(BUILD)/filesystem/
|
||||||
|
echo exit | cargo run --manifest-path schemes/redoxfs/Cargo.toml --bin redoxfs-utility $@
|
||||||
|
mkdir -p $(BUILD)/filesystem/
|
||||||
|
cargo run --manifest-path schemes/redoxfs/Cargo.toml --bin redoxfs-fuse $@ $(BUILD)/filesystem/ &
|
||||||
|
sleep 2
|
||||||
|
-cp -RL initfs/* $(BUILD)/filesystem/
|
||||||
|
sync
|
||||||
|
-fusermount -u $(BUILD)/filesystem/
|
||||||
|
rm -rf $(BUILD)/filesystem/
|
||||||
|
|
|
@ -17,3 +17,5 @@ kernel_file:
|
||||||
.end:
|
.end:
|
||||||
.length equ kernel_file.end - kernel_file
|
.length equ kernel_file.end - kernel_file
|
||||||
.length_sectors equ .length / 512
|
.length_sectors equ .length / 512
|
||||||
|
|
||||||
|
incbin "build/userspace/filesystem.bin"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
initfs:bin/vesad
|
initfs:bin/vesad
|
||||||
initfs:bin/ps2d
|
initfs:bin/ps2d
|
||||||
initfs:bin/pcid initfs:etc/pcid.toml
|
initfs:bin/pcid initfs:etc/pcid.toml
|
||||||
initfs:bin/login display: initfs:bin/ion
|
initfs:bin/redoxfs disk:0
|
||||||
|
file:bin/login display: file:bin/ion
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 11f3485173cf63d5beea42e9e1ce519d503c56a6
|
Subproject commit 9bd5d69776e2df6a831e775631549aafcc5597af
|
Loading…
Reference in a new issue