Documentation/driver-api/firmware/fw_search_path.rst GitHub 원문 ↗

Linux 6.18.37 · Driver API

Firmware search paths

Firmware_class가 root filesystem에서 firmware를 찾는 우선순위와 boot/runtime custom path 설정법을 설명합니다.

Source pathDocumentation/driver-api/firmware/fw_search_path.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약과 해설

fw_search_path.rst:1-31

Firmware lookup은 custom `fw_path_para`, release별 update, 공통 update, release별 기본, 공통 기본 directory 순으로 진행합니다.

Custom path는 boot parameter 또는 runtime sysfs parameter로 설정할 수 있습니다. Runtime 기록에는 newline이 path에 포함되지 않도록 `echo -n`을 사용해야 합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 =====================
2 Firmware search paths
3 =====================
4
5 The following search paths are used to look for firmware on your
6 root filesystem.
7
8 * fw_path_para - module parameter - default is empty so this is ignored
9 * /lib/firmware/updates/UTS_RELEASE/
10 * /lib/firmware/updates/
11 * /lib/firmware/UTS_RELEASE/
12 * /lib/firmware/
13
14 The module parameter ''path'' can be passed to the firmware_class module
15 to activate the first optional custom fw_path_para. The custom path can
16 only be up to 256 characters long. The kernel parameter passed would be:
17
18 * 'firmware_class.path=$CUSTOMIZED_PATH'
19
20 There is an alternative to customize the path at run time after bootup, you
21 can use the file:
22
23 * /sys/module/firmware_class/parameters/path
24
25 You would echo into it your custom path and firmware requested will be searched
26 for there first. Be aware that newline characters will be taken into account
27 and may not produce the intended effects. For instance you might want to use:
28
29 echo -n /path/to/script > /sys/module/firmware_class/parameters/path
30
31 to ensure that your script is being used.
32

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

Firmware search path 우선순위

1-13

문서 제목은 `Firmware search paths`입니다.

Root filesystem에서 firmware를 찾을 때 다음 path를 순서대로 사용합니다.

  • `fw_path_para`: module parameter이며 기본값이 비어 있어 기본 상태에서는 무시합니다.
  • `/lib/firmware/updates/UTS_RELEASE/`
  • `/lib/firmware/updates/`
  • `/lib/firmware/UTS_RELEASE/`
  • `/lib/firmware/`
Firmware lookup 순서
순위Path용도
1fw_path_para선택적인 custom path
2/lib/firmware/updates/UTS_RELEASE/release별 update
3/lib/firmware/updates/공통 update
4/lib/firmware/UTS_RELEASE/release별 기본 firmware
5/lib/firmware/공통 기본 firmware

위에서 아래로 탐색하며 첫 번째로 찾은 firmware를 사용합니다.

Boot 시 custom path 설정

14-19

Firmware_class module에 module parameter `path`를 전달하면 첫 번째 선택 항목인 custom `fw_path_para`를 활성화할 수 있습니다. Custom path의 최대 길이는 256자입니다.

Kernel parameter는 `firmware_class.path=$CUSTOMIZED_PATH` 형식입니다.

Runtime custom path 설정

20-31

Boot 뒤 runtime에도 다음 file을 사용해 path를 바꿀 수 있습니다.

  • `/sys/module/firmware_class/parameters/path`

이 file에 custom path를 echo하면 이후 firmware request가 해당 위치를 먼저 탐색합니다. Newline character도 path에 포함되어 의도와 다른 결과를 낼 수 있으므로 주의해야 합니다.

Newline을 쓰지 않도록 다음 명령처럼 `echo -n`을 사용할 수 있습니다.

echo -n /path/to/script > /sys/module/firmware_class/parameters/path

이렇게 하면 지정한 script path가 정확히 사용됩니다.

Runtime custom firmware path 설정
Custom path 결정echo -n으로 sysfs parameter에 기록fw_path_para가 search order 첫 위치가 됨다음 firmware request가 custom path를 먼저 탐색

Trailing newline 없이 sysfs parameter를 갱신하는 절차입니다.