본문 바로가기
SW/Linux (Kernel)

Linux From Scratch 개발 노트 2 - Host System

by FastBench 2024. 8. 27.

참고 

github : https://github.com/NuttyJamie/LinuxFromScratch-for-Korean

 

GitHub - NuttyJamie/LinuxFromScratch-for-Korean: Korean translation of the LFS project.

Korean translation of the LFS project. Contribute to NuttyJamie/LinuxFromScratch-for-Korean development by creating an account on GitHub.

github.com

 

html 문서 : https://rawcdn.githack.com/NuttyJamie/LinuxFromScratch-for-Korean/88bdabae8abf2fad511b497b0dc676e6ac95b965/9.1/BOOK/HTML/index.html

 

Linux From Scratch

 

rawcdn.githack.com

 

Host tool 설치

참고 : https://rawcdn.githack.com/NuttyJamie/LinuxFromScratch-for-Korean/88bdabae8abf2fad511b497b0dc676e6ac95b965/9.1/BOOK/HTML/chapter02/hostreqs.html

 

version_check.sh 스크립트 실행으로 필요한 패키지들이 준비가 되었는지 준비한다.

(버전은 맞추지 않았다. 후에 수정이 필요하다면 업데이트하겠다.)

 

 

파티셔닝

호스트 시스템에 우분투 배포판을 설치할 때, 50GB 가량의 공간을 남겨두지 않았는데 이를 활성화한다.

 

ssd 성능 최적화를 위해 4KiB 경계에 정렬되어야 하므로 start sector 는  90200896이 아닌 902002688으로 된 것이 확인된다.

 

이후 파티션에 파일 시스템을 만든다.

 

이후 마운팅을 한다

export LFS=/mnt/lfs
sudo mkdir -pv $LFS
sudo mount -v -t ext4 /dev/nvme0n1p3 $LFS

 

 

재부팅 이후에도 같은 환경을 유지하기 위해 .bashrc 와 /etc/fstab 파일을 수정한다.

echo "export LFS=/mnt/lfs" >> ~/.bashrc
# /etc/fstab
/dev/nvme0n1p3	/mnt/lfs	ext4	defaults	1	1

 

 

패키지 & 패치 설치

root 권한으로 진행한다.

 

mkdir -v $LFS/sources
chmod -v a+wt $LFS/sources
# a+wt let every users have w permission for the directory, but only owner of file could remove the file.

 

아래링크 내용을 복붙하여 wget-list 파일 작성한다.

https://raw.githubusercontent.com/NuttyJamie/LinuxFromScratch-for-Korean/88bdabae8abf2fad511b497b0dc676e6ac95b965/9.1/BOOK/HTML/wget-list

 

wget --input-file=wget-list --continue --directory-prefix=$LFS/sources

 

이후 md5sum 툴을 통해 제대로 다운받아졌는지 확인 가능하다.

https://raw.githubusercontent.com/NuttyJamie/LinuxFromScratch-for-Korean/88bdabae8abf2fad511b497b0dc676e6ac95b965/9.1/BOOK/HTML/md5sums

pushd $LFS/sources
md5sum -c md5sums
popd

 

링크가 삭제된게 몇몇 존재하여 보완

wget https://toolchains.bootlin.com/downloads/releases/sources/expat-2.2.9/expat-2.2.9.tar.xz
wget https://cdn.kernel.org/pub/linux/docs/man-pages/Archive/man-pages-5.05.tar.xz
wget https://toolchains.bootlin.com/downloads/releases/sources/zlib-1.2.11/zlib-1.2.11.tar.xz
wget https://sources.buildroot.net/psmisc/psmisc-23.2.tar.xz

 

 

댓글