From f6a7fe5353619bd2a6f3a0e98b0693b8d2230bd8 Mon Sep 17 00:00:00 2001 From: Tobias Waldekranz Date: Mon, 5 Jun 2023 14:02:20 +0200 Subject: [PATCH] qemu: Allow qemu.sh to be run from any directory Since qemu.sh is now tied to the directory it's ran from, it makes sense to change into that directory before starting to resolve any file paths. This let's us start the script from any directory without the need for any (cd && qemu) subshell. --- board/common/qemu/qemu.sh | 2 ++ external.mk | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/board/common/qemu/qemu.sh b/board/common/qemu/qemu.sh index dfe72d23..b047debe 100755 --- a/board/common/qemu/qemu.sh +++ b/board/common/qemu/qemu.sh @@ -220,6 +220,8 @@ menuconfig() exec kconfig-mconf Config.in } +cd $(dirname $(readlink -f "$0")) + while [ "$1" != "" ]; do case $1 in -c) diff --git a/external.mk b/external.mk index cc8a8366..7740dd7c 100644 --- a/external.mk +++ b/external.mk @@ -11,8 +11,9 @@ local.mk: .PHONY: run run: - @(cd $O/images && ./qemu.sh) + @$(BINARIES_DIR)/qemu.sh .PHONY: run-menuconfig run-menuconfig: - @(cd $O/images && CONFIG_="CONFIG_" BR2_CONFIG=".config" ../build/buildroot-config/mconf Config.in) + CONFIG_="CONFIG_" BR2_CONFIG="$(BINARIES_DIR)/.config" \ + $(BUILD_DIR)/buildroot-config/mconf $(BINARIES_DIR)/Config.in