차이

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

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
linuxfromscratch:auto-lfs [2024/05/14 15:33] – [파일 다운로드 링크 처리] baecylinuxfromscratch:auto-lfs [2024/06/07 20:14] (현재) – [파일 다운로드 링크 처리] baecy
줄 49: 줄 49:
                     if mountpoint $LFS/$kvfs; then umount -q $LFS/$kvfs; fi                     if mountpoint $LFS/$kvfs; then umount -q $LFS/$kvfs; fi
             done             done
-            findmnt -o FSTYPE,SIZE,USED,AVAIL,USE%,TARGET | grep lfs+            findmnt -D -R $LFS 
             echo "Ok unmount unnecessary devices"             echo "Ok unmount unnecessary devices"
             echo "Good bye"             echo "Good bye"
줄 55: 줄 55:
         else         else
             echo "Cleanup of Kernel Virtual File System is Complete."             echo "Cleanup of Kernel Virtual File System is Complete."
-            findmnt -o FSTYPE,SIZE,USED,AVAIL,USE%,TARGET | grep lfs+            findmnt -D -R $LFS
             exit 0             exit 0
         fi         fi
줄 70: 줄 70:
         if ! mountpoint -q $LFS/dev/shm; then mount -t tmpfs -o nosuid,nodev tmpfs $LFS/dev/shm;      fi         if ! mountpoint -q $LFS/dev/shm; then mount -t tmpfs -o nosuid,nodev tmpfs $LFS/dev/shm;      fi
         if ! mountpoint -q $LFS/sources; then mount --rbind /mnt/nfs/sources $LFS/sources;            fi         if ! mountpoint -q $LFS/sources; then mount --rbind /mnt/nfs/sources $LFS/sources;            fi
-        findmnt -o FSTYPE,SIZE,USED,AVAIL,USE%,TARGET | grep lfs+        findmnt -D -R $LFS
         # Run 'chroot'         # Run 'chroot'
         chroot "$LFS" $(type -p env) -i \         chroot "$LFS" $(type -p env) -i \
줄 105: 줄 105:
 </code> \\ \\ </code> \\ \\
 ===== 파일 다운로드 링크 처리 ===== ===== 파일 다운로드 링크 처리 =====
 +
 +다음과 같이 등록하고 사용해야 ''cd'' 가 작동을 합니다.
 +
 +<code lang=bash>
 +alias <filename>='source <filename>'
 +</code>
 +
 다운로드 링크 입력: 다운로드 -> 압축 해제 -> 디렉토리 이동 다운로드 링크 입력: 다운로드 -> 압축 해제 -> 디렉토리 이동
 +
 +추가한 사항
 +  - 입력받은 URL이 Git인 경우 처리 추가
 +  - 확장자가 .zip인 경우 처리 추가
 +  - 이미 다운로드 완료한 파일의 경우 처리 추가
 +  - 작업 디렉토리의 소유권 확인 추가
 +  - 출력 색상 변수 설정
 +
 +추가할 사항
 +  - alias 등록 확인
 +  - wget, git, gawk 설치 여부 확인
 +
 +수정할 사항
 +  - git clone 사용 할 때 작업 디렉터리에 먼저 받고 source 디렉터리에 복사하는 방식으로 변경 필요.
 +
 +
 <code user=user host=host lang=bash> <code user=user host=host lang=bash>
 user@host:[ ~ ] $ pre-stage  https://xorg.freedesktop.org/archive/individual/proto/xcb-proto-1.17.0.tar.xz user@host:[ ~ ] $ pre-stage  https://xorg.freedesktop.org/archive/individual/proto/xcb-proto-1.17.0.tar.xz
줄 113: 줄 136:
 <code lang=bash> <code lang=bash>
 #!/bin/bash #!/bin/bash
 +
 +Green='\033[0;32m'
 +BIGreen='\033[1;32m'
 +Red='\033[0;31m'
 +Yellow='\033[0;33m'
 +Color_Off='\033[0m'
 +
 +if [ "$(type -t p4c)" != 'alias' ] ; then
 +        echo -e "p4c is not ${Yellow}alias registered${Color_Off}, so the functionality is not available."
 +        source ${HOME}/.bash_aliases
 +        return 2>&/dev/null
 +fi
 +
 if [ -z "$1" ]; then echo -e "${Green}An appropriate factor (file name or download link) is required.${Color_Off}"; return; fi if [ -z "$1" ]; then echo -e "${Green}An appropriate factor (file name or download link) is required.${Color_Off}"; return; fi
 InputStringType=$(echo "$1" | awk 'BEGIN { FS = ":" } ; { print $1 }') InputStringType=$(echo "$1" | awk 'BEGIN { FS = ":" } ; { print $1 }')
줄 121: 줄 157:
 GitCheck=${TargetFile: -3} GitCheck=${TargetFile: -3}
 ZipCheck=${TargetFile: -3} ZipCheck=${TargetFile: -3}
 +TargetDir=$(echo "$TargetFile" | sed -e 's/\.tar.*$//' -e 's/\.tgz*$//' -e 's/\.src*$//' -e 's/\.zip*$//' -e 's@^.*/@@')
 NotFoundMsg1="The directory derived from the filename is ${BIGreen}$TargetDir${Color_Off}.\n\ NotFoundMsg1="The directory derived from the filename is ${BIGreen}$TargetDir${Color_Off}.\n\
 However, it does not exist, so it will move to the ${Yellow}most recent directory created${Color_Off}.\n\ However, it does not exist, so it will move to the ${Yellow}most recent directory created${Color_Off}.\n\
 Please check if it is correct." Please check if it is correct."
-TargetDir=$(echo "$TargetFile" | sed -e 's/\.tar.*$//' -e 's/\.tgz*$//' -e 's/\.src*$//' -e 's/\.zip*$//' -e 's@^.*/@@') 
  
-if [ $(stat -c %u $BuildBase) -ne $(id -u) ] ; then echo "Check $BuildBase Ownership"; return; fi+if [ $(stat -c %u $BuildBase) -ne $(id -u) ] ; then echo -e "Check ${Red}$BuildBase${Color_Off} Ownership"; return; fi
  
 function chg_dir() { function chg_dir() {
줄 163: 줄 199:
 case "$InputStringType" in case "$InputStringType" in
         https|http|ftp)         https|http|ftp)
-            wget --no-verbose --no-clobber --directory-prefix="$SourceBase" "$1"+            wget --no-verbose -nc --directory-prefix="$SourceBase" "$1"
         ;;         ;;
         *)         *)
줄 182: 줄 218:
  
 fi fi
-</code> \\+ 
 +unset  InputStringType BuildBase SourceBase TargetFile GitDirCheck GitCheck ZipCheck TargetDir NotFoundMsg1 
 +</code>  
  • linuxfromscratch/auto-lfs.1715700835.txt.gz
  • 마지막으로 수정됨: 2024/05/14 15:33
  • 저자 baecy