From ff739f08b0b483c7f467e933decffe6fcc4a4ad0 Mon Sep 17 00:00:00 2001 From: Samuel Dai Date: Thu, 13 Mar 2025 17:57:14 +0800 Subject: [PATCH] fix: permission problems in container (#1106) --- .vscode/settings.json | 4 ++-- Makefile | 11 ++++++----- dadk-manifest.toml | 2 +- env.mk | 2 +- oscomp/run-qemu.sh | 2 +- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index ede91604..ada1dbe1 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -147,8 +147,8 @@ //"./tools/Cargo.toml", ], - // "rust-analyzer.cargo.target": "riscv64gc-unknown-none-elf", - "rust-analyzer.cargo.target": "x86_64-unknown-none", + "rust-analyzer.cargo.target": "riscv64gc-unknown-none-elf", + // "rust-analyzer.cargo.target": "x86_64-unknown-none", "rust-analyzer.check.overrideCommand": [ "make", "check", diff --git a/Makefile b/Makefile index ed34bc5e..e77e1c3b 100644 --- a/Makefile +++ b/Makefile @@ -88,21 +88,21 @@ write_diskimage-uefi: check_arch bash -c "export ARCH=$(ARCH); cd tools && bash grub_auto_install.sh && sudo DADK=$(DADK) ARCH=$(ARCH) bash $(ROOT_PATH)/tools/write_disk_image.sh --bios=uefi && cd .." # 不编译,直接启动QEMU qemu: check_arch - sh -c "cd tools && bash run-qemu.sh --bios=legacy --display=window && cd .." + sh -c "cd oscomp && bash run-qemu.sh --bios=legacy --display=window && cd .." # 不编译,直接启动QEMU,不显示图像 qemu-nographic: check_arch - sh -c "cd tools && bash run-qemu.sh --bios=legacy --display=nographic && cd .." + sh -c "cd oscomp && bash run-qemu.sh --bios=legacy --display=nographic && cd .." # 不编译,直接启动QEMU(UEFI) qemu-uefi: check_arch - sh -c "cd tools && bash run-qemu.sh --bios=uefi --display=window && cd .." + sh -c "cd oscomp && bash run-qemu.sh --bios=uefi --display=window && cd .." # 不编译,直接启动QEMU,使用VNC Display作为图像输出 qemu-vnc: check_arch - sh -c "cd tools && bash run-qemu.sh --bios=legacy --display=vnc && cd .." + sh -c "cd oscomp && bash run-qemu.sh --bios=legacy --display=vnc && cd .." # 不编译,直接启动QEMU(UEFI),使用VNC Display作为图像输出 qemu-uefi-vnc: check_arch - sh -c "cd tools && bash run-qemu.sh --bios=uefi --display=vnc && cd .." + sh -c "cd oscomp && bash run-qemu.sh --bios=uefi --display=vnc && cd .." # 编译并写入磁盘镜像 build: check_arch @@ -159,6 +159,7 @@ log-monitor: .PHONY: update-submodules update-submodules: @echo "更新子模块" + @sudo chown -R $(USER):$(USER) . @git submodule update --recursive --init # @git submodule foreach git pull origin master diff --git a/dadk-manifest.toml b/dadk-manifest.toml index bbb88120..fcfc561b 100644 --- a/dadk-manifest.toml +++ b/dadk-manifest.toml @@ -2,7 +2,7 @@ [metadata] # Target architecture. Options: x86_64, riscv64 -arch = "x86_64" +arch = "riscv64" # Hypervisor config path hypervisor-config = "config/hypervisor.toml" diff --git a/env.mk b/env.mk index facd546e..f74dd54a 100644 --- a/env.mk +++ b/env.mk @@ -2,7 +2,7 @@ ifeq ($(ARCH), ) # !!!!在这里设置ARCH,可选 x86_64 和 riscv64 # !!!!!!!如果不同时调整这里以及vscode的settings.json,那么自动补全和检查将会失效 -export ARCH?=x86_64 +export ARCH?=riscv64 endif ifeq ($(EMULATOR), ) diff --git a/oscomp/run-qemu.sh b/oscomp/run-qemu.sh index 4b9c0ea9..68270605 100644 --- a/oscomp/run-qemu.sh +++ b/oscomp/run-qemu.sh @@ -70,7 +70,7 @@ fi # uboot版本 UBOOT_VERSION="v2023.10" -RISCV64_UBOOT_PATH="arch/riscv64/u-boot-${UBOOT_VERSION}-riscv64" +RISCV64_UBOOT_PATH="../tools/arch/riscv64/u-boot-${UBOOT_VERSION}-riscv64" DISK_NAME="disk-image-${ARCH}.img"