> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 使用 devtool 修改源代码

以下示例展示了 `devtool` 在 Qualcomm 软件组件中的用法。

## **内核**

请参阅[使用 Yocto 开发内核](https://dragonwingdocs.qualcomm.com/System/Kernel/build-kernel-yocto)。

## **QDL 工具**

使用 `devtool` 在创建的工作区中修改 QDL 源代码。

```text theme={null}
devtool modify qdl
INFO: Source tree extracted to <workspace>/build/workspace/sources/qdl
INFO: Using source tree as build directory since that would be the default for this recipe
INFO: Recipe qdl now set up to build from <workspace>/build/workspace/sources/qdl
```

1. 在本地检出以下目录树：
   ```text theme={null}
   tree -L 2 build/workspace/
   build/workspace/
   ├── appends
   │   └── qdl_git.bbappend
   ├── conf
   │   └── layer.conf
   ├── README
   └── sources
       └── qdl
   ```
2. 检查已检出的 QDL 源代码树：
   ```text theme={null}
   ls workspace/sources/qdl/
   firehose.c  LICENSE  Makefile  patch.c  patch.h  program.c  program.h  qdl.c  qdl.h  README  sahara.c  ufs.c  ufs.h  util.c
   ```
3. 修改 `workspace/sources/qdl/` 下的源代码树并构建您的更改：
   ```text theme={null}
   devtool build qdl
   devtool build-image qcom-multimedia-image
   ```

生成的镜像位于 `build/tmp/deploy/images/rb3gen2-core-kit/qcom-multimedia-image` 路径下。

## **Weston**

使用 `devtool` 在创建的工作区中修改 Weston。

```text theme={null}
devtool modify weston
INFO: Adding local source files to srctree...
INFO: Source tree extracted to <workspace>/build/workspace/sources/weston
INFO: Recipe weston now set up to build from <workspace>/build/workspace/sources/weston
```

1. 在本地检出以下目录树：
   ```text theme={null}
   tree -L 2 build/workspace/
   build/workspace/
   ├── appends
   │   └── weston_10.0.2.bbappend
   ├── conf
   │   └── layer.conf
   ├── README
   └── sources
       └── weston
   ```
2. 检查已检出的 Weston 源代码树：
   ```text theme={null}
   ls workspace/sources/weston/
   clients           COPYING      desktop-shell     include      libweston          meson.build        oe-local-files  pipewire    releasing.rst  tests  weston.ini.in
   compositor        data         doc               ivi-shell    libweston-desktop  meson_options.txt  oe-logs         protocol    remoting       tools  xwayland
   CONTRIBUTING.rst  DCO-1.1.txt  fullscreen-shell  kiosk-shell  man                notes.txt          oe-workdir      README.rst  shared         wcap
   ```
3. 修改 `workspace/sources/weston/` 下的源代码树并构建您的更改：
   ```text theme={null}
   devtool build weston
   devtool build-image qcom-multimedia-image
   ```

生成的镜像位于 `build/tmp/deploy/images/rb3gen2-core-kit/qcom-multimedia-image` 路径下。
