Skip to content

Commit 22b7543

Browse files
committed
Add buildroot for building test kernel/initramfs
1 parent 2286902 commit 22b7543

File tree

7 files changed

+6942
-0
lines changed

7 files changed

+6942
-0
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
output/
2+
buildroot/

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
output/

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "buildroot"]
2+
path = buildroot
3+
url = https://github.com/buildroot/buildroot.git

Makefile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
.DEFAULT_GOAL := test-images
2+
3+
OUTPUT_ROOT=output/
4+
TEST_GUEST_KERNEL_TARGET=$(OUTPUT_ROOT)/test-bzImage
5+
TEST_GUEST_KERNEL_INITRAMFS=$(OUTPUT_ROOT)/test-initramfs.img
6+
7+
.PHONY: test-images
8+
test-images: $(TEST_GUEST_KERNEL_TARGET) $(TEST_GUEST_KERNEL_INITRAMFS)
9+
10+
$(OUTPUT_ROOT):
11+
mkdir -p $(OUTPUT_ROOT)
12+
13+
$(TEST_GUEST_KERNEL_TARGET): buildroot.config kernel.config $(OUTPUT_ROOT)
14+
cp buildroot.config buildroot/.config
15+
make -C buildroot linux
16+
cp buildroot/output/images/bzImage $(TEST_GUEST_KERNEL_TARGET)
17+
18+
$(TEST_GUEST_KERNEL_INITRAMFS): $(TEST_GUEST_KERNEL_TARGET)
19+
cp buildroot.config buildroot/.config
20+
make -C buildroot
21+
cp buildroot/output/images/rootfs.cpio.gz $(TEST_GUEST_KERNEL_INITRAMFS)
22+
23+
.PHONY: docker
24+
docker:
25+
docker build .
26+
27+
.PHONY: clean
28+
clean:
29+
rm -rf $(OUTPUT_ROOT)
30+
make -C buildroot clean

buildroot

Submodule buildroot added at 6eff339

0 commit comments

Comments
 (0)