요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
Runtime module parameters
sysfs-module:14-26Runtime에 변경 가능한 module parameter file의 배치 위치와 parameter별 ABI 안정성 범위를 구분합니다.
Reference count와 source identity
sysfs-module:28-47Unload 가능한 module의 현재 reference count와 MODULE_VERSION이 제공하는 source checksum·version을 노출합니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
The /sys/module tree consists of the following structure:
What: /sys/module/<MODULENAME>
Description:
The name of the module that is in the kernel. This
module name will always show up if the module is loaded as a
dynamic module. If it is built directly into the kernel, it
will only show up if it has a version or at least one
parameter.
Note: The conditions of creation in the built-in case are not
by design and may be removed in the future.
What: /sys/module/<MODULENAME>/parameters
Description:
This directory contains individual files that are each
individual parameters of the module that are able to be
changed at runtime. See the individual module
documentation as to the contents of these parameters and
what they accomplish.
Note: The individual parameter names and values are not
considered stable, only the fact that they will be
placed in this location within sysfs. See the
individual driver documentation for details as to the
stability of the different parameters.
What: /sys/module/<MODULENAME>/refcnt
Description:
If the module is able to be unloaded from the kernel, this file
will contain the current reference count of the module.
Note: If the module is built into the kernel, or if the
CONFIG_MODULE_UNLOAD kernel configuration value is not enabled,
this file will not be present.
What: /sys/module/<MODULENAME>/srcversion
Date: Jun 2005
Description:
If the module source has MODULE_VERSION, this file will contain
the checksum of the source code.
What: /sys/module/<MODULENAME>/version
Date: Jun 2005
Description:
If the module source has MODULE_VERSION, this file will contain
the version of the source code.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
/sys/module tree와 module directory
1-12/sys/module tree는 다음 구조로 이루어진다.
| 항목 | 내용 |
|---|---|
| What | /sys/module/<MODULENAME> |
| Description | Kernel 안에 존재하는 module의 이름이다. 동적 module로 load된 경우 이 module 이름은 항상 나타난다. Kernel에 직접 built-in된 경우에는 version이 있거나 parameter가 하나 이상 있을 때만 나타난다. |
Built-in module에 관한 이 생성 조건은 의도적으로 설계된 규약이 아니며, 향후 제거될 수 있다.
Runtime에 변경 가능한 module parameter
14-26| 항목 | 내용 |
|---|---|
| What | /sys/module/<MODULENAME>/parameters |
| Description | 이 directory에는 runtime에 변경할 수 있는 module의 개별 parameter를 각각의 file로 담는다. 각 parameter의 내용과 기능은 해당 module의 개별 문서를 참조한다. |
개별 parameter의 이름과 값 자체는 stable ABI로 간주하지 않는다. Stable한 것은 이들이 sysfs의 해당 위치에 배치된다는 사실뿐이다. 서로 다른 parameter의 안정성에 관한 세부 사항은 개별 driver 문서를 참조한다.
Unload 가능 module의 reference count
28-35| 항목 | 내용 |
|---|---|
| What | /sys/module/<MODULENAME>/refcnt |
| Description | 해당 module을 kernel에서 unload할 수 있다면 이 file은 module의 현재 reference count를 담는다. |
Module이 kernel에 built-in되어 있거나 `CONFIG_MODULE_UNLOAD` kernel configuration 값이 활성화되지 않았다면 이 file은 존재하지 않는다.
Source checksum과 version
37-47| 경로 | 날짜 | 내용 |
|---|---|---|
| /sys/module/<MODULENAME>/srcversion | 2005년 6월 | Module source에 `MODULE_VERSION`이 있으면 source code의 checksum을 담는다. |
| /sys/module/<MODULENAME>/version | 2005년 6월 | Module source에 `MODULE_VERSION`이 있으면 source code의 version을 담는다. |
Module의 build 방식과 configuration에 따라 나타나는 directory와 file이 달라진다.
Module directory 생성 조건
sysfs-module:1-12동적 module은 load되면 항상 directory가 나타나지만 built-in module은 version 또는 parameter가 있을 때만 나타납니다.