참조
- https://wiki.archlinux.org/title/Installation_guide
- https://juo6442.github.io/study/2021/04/26/setup-archlinux.html
chroot - /mnt 후 nano 같은 툴이 설치되어 있지 않은 이유
Arch의 최소 설치 패키지인 base가 경량화돼서 내장 툴이 아예 없다.
그래서 pacstrap 혹은 설치된 Arch로 부팅 후 pacman 명령을 사용해서 원하는 패키지를 설치하면 된다.
# FAT32로 EFI 시스템 파티션 포맷
mkfs.fat -F 32 /dev/{efi_system_partition}
# EXT4로 루트 파티션 포맷
mkfs.ext4 /dev/{root_partition}
# 스왑용 파티션 지정 (메모리 스왑)
mkswap /dev/{swap_partition}
swapon /dev/{swap_partition}
# vim 편집기 설치
pacstrap /mnt vim
# iwd를 통한 WiFi 연결 지원
pacstrap /mnt iwd
# iwd 설정 파일 수정
vim /etc/iwd/main.conf
- [General]
- EnableNetworkConfiguration=true
-
- [Network]
- NameResolvingService=systemd
- PowerSavingMode=off
# 기본 내장 DNS Resolver 서비스 startup 등록
systemctl enable --now systemd-resolved
ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
# iwd 서비스 startup 등록
systemctl enable --now iwd
# iwctl 인터페이스 쉘 진입
iwctl
# 랜 디바이스 목록 보기
[iwctl] device list
[iwctl] adapter list
# LAN 어댑터 켜기
[iwctl] adapter {ADAPTER} set-property Powered on
# {DEVICE} 랜 디바이스로 무선 네트워크 스캔
[iwctl] station {DEVICE} scan
# 스캔한 무선 네트워크 목록 보기
[iwctl] station {DEVICE} get-networks
# {SSID}에 해당하는 무선 네트워크 연결
[iwctl] ststion {DEVICE} connect {SSID}
pacman 명령 옵션 설명서
https://archlinux.org/pacman/pacman.8.html#_query_options_apply_to_em_q_em_a_id_qo_a
Enable Lenovo’s battery save mode
# /etc/systemd/system/battery.service
[Unit]
Description=BatteryOptimizer
After=multi-user.target
[Service]
Type=oneshot
ExecStart=/bin/sh -c 'echo 1 > /sys/bus/platform/drivers/ideapad_acpi/VPC2004:00/conservation_mode'
ExecStart=/bin/sh -c 'for dev in /sys/devices/system/cpu/cpu*/cpufreq/energy_performance_preference; do [ -f "$dev" ] && echo balance_performance > "$dev"; done'
ExecStart=/bin/sh -c 'echo 0 > /sys/class/backlight/amdgpu_bl1/brightness'
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
Disable unused modules
# /etc/modprobe.d/blacklist.conf
blacklist pcspkr
blacklist bluetooth
blacklist btusb
blacklist uvcvideo
# for block the Wi-Fi device
blacklist rtw89_8852be
VIM Configuration
" .vimrc
" 시스템 설정
set encoding=utf-8
set fileencodings=utf-8,euc-kr,cp949
set nocp " vi 호환 모드 기능 비활성화
set confirm " 명령 실행 시 진행 여부 확인 기능 활성화
" 들여쓰기 기능
set autoindent " 엔터 자동 들여쓰기
set smartindent " 언어별 엔터 자동 들여쓰기
" 검색 기능
set hlsearch " 검색 결과 하이라이트
set incsearch " 검색어 입력 도중에도 계속 검색
set smartcase " 검색어에 대문자 포함 시 자동으로 case-sensitive
" 외관
syntax on
set number " 라인넘버 표시
set showmatch " 괄호쌍 하이라이트
" Map Leader 설정
let mapleader = "\<Space>"
" NetRW(파일 탐색기) 설정
" let g:loaded_netrw = 1
" let g:loaded_netrwPlugin = 1
let g:netrw_liststyle = 0
let g:netrw_browse_split = 0
nnoremap <silent> <Leader>e :if &modified \| execute "edit" \| else \| Explore \| endif<CR>
Service example
# /etc/systemd/system/foobar.service
[Unit]
Description=FooBar: Sample Service
After=systemd-resolved.service
[Service]
Type=simple
User=
ExecStart=
[Install]
WantedBy=multi-user.target
Set noatime option to root partition
(reducing disk write overhead)
# /etc/fstab
# Static information about the filesystems.
# See fstab(5) for details.
# <file system> <dir> <type> <options> <dump> <pass>
# /dev/YOUR_DISK
UUID=YOUR_DISK / ext4 rw,noatime 0 1
# /dev/...
# UUID=...
Journal Log Limit
# /etc/systemd/journald.conf.d/99-custom.conf
[Journal]
SystemMaxUse=16M
RuntimeMaxUse=8M
Lid Switch Setting
# /etc/systemd/logind.conf
HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore
HandleLidSwitchDocked=ignore
Network Setting
(iwd + systemd-networkd + systemd-resolved)
# /etc/systemd/network/25-wireless.network
[Match]
Type=wlan
[Network]
DHCP=yes
# /etc/systemd/network/20-wired.network
[Match]
Type=ether
[Network]
DHCP=yes