이번 포스트에서는 Crash-utility에 컨트리뷰션하는 방법을 정리한다.
<환경: 라즈베리 파이 4B>
<예상 독자: Austin Kim>
패치를 작성하는 이유
먼저 작성한 패치는 다음과 같다. 누구나 작성할 수 있는 typo 패치다.
diff --git a/symbols.c b/symbols.c
index 73baa95..9ae0187 100644
--- a/symbols.c
+++ b/symbols.c
@@ -3139,7 +3139,7 @@ kallsyms_module_function_size(struct syment *sp, struct load_module *lm, ulong *
if (!(lm->mod_flags & MOD_KALLSYMS) || !(kt->flags & KALLSYMS_V2))
return FALSE;
- if (THIS_KERNEL_VERSION >= LINUX(5,0,0)) /* st_size not useable */
+ if (THIS_KERNEL_VERSION >= LINUX(5,0,0)) /* st_size not usable */
return FALSE;
module_buf = GETBUF(lm->mod_size);
@@ -7624,7 +7624,7 @@ is_percpu_symbol(struct syment *sp)
* args[0] is checked to see whether it's the name of a variable, structure,
* union, or typedef. If so, args[0] is changed to the appropriate command,
* i.e., "p", "struct", "union", or "whatis", and the original args are all
- * shifted into the next higer args[] location.
+ * shifted into the next higher args[] location.
*/
int
is_datatype_command(void)
@@ -11608,7 +11608,7 @@ calculate_load_order_v2(struct load_module *lm, bfd *bfd, int dynamic,
}
/*
- * Later versons of insmod store basic address information of each
+ * Later versions of insmod store basic address information of each
* module in a format that looks like the following example of the
* nfsd module:
*
--
2.20.1
이 포스트를 읽으면 손가락만 있으면 만들 수 있는 이런 클린-업 패치를 업스트림하는 이유가 뭔지 궁금해할 수 있다.
이유는 간단하다. 다른 덩치 큰 패치를 보내기 전에,
마이너한 패치를 보내서 다른 개발자에게 '신고식'을 하려는 게 목적이다.
갑자기 처음 보는 개발자가 나타나 컨트리뷰션을 시도하면 '이 녀석은 뭐지?'라고 경계심이 일어날 것이다.
mutt로 패치 보내기
해당 패치에 대한 커밋을 하나 만든 다음에 패치 파일을 생성하자.
그다음에 mutt를 사용해 패치를 전달하려면 다음과 같은 포멧으로 mutt 명령어를 입력하자.
mutt -H '패치 이름'
root@raspberrypi:/home/pi# mutt -H 0001-fix-minor-spelling-typos-in-symbols.c.patch
다음과 같이 주소를 입력하라는 창이 보인다.
To:
crash-utility의 메일링 리스트 주소는 crash-utility@redhat.com이니,
이 주소를 입력하고 '엔터'를 입력하자.
To:crash-utility@redhat.com
'엔터'를 입력하면 커밋 타이틀이 보인다.
Subject: [PATCH] fix minor spelling typos in symbols.c
커밋 타이틀에 이상이 없으니 '엔터'를 입력하자.
다음 화면에는 커밋 메시지와 패치의 내용이 출력된다.
1 fix minor spelling typos in symbols.c as below:
2
3 useable => usable
4 higer => higher
5 versons => versions
6
7 Signed-off-by: Austin Kim <austindh.kim@gmail.com>
8 ---
9 symbols.c | 6 +++---
10 1 file changed, 3 insertions(+), 3 deletions(-)
11
12 diff --git a/symbols.c b/symbols.c
13 index 73baa95..9ae0187 100644
14 --- a/symbols.c
15 +++ b/symbols.c
16 @@ -3139,7 +3139,7 @@ kallsyms_module_function_size(struct syment *sp, struct load_module *lm, ulong *
17 if (!(lm->mod_flags & MOD_KALLSYMS) || !(kt->flags & KALLSYMS_V2))
18 return FALSE;
19
20 - if (THIS_KERNEL_VERSION >= LINUX(5,0,0)) /* st_size not useable */
21 + if (THIS_KERNEL_VERSION >= LINUX(5,0,0)) /* st_size not usable */
22 return FALSE;
23
24 module_buf = GETBUF(lm->mod_size);
25 @@ -7624,7 +7624,7 @@ is_percpu_symbol(struct syment *sp)
26 * args[0] is checked to see whether it's the name of a variable, structure,
27 * union, or typedef. If so, args[0] is changed to the appropriate command,
28 * i.e., "p", "struct", "union", or "whatis", and the original args are all
29 - * shifted into the next higer args[] location.
30 + * shifted into the next higher args[] location.
31 */
/tmp/mutt-raspberrypi-0-11959-20379766811612035705
':wq'를 입력하자. 참고로 ':wq'는 vi 에디터를 사용할 때의 방식과 같다.
/tmp/mutt-raspberrypi-0-11959-20379766811612035705
:wq
그 다음 '엔터'를 입력하면 다음과 같은 화면이 보인다.
이제 패치를 보내기 직전이다.
y:Send q:Abort t:To c:CC s:Subj a:Attach file d:Descrip ?:Help
From: Austin Kim <austindh.kim@gmail.com>
To: crash-utility@redhat.com
Cc:
Bcc:
Subject: [PATCH] fix minor spelling typos in symbols.c
Reply-To:
Fcc:
Mix: <no chain defined>
Security: None
-- Attachments
- I 1 /tmp/mutt-raspberrypi-0-11959-2037976681
이어서 'c'를 입력하자. cc로 메일 계정 주소를 입력해야 하기 때문이다.
-- Mutt: Compose [Approx. msg size: 1.5K Atts: 1]---------------------------------------------------------------
Cc: austindh.kim@gmail.com
내 개인 이메일 주소를 입력한 다음에 '엔터'를 입력하자. 그 다음에 아래 화면이 보일 것이다.
여기서 y를 입력하면 패치가 전달된다.
y:Send q:Abort t:To c:CC s:Subj a:Attach file d:Descrip ?:Help
From: Austin Kim <austindh.kim@gmail.com>
To: crash-utility@redhat.com
Cc: austindh.kim@gmail.com
Bcc:
Subject: [PATCH] fix minor spelling typos in symbols.c
Reply-To:
Fcc:
Mix: <no chain defined>
Security: None
-- Attachments
- I 1 /tmp/mutt-raspberrypi-0-11959-2037976681
이메일 주소를 다시 꼼꼼이 점검하고 y를 누르자.
패치 업스트림 확인
패치를 보내면 끝난 것이 아니다. 패치가 제대로 업스트림됐는지 crash-utility archives 사이트에서
확인하자.
아래 링크를 가니 업스트림한 패치가 보인다.
https://listman.redhat.com/archives/crash-utility/2021-December/msg00017.html
[Crash-utility] [PATCH] fix minor spelling typos in symbols.c
From: Austin Kim <austindh kim gmail com>
To: crash-utility redhat com
Subject: [Crash-utility] [PATCH] fix minor spelling typos in symbols.c
Date: Tue, 14 Dec 2021 01:38:19 +0000
fix minor spelling typos in symbols.c as below:
useable => usable
higer => higher
versons => versions
Signed-off-by: Austin Kim <austindh kim gmail com>
---
symbols.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/symbols.c b/symbols.c
index 73baa95..9ae0187 100644
--- a/symbols.c
+++ b/symbols.c
@@ -3139,7 +3139,7 @@ kallsyms_module_function_size(struct syment *sp, struct load_module *lm, ulong *
if (!(lm->mod_flags & MOD_KALLSYMS) || !(kt->flags & KALLSYMS_V2))
return FALSE;
- if (THIS_KERNEL_VERSION >= LINUX(5,0,0)) /* st_size not useable */
+ if (THIS_KERNEL_VERSION >= LINUX(5,0,0)) /* st_size not usable */
return FALSE;
module_buf = GETBUF(lm->mod_size);
@@ -7624,7 +7624,7 @@ is_percpu_symbol(struct syment *sp)
* args[0] is checked to see whether it's the name of a variable, structure,
* union, or typedef. If so, args[0] is changed to the appropriate command,
* i.e., "p", "struct", "union", or "whatis", and the original args are all
- * shifted into the next higer args[] location.
+ * shifted into the next higher args[] location.
*/
int
is_datatype_command(void)
@@ -11608,7 +11608,7 @@ calculate_load_order_v2(struct load_module *lm, bfd *bfd, int dynamic,
}
/*
- * Later versons of insmod store basic address information of each
+ * Later versions of insmod store basic address information of each
* module in a format that looks like the following example of the
* nfsd module:
*
--
2.20.1
레드헷 개발자가 이 패치를 보면 어떤 반응을 보일지 궁금하긴 하다. 어떤 반응을 보일지는 상관없지만 '욕을 하던', '알았다고'고 하던 메일에 뭐라도 반응을 했으면 좋겠다.
최근 덧글