/sbin/init 와 /bin/sh 그리고 glibc 코드를 보고 싶습니다

kkb의 이미지

/sbin/init 와 /bin/sh 그리고 glibc 코드를 각각 보고 싶은데
어떻게 해야 하나요?

방법 좀 알려주세요.

planetarium의 이미지

마잇의 이미지

어느 리눅스 배포본을 사용하고 계십니까? 패키지 관리자로 설치하는 것이 가장 편리할 겁니다. 대부분의 패키지 관리자들이 소스 다운로드도 기능도 있습니다.

예를 들면 우분투(데비안) 같은 경우는 이렇게 합니다.

$ dpkg-query --search /bin/sh
diversion by dash from: /bin/sh
diversion by dash to: /bin/sh.distrib
dash: /bin/sh

$ sudo apt-get source dash
Reading package lists... Done
Building dependency tree       
Reading state information... Done
NOTICE: 'dash' packaging is maintained in the 'Git' version control system at:
http://smarden.org/git/dash.git/
Need to get 281 kB of source archives.
Get:1 http://archive.ubuntu.com/ubuntu/ precise/main dash 0.5.7-2ubuntu2 (dsc) [
1,201 B]
Get:2 http://archive.ubuntu.com/ubuntu/ precise/main dash 0.5.7-2ubuntu2 (tar) [224 kB]
Get:3 http://archive.ubuntu.com/ubuntu/ precise/main dash 0.5.7-2ubuntu2 (diff) [55.9 kB]
Fetched 281 kB in 3s (93.3 kB/s)
gpgv: Signature made Tue 27 Mar 2012 09:03:24 PM KST using DSA key ID C5AA2301
gpgv: Can't check signature: public key not found
dpkg-source: warning: failed to verify signature on ./dash_0.5.7-2ubuntu2.dsc
dpkg-source: info: extracting dash in dash-0.5.7
dpkg-source: info: unpacking dash_0.5.7.orig.tar.gz
dpkg-source: info: applying dash_0.5.7-2ubuntu2.diff.gz
dpkg-source: info: upstream files that have been modified: 
 dash-0.5.7/tests.tar.gz.uue

$ cd dash-0.5.7
$ ls
Makefile.am  install-sh*  configure.ac  Makefile.in  src/
COPYING      INSTALL      ChangeLog     configure*   tests.tar.gz.uue
missing*     depcomp*     aclocal.m4    config.h.in  debian/

$ cd src
$ ls
show.h        init.h           trap.h       arith_yacc.c  parser.h
show.c        hetio.h          trap.c       system.h      parser.c
shell.h       cd.h             redir.c      exec.h        mktokens
nodes.c.pat   arith_yacc.h     system.c     var.h         main.c
myhistedit.h  alias.h          output.c     var.c         eval.h
mknodes.c     alias.c          mystring.h   nodetypes     dash.1
mkinit.c      mksignames.c     mystring.c   jobs.c        output.h
miscbltin.h   arith_yylex.c    mkbuiltins   input.h       Makefile.am
memalloc.h    options.h        miscbltin.c  input.c       memalloc.c
main.h        options.c        jobs.h       exec.c        eval.c
mail.h        mksyntax.c       histedit.c   error.h       Makefile.in
mail.c        builtins.def.in  expand.h     expand.c      bltin/
machdep.h     redir.h          cd.c         error.c

일단 패키지 이름을 알아내서 패키지 관리자로 소스를 받던지 아니면 해당 패키지 홈페이지에 가서 다운 받으면 됩니다.

우분투(데비안)에서는 'dpkg-query --search /파일/위치' 명령으로 어떤 패키지에 속해있는지 알 수 있습니다.

다른 배포본을 사용하신다면 다음 분에게 설명하실 영광을 양보하겠습니다.


--
마잇

마잇의 이미지

$ sudo apt-get source dash

이 부분에서 sudo는 빼셔도 됩니다 root 소유로 파일이 생성되서 불편하네요.


--
마잇

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.