소스코드에 debian patch 적용

Cute_Security15·2024년 8월 21일
0

linux dev

목록 보기
4/9
post-thumbnail

상황

libseccomp 소스코드가 필요한 상황인데, launchpad 사이트에 접속해보면
여러파일들이 존재한다.

How to extract the source files

debian 계열의 경우, upstream (mainline) 소스코드와 patch 가 함께 제공된다.
구조는 다음과 같다.

https://wiki.debian.org/Packaging/SourcePackage?action=show&redirect=SourcePackage#Working_with_a_source_package

libseccomp_2.5.3.orig.tar.gz                   소스코드
libseccomp_2.5.3.orig.tar.gz.asc               PGP signature Signature (old)
libseccomp_2.5.3-2ubuntu2.debian.tar.xz        patch
libseccomp_2.5.3-2ubuntu2.dsc                  PGP signed message, Debian source control files

dpkg-source x 옵션을 사용해서 압축 해제후 패치를 적용한다.

/// man dpkg-source
       -x, --extract filename.dsc [output-directory]
           Extract a source package (--extract since dpkg 1.17.14).  One non-option argument must be supplied, the name of the Debian
           source control file (.dsc).  An optional second non-option argument may be supplied to specify the directory to extract the
           source package to, this must not exist. If no output directory is specified, the source package is extracted into a directory
           named source-version under the current working directory.

           dpkg-source will read the names of the other file(s) making up the source package from the control file; they are assumed to
           be in the same directory as the .dsc.

           The files in the extracted package will have their permissions and ownerships set to those which would have been expected if
           the files and directories had simply been created - directories and executable files will be 0777 and plain files will be
           0666, both modified by the extractors' umask; if the parent directory is setgid then the extracted directories will be too,
           and all the files and directories will inherit its group ownership.

           If the source package uses a non-standard format (currently this means all formats except “1.0”), its name will be stored in
           debian/source/format so that the following builds of the source package use the same format by default.

패치결과 비교

debian 디렉토리가 추가되는걸 확인할수 있다.

패치 전 (upstream source)

패치 후

profile
관심분야 : Filesystem, Data structure, user/kernel IPC

1개의 댓글

comment-user-thumbnail
2024년 8월 21일

debian.org 에 접속해보면 maintainer 가이드가 첨부되어 있고, 그 안에 각 파일들의 역활, 개략적인 workflow 등이 잘 기술되어 있어서 참고가 많이 되었다.

답글 달기