Linux2010. 1. 27. 11:09
patch -p0 < filename 이라고 스크립트가 되어있었는데 귀차니즘으로
patch -p0 filename 라고 했더니 끝나지 않아서 man page에서 확인하니


SYNOPSIS
       patch [options] [originalfile [patchfile]]

       but usually just

       patch -pnum < patchfile

[링크 : http://linux.die.net/man/1/patch]

엄훠 히밤~
착한 아이는 스크립트 대로 하세요~ ㅋㅋ
Posted by 구차니
Linux2010. 1. 26. 15:54
How seperate directory and filename from path.

getfilename()
getdirectorypath()

이런식으로 좀 구현해주면 덧나나 싶을 정도로
은근히 검색해도 안나오는 녀석이었는데, 은근히 용도가 많은 녀석이다.

#include <libgen.h>
char *dirname(char *path);
char *basename(char *path);

path          dirname        basename
"/usr/lib"     "/usr"        "lib"
"/usr/"        "/"           "usr"
"usr"          "."           "usr"
"/"            "/"           "/"
"."            "."           "."
".."           "."           ".."


[링크 : http://www.joinc.co.kr/modules/moniwiki/wiki.php/man/3/basename]

path가 절대경로이든, 상대경로이든 dirname()과 basename()은 알아서 분리해준다.

[링크 : http://linux.die.net/man/3/basename]
[링크 : http://linux.die.net/man/3/dirname]

#include <string.h>
char *strdup(const char *s);
#define _GNU_SOURCE
#include <string.h>
char *strndup(const char *s, size_t n);
char *strdupa(const char *s);
char *strndupa(const char *s, size_t n);

The strdup() function returns a pointer to a new string which is a duplicate of the string s. Memory for the new string is obtained with malloc(3), and can be freed with free(3).

[링크 : http://linux.die.net/man/3/strdup]

[링크 : http://www.unix.com/unix-dummies-questions-answers/100617-how-get-directory-name-its-path.html]

오늘의 교훈 : 쉘에서 되면 당연히 API로도 존재한다!


Posted by 구차니
Linux/Ubuntu2010. 1. 25. 12:28
FC6 참.. 오래된 녀석인데.. 아무튼 이녀석 OS를 깔았떤 하드를 우분투에 연결하니 인식이 안된다.
/boot 만 인식해서 마운트를 할 수 있는데
그 아래의 것들은 LVM(Logical Volume Manager)로 되어있기 때문이다.


아무튼 필요한 패키지는
$ sudo apt-get install lvm2
로 설치하고

$ sudo vgscan
  Reading all physical volumes.  This may take a while...
  Found volume group "VolGroup00" using metadata type lvm2
$ sudo vgchange -a y
  2 logical volume(s) in volume group "VolGroup00" now active
로 LVM을 검색후 활성화 해준다.

그리고 마운트는 별다른 옵션없이 붙었다.
$ sudo mount /dev/VolGroup00/LogVol00 /mnt/lvm

modprobe 하라는데 없다고 에러나지만 별다른 문제 없이 작동한다.

$ mount
...
/dev/mapper/VolGroup00-LogVol00 on /media/sdb type ext3 (rw)
ext3로 rw 하게 붙었다!
Posted by 구차니
Linux/Ubuntu2010. 1. 15. 13:55
집에서는 잘되던넘이.. 회사오니 배를 짼다.
죽일수도 없는 노릇이고, 2일째 틈틈히 검색을 해보니 조금의 실마리가 잡힌다.

원인은 저번글에 적었듯 EDID이고
Nvidia 에서 지원하는 option으로 IgnoreEDID 라는 것이 존재한다.
[링크 : http://baudizm.blogsome.com/2005/09/27/ignoring-edid-to-impose-higher-resolution/]

내가 사용하는 카드는 Geforce2 MX, 드라이버는 96.43.13 이다.
아무튼 IgnoreEDID는 아래와 같은 오류가 난다.

$ vi /var/log/Xorg.0.log
202 (**) NVIDIA(0): Option "IgnoreEDID" "True"
203 (**) NVIDIA(0): Option "AddARGBGLXVisuals" "True"
204 (**) NVIDIA(0): Enabling RENDER acceleration
205 (WW) NVIDIA(0):
206 (WW) NVIDIA(0): The IgnoreEDID and NoDDC options have been deprecated.  The
207 (WW) NVIDIA(0):     NVIDIA X driver makes use of a display device's EDID
208 (WW) NVIDIA(0):     during construction of its modePool.  It is recommended
209 (WW) NVIDIA(0):     that you allow the X driver to make use of any available
210 (WW) NVIDIA(0):     EDID.  If, however, you know what you are doing and have
211 (WW) NVIDIA(0):     good reason to do so, you can disable the X driver's use
212 (WW) NVIDIA(0):     of EDIDs by setting the "UseEDID" X configuration option
213 (WW) NVIDIA(0):     to FALSE; e.g.,
214 (WW) NVIDIA(0):
215 (WW) NVIDIA(0):   Option "UseEDID" "FALSE"
216 (WW) NVIDIA(0):
217 (WW) NVIDIA(0): Note that, rather than globally disable all uses of the EDID,
218 (WW) NVIDIA(0):     you can individually disable each particular use of the
219 (WW) NVIDIA(0):     EDID; e.g.,
220 (WW) NVIDIA(0):
221 (WW) NVIDIA(0):   Option "UseEDIDFreqs" "FALSE"
222 (WW) NVIDIA(0):   Option "UseEDIDDpi" "FALSE"
223 (WW) NVIDIA(0):   Option "ModeValidation" "NoEdidModes"
224 (WW) NVIDIA(0):
225 (WW) NVIDIA(0): See Appendix D: X Config Options in the README for details on
226 (WW) NVIDIA(0):     each of these options.
간단하게 말하자면, IgnoreEDID 대신에 UseEDID를 쓰라는 이야기이다.

아무튼, 이런식의 오류가 나면서 640x480으로 강제 설정된다.
209 (II) NVIDIA(0): NVIDIA GPU GeForce2 MX 100/200 at PCI:1:0:0 (GPU-0)
210 (--) NVIDIA(0): Memory: 32768 kBytes
211 (--) NVIDIA(0): VideoBIOS: 03.11.01.26.31
212 (II) NVIDIA(0): Detected AGP rate: 4X
213 (--) NVIDIA(0): Interlaced video modes are not supported on this GPU
214 (--) NVIDIA(0): Connected display device(s) on GeForce2 MX 100/200 at
215 (--) NVIDIA(0):     PCI:1:0:0:
216 (--) NVIDIA(0):     CRT-0
217 (--) NVIDIA(0): CRT-0: 350.0 MHz maximum pixel clock
218 (II) NVIDIA(0): Assigned Display Device: CRT-0
219 (WW) NVIDIA(0): No valid modes for "1024x768"; removing.
220 (WW) NVIDIA(0): No valid modes for "800x600"; removing.
221 (II) NVIDIA(0): Validated modes:
222 (II) NVIDIA(0):     "640x480"
223 (II) NVIDIA(0): Virtual screen size determined to be 640 x 480
224 (WW) NVIDIA(0): Unable to get display device CRT-0's EDID; cannot compute DPI
225 (WW) NVIDIA(0):     from CRT-0's EDID.
226 (==) NVIDIA(0): DPI set to (75, 75); computed from built-in default



640x480 에서 처참하게 잘린 X Server Setting (드라이버 버전 96.43.13)


해결방법 : 나의 경우에는 어처구니 없게도.. 모니터 케이블 교체하니 EDID를 제대로 받아왔다.
               케이블이 회사에 없어서 20m 짜리 케이블을 사용했는데 커넥터 하나가 비어있었다.
               아무튼 이녀석이야 Green GND 쪽이라 상관은 없겠지만.. 아무튼 케이블 문제라니 ㄱ-
               (아래 기준으로 7번 핀이 빠져있었지만, 상관없어 보이고, 아마 단가를 낮추기 위해서
               가장 아래쪽에 13,14번 핀을 제외한 나머지 핀이 연결되어 있지 않았었나보다)


Pin 1 RED Red video
Pin 2 GREEN Green video
Pin 3 BLUE Blue video
Pin 4 ID2/RES formerly Monitor ID bit 2, reserved since E-DDC
Pin 5 GND Ground (HSync)
Pin 6 RED_RTN Red return
Pin 7 GREEN_RTN Green return
Pin 8 BLUE_RTN Blue return
Pin 9 KEY/PWR formerly key, now +5V DC
Pin 10 GND Ground (VSync, DDC)
Pin 11 ID0/RES formerly Monitor ID bit 0, reserved since E-DDC
Pin 12 ID1/SDA formerly Monitor ID bit 1, I²C data since DDC2
Pin 13 HSync Horizontal sync
Pin 14 VSync Vertical sync
Pin 15 ID3/SCL formerly Monitor ID bit 3, I²C clock since DDC2

[링크 : http://en.wikipedia.org/wiki/VGA_connector]
Posted by 구차니
Linux2010. 1. 14. 14:14
우분투에는 /etc/ld.so.conf.d 로 존재한다.
다른 배포판에서는 /etc/ld.so.conf 로 존재하는듯 하다.

----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variableduring execution
   - add LIBDIR to the `LD_RUN_PATH' environment variableduring linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

autoconf 에서 출력되는 ld 관련 메시지



3.3. 환경 변수들

여러가지 환경변수는 이 과정을 제어할 수 있다. 그리고 이 과정을 오버라이드하는 환경변수들이 존재한다.
3.3.1. LD_LIBRARY_PATH

이 특별한 실행을 위해 당신은 일시적으로 다른 라이브러리를 대체할 수 있다. 리눅스에서, 환경변수 LD_LIBRARY_PATH는 표준의 디렉토리들을 찾기전에 찾아보게되는 라이브러리의 디렉토리들의 콜론으로 구분되는 셋이다; 이것은 새 라이브러리나 특별히 제작한 표준이 아닌 라이브러리를 디버깅할때 유용하다. 환경변수 LD_PRELOAD는 /etc/ld.so.preload가 하는 것처럼 표준 셋을 오버라이드하는 공유 라이브러리를 함수와 함께 나열한다. 이것들은 /lib/ld-linux.so라는 로더에 의해 구현된다. LD_LIBRARY_PATH가 많은 유닉스 시스템에서 작동하는 반면 모든 시스템에서 작동하지 않는다는 것을 말하고 싶다; 예를들어, HU-UX에서는 이 기능이 환경변수 SHLIB_PATH에 의해서 가능하고, AIX에서는 LIBPATH에 의해 가능하다(같은 문법과, 콜론으로 구분되는 리스트로 가능하다).

LD_LIBRARY_PATH는 개발과 검사를 위해 편리하다. 그러나 보통의 유저의 보통의 사용을 위해서 설치 과정에서 변경되면 안된다; 왜 그런지는 http://www.visi.com/~barr/ldpath.html의 ``Why LD_LIBRARY_PATH is Bad''에서 찾아보라. 하지만, 이 기능은 여전히 개발과 검사를 위해 유용하고, 다른방식으로 해결하지 못하는 것을 해결하는데 유용하다. 만약 당신이 환경변수 LD_LIBRARY_PATH를 설정하고 싶지 않다면, 리눅스에서 당신은 프로그램 로더를 직접 불러서 인자를 넘겨줄수도 있다. 예를들어, 다음은 환경변수 LD_LIBRARY_PATH의 경로 이외의 주어진 PATH를 사용할 것이고, 실행가능 프로그램을 돌릴 것이다.

  /lib/ld-linux.so.2 --library-path PATH EXECUTABLE

인자없이 ld-linux.so를 돌리는 것은 당신이 이렇게 사용하는데에 도움을 줄 것이다. 하지만, 이것을 보통의 용도로 사용하지 마라. 이것들은 디버깅용이다.

[링크 : http://wiki.kldp.org/HOWTO/html/Program-Library-HOWTO/shared-libraries.html]

/sbin/ldconfig - configure dynamic linker run time bindings

Files
/lib/ld.so                run-time linker/loader
/etc/ld.so.conf        File containing a list of colon, space, tab, newline, or comma-separated directories in which to search for libraries.
/etc/ld.so.cache    File containing an ordered list of libraries found in the directories specified in /etc/ld.so.conf.

[링크 : http://linux.die.net/man/8/ldconfig]

pkg-config - Return metainformation about installed libraries

PKG_CONFIG_PATH
    A colon-separated (on Windows, semicolon-separated) list of directories to search for .pc files. The default directory will always be searched after searching the path; the default is libdir/pkgconfig:datadir/pkgconfig where libdir is the libdir where pkg-config and datadir is the datadir where pkg-config was installed.
[링크 : http://linux.die.net/man/1/pkg-config]

[링크 : http://kldp.org/node/71409]
[링크 : http://kldp.org/node/64845]
Posted by 구차니
Linux/Ubuntu2010. 1. 13. 22:49
우분투에서 우연히 보게된 기능인데.. 기존에도 있었던가?



오른쪽 클릭하고 탭 열기 하면 탭으로 생긴다.
나만 몰랐나 -ㅁ-?
Posted by 구차니
Linux2010. 1. 11. 11:42
/proc/diskstats 파일은 linux kernel 2.6 부터 지원하는 것으로
hdd의 파일 입출력 속도를 볼 수 있다.

음.. FC6에서는 해보니, 1초 간격으로 갱신되는것 같은데
$ cat /proc/diskstats
   1    0 ram0 0 0 0 0 0 0 0 0 0 0 0
   1    1 ram1 0 0 0 0 0 0 0 0 0 0 0
   1    2 ram2 0 0 0 0 0 0 0 0 0 0 0
   1    3 ram3 0 0 0 0 0 0 0 0 0 0 0
   1    4 ram4 0 0 0 0 0 0 0 0 0 0 0
   1    5 ram5 0 0 0 0 0 0 0 0 0 0 0
   1    6 ram6 0 0 0 0 0 0 0 0 0 0 0
   1    7 ram7 0 0 0 0 0 0 0 0 0 0 0
   1    8 ram8 0 0 0 0 0 0 0 0 0 0 0
   1    9 ram9 0 0 0 0 0 0 0 0 0 0 0
   1   10 ram10 0 0 0 0 0 0 0 0 0 0 0
   1   11 ram11 0 0 0 0 0 0 0 0 0 0 0
   1   12 ram12 0 0 0 0 0 0 0 0 0 0 0
   1   13 ram13 0 0 0 0 0 0 0 0 0 0 0
   1   14 ram14 0 0 0 0 0 0 0 0 0 0 0
   1   15 ram15 0 0 0 0 0 0 0 0 0 0 0
   3    0 hda 108013 40509 5794964 3417656 108015 779595 7103102 61420792 0 2737052 64843120
   3    1 hda1 1076 2158 19 38
   3    2 hda2 147415 5792382 887883 7103064
 253    0 dm-0 147169 0 5791122 5857704 887853 0 7102824 1796618756 0 2736044 1802476620
 253    1 dm-1 70 0 560 1432 30 0 240 38624 0 6188 40056
   2    0 fd0 0 0 0 0 0 0 0 0 0 0 0
   9    0 md0 0 0 0 0 0 0 0 0 0 0 0

이런식으로 숫자만 잔뜩 나온다.

/proc/diskstats, giving some information (including device numbers) for each of the logical disk devices
[링크 : http://en.wikipedia.org/wiki/Procfs]

sysstat 패키지의 iostat 유틸리티
[링크 : http://elenoa.tistory.com/52]

3.2 /proc/diskstat => disk utilization, throughput (only 2.6 kernels)
[링크 : http://duo830210.tistory.com/45]

Field  1 -- # of reads completed
    This is the total number of reads completed successfully.

Field  2 -- # of reads merged, field 6 -- # of writes merged
    Reads and writes which are adjacent to each other may be merged for
    efficiency.  Thus two 4K reads may become one 8K read before it is
    ultimately handed to the disk, and so it will be counted (and queued)
    as only one I/O.  This field lets you know how often this was done.

Field  3 -- # of sectors read
    This is the total number of sectors read successfully.

Field  4 -- # of milliseconds spent reading
    This is the total number of milliseconds spent by all reads (as
    measured from __make_request() to end_that_request_last()).

Field  5 -- # of writes completed
    This is the total number of writes completed successfully.

Field  7 -- # of sectors written
    This is the total number of sectors written successfully.

Field  8 -- # of milliseconds spent writing
    This is the total number of milliseconds spent by all writes (as
    measured from __make_request() to end_that_request_last()).

Field  9 -- # of I/Os currently in progress
    The only field that should go to zero. Incremented as requests are
    given to appropriate struct request_queue and decremented as they finish.

Field 10 -- # of milliseconds spent doing I/Os
    This field is increases so long as field 9 is nonzero.

Field 11 -- weighted # of milliseconds spent doing I/Os
    This field is incremented at each I/O start, I/O completion, I/O
    merge, or read of these stats by the number of I/Os in progress
    (field 9) times the number of milliseconds spent doing I/O since the
    last update of this field.  This can provide an easy measure of both
    I/O completion time and the backlog that may be accumulating.

[링크 : http://www.mjmwired.net/kernel/Documentation/iostats.txt]


Posted by 구차니
Linux2010. 1. 11. 09:42
fork-exec로 실행한 프로그램의 리턴값을 받는 방법이다.
예를 들어 mount를 쉘에서 실행하고 그 결과값을 받고 싶을때 사용한다.

#include <sys/types.h>
#include <sys/wait.h>

WEXITSTATUS
(status)
    returns the exit status of the child. This consists of the least significant 16-8 bits of the status argument that the child specified in a call to exit() or _exit() or as the argument for a return statement in main(). This macro should only be employed if WIFEXITED returned true.

[링크 : http://linux.die.net/man/2/waitpid]

[링크 : http://www.joinc.co.kr/modules/moniwiki/wiki.php/man/2/waitpid]
Posted by 구차니
Linux2010. 1. 8. 16:26
# mount -t ntfs-3g

머.. 이런식으로 실행하면 자동으로 mount.ntfs-3g 라는 파일을 찾아서 실행을 한다.
처음에는 오 졸라 신기해!!! 하면서 뻘짓으로 ..

make 과정중에 나온 intall-exec-hook 인줄 알고 파고 들었다가 웬걸 ㄱ-
아무튼 install-exec-hook은 설치후 trigger 식으로 실행해주는 루틴을 의미할 뿐,
execution hook 이랑은 연관이 없다. (젠장 된장 미네랄!)
[링크 : http://wiki.kldp.org/wiki.php/DocbookSgml/Autotools-KLDP]

아무튼, linux kernel utils 를 검색해서 mount.c 를 열어보니 busybox와는 다른 확연한 차이가 있었다.
일단 exec() 패밀리와 fork()를 사용하는 루틴의 존재유무

util-linux-2.12r/mount/mount.c

static int
check_special_mountprog(const char *spec, const char *node, const char *type,
			int flags, char *extra_opts, int *status) {
  char mountprog[120];
  struct stat statbuf;
  int res;

  if (!external_allowed)
      return 0;

  if (type && strlen(type) < 100) {
       sprintf(mountprog, "/sbin/mount.%s", type);
       if (stat(mountprog, &statbuf) == 0) {
	    res = fork();
	    if (res == 0) {
		 const char *oo, *mountargs[10];
		 int i = 0;

		 setuid(getuid());
		 setgid(getgid());
		 oo = fix_opts_string (flags, extra_opts, NULL);
		 mountargs[i++] = mountprog;
		 mountargs[i++] = spec;
		 mountargs[i++] = node;
		 if (nomtab)
		      mountargs[i++] = "-n";
		 if (verbose)
		      mountargs[i++] = "-v";
		 if (oo && *oo) {
		      mountargs[i++] = "-o";
		      mountargs[i++] = oo;
		 }
		 mountargs[i] = NULL;
		 execv(mountprog, (char **) mountargs);
		 exit(1);	/* exec failed */
	    } else if (res != -1) {
		 int st;
		 wait(&st);
		 *status = (WIFEXITED(st) ? WEXITSTATUS(st) : EX_SYSERR);
		 return 1;
	    } else {
	    	 int errsv = errno;
		 error(_("mount: cannot fork: %s"), strerror(errsv));
	    }
       }
  }
  return 0;
}

위에 소스에서 보면

sprintf(mountprog, "/sbin/mount.%s", type);
res = fork();
execv(mountprog, (char **) mountargs);

mount -t ntfs 는 mount.ntfs 로
mount -t cifs 는 mount.cifs 로

-t type 으로 받은 인자를 이용하여 실행을 넘겨준다.



결론 : busybox에서는 mount 소스가 많이 간략화 되어있으므로
         표준 mount 파일에서 지원하는 mount.type 실행치환 기능을 지원하지 않는다.

[링크 : ftp://ftp.kernel.org/pub/linux/utils/util-linux/] 리눅스용 mount.c
[링크 : http://www.koders.com/c/fid840A8124E3B838F1EC7B690C35A7A6F9BF10277B.aspx] busybox용 mount.c

'Linux' 카테고리의 다른 글

linux에 연결된 HDD의 IO 상태보기  (0) 2010.01.11
fork-exec 종료시 리턴값  (0) 2010.01.11
ntfs-3g 크로스 컴파일 하기 (ntfs-3g cross compile)  (0) 2010.01.07
FUSE 넌 머냐?  (0) 2010.01.07
ntfs-3g at Tuxera  (0) 2010.01.06
Posted by 구차니
Linux2010. 1. 7. 14:23
이녀석.. 미운 4살도 아닌데 크로스 컴파일 대책이 제대로 안되어 있는지 한큐에 안된다 ㄱ-

i686 linux에서는 참 쉽게 한다.

./configure
make
make install

[링크 : http://www.tuxera.com/community/ntfs-3g-download/]

세줄 끝.. 참 쉽죠잉~



그.런.데 크로스컴파일은 악몽의 시작이었다.
sh4-linux 에서 크로스컴파일은 산넘어 산이었는데..

crash 1.
# export CC=gsh4-linux-gcc
# ./configure --host-=i686 --target=sh4-linux
..
checking if libtool supports shared libraries... no
checking whether to build shared libraries... no
..
# make
...
Making install in libntfs-3g
test -z "/usr/local/lib" || /bin/mkdir -p "/home/morpheuz/st7109/target/usr/local/lib"
 /bin/sh ../libtool   --mode=install /usr/bin/install -c  'libntfs-3g.la' '/home/morpheuz/st7109/target/usr/local/lib/libntfs-3g.la'
/usr/bin/install -c .libs/libntfs-3g.lai /home/morpheuz/st7109/target/usr/local/lib/libntfs-3g.la
/usr/bin/install -c .libs/libntfs-3g.a /home/morpheuz/st7109/target/usr/local/lib/libntfs-3g.a
chmod 644 /home/morpheuz/st7109/target/usr/local/lib/libntfs-3g.a
ranlib /home/morpheuz/st7109/target/usr/local/lib/libntfs-3g.a
libtool: install: warning: remember to run `libtool --finish /usr/local/lib'
make  install-exec-hook
test -z "/lib" || /bin/mkdir -p "/home/morpheuz/st7109/target/lib"
if [ ! "/lib" -ef "/usr/local/lib" ]; then \
/bin/mv -f "/home/morpheuz/st7109/target//usr/local/lib"/libntfs-3g.so* "/home/morpheuz/st7109/target//lib";  \
fi
/bin/mv: cannot stat `/home/morpheuz/st7109/target//usr/local/lib/libntfs-3g.so*': No such file or directory
make[3]: *** [install-exec-hook] Error 1
make[2]: *** [install-exec-am] Error 2
make[1]: *** [install-am] Error 2
make: *** [install-recursive] Error 1

머.. 간단해 보이지만 대책이 안선다 ㄱ-
일단은 so 파일도 생성하지 못하면서, so 파일을 옮길려고 하면서 죽는다..
미네랄!

아무튼 해결책은 아래와 같다.

Step 1. 혹시 모르니 liunx kernel의 FUSE 지원여부를 확인한다.
Step 2. 환경설정
# unset CC
# ./configure

# vi Makefile
# vi src/Makefile
# vi libntfs-3g/Makefile
# vi libfuse-lite/Makefile

에서
AR = ar
CC = gcc
CPP = gcc -E
CXX = g++
CXXCPP = g++ -E
ac_ct_CC = gcc
ac_ct_CXX = g++
를 찾아 sh4-linux- 접두를 붙여준다.

# vi libtool
에서
AR="ar"
LTCC="gcc"
CC="gcc"
OBJDUMP="objdump"
AS="as"
를 찾아 sh4-linux- 접두를 붙여준다.

이렇게 수정후에는 마음 편하게

# make

만약 make 시에 secaudio.c 에러가 발생하면
<attr/xattr.h> 를 <sys/xattr.h>로 수정한다.

# vi src/secaudit.c
 261 #ifdef HAVE_SETXATTR
 262 #include <sys/xattr.h>
 263 #else
 264 #warning "The extended attribute package is not available"
 265 #endif /* HAVE_SETXATTR */

아무래도 target 경로가 다를테니 DESTDIR을 넣고 목적지를 정해준다.

# make DESTDIR={target path} install

설치후 생성되는 파일목록
/sbin/mount.ntfs-3g -> /bin/ntfs-3g
/bin/ntfs-3g
/usr/local/bin/ntfs-3g.probe
/usr/local/bin/ntfs-3g.secaudit
/usr/local/bin/ntfs-3g.usermap

/lib/libntfs-3g.so -> libntfs-3g.so.71.0.0
/lib/libntfs-3g.so.71 -> libntfs-3g.so.71.0.0
/lib/libntfs-3g.so.71.0.0

/usr/local/share/man/man8/mount.ntfs-3g.8 -> ntfs-3g.8
/usr/local/share/man/man8/ntfs-3g.8
/usr/local/share/man/man8/ntfs-3g.probe.8
/usr/local/share/man/man8/ntfs-3g.secaudit.8
/usr/local/share/man/man8/ntfs-3g.usermap.8

/usr/local/lib/libntfs-3g.a
/usr/local/lib/libntfs-3g.la
/usr/local/lib/libntfs-3g.so -> /lib/libntfs-3g.so


실행결과
# mount -t ntfs-3g /dev/sda1 /root/sda1
mount: mounting /dev/sda1 on /root/sda1 failed: No such device

# ntfs-3g /dev/sda1 /root/sda1
WARNING: Deficient Linux kernel detected. Some driver features are
         not available (swap file on NTFS, boot from NTFS by LILO), and
         unmount is not safe unless it's made sure the ntfs-3g process
         naturally terminates after calling 'umount'. If you wish this
         message to disappear then you should upgrade to at least kernel
         version 2.6.20, or request help from your distribution to fix
         the kernel problem. The below web page has more information:
         http://ntfs-3g.org/support.html#fuse26

# mount
rootfs on / type rootfs (rw)
/dev/root on / type nfs (rw,noatime,vers=2,rsize=4096,wsize=4096,hard,nolock,proto=tcp,timeo=600,retrans=2,addr=192.168.10.10)
proc on /proc type proc (rw)
usbfs on /proc/bus/usb type usbfs (rw)
sysfs on /sys type sysfs (rw)
/dev/sda1 on /root/sda1 type fuse (rw,user_id=0,group_id=0,allow_other)

'Linux' 카테고리의 다른 글

fork-exec 종료시 리턴값  (0) 2010.01.11
mount.cifs mount.ntfs 등 자동연결의 비밀(?)  (0) 2010.01.08
FUSE 넌 머냐?  (0) 2010.01.07
ntfs-3g at Tuxera  (0) 2010.01.06
웹캠 VLC에서 테스트(Ubuntu 9.10)  (0) 2009.12.29
Posted by 구차니