요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
=====================
Firmware search paths
=====================
The following search paths are used to look for firmware on your
root filesystem.
* fw_path_para - module parameter - default is empty so this is ignored
* /lib/firmware/updates/UTS_RELEASE/
* /lib/firmware/updates/
* /lib/firmware/UTS_RELEASE/
* /lib/firmware/
The module parameter ''path'' can be passed to the firmware_class module
to activate the first optional custom fw_path_para. The custom path can
only be up to 256 characters long. The kernel parameter passed would be:
* 'firmware_class.path=$CUSTOMIZED_PATH'
There is an alternative to customize the path at run time after bootup, you
can use the file:
* /sys/module/firmware_class/parameters/path
You would echo into it your custom path and firmware requested will be searched
for there first. Be aware that newline characters will be taken into account
and may not produce the intended effects. For instance you might want to use:
echo -n /path/to/script > /sys/module/firmware_class/parameters/path
to ensure that your script is being used.
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를 사용합니다.
Boot 시 custom path 설정
14-19Firmware_class module에 module parameter `path`를 전달하면 첫 번째 선택 항목인 custom `fw_path_para`를 활성화할 수 있습니다. Custom path의 최대 길이는 256자입니다.
Kernel parameter는 `firmware_class.path=$CUSTOMIZED_PATH` 형식입니다.
Runtime custom path 설정
20-31Boot 뒤 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가 정확히 사용됩니다.
Trailing newline 없이 sysfs parameter를 갱신하는 절차입니다.
요약과 해설
fw_search_path.rst:1-31Firmware lookup은 custom `fw_path_para`, release별 update, 공통 update, release별 기본, 공통 기본 directory 순으로 진행합니다.
Custom path는 boot parameter 또는 runtime sysfs parameter로 설정할 수 있습니다. Runtime 기록에는 newline이 path에 포함되지 않도록 `echo -n`을 사용해야 합니다.