차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
linuxfromscratch [2024/06/07 19:30] – [화면 출력 로그파일로 저장] baecylinuxfromscratch [2024/06/16 23:14] (현재) – [PS1 설정] baecy
줄 1: 줄 1:
-====== Linux From Scratch ======+===== 토막 상식 =====
  
 +==== for, echo and sed =====
 +
 +<code bash>
 +for i in $(echo "ldapadd, ldapcompare, ldapdelete, ldapexop, ldapmodify, slapschema, slaptest" | sed 's/,/ /g') ; do find /usr/bin -type f -name $i ; done
 +</code>
 ==== Grep && Tar ==== ==== Grep && Tar ====
  
줄 168: 줄 173:
 PS1_USER='\[$(tput setaf 75)\][ \[$(tput sgr0)\]\w \[$(tput setaf 75)\]] \[$(tput sgr0)\]\$\n' PS1_USER='\[$(tput setaf 75)\][ \[$(tput sgr0)\]\w \[$(tput setaf 75)\]] \[$(tput sgr0)\]\$\n'
 PS1_HEAD='\[$(tput setaf 229)\]\u\[$(tput setaf 199)\]@\[$(tput setaf 215)\]\h ' PS1_HEAD='\[$(tput setaf 229)\]\u\[$(tput setaf 199)\]@\[$(tput setaf 215)\]\h '
-if [ "$(awk '$5=="/" {print $1}' </proc/1/mountinfo)" != "$(awk '$5=="/" {print $1}' </proc/$$/mountinfo)" ] ; th +if [ "$(awk '$5=="/" {print $1}' </proc/1/mountinfo)" != "$(awk '$5=="/" {print $1}' </proc/$$/mountinfo)" ] ; then
-en                                                                                                                +
     if [ $(id -u) -eq 0 ] ; then     if [ $(id -u) -eq 0 ] ; then
         PS1="<Chroot>${PS1_HEAD}${PS1_ROOT}"         PS1="<Chroot>${PS1_HEAD}${PS1_ROOT}"
     else     else
-        PS1="<Chroot>${PS1_HEAD}${PS1_USER}"                                                                      +        PS1="<Chroot>${PS1_HEAD}${PS1_USER}"
     fi     fi
 else else
     if [ $(id -u) -eq 0 ] ; then     if [ $(id -u) -eq 0 ] ; then
-        PS1="${PS1_HEAD}${PS1_ROOT}"                                                                              +        PS1="${PS1_HEAD}${PS1_ROOT}"
     else     else
         PS1="${PS1_HEAD}${PS1_USER}"         PS1="${PS1_HEAD}${PS1_USER}"
줄 189: 줄 193:
 LFS 진행에 필요한 패키지 설치 LFS 진행에 필요한 패키지 설치
  
-<codelang=bash >+<code bash >
 sudo apt install build-essentials bison gawk m4 texinfo texinfo  ## 필수 사항 sudo apt install build-essentials bison gawk m4 texinfo texinfo  ## 필수 사항
 sudo apt install gettext libisl-dev                              ## 선택 사항 sudo apt install gettext libisl-dev                              ## 선택 사항
줄 205: 줄 209:
 ---- ----
 ==== Qemu에서 부팅중 마운트 에러가 발생하는 경우 ==== ==== Qemu에서 부팅중 마운트 에러가 발생하는 경우 ====
-Qemu에서 가상머신 시작시 디바이스 순서가 바뀌는 일이 발생 \\ + 
-다음과 같이 처리했음+Qemu에서 가상머신 시작시 디바이스 순서가 바뀌는 일이 발생해서 처리한 내용. 
-<code cmd=true lang=bash>+ 
 +파티션 레이블 설정 
 + 
 +<code lang=bash>
 mkswap -L <label> <partition> mkswap -L <label> <partition>
-e2label <device> <label></code> +e2label <device> <label> 
-등으로 라벨 설후 +</code> 
 + 
 +''/etc/fstab'' 
 <code lang=bash> <code lang=bash>
 # /etc/fstab: static file system information. # /etc/fstab: static file system information.
줄 230: 줄 240:
 LABEL=LFS_DISK          /mnt/lfs        ext4            defaults                1       1 LABEL=LFS_DISK          /mnt/lfs        ext4            defaults                1       1
 </code> </code>
-정상적으로 부팅 가능. \\ + 
-UUID 설정도 가능지만 그럴때는 주석으로 확실게 어떤 장치인지 명할것+UUID로 설정하는 경우 장치명을 주석으로 표기면 추후 수정시 용이
-\\ \\+ 
 +----
 ==== Putty에서 Ncurses 설치 후 <Home>,<End> Key 사용 설정 ==== ==== Putty에서 Ncurses 설치 후 <Home>,<End> Key 사용 설정 ====
 +
 ~/.profie or ~/.bashrc ~/.profie or ~/.bashrc
 +
 <code lang=bash> <code lang=bash>
 TERM=putty-256color TERM=putty-256color
-export TERM</code> +export TERM 
-이렇게 적용 할 것. +</code> 
-\\ \\+ 
 +----
 ==== Glibc-2.35 Compile ==== ==== Glibc-2.35 Compile ====
 컴파일중 알 수 없는 에러가 발생하고 매번 발생 위치가 다르다면 -j1 인자로 병렬처리 없이 make 실행 컴파일중 알 수 없는 에러가 발생하고 매번 발생 위치가 다르다면 -j1 인자로 병렬처리 없이 make 실행
줄 256: 줄 270:
  
 === Wget === === Wget ===
-소스 패키지 다운로드에 필요 \\ + 
-[[https://www.linuxfromscratch.org/blfs/view/systemd/basicnet/wget.html|Wget-1.24.5]] \\+소스 패키지 다운로드에 필요  
 + 
 +[[https://www.linuxfromscratch.org/blfs/view/systemd/basicnet/wget.html|Wget-1.24.5]]  
 설치 순서 : Libunistring - Libidn2 - Libpsl - Libtasn1 - P11-kit - SQLite - NSPR - NSS -Make-ca - Wget 설치 순서 : Libunistring - Libidn2 - Libpsl - Libtasn1 - P11-kit - SQLite - NSPR - NSS -Make-ca - Wget
-== DEPS ==+ 
 +++++ 의존성|
   * [[https://www.linuxfromscratch.org/blfs/view/systemd/basicnet/libpsl.html|Libpsl-0.21.5]] REQ   * [[https://www.linuxfromscratch.org/blfs/view/systemd/basicnet/libpsl.html|Libpsl-0.21.5]] REQ
     * [[https://www.linuxfromscratch.org/blfs/view/systemd/general/libunistring.html|Libunistring-1.2]] REQ     * [[https://www.linuxfromscratch.org/blfs/view/systemd/general/libunistring.html|Libunistring-1.2]] REQ
줄 273: 줄 291:
       * [[https://www.linuxfromscratch.org/blfs/view/systemd/server/sqlite.html|SQLite-3.45.3]] REC       * [[https://www.linuxfromscratch.org/blfs/view/systemd/server/sqlite.html|SQLite-3.45.3]] REC
       * [[https://www.linuxfromscratch.org/blfs/view/systemd/postlfs/p11-kit.html|P11-kit-0.25.3]] Runtime REC       * [[https://www.linuxfromscratch.org/blfs/view/systemd/postlfs/p11-kit.html|P11-kit-0.25.3]] Runtime REC
 +++++
  
 === NFS-UTILS === === NFS-UTILS ===
-[[https://www.linuxfromscratch.org/blfs/view/stable-systemd/basicnet/nfs-utils.html|NFS-Utils-2.6.4]] \\ 
-필요한 패키지를 아래의 순서대로 설치 후 설치 \\ 
  
-== DEPS ==+[[https://www.linuxfromscratch.org/blfs/view/stable-systemd/basicnet/nfs-utils.html|NFS-Utils-2.6.4]] 
 + 
 +필요한 패키지를 아래의 순서대로 설치 후 설치  
 + 
 +++++ 의존성|
   * [[https://www.linuxfromscratch.org/blfs/view/stable-systemd/basicnet/libtirpc.html|libtirpc-1.3.4]] REQ   * [[https://www.linuxfromscratch.org/blfs/view/stable-systemd/basicnet/libtirpc.html|libtirpc-1.3.4]] REQ
   * [[https://www.linuxfromscratch.org/blfs/view/stable-systemd/basicnet/libevent.html|libevent-2.1.12]] REQ   * [[https://www.linuxfromscratch.org/blfs/view/stable-systemd/basicnet/libevent.html|libevent-2.1.12]] REQ
줄 284: 줄 305:
   * [[https://www.linuxfromscratch.org/blfs/view/stable-systemd/server/sqlite.html|SQLite-3.45.1]] REQ   * [[https://www.linuxfromscratch.org/blfs/view/stable-systemd/server/sqlite.html|SQLite-3.45.1]] REQ
   * [[https://www.linuxfromscratch.org/blfs/view/stable-systemd/basicnet/rpcbind.html|rpcbind-1.2.6]] REQ   * [[https://www.linuxfromscratch.org/blfs/view/stable-systemd/basicnet/rpcbind.html|rpcbind-1.2.6]] REQ
 +++++
  
 === SSHFS (NFS 사용 안하는 경우)=== === SSHFS (NFS 사용 안하는 경우)===
-N40L에 있는 소스 디렉토리 마운트에 필요 \\ + 
-[[https://www.linuxfromscratch.org/blfs/view/systemd/postlfs/sshfs.html|sshfs-3.7.3]] \\+N40L에 있는 소스 디렉토리 마운트에 필요 
 + 
 +[[https://www.linuxfromscratch.org/blfs/view/systemd/postlfs/sshfs.html|sshfs-3.7.3]]  
 설치 순서 : ICU - Libxml2 - Sgml-common - UnZip - Docbook-xsl-nons - Docbook-xml - Libxslt - Docutil - Packing - PCRE2 - Glib - OpenSSH - Fuse - SSHFS 설치 순서 : ICU - Libxml2 - Sgml-common - UnZip - Docbook-xsl-nons - Docbook-xml - Libxslt - Docutil - Packing - PCRE2 - Glib - OpenSSH - Fuse - SSHFS
-== DEPS ==+ 
 +++++ 의존성|
   * [[https://www.linuxfromscratch.org/blfs/view/systemd/postlfs/fuse.html|Fuse-3.16-1]] REQ   * [[https://www.linuxfromscratch.org/blfs/view/systemd/postlfs/fuse.html|Fuse-3.16-1]] REQ
   * [[https://www.linuxfromscratch.org/blfs/view/systemd/general/glib2.html|Glib-2.80.0]] REQ   * [[https://www.linuxfromscratch.org/blfs/view/systemd/general/glib2.html|Glib-2.80.0]] REQ
줄 304: 줄 330:
         * [[https://www.linuxfromscratch.org/blfs/view/systemd/general/libxml2.html|Libxml2-2.12.6]] REQ         * [[https://www.linuxfromscratch.org/blfs/view/systemd/general/libxml2.html|Libxml2-2.12.6]] REQ
     * [[https://www.linuxfromscratch.org/blfs/view/systemd/general/pcre2.html|Pcre2-10.43]] REC     * [[https://www.linuxfromscratch.org/blfs/view/systemd/general/pcre2.html|Pcre2-10.43]] REC
-  * [[https://www.linuxfromscratch.org/blfs/downloads/stable-systemd/BLFS-BOOK-12.1-systemd-nochunks.html#openssh|OpenSSH 9.6p1]] REQ\\+  * [[https://www.linuxfromscratch.org/blfs/downloads/stable-systemd/BLFS-BOOK-12.1-systemd-nochunks.html#openssh|OpenSSH 9.6p1]] REQ 
 +++++
  
-==== Glibc 2.39 Testsuite Fail ==== +----
-8.5 Glibc 2.39 ''make check'' Fail  +
-<code cmd=true cmdout=3-9 user=root> +
-make check +
-grep "^FAIL" -l $(find -name \*.out) | cat  +
-./conform/XOPEN2K8/ndbm.h/conform.out +
-./conform/UNIX98/varargs.h/conform.out +
-./conform/UNIX98/ndbm.h/conform.out +
-./conform/XPG42/varargs.h/conform.out +
-./conform/XPG42/ndbm.h/conform.out +
-./conform/XOPEN2K/ndbm.h/conform.out +
-./conform/XPG4/varargs.h/conform.out</code>\\ +
- +
-=== 다음의 두 가지 경우는 넘겨도 상관없음 === +
-ndbm.h가 없어서 Fail.\\ +
-8.37. GDBM-1.23 을 설치하면 해결 +
-<code lang=log> +
-/tmp/tmpgeea6yiz/test.c:1:10: fatal error: ndbm.h: No such file or directory +
-    1 | #include <ndbm.h> +
-      |          ^~~~~~~~ +
-compilation terminated. +
-FAIL: Availability of <ndbm.h> +
-SKIP: Namespace of <ndbm.h> +
----------------------------------------------------------------------------- +
-  Total number of tests   :    1 +
-  Number of failed tests  :    1 +
-  Number of xfailed tests :    0 +
-  Number of skipped tests :    1</code>\\ +
-GCC에서 더 이상 지원하지 않는 <varargs.h>를 사용해서 발생하는 Fail +
-<code lang=log> +
-  In file included from /tmp/tmpi1821p31/test.c:1: +
-/usr/lib/gcc/x86_64-lfs-linux-gnu/13.2.0/include/varargs.h:4:2: error: #error "GCC no longer implements <varargs.h>." +
-    4 | #error "GCC no longer implements <varargs.h>." +
-      |  ^~~~~ +
-/usr/lib/gcc/x86_64-lfs-linux-gnu/13.2.0/include/varargs.h:5:2: error: #error "Revise your code to use <stdarg.h>." +
-    5 | #error "Revise your code to use <stdarg.h>." +
-      |  ^~~~~ +
-FAIL: Availability of <varargs.h> +
-SKIP: Namespace of <varargs.h> +
----------------------------------------------------------------------------- +
-  Total number of tests   :    1 +
-  Number of failed tests  :    1 +
-  Number of xfailed tests :    0 +
-  Number of skipped tests :    1 +
-  </code>\\+
  
 ==== Textinfo Dir File Rebuild ==== ==== Textinfo Dir File Rebuild ====
 +
 <code lang=bash> <code lang=bash>
 pushd /usr/share/info pushd /usr/share/info
줄 359: 줄 343:
     do install-info $f dir 2>/dev/null     do install-info $f dir 2>/dev/null
   done   done
-popd</code> \\+popd 
 +</code>
  
 +----
 ==== Swap file ==== ==== Swap file ====
 +
 <code cmd=true cmdout=6,7> <code cmd=true cmdout=6,7>
 export LFS=/mnt/lfs export LFS=/mnt/lfs
줄 371: 줄 358:
 no label, UUID=890ba9a5-da48-4374-84ce-b71b91863e00 no label, UUID=890ba9a5-da48-4374-84ce-b71b91863e00
 sudo swapon $LFS_SWAP sudo swapon $LFS_SWAP
-sudo echo "$LFS_SWAP  swap  swap  defaults  0  0" >> /etc/fstab</code>\\+sudo echo "$LFS_SWAP  swap  swap  defaults  0  0" >> /etc/fstab 
 +</code> 
 + 
 +---- 
 +==== Binutils 설치하기 전에 ISL 설치하기 ==== 
 + 
 +GMP를 먼저 설치 
  
-==== Binutils 설치하기 전에 ISL 설치하기 (실패) ==== 
-GMP를 먼저 설치 \\ 
 <code lang=bash> <code lang=bash>
 ./configure --prefix=/usr    \ ./configure --prefix=/usr    \
줄 382: 줄 373:
 make make
 make check 2>&1 | tee gmp-check.log make check 2>&1 | tee gmp-check.log
-## 책에서는 199이라고 나오지만 실제는 200이 나옴 
 awk '/# PASS:/{total+=$3} ; END{print total}' gmp-check-log awk '/# PASS:/{total+=$3} ; END{print total}' gmp-check-log
-</code>\\ +</code> 
-LFS 12.1 기준으로 8.20 참고 \\ + 
-[[https://libisl.sourceforge.io/|ISL Homepage]]에서 받아서 준비 \\+[[https://libisl.sourceforge.io/|ISL Homepage]]에서 받아서 준비 
 <code lang=bash> <code lang=bash>
-./configure --prefix=/usr --sysconfdir=/etc --disable-static --with-gmp=system+./configure --prefix=/usr --disable-static --with-gmp=system
 make make
-make install</code> \\+make install 
 +</code>
  
-==== BLFS 시작하기 전에 필요한 패키지 ==== +----
-sudo, nfs-utils(또는 sshfs), openssh, wget+
  
 ==== $LFS/sources에서 디렉토리 검색 ==== ==== $LFS/sources에서 디렉토리 검색 ====
 +
 <code lang=bash> <code lang=bash>
 alias dirfind="find -mindepth 1 -maxdepth 1 -type d | sed 's@^./@@'" alias dirfind="find -mindepth 1 -maxdepth 1 -type d | sed 's@^./@@'"
줄 401: 줄 393:
 rm -rf $(dirfind)  ## 설치 완료된 소스 디렉토리 삭제 rm -rf $(dirfind)  ## 설치 완료된 소스 디렉토리 삭제
 ## 설치 완료된 패키지 디렉토리만 삭제할거면 다음과 같이 ## 설치 완료된 패키지 디렉토리만 삭제할거면 다음과 같이
-alias SearchAndDestroy='find -mindepth 1 -maxdepth 1 -type d -exec rm -rf {} \;'</code> \\+alias SearchAndDestroy='find -mindepth 1 -maxdepth 1 -type d -exec rm -rf {} \;' 
 +</code>
  
 +----
 ==== SBU 측정 ==== ==== SBU 측정 ====
 <code lang=bash> <code lang=bash>
  • linuxfromscratch.1717788620.txt.gz
  • 마지막으로 수정됨: 2024/06/07 19:30
  • 저자 baecy