← Documents Documentation/block/cmdline-partition.rst GitHub 원문 ↗

Linux 6.18.37 · Block

Embedded device command line partition parsing

blkdevparts command-line 문법과 eMMC partition 정의·이름·read-only 설정을 설명합니다.

Source pathDocumentation/block/cmdline-partition.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약과 해설

cmdline-partition.rst:1-56

`blkdevparts`는 MBR 없이 kernel command line에서 fixed block device의 partition layout을 정의합니다. 크기·offset·이름·read-only flag를 지정할 수 있어 embedded eMMC 배치에 적합합니다.

disk 정의는 semicolon으로, 같은 disk의 partition 정의는 comma로 구분합니다. 마지막 partition에 `-`를 쓰면 남은 공간 전체를 할당하며, kernel이 제공하는 `PARTNAME` uevent로 userspace에서 이름 기반 link를 만들 수 있습니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 ==============================================
2 Embedded device command line partition parsing
3 ==============================================
4
5 The "blkdevparts" command line option adds support for reading the
6 block device partition table from the kernel command line.
7
8 It is typically used for fixed block (eMMC) embedded devices.
9 It has no MBR, so saves storage space. Bootloader can be easily accessed
10 by absolute address of data on the block device.
11 Users can easily change the partition.
12
13 The format for the command line is just like mtdparts:
14
15 blkdevparts=<blkdev-def>[;<blkdev-def>]
16 <blkdev-def> := <blkdev-id>:<partdef>[,<partdef>]
17 <partdef> := <size>[@<offset>](part-name)
18
19 <blkdev-id>
20 block device disk name. Embedded device uses fixed block device.
21 Its disk name is also fixed, such as: mmcblk0, mmcblk1, mmcblk0boot0.
22
23 <size>
24 partition size, in bytes, such as: 512, 1m, 1G.
25 size may contain an optional suffix of (upper or lower case):
26
27 K, M, G, T, P, E.
28
29 "-" is used to denote all remaining space.
30
31 <offset>
32 partition start address, in bytes.
33 offset may contain an optional suffix of (upper or lower case):
34
35 K, M, G, T, P, E.
36
37 (part-name)
38 partition name. Kernel sends uevent with "PARTNAME". Application can
39 create a link to block device partition with the name "PARTNAME".
40 User space application can access partition by partition name.
41
42 ro
43 read-only. Flag the partition as read-only.
44
45 Example:
46
47 eMMC disk names are "mmcblk0" and "mmcblk0boot0".
48
49 bootargs::
50
51 'blkdevparts=mmcblk0:1G(data0),1G(data1),-;mmcblk0boot0:1m(boot)ro,-(kernel)'
52
53 dmesg::
54
55 mmcblk0: p1(data0) p2(data1) p3()
56 mmcblk0boot0: p1(boot) p2(kernel)
57

3. 한국어 전문 번역

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

embedded device command line partition

1-12

`Embedded device command line partition parsing`은 `blkdevparts` kernel command-line option으로 block device partition table을 읽는 기능입니다.

보통 eMMC 같은 fixed block embedded device에 사용합니다. MBR이 없어 storage 공간을 절약하고, bootloader는 block device data의 absolute address로 쉽게 접근할 수 있습니다. 사용자도 partition을 간단히 변경할 수 있습니다.

blkdevparts 문법

13-18

command line 형식은 `mtdparts`와 같습니다.

blkdevparts=<blkdev-def>[;<blkdev-def>]
  <blkdev-def> := <blkdev-id>:<partdef>[,<partdef>]
    <partdef> := <size>[@<offset>](part-name)

문법 요소와 flag

19-44

`<blkdev-id>`는 block device disk name입니다. embedded device는 fixed block device를 사용하므로 disk name도 `mmcblk0`, `mmcblk1`, `mmcblk0boot0`처럼 고정됩니다.

`<size>`는 byte 단위 partition size이며 `512`, `1m`, `1G`처럼 씁니다. 대소문자를 구분하지 않는 선택적 suffix `K`, `M`, `G`, `T`, `P`, `E`를 붙일 수 있습니다. `-`는 남은 공간 전부를 뜻합니다.

`<offset>`은 byte 단위 partition start address입니다. `<size>`와 마찬가지로 대소문자를 구분하지 않는 선택적 suffix `K`, `M`, `G`, `T`, `P`, `E`를 사용할 수 있습니다.

`(part-name)`은 partition name입니다. kernel은 `PARTNAME`을 포함한 uevent를 보냅니다. application은 `PARTNAME`이라는 이름으로 block device partition link를 만들 수 있으며 userspace application은 partition name으로 partition에 접근할 수 있습니다.

`ro`는 read-only를 뜻하며 해당 partition을 read-only로 표시합니다.

eMMC 설정 예제

45-56

예제의 eMMC disk name은 `mmcblk0`과 `mmcblk0boot0`입니다.

bootargs는 다음과 같습니다.

'blkdevparts=mmcblk0:1G(data0),1G(data1),-;mmcblk0boot0:1m(boot)ro,-(kernel)'

이에 대한 dmesg 출력은 다음과 같습니다.

mmcblk0: p1(data0) p2(data1) p3()
mmcblk0boot0: p1(boot) p2(kernel)