dynamic linking을 공부하다가 좀 지겨워서 kernel도 조금씩 공부하려고 하고 있다. 

 

lkmpg를 읽고 있는데 아래와 같은 assembly source가 있다고 한다. 

arch/$(architecture)/kernel/entry.S

 

Bootlin에 가서 arch/x86/kernel/entry.S에 있는 줄 알았는데 없어졌다. 자세한 내용은 모르겠지만, userspace에서 int 0x80, syscall 등의 instruction을 실행하면 실제 entry.S에 있는 code를 통해서 syscall이 trigger 되는 것 같다. 

 

자세한 내용은 kernel docs를 읽으면 된다.  

 

보통 assembly source는 .s인데 왜 하필 capital .S로 적었을까? 

 

stackoverflow에 의하면 우리가 알다시피 순수 assembly는 .s extension을 쓰지만 #include, #define 등 C preprocessor(cpp)를 실행해야 되는 assembly는 .S라는 extension을 가진다고 한다. 

'삽질 > Ubuntu' 카테고리의 다른 글

Kernel root shell에서 exit 하기  (0) 2026.07.20
Tmux 사용법  (0) 2026.07.20
Ubuntu 24.04 업데이트 이후 Wifi 사라짐  (0) 2026.07.16
GNU as Warning: end of file not at end of a line; newline inserted  (0) 2026.06.17
heic to png  (0) 2026.05.22

QEMU가 낯설어서 그런지 일반적인 userspace shell처럼 exit을 누르면 kernel shell은 exit이 안 된다. 

평소처럼 exit을 하려고 하면 kernel panic이 뜨는 기이한 일이 발생한다. 

 

초반에는 평소 관성처럼 exit 하고 오른쪽 X로 close terminal을 했으나 이렇게 root shell을 exit 하는 건 아무리 봐도 아닌 것 같다. 

 

kernel의 root shell에서 exit 하고 싶으면 ctrl a + x로 exit 하면 아래와 같아 깔끔하게 exit 된다. 

아직 원리는 정확히 뭔지 모르겠다. 

 

 

Google에 또 검색하기가 귀찮아서 Gemini한테 그냥 답만 알려달라고 했는데, 양심에 좀 찔렸다.

그래서 검색해 보니 아니나 다를까 누가 미리 질문을 해놓았고, 우리 Ciro Santilli 형님이 또 친절하고 자세하게 답변을 달아줬다. 

 

최고입니다! Ciro 형님

 

stackoverflow에서 정말 도움이 많이 되는 분들이 몇 명 있는데, 많지는 않지만 Ciro Santilli는 그중 한 명이다. 이해가 쏙쏙 가게 설명을 너무 잘하는 것 같다.  

'삽질 > Ubuntu' 카테고리의 다른 글

.s vs .S  (0) 2026.07.27
Tmux 사용법  (0) 2026.07.20
Ubuntu 24.04 업데이트 이후 Wifi 사라짐  (0) 2026.07.16
GNU as Warning: end of file not at end of a line; newline inserted  (0) 2026.06.17
heic to png  (0) 2026.05.22

tmux로 Tmux 실행. 

 

Vertical split 

Ctrl + b  누르고 shift 5로 vertical 창분할 

Ctrl + b 왼쪽, 오른쪽 화살표로 pane 간 이동. 

 

Horizontal split

Ctrl + b 누르고 "로 horizontal 창분할 

Ctrl + b 위쪽,아래쪽 화살표로 pane 간 이동. 

 

Horizontal to Vertical and vice versa 

Ctrl + b + spacebar 

 

Tmux enable mouse scroll 

https://superuser.com/questions/209437/how-do-i-scroll-in-tmux

 

'삽질 > Ubuntu' 카테고리의 다른 글

.s vs .S  (0) 2026.07.27
Kernel root shell에서 exit 하기  (0) 2026.07.20
Ubuntu 24.04 업데이트 이후 Wifi 사라짐  (0) 2026.07.16
GNU as Warning: end of file not at end of a line; newline inserted  (0) 2026.06.17
heic to png  (0) 2026.05.22

점심 먹기 전에 Ubuntu가 system update를 했다. 점심을 먹고 나서 다시 desktop을 켰는데 wifi button이 사라져서 살짝 panic 했다. 

 

사실 처음 이런 거는 아니고, 이미 한 번 경험한 적이 있었는데 그 당시에는 좀 놀라서 그냥 새로 깔았다. 

 

결론부터 말하자면 전혀 새로 설치할 필요는 없다. 

 

그렇다면 왜 system update를 하면 wifi/bluetooth가 작동하지 않을까? 

 

이유는 바로 kernel update 때문이다. 

 

나의 경우에는 Ubuntu 24.04.4 LTS를 쓰고 있고 24.04.4에서 사용하는 kernel은 6.17.0.35-generic 이다. 

 

Ubuntu kernel version에 대한 정보는 Ubuntu에서 볼 수 있다. 

$ uname -a
Linux ubuntu 6.17.0-35-generic #35~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 19:30:42 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

 

그러나 최근에 update를 통해서 6.17.0.40으로 kernel version이 올라갔는데, kernel이 바뀌면서 wifi/bluetooth driver도 업데이트를 해야 된다.

 

문제는 wifi/bluetooth chip 제조사(realtek)에서 이러한 kernel update에 따른 driver 수정을 해야 되는데 Intel을 제외한 나머지 회사들은 그다지 driver update에 관심이 없는 것 같다.

 

아무래도 kernel driver를 수정하는 programmer을 고용해서 추가적으로 비용이 발생해서 그런 듯하다. 

 

일단 Wifi/bluetooth가 연결되지 않는다면 높은 확률로 kernel version이 올라갔을 것이다.

 

Grub에서 Advanced options for Ubuntu를 선택하면 upgrade 된 kernel과 이전 kernel이 있을 것이다. 

 

이때 이전 kernel을 선택한다. 만약 해당 kernel로 booting을 해서 wifi/bluetooth가 있다면 kernel update를 하지 않도록 kernel version을 고정시키는 것이 좋다. 

 

dpkg --get-selections 으로는 kernel version을 확인할 수 있다. 현재 설치되어 있는 kernel과 hardware environment (hwe)를 보여준다. 

 

askubuntu 에서는 hwe를 지우지 말라고 하는데 삭제하지 않으면 자동적으로 6.17.0-40 kernel을 load 해서 나의 경우에는 삭제해 버렸다. 

 

 

그다음에는 apt-mark hold로 사용할 kernel을 자동으로 upgrade/install 하지 않게 hold 할 수 있다. 

나의 경우 hwe도 hold 하기로 했다. 

$ sudo apt-mark hold linux-image-6.17.0-35-generic
linux-image-6.17.0-35-generic set on hold.

sudo apt-mark hold linux-image-generic-hwe-24.04      
linux-image-generic-hwe-24.04 set on hold.

 

apt-mark로 hold를 하고 나서 다시 dpkg --get-selections를 하면 확실히 결과가 바뀌었다. 

 

apt, dpkg 모두 man page가 있고 심지어는 apt-mark도 있으니 한 번 읽어보자. 

 

참고로 Realtek이 이런 driver에 인식하니 웬만하면 Wifi chip은 Intel AX 210 처럼 좀 유명한 거를 쓰는 게 좋고 그거보다 더 좋은 선택지는 lan card를 쓰는 것이다. 

 

그러면 Wifi 문제가 아예 사라지기 때문이다. 슬프게도 우리 집은 여건상 내 방에 랜선을 꼽을 수가 없다. 참 안타깝다... 

 

어쨌든 이 상태에서 재부팅을 하면 원래 상태로 잘 동작을 하지 않고 계속 6.17.0-40을 사용한다... 

 

그럴 때에는 6.17.0-35나 wifi 접속이 가능한 kernel version으로 부팅을 하고 sudo /etc/default/grub으로 아래 두 줄을 추가한다. 

GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true

 

vim, nano 등을 이용하여 저장하고 sudo update-grub 으로 grub을 update 한다. 

 

아마 이 정도만 해도 6.17.0-35를 선택하여 부팅할 텐데 6.17.0-40이 문제를 일으킬까 봐 삭제를 하기로 하였다. 

 

아래의 command를 이용하여 6.17.0.40 kernel을 삭제하자. 

sudo dpkg --remove --force-all linux-image-6.17.0-40-generic
sudo dpkg --remove --force-all linux-image-generic-hwe-24.04

 

이렇게 하면 아예 Advanced options for Ubuntu에서 6.17.0-40이 뜨지를 않는다. 

 

그러나 단점이 하나 있는데 바로 sudo apt-get upgrade를 하면 문제가 생긴다는 것이다. 

 

이 외에도 brave가 작동은 잘 하지만 오른쪽 상단 bar에 an error occurred please run the package manager... 라고 뜬다. 

 

아직 완벽하게 고치지는 않았지만 일단은 여기까지.

 

7월 18일 

 

오늘은 gdb 강의를 들으면서 gcc/clang으로 같은 source code를 compile 보는 것이 debugging에 좋다고 해서 clang을 설치하려고 했다.

 

그러나 지난번에 6.17.0-35를 apt-mark로 hold 해서 인지 6.17.0-40과 hwe에 dependency가 있어서 설치하지 못하였다. 

 

apt-mark hold를 하면 새로운 packages를 설치하거나 update 하지 못하니 좋은 방법은 전혀 아닌 것 같다. 그리하여 다시 apt-mark를 unhold 하고 다시 sudo apt-get full upgrade로 kernel을 다시 update 했다. 

 

그랬더니 6.17.0-35에서 6.17.0-40이 아닌 7점대 7.0.0-28 kernel로 올라갔다. 

 

 

장점은 7.0.0-28에서는 wifi/bluetooth 모두 잘 됐다. ibus에서 한/영 전환만 잘 안 됐는데 아래의 command로 해결했다. 

 

오른쪽 alt 키로 한/영 전환을 하는데 Hangul/alt_r이 아닌 ISO_shift_level3으로 인식을 해서 강제로 바꿔줬다. 

gsettings get org.gnome.desktop.input-sources xkb-options

gsettings set org.gnome.desktop.input-sources xkb-options "['lv3:ralt_alt']"

 

추가로 아래의 command 까지 실행해야지 Hangul key를 입력해도 막 스크린샷이 찍히거나 browser의 hamburger 키가 눌리지 않는다. 

gsettings set org.gnome.desktop.input-sources xkb-options "['korean:ralt_hangul', 'korean:rctrl_hanja']"

 

terminal에서 이런 결과가 나와야 된다. 

 

$ gsettings get org.gnome.desktop.input-sources xkb-options
['korean:ralt_hangul', 'korean:rctrl_hanja']

 

 

Realtek 같은 chip manufacturer 들이 LTS kernel version들은 발 빠르게 driver를 짜주는데, 중간에 단계인 version들은 무시하는 것 같다. 약간 glibc 2.31(Ubuntu 20.04), 2.35(Ubuntu 22.04), 2.39(Ubuntu 24.04), 2.43(Ubuntu 26.04)은 모두가 사용하지만 그 사이사이에 있는 버전들은 사람들이 잘 안 쓰는 거랑 비슷한 논리가 아닐까 싶다. 

 

어찌 됐건 무사히 해결해서 기분이 좋다. 

'삽질 > Ubuntu' 카테고리의 다른 글

Kernel root shell에서 exit 하기  (0) 2026.07.20
Tmux 사용법  (0) 2026.07.20
GNU as Warning: end of file not at end of a line; newline inserted  (0) 2026.06.17
heic to png  (0) 2026.05.22
Ubuntu 에서 folder icons 숨기기  (0) 2026.05.18

가끔 as로 assembly source에서 object code를 만들면 이런 warning이 뜰 때가 있다. 

C/C++ source code는 항상 끝이 '\n'이 끝난다. 이 내용 관련해서 네이버 블로그에 한 번 글을 적은 적이 있었다. 

GNU as도 '\n'을 만날 때까지 line by line instruction을 parsing 해서 그런지, 끝에 '\n'을 하나 해줘야지 해당 warning이 없어진다. 

 

Assembly source 끝에 반드시 '\n'이 있을 필요는 없지만 warning 뜨는 게 찝찝하기도 하고 관습을 따라주는 게 옳다고 생각하기 때문에 앞으로는 유의하여 '\n'을 source 끝에 넣어줘야겠다. 

 

'삽질 > Ubuntu' 카테고리의 다른 글

Tmux 사용법  (0) 2026.07.20
Ubuntu 24.04 업데이트 이후 Wifi 사라짐  (0) 2026.07.16
heic to png  (0) 2026.05.22
Ubuntu 에서 folder icons 숨기기  (0) 2026.05.18
Ubuntu dual booting시 Windows 시간이 안 맞을때  (0) 2026.05.18

핸드폰은 heic(heif) format이 기본 사진 format이다. heic는 블로그에 안 보여서, png로 바꾸고 싶었다. 

 

libhelf-examples를 사용하면 heic to png가 된다고 해서 package를 설치하려고 했으나 자꾸 error가 떴다 

 

$ sudo apt install aptitude libheif-examples
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
aptitude is already the newest version (0.8.13-5ubuntu5).
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libheif-examples : Depends: libheif1 (= 1.17.6-1ubuntu4.2) but 1.17.6-1ubuntu4.3 is to be installed
E: Unable to correct problems, you have held broken packages.

 

sudo apt upgrade, update, clean 등 이것저것 해봤지만 아무것도 해결을 하지 못했다. 

 

이럴 때에는 그냥 Imagemagick의 convert command를 쓰면 된다. 이러면 png 파일로 손쉽게 바꿀 수 있다. 

 

convert x.heic output.png

Hugo server를 실행하면 다음과 같은 error가 뜬다. 

WARN  deprecated: project config key languageCode was deprecated in Hugo v0.158.0 and will be removed in a future release. Use locale instead.

WARN  deprecated: .Language.LanguageDirection was deprecated in Hugo v0.158.0 and will be removed in a future release. Use .Language.Direction instead.
WARN  deprecated: .Language.LanguageCode was deprecated in Hugo v0.158.0 and will be removed in a future release. Use .Language.Locale instead.

 

Hugo version은 0.161.1이다.

$ hugo version
hugo v0.161.1-ea8f66a7ce988664dcc84c052fc96757042e2e4a+extended linux/amd64 BuildDate=2026-04-29T13:56:01Z VendorInfo=snap:0.161.1

 

github issues에 나와있는 데로 바꾸면 되는데 나의 경우에는 해당 파일이 없다. 

 

https://github.com/adityatelange/hugo-PaperMod/issues/1856

 

[Bug]: .Language variable name deprecations · Issue #1856 · adityatelange/hugo-PaperMod

What happened? With hugo v0.161.1+extended+withdeploy PaperMod leads to these warnings: WARN deprecated: .Language.LanguageDirection was deprecated in Hugo v0.158.0 and will be removed in a future ...

github.com

 

아무래도 다시 git clone을 해서 update를 해야 되지 않을까 싶다.

Settings-> Ubuntu Desktop에서는 Home Folder만 숨길 수 있어서, 전체 folder들을 다 숨기고 싶으면 gnome-extensions를 이용해야 한다. 

 

Reddit에서 누군가 또 미리 삽질을 해서 예상보다 쉽게 해결할 수 있었다.  

 

아래의 command를 실행하면 icons 들이 싹 숨김처리된다.

gnome-extensions disable ding@rastersoft.com

+ Recent posts