Initfs makefile
This commit is contained in:
parent
b156510422
commit
0f42691db8
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,4 +1,3 @@
|
||||
/build
|
||||
**/target
|
||||
/tools
|
||||
*.ignore
|
||||
|
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -22,3 +22,6 @@
|
||||
[submodule "components/sources/zerod"]
|
||||
path = components/sources/zerod
|
||||
url = https://gitlab.redox-os.org/redox-os/zerod.git
|
||||
[submodule "tools/initfs"]
|
||||
path = tools/initfs
|
||||
url = https://gitlab.redox-os.org/redox-os/redox-initfs.git
|
||||
|
@ -1,6 +1,6 @@
|
||||
BUILD=./build
|
||||
|
||||
TOOLCHAIN = $(CURDIR)/../tools/x86_64-unknown-redox/toolchain
|
||||
TOOLCHAIN = $(CURDIR)/../tools/bin/x86_64-unknown-redox/toolchain
|
||||
CARGO = $(TOOLCHAIN)/bin/cargo
|
||||
PATH := $(TOOLCHAIN)/bin:$(PATH)
|
||||
|
||||
|
@ -1,13 +1,19 @@
|
||||
$(BUILD_DIR)/filesystem:
|
||||
@mkdir -p $(BUILD_DIR)
|
||||
rm -f $@.partial
|
||||
mkdir $@.partial
|
||||
fallocate -l 1MiB $@.partial/kernel
|
||||
mv $@.partial $@
|
||||
$(BUILD_DIR)/filesystem/boot/initfs: $(shell find ./components -type f -not -path "*/target/*")
|
||||
@mkdir -p $(BUILD_DIR)/filesystem/boot
|
||||
rm -f $@
|
||||
make -C tools
|
||||
make -C components
|
||||
./tools/bin/redox-initfs-ar --output $@ ./components/build
|
||||
|
||||
$(BUILD_DIR)/filesystem.img: $(BUILD_DIR)/filesystem
|
||||
$(BUILD_DIR)/filesystem/boot/kernel:
|
||||
@mkdir -p $(BUILD_DIR)/filesystem/boot
|
||||
rm -f $@
|
||||
fallocate -l 1MiB $(BUILD_DIR)/filesystem/boot/kernel
|
||||
|
||||
|
||||
$(BUILD_DIR)/filesystem.img: $(BUILD_DIR)/filesystem/boot/kernel $(BUILD_DIR)/filesystem/boot/initfs
|
||||
@mkdir -p $(BUILD_DIR)
|
||||
rm -f $@.partial
|
||||
fallocate -l 254MiB $@.partial
|
||||
redoxfs-ar $@.partial $<
|
||||
redoxfs-ar $@.partial $(BUILD_DIR)/filesystem
|
||||
mv $@.partial $@
|
1
tools/.gitignore
vendored
Normal file
1
tools/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
bin
|
14
tools/Makefile
Normal file
14
tools/Makefile
Normal file
@ -0,0 +1,14 @@
|
||||
.PHONY: all
|
||||
all: bin/redox-initfs-ar bin/redox-initfs-dump
|
||||
|
||||
bin/redox-initfs-ar: $(shell find ./initfs -type f -not -path "*/target/*")
|
||||
@mkdir -p bin
|
||||
cd initfs/tools && \
|
||||
cargo build --release --bin redox-initfs-ar
|
||||
cp initfs/target/release/redox-initfs-ar $@
|
||||
|
||||
bin/redox-initfs-dump: $(shell find ./initfs -type f -not -path "*/target/*")
|
||||
@mkdir -p bin
|
||||
cd initfs/tools && \
|
||||
cargo build --release --bin redox-initfs-dump
|
||||
cp initfs/target/release/redox-initfs-dump $@
|
1
tools/initfs
Submodule
1
tools/initfs
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit d0802237d7894881df7ddd338dfc64220d0646ff
|
Loading…
x
Reference in New Issue
Block a user