<From: https://m.blog.naver.com/lithium81/80137729050>

gzip의 분할 압축 명령

$ tar zcvfp - 대상파일(들) | split -b 4m - 압축할이름.tar.gz [엔터] 또는,
$ tar zcvfp - 디렉토리/ | split -b 4m - 압축할이름.tar.gz [엔터]

실행하면 *.tar.gzaa, ....gzab, ....gzac 이런 식으로 파일 확장자의 문자열이 증가하면서 파일이 생성된다.

gzip의 분할된 압축 파일 하나로 합치기

$ cat 압축파일이름.tar.gza* > 합쳐진파일이름.tar.gz [엔터]

실행하면 통짜로 된 .tar.gz 파일만 얻을 수 있다.

(참고: tar + gzip 압축 파일 해제)
~$ tar zxvf 압축파일이름.tar.gz [엔터]

실행하면 압축했던 디렉토리를 복구할 수 있다.

 

// example

 

cat panic.tar.gza* > a_panic.tar.gz
gzip -d  a_panic.tar.gz
tar -zvxf a_panic.tar
tar -xvf a_panic.tar

$ git config --global user.name "Austin Kim"
$ git config --global user.email austindh.kim@gmail.com

$ git config --global alias.ch checkout
$ git config --global alias.b branch
$ git config --global alias.co commit
$ git config --global alias.s  status
$ git config --global alias.fp  format-patch
$ git config --global alias.ap  apply

<From>
https://git-scm.com/book/ko/v2/Git%EC%9D%98-%EA%B8%B0%EC%B4%88-Git-Alias

32비트 라즈비안 커널

커널 빌드 (arm32_rpi_kernel_build.sh)

#!/bin/bash

KERNEL=kernel8

echo "configure build output path"
TOP_PATH=$( cd "$(dirname "$0")" ; pwd )
OUTPUT="$TOP_PATH/out32"

BUILD_LOG="$TOP_PATH/rpi_build_log.txt"

rpi_build_start_time=`date +%s`

pushd linux > /dev/null

make ARCH=arm O=$OUTPUT CROSS_COMPILE=arm-linux-gnueabihf- bcm2711_defconfig -j16 2>&1
make ARCH=arm O=$OUTPUT CROSS_COMPILE=arm-linux-gnueabihf- zImage modules dtbs  -j16 2>&1 | tee $BUILD_LOG

popd > /dev/null

커널 설치 (arm32_rpi_kernel_install.sh)

#!/bin/bash

echo "configure build output path"
TOP_PATH=$( cd "$(dirname "$0")" ; pwd )
OUTPUT="$TOP_PATH/out32"

sudo make modules_install

sudo cp $OUTPUT/arch/arm/boot/dts/*.dtb /boot/
sudo cp $OUTPUT/arch/arm/boot/dts/overlays/*.dtb* /boot/overlays/
sudo cp $OUTPUT/arch/arm/boot/zImage /boot/kernel7l.img

64비트 라즈비안 커널

커널 빌드 (arm64_rpi_kernel_build.sh)

#!/bin/bash

KERNEL=kernel8

echo "configure build output path"
TOP_PATH=$( cd "$(dirname "$0")" ; pwd )
OUTPUT="$TOP_PATH/out64"

BUILD_LOG="$TOP_PATH/rpi_build_log.txt"

rpi_build_start_time=`date +%s`

pushd linux > /dev/null

make ARCH=arm64 O=$OUTPUT CROSS_COMPILE=aarch64-linux-gnu- bcm2711_defconfig -j16 2>&1
make ARCH=arm64 O=$OUTPUT CROSS_COMPILE=aarch64-linux-gnu- Image modules dtbs  -j16 2>&1 | tee $BUILD_LOG

popd > /dev/null

커널 설치 (arm64_rpi_kernel_install.sh)

#!/bin/bash

echo "configure build output path"
TOP_PATH=$( cd "$(dirname "$0")" ; pwd )
OUTPUT="$TOP_PATH/out64"

BUILD_LOG="$TOP_PATH/rpi_build_log.txt"

rpi_build_start_time=`date +%s`

sudo make modules_install

sudo cp $OUTPUT/arch/arm64/boot/dts/broadcom/*.dtb /boot/
sudo cp $OUTPUT/arch/arm64/boot/dts/overlays/*.dtb* /boot/overlays/
sudo cp arch/arm64/boot/Image.gz /boot/kernel8.img

<From:>
https://www.raspberrypi.com/documentation/computers/linux_kernel.html
#!/bin/bash

echo "configure build output path"
TOP_PATH=$( cd "$(dirname "$0")" ; pwd )
OUTPUT="$TOP_PATH/out64"

BUILD_LOG="$TOP_PATH/rpi_build_log.txt"

rpi_build_start_time=`date +%s`

sudo make modules_install

sudo cp $OUTPUT/arch/arm64/boot/dts/broadcom/*.dtb /boot/
sudo cp $OUTPUT/arch/arm64/boot/dts/overlays/*.dtb* /boot/overlays/
sudo cp arch/arm64/boot/Image.gz /boot/kernel8.img

<From:>
https://www.raspberrypi.com/documentation/computers/linux_kernel.html

Each raspbian image is attached under below directory.

https://downloads.raspberrypi.org/raspios_arm64/images/


[PARENTDIR] Parent Directory   -  
[DIR] raspios_arm64-2020-05-28/ 2020-05-28 06:01 -  
[DIR] raspios_arm64-2020-08-24/ 2020-08-24 18:56 -  
[DIR] raspios_arm64-2021-04-09/ 2021-04-09 15:57 -  
[DIR] raspios_arm64-2021-05-28/ 2021-05-28 16:08 -  
[DIR] raspios_arm64-2021-11-08/ 2021-11-08 07:49 -  
[DIR] raspios_arm64-2022-01-28/ 2022-01-28 16:53 -  
[DIR] raspios_arm64-2022-04-07/ 2022-04-07 12:03 -  
[DIR] raspios_arm64-2022-09-07/ 2022-09-07 05:18 -  
[DIR] raspios_arm64-2022-09-26/ 2022-09-26 09:37 -  
[DIR] raspios_arm64-2023-02-22/ 2023-02-22 11:31 -  
[DIR] raspios_arm64-2023-05-03/ 2023-05-03 11:39 -

아래 경로에서 라즈비안 이미지를 내려 받을 수 있습니다.

* 2019-07-10-raspbian-buster-full.zip 위치

https://downloads.raspberrypi.org/raspbian/images/raspbian-2019-07-12/

* 전체 라즈비안 이미지 백업

https://downloads.raspberrypi.org/raspbian/images/

라즈비안(데비안 기반)에서 vim 에디터를 사용하면 visual 모드가 
by default로 설정돼 있어 쓰기 불편합니다. 
 
이번 포스트에서는 vi(vim) 에디터에서 visual mode를 삭제하는 방법을 소개합니다.
 
1. vi 에디터 편집창에서 명령어 입력

 

vi를 실행한 다음에 편집창 안에서 다음 명령어를 입력합니다. 
 
":set mouse="
":set mouse-=a"
 
2. $HOME/.vimrc 수정
 
'$HOME/.vimrc' 파일을 수정하는 방법도 있습니다. 이 방법을 적용하면 vi 에디터를 
사용할 때 마다 ":set mouse=" 명령어를 입력할 필요가 없으니 더 편한 것 같아요.
 
'$HOME/.vimrc' 파일을 열고 다음 명령어를 입력합시다.
 
set mouse=
 
root 계정으로 사용 중이면 다음 명령어를 입력하면 됩니다.
 
root@raspberrypi:/home/pi# vi /root/.vimrc
root@raspberrypi:/home/pi# source /root/.vimrc

solarianprogrammer.com/2018/04/22/raspberry-pi-raspbian-install-clang-compile-cpp-17-programs/

이번 포스트에서는 우분투에서 clang12를 설치하는 방법을 소개합니다.
참고로 우분투 버전은 20.04입니다. 
 
'sudo apt install clang-12 --install-suggests' 명령어를 사용해 clang12를 설치합니다.
 
$ sudo apt install clang-12 --install-suggests
 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  clang-12-doc fonts-font-awesome fonts-mathjax fonts-mathjax-extras fonts-stix libjs-mathjax libjs-mathjax-doc libjs-modernizr
  libjs-sphinxdoc libjs-underscore libomp-12-doc llvm-12-doc sphinx-rtd-theme-common
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  clang-12-doc fonts-font-awesome fonts-mathjax fonts-mathjax-extras fonts-stix libclang-common-12-dev libclang-cpp12 libclang1-12
  libjs-mathjax libjs-mathjax-doc libjs-modernizr libjs-sphinxdoc libjs-underscore libomp-12-dev libomp-12-doc libomp5-12 llvm-12
  llvm-12-dev llvm-12-doc llvm-12-linker-tools llvm-12-runtime llvm-12-tools sphinx-rtd-theme-common
The following packages will be REMOVED:
...
etting up libjs-mathjax-doc (2.7+20171212-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for fontconfig (2.13.1-2ubuntu3) ...
 
커널을 빌드할 때 'make CC=clang' 구문을 추가하면 Clang으로 커널 빌드가 됩니다.
 
make CC=clang ARCH=arm64 O=$OUTPUT CROSS_COMPILE=aarch64-linux-gnu- allyesconfig  -j16 2>&1
make CC=clang ARCH=arm64 O=$OUTPUT CROSS_COMPILE=aarch64-linux-gnu- Image modules dtbs  -j16 2>&1 | tee $BUILD_LOG
라즈비안에서 '7z 파일' 압축을 풀고 싶을 때가 있다.
 
p7zip 유틸리티를 설치
 
먼저 p7zip 유틸리티를 설치하자.
 
$ apt install p7zip
 
root@raspberrypi:/home/pi/work/crash_dump/out# apt install p7zip
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  python-colorzero
Use 'sudo apt autoremove' to remove it.
Suggested packages:
  p7zip-full
The following NEW packages will be installed:
  p7zip
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 350 kB of archives.
After this operation, 1,006 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian buster/main arm64 p7zip arm64 16.02+dfsg-6 [350 kB]
Fetched 350 kB in 0s (1,070 kB/s)
Selecting previously unselected package p7zip.
(Reading database ... 92716 files and directories currently installed.)
Preparing to unpack .../p7zip_16.02+dfsg-6_arm64.deb ...
Unpacking p7zip (16.02+dfsg-6) ...
Setting up p7zip (16.02+dfsg-6) ...
Processing triggers for man-db (2.8.5-2) ...
 
설치 완료!
 
p7zip는 어디에 있나?
 
root@raspberrypi:/home/pi/work/crash_dump/rpi_sample# whereis p7zip
p7zip: /usr/bin/p7zip /usr/lib/p7zip /usr/share/man/man1/p7zip.1.gz
 
root@raspberrypi:/home/pi/work/crash_dump/rpi_sample# p7zip
/usr/bin/p7zip: compressed data not written to a terminal.
For help, type: /usr/bin/p7zip -h
 
'/usr/bin/p7zip' 디렉토리에 존재한다.
 
p7zip help 출력 결과 
 
root@raspberrypi:/home/pi/work/crash_dump/rpi_sample# /usr/bin/p7zip -h
Usage: /usr/bin/p7zip [options] [--] [ name ... ]
 
Options:
    -c --stdout --to-stdout      output data to stdout
    -d --decompress --uncompress decompress file
    -f --force                   do not ask questions
    -k --keep                    keep original file
    -h --help                    print this help
    --                           treat subsequent arguments as file
                                 names, even if they start with a dash
 
이제 압축을 풀어볼까?  
 
p7zip -d file.7z
 
root@raspberrypi:/home/pi/work/crash_dump/rpi_sample# p7zip -d user_call_stack_dump_rpi.7z
 
7-Zip (a) [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=en_GB.UTF-8,Utf16=on,HugeFiles=on,64 bits,4 CPUs LE)
 
Scanning the drive for archives:
1 file, 110218549 bytes (106 MiB)
 
Extracting archive: user_call_stack_dump_rpi.7z
--
Path = user_call_stack_dump_rpi.7z
Type = 7z
Physical Size = 110218549
Headers Size = 918
Method = LZMA2:24
Solid = +
Blocks = 5
아래 파일을 열고, 다음과 같은 코드를 입력하면 깃 명령어에 대해 단축키를 지정할 수 있습니다.
 
~/.gitconfig
[alias]
    ch = checkout
    co = commit
    fp = format-patch
    s = status
    b = branch
 
아래 링크에 가보면 훌륭한 개발자님께서 깃에 대한 유용한 정보를 올렸으니, 잘 참고했으면 합니다.
 

+ Recent posts