Create basic BR2_EXTERNAL, with a twist

Initial defconfig is based on Buildroot qemu_x86_64_defconfig, with a
Bootlin pre-built toolchain and a very basic qemu.sh script, generated
by a local post-image.sh, for `make run`.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2022-05-09 19:52:45 +02:00
commit a441f9a988
10 changed files with 99 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
*~
.gdb_history
/.ccache
/dl
/output*
/local.mk
+3
View File
@@ -0,0 +1,3 @@
[submodule "buildroot"]
path = buildroot
url = https://github.com/buildroot/buildroot.git
View File
+30
View File
@@ -0,0 +1,30 @@
export BR2_EXTERNAL := $(CURDIR)
export PATH := $(CURDIR)/bin:$(PATH)
ARCH ?= $(shell uname -m)
O ?= $(CURDIR)/output
config := $(O)/.config
bmake = $(MAKE) -C buildroot O=$(O) $1
all: $(config) buildroot/Makefile
@+$(call bmake,$@)
$(config):
@+$(call bmake,list-defconfigs)
@echo "ERROR: No configuration selected."
@echo "Please choose a configuration from the list above by running"
@echo "'make <board>_defconfig' before building an image."
@exit 1
%: buildroot/Makefile
@+$(call bmake,$@)
buildroot/Makefile:
@git submodule update --init
run:
@echo "Starting Qemu :: Ctrl-a x -- exit | Ctrl-a c -- toggle console/monitor"
@(cd $(O)/images && ./qemu.sh)
+16
View File
@@ -0,0 +1,16 @@
#!/bin/sh
# shellcheck disable=SC1090
. "$BR2_CONFIG" 2>/dev/null
cat <<-EOF >"$BINARIES_DIR/qemu.sh"
#!/bin/sh
line=\$(stty -g)
stty raw
qemu-system-x86_64 -M pc -cpu kvm64 -enable-kvm -nographic \\
-kernel bzImage -append "rootwait root=/dev/vda console=ttyS0" \\
-drive file=rootfs.ext2,if=virtio,format=raw \\
-net nic,model=virtio -net user
stty "\$line"
EOF
chmod +x "$BINARIES_DIR/qemu.sh"
Submodule
+1
Submodule buildroot added at 21ab3e720c
+41
View File
@@ -0,0 +1,41 @@
# Architecture
BR2_x86_64=y
BR2_x86_corei7=y
BR2_DL_DIR="$(BR2_EXTERNAL_INFIX_PATH)/dl"
BR2_CCACHE=y
BR2_CCACHE_DIR="$(BR2_EXTERNAL_INFIX_PATH)/.ccache"
BR2_ENABLE_DEBUG=y
BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_INFIX_PATH)/patches"
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_X86_64_CORE_I7_UCLIBC_BLEEDING_EDGE=y
# System
BR2_SYSTEM_DHCP="eth0"
BR2_TARGET_GENERIC_HOSTNAME="infix"
BR2_TARGET_GENERIC_ISSUE="Inf/IX by KernelKit"
# Filesystem
BR2_TARGET_ROOTFS_EXT2=y
# BR2_TARGET_ROOTFS_TAR is not set
# Image
BR2_ROOTFS_POST_BUILD_SCRIPT="board/qemu/x86_64/post-build.sh"
# Image
BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/post-image.sh $(BR2_EXTERNAL_INFIX_PATH)/board/common/post-image.sh"
BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
# Linux headers same as kernel
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_15=y
# Kernel
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.15.18"
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/x86_64/linux.config"
BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF=y
# host-qemu for gitlab testing
#BR2_PACKAGE_HOST_QEMU=y
#BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE=y
+2
View File
@@ -0,0 +1,2 @@
name: INFIX
desc: Inf/IX by KernelKit
View File
View File