Skip to content

Commit

Permalink
Add buildroot for building test kernel/initramfs
Browse files Browse the repository at this point in the history
  • Loading branch information
ALSchwalm committed Dec 5, 2020
1 parent 2286902 commit 22b7543
Show file tree
Hide file tree
Showing 7 changed files with 6,942 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
output/
buildroot/
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
output/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "buildroot"]
path = buildroot
url = https://github.com/buildroot/buildroot.git
30 changes: 30 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.DEFAULT_GOAL := test-images

OUTPUT_ROOT=output/
TEST_GUEST_KERNEL_TARGET=$(OUTPUT_ROOT)/test-bzImage
TEST_GUEST_KERNEL_INITRAMFS=$(OUTPUT_ROOT)/test-initramfs.img

.PHONY: test-images
test-images: $(TEST_GUEST_KERNEL_TARGET) $(TEST_GUEST_KERNEL_INITRAMFS)

$(OUTPUT_ROOT):
mkdir -p $(OUTPUT_ROOT)

$(TEST_GUEST_KERNEL_TARGET): buildroot.config kernel.config $(OUTPUT_ROOT)
cp buildroot.config buildroot/.config
make -C buildroot linux
cp buildroot/output/images/bzImage $(TEST_GUEST_KERNEL_TARGET)

$(TEST_GUEST_KERNEL_INITRAMFS): $(TEST_GUEST_KERNEL_TARGET)
cp buildroot.config buildroot/.config
make -C buildroot
cp buildroot/output/images/rootfs.cpio.gz $(TEST_GUEST_KERNEL_INITRAMFS)

.PHONY: docker
docker:
docker build .

.PHONY: clean
clean:
rm -rf $(OUTPUT_ROOT)
make -C buildroot clean
1 change: 1 addition & 0 deletions buildroot
Submodule buildroot added at 6eff33
Loading

0 comments on commit 22b7543

Please sign in to comment.