Skip to content

Commit 553c536

Browse files
committed
fix devcontainer for armmac users
1 parent 6b5f4c5 commit 553c536

5 files changed

Lines changed: 33 additions & 5 deletions

File tree

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ submodule 下的 prebuilts tarball 文件很大,非必要不要 clone submodul
1515
> [!TIP]
1616
> 对于中国大陆用户,可以使用 docker.cnb.cool/ylarod/ddk/ddk 来代替 ghcr.io/ylarod/ddk
1717
18-
## 本地部署 Dev Container 开发环境
18+
### 本地部署 Dev Container 开发环境
1919

2020
把下面内容放置到 .devcontainer/devcontainer.json
2121

@@ -26,6 +26,14 @@ submodule 下的 prebuilts tarball 文件很大,非必要不要 clone submodul
2626
- [ddk-clang](https://github.com/Ylarod/ddk/blob/main/features/src/ddk-clang/devcontainer-feature.json)
2727
- [ddk-src](https://github.com/Ylarod/ddk/blob/main/features/src/ddk-src/devcontainer-feature.json)
2828

29+
对于 M1 Mac + orbstack 用户,参考 `module_template/.devcontainer` 下的配置可以开发,还需要提取拉取镜像
30+
31+
```bash
32+
docker run --platform linux/amd64 --rm -it docker.cnb.cool/ylarod/ddk/ddk-builder:latest
33+
```
34+
35+
对于 x86_64 用户:
36+
2937
```yml
3038
{
3139
"name": "ddk-module-dev",

README_en.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Prebuilts tarball in submodule is very large,do not clone submodules if unnece
1515
> [!TIP]
1616
> For users in Mainland China, you can use `docker.cnb.cool/ylarod/ddk/ddk` as a replacement for `ghcr.io/ylarod/ddk`.
1717
18-
## Local Dev Container Development Environment
18+
### Local Dev Container Development Environment
1919

2020
Place the following content in `.devcontainer/devcontainer.json`.
2121

@@ -26,6 +26,14 @@ References:
2626
- [ddk-clang](https://github.com/Ylarod/ddk/blob/main/features/src/ddk-clang/devcontainer-feature.json)
2727
- [ddk-src](https://github.com/Ylarod/ddk/blob/main/features/src/ddk-src/devcontainer-feature.json)
2828

29+
For users with M1 Mac + orbstack, Ref to `module_template/.devcontainer`, and pull image in advance.
30+
31+
```bash
32+
docker run --platform linux/amd64 --rm -it docker.cnb.cool/ylarod/ddk/ddk-builder:latest
33+
```
34+
35+
For x86_64 users:
36+
2937
```yml
3038
{
3139
"name": "ddk-module-dev",

module_template/.devcontainer/devcontainer.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"name": "ddk-module-dev",
3-
"image": "docker.cnb.cool/ylarod/ddk/ddk-builder:latest",
3+
"dockerComposeFile": [
4+
"docker-compose.yml"
5+
],
6+
"service": "ddk",
7+
"workspaceFolder": "/workspace",
48
"features": {
59
"ghcr.io/ylarod/ddk/features/ddk-clang:latest": {
610
"clangVer": "clang-r416183b",
@@ -13,7 +17,7 @@
1317
}
1418
},
1519
"remoteUser": "root",
16-
"postCreateCommand": "make && make compdb && echo Devcontainer ready",
20+
"postCreateCommand": "echo Devcontainer ready",
1721
"customizations": {
1822
"vscode": {
1923
"extensions": [
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
services:
2+
ddk:
3+
platform: linux/amd64
4+
image: docker.cnb.cool/ylarod/ddk/ddk-builder:latest
5+
stdin_open: true
6+
tty: true
7+
volumes:
8+
- ..:/workspace:cached

module_template/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ccflags-y += -Wno-unused-result
99
ccflags-y += -Wno-unused-function
1010
ccflags-y += -Wno-builtin-macro-redefined -U__FILE__ -D__FILE__='""'
1111

12-
KDIR := $(KERNEL_SRC)
12+
KDIR := $(KDIR)
1313
MDIR := $(realpath $(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
1414

1515
$(info -- KDIR: $(KDIR))

0 commit comments

Comments
 (0)