프로그램 사용/nfs2010. 2. 6. 14:12
이번에도 될지 안될지는.. 정식으로 서버 아이피 변경해봐야 하겠지만.. OTL
일단 문제가 된건, 자동 생성된 exports 파일의 내용차이

FC6 버전의 exports 파일의 내용이 아래와 같이 간략했다면
 /home/morpheuz/st7109/target      *(rw,async,nohide,no_root_squash)

우분투 버전의 exports 파일은 이렇게 길다
 /home/morpheuz/st7109/target
        *(rw,async,wdelay,nohide,nocrossmnt,secure,no_root_squash,no_all_squash,no_subtree_check,
        secure_locks,no_acl,anonuid=65534,anongid=65534)

아무튼 exports manpage를 찾아보니,
no_acl

On some specially patched kernels, and when exporting filesystems that support ACLs, this option tells nfsd not to reveal ACLs to clients, so they will see only a subset of actual permissions on the given file system. This option is safe for filesystems used by NFSv2 clients and old NFSv3 clients that perform access decisions locally. Current NFSv3 clients use the ACCESS RPC to perform all access decisions on the server. Note that the no_acl option only has effect on kernels specially patched to support it, and when exporting filesystems with ACL support. The default is to export with ACL support (i.e. by default, no_acl is off).

[링크 : http://linux.die.net/man/5/exports]
요런 내용이 나오는데.. 이게 원인이려나?

잠시 테스트 하는데.. tcp 접속 옵션이 빠져 udp로 되니 이상없이.. OTL 머가 도대체 문제지?
ACL도 상관없고 도대체 TCP가 안되는건 또 머냐고 ㅠ.ㅠ

2010/02/05 - [Linux/Ubuntu] - [확인중] 우분투의 nfs 서버로 uboot nfs 타켓 부팅 안되는 경우

'프로그램 사용 > nfs' 카테고리의 다른 글

unfsd - udev nfs deamon  (2) 2010.02.08
nfsstat  (0) 2010.02.07
우분투의 nfs 서버로 uboot nfs 타켓 부팅 안되는 경우  (0) 2010.02.05
우분투 nfs 서버 접속불가  (2) 2010.02.05
ubuntu에 NFS 서버 설치  (0) 2010.02.04
Posted by 구차니
프로그램 사용/nfs2010. 2. 5. 15:29
Ubuntu 9.10 Desktop Edition 에서 nfs를 사용해서 target 보드를 사용할때 발생하는 문제이다.

1. 우분투 설치시 기본으로 추가하는 계정은
    sudo user로서 admin 그룹에 추가되어 있고, gid/uid=1000 이다.
2. FC6 에서 생성되는 녀석은 gid/uid=500 부터이다.
3. FC6의 유저와 타겟을 우분투로 옮기면 nfs rootfs를 붙이고는 서버가 응답이 없다고 나온다.
IP-Config: Complete:
      device=eth0, addr=192.168.10.198, mask=255.255.255.0, gw=192.168.10.1,
     host=hmp_7109, domain=, nis-domain=(none),
     bootserver=255.255.255.255, rootserver=192.168.10.91, rootpath=
Looking up port of RPC 100003/2 on 192.168.10.91
PHY: 0:03 - Link is Up - 100/Full
Looking up port of RPC 100005/1 on 192.168.10.91
VFS: Mounted root (nfs filesystem) readonly.
Freeing unused kernel memory: 104k freed
nfs: server 192.168.10.91 not responding, still trying
4. 물론, mount -t nfs 서버:/경로 로 붙이면 붙는다.
5. 혹시나 해서 유저를 admin 그룹에 추가하고, uid를 1000번 대로 이동시켰다.(확인 필요)

이런 경우에는 우분투의 nfs-kernel-server의 기본설정이 gid를 확인하도록 해놨기 때문이다.
이러한 보안 설정은 /etc/default/nfs-kernel-server 파일에 들어 있으며, 아래의 내용이 기본으로 들어 있다.
물론 이 파일은 기본 포맷으로 /usr/share/nfs-kernel-server/conffiles/nfs-kernel-server.default 에 존재한다.

$ cat /etc/default/nfs-kernel-server
# Number of servers to start up
RPCNFSDCOUNT=8

# Runtime priority of server (see nice(1))
RPCNFSDPRIORITY=0

# Options for rpc.mountd.
# If you have a port-based firewall, you might want to set up
# a fixed port here using the --port option. For more information,
# see rpc.mountd(8) or http://wiki.debian.org/?SecuringNFS
RPCMOUNTDOPTS=--manage-gids

# Do you want to start the svcgssd daemon? It is only required for Kerberos
# exports. Valid alternatives are "yes" and "no"; the default is "no".
NEED_SVCGSSD=

# Options for rpc.svcgssd.
RPCSVCGSSDOPTS=

아무튼, 아래 내용을 번역하기 귀찮아서.. 대충 떄려잡기만 했는데,
결과론적으로, gid를 무시하고 접속을 하도록 하는것 같다.(ACL을 무시하는 듯)

장담은 못하겠지만, FC11에서도 동일한 현상으로 NFS 접속이 되지 않았는데(uboot에서)
FC11에서도 gid를 확인하도록 하기 때문이 아닐까 생각된다.

엄밀하게는 gid를 맞추어 주면 해결이 될듯 하지만.. 일단, 작동이 되니 여기까지 하는 구차니즘.. OTL

2010/02/05 - [Linux/Ubuntu] - 우분투 nfs 서버 접속불가
2010/02/04 - [Linux/Ubuntu] - ubuntu에 NFS 서버 설치


$ man mountd

NAME
       rpc.mountd - NFS mount daemon

OPTIONS
       -g  or  --manage-gids
              Accept requests from the kernel to map user id numbers into  lists of group id numbers for use in access  control.   An
              NFS  request  will normally (except when using Kerberos or other cryptographic authentication) contains a user-id and a
              list of group-ids.  Due to a limitation in the NFS protocol, at most 16 groups ids can be listed.  If you  use  the  -g
              flag,  then  the  list  of  group ids received from the client will be replaced by a list of group ids determined by an
              appropriate lookup on the server. Note that the 'primary' group id is not affected so a newgroup command on the  client
              will still be effective.  This function requires a Linux Kernel with version at least 2.6.21.

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

2010.02.06 추가
막상 구서버를 옮기고 나서 다시 테스트 하는데 안된다 ㄱ- 뭥미?

----
다른 연관글 확인요망
Atheros LAN 드라이버의 버그로 인해 NFS/TCP의 전송에 대한 문제가 있었다.

'프로그램 사용 > nfs' 카테고리의 다른 글

nfsstat  (0) 2010.02.07
우분투에서 nfs로 uboot 부팅이 안돼요 2  (0) 2010.02.06
우분투 nfs 서버 접속불가  (2) 2010.02.05
ubuntu에 NFS 서버 설치  (0) 2010.02.04
NFS 마운트 하기 - how mount nfs filesystem  (0) 2010.01.11
Posted by 구차니
프로그램 사용/nfs2010. 2. 5. 10:18
FC6의 /etc/exports 를 우분투로 끌어왔는데 nfs가 제대로 구동되지 않았다.
아래와 같이 exportfs 라는 명령어를 통해 우분투용 설정에 맞도록 설정을 해주어야 한다.

ubuntu 9.10의 경우 nfs는 존재하지 않고, 커널이나 udev 방식의 nfs 서버가 존재한다.
아마 일반적으로 nfs대신 nfs-kernel-server 라는 서비스명으로 하면 될것이다.
확신은 못하겠지만, service nfs-kernel-server 라고 하면 /etc/exports 변경시 자동으로 업데이트 되는듯 하다.

$ sudo service nfs-kernel-server restart
이거 한줄이면 업데이트 끝.

2010/02/05 - [Linux/Ubuntu] - 우분투의 nfs 서버로 uboot nfs 타켓 부팅 안되는 경우
2010/02/04 - [Linux/Ubuntu] - ubuntu에 NFS 서버 설치


exportfs -a
exportfs
service nfs restart
service network restart

[링크 : http://www.linuxquestions.org/questions/linux-server-73/root-nfs-server-returned-error-13-while-mounting-homearavindbrfsrootfs-589574/]

exportfs - maintain list of NFS exported file systems

/usr/sbin/exportfs [-avi] [-o options,..] [client:/path ..]
/usr/sbin/exportfs -r [-v]
/usr/sbin/exportfs [-av] -u [client:/path ..]
/usr/sbin/exportfs [-v]
/usr/sbin/exportfs -f

The exportfs command is used to maintain the current table of exported file systems for NFS. This list is kept in a separate file named /var/lib/nfs/xtab which is read by mountd when a remote host requests access to mount a file tree, and parts of the list which are active are kept in the kernel's export table.

-a
    Export or unexport all directories.

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

exportfs를 실행하면 /etc/exports 파일에서 /var/lib/nfs/xtab 으로 설정을 옮겨간다.




2010.02.17 추가
*** VERY IMPORTANT!!!! ***

M/B - P5G41T-M LX
LAN - Atheros GbE AR81 family (AR8131/AR8132)
OS   - tested on FC6
증상 - NFS 를 TCP로 접속시 타켓이 부팅을 하지 못함
원인 - 드라이버 이상으로 추측(드라이버 교체로 해결)
해결 -
아래의 링크에서 문제가 해결된 드라이버로 교체(컴파일 필요)
[링크 : http://lnx.sensibile.it/files/foxconn/AR81Family-linux-v1.0.1.4.tar.gz]


2010/02/17 - [Linux] - NFS 왜 안될까?

Posted by 구차니
3.0.x 에서는 (다르게 말하자면 Fedora Core 6 용 삼바)
기본적으로 /etc/samba/smbpasswd 라는 파일을 이용해서 계정의 암호를 관리한다.
하지만 3.4.0 으로 가면서 tdb를 사용하게 되는데, 일종의 migration이 필요하게 된다.

조금 간단하게 이야기하자면
FC6 -> Ubuntu 9.10 삼바 마이그레이션 할 경우이다.

Account Import/Export

The pdbedit tool allows import/export of authentication (account) databases from one backend to another. For example, to import/export accounts from an old smbpasswd database to a tdbsam backend:

  1. root# pdbedit -i smbpasswd -e tdbsam

  2. Replace the smbpasswd with tdbsam in the passdb backend configuration in smb.conf.



[링크 : http://samba.org/samba/docs/man/Samba-HOWTO-Collection/passdb.html#pdbeditthing]

'프로그램 사용 > SMB(Samba)' 카테고리의 다른 글

samba on Ubuntu 10.04 LTS  (0) 2010.11.11
cifsd  (0) 2010.03.18
SPNEGO, NTLMSSP  (0) 2009.12.21
삼바 디버그 메시지 설정하기  (4) 2009.12.18
삼바에서 대용량 파일 전송 실패  (0) 2009.12.03
Posted by 구차니
프로그램 사용/nfs2010. 2. 4. 12:25
NFS 서버는        nfs-kernel-server 패키지
NFS 클라이언트는 nfs-common 패키지를 설치한다.

머.. 패키지 이름이 그러하듯, 우분투에서 nfs 서버 재가동은
sudo service nfs-kernel-server restart

[링크 : https://help.ubuntu.com/8.04/serverguide/C/network-file-system.html]
Posted by 구차니
프로그램 사용/VLC2010. 2. 3. 19:39
VLC 크로스컴파일은 참.. 멀고도 험하다..

vlc-1.0.4$ make
...
 /opt/STM/STLinux-2.2/devkit/sh4/lib/gcc/sh4-linux/4.1.1/../../../../sh4-linux/bin/ld: warning: libvlccore.so.2, needed by ../src/.libs/libvlc.so, not found (try using -rpath or -rpath-link)
collect2: ld returned 1 exit status
이런식으로 오류가 발생한다.

아무튼, Makefile의 문제로, 1.0.5 에는 버그 수정이 되었다고 한다.

Try to modify bin/Makefile. It works for me.
vlc_LDADD = ../src/libvlc.la `$(VLC_CONFIG) -libs vlc` $(am__append_2)
change to
vlc_LDADD = ../src/libvlccore.la ../src/libvlc.la `$(VLC_CONFIG) -libs vlc` $(am__append_2)

[링크 : http://forum.videolan.org/viewtopic.php?f=13&t=63438]

위와 같이 수정하고 나면 다른 에러가 발생한다.
libtool: link: sh4-linux-gcc -std=gnu99 -I/usr/local/include -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98 -D_LARGEFILE64_SOURCE -D_REENTRANT -D_THREAD_SAFE -DMODULE_NAME=vlc -DMODULE_NAME_IS_vlc -DMODULE_STRING=\"vlc\" -O2 -ffast-math -funroll-loops -fomit-frame-pointer -Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wvolatile-register-var -Werror-implicit-function-declaration -o .libs/vlc vlc.o  ../src/.libs/libvlccore.so ../src/.libs/libvlc.so -Wl,-rpath -Wl,/opt/STM/STLinux-2.2/devkit/sh4/target/usr/lib
../src/.libs/libvlccore.so: undefined reference to `dbus_threads_init_default'
collect2: ld returned 1 exit status
이녀석은 --disable-dbus-control --disable-dbus 옵션을 주고 하면 사라진다.

그래도 또 다른 에러가 발생한다.
libtool: link: sh4-linux-gcc -std=gnu99 -shared  .libs/librtp_plugin_la-rtp.o .libs/librtp_plugin_la-input.o .libs/librtp_plugin_la-session.o  -Wl,--whole-archive ../../../compat/.libs/libcompat.a ../../../libs/srtp/.libs/libvlc_srtp.a -Wl,--no-whole-archive  -Wl,-rpath -Wl,/home/morpheuz/다운로드/vlc-1.0.4/src/.libs -Wl,-rpath -Wl,/opt/STM/STLinux-2.2/devkit/sh4/target/usr/lib -Wl,-rpath -Wl,/opt/STM/STLinux-2.2/devkit/sh4/target/usr/lib ../../../src/.libs/libvlccore.so /opt/STM/STLinux-2.2/devkit/sh4/target/usr/lib/libgcrypt.so /lib/libgpg-error.so -lnsl -lpthread    -Wl,-soname -Wl,librtp_plugin.so -o .libs/librtp_plugin.so
/lib/libgpg-error.so: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
이녀석은 --libdir=/opt/STM/STLinux-2.2/devkit/sh4/target/usr/lib/ 옵션을 줘도 안된다 ㅠ.ㅠ

'프로그램 사용 > VLC' 카테고리의 다른 글

x264 , libavcodec 다운로드  (0) 2010.02.24
vlc-1.0.5 cross compile  (3) 2010.02.09
VLC 1.0.4 cross compile + busybox  (0) 2010.02.02
의미는 없는 Linux / Windows VLC 차이  (0) 2010.01.26
VLC로 youtube 동영상 감상하기  (0) 2010.01.26
Posted by 구차니
프로그램 사용/VLC2010. 2. 2. 16:48
VLC 1.0.4
ubuntu 9.10 에서 크로스 컴파일을 시도했다.

$ ./configure --disable-mmx --disable-sse --enable-run-as-root --with-tuning=no --host=sh4-linux --build=i686

$ vi configure.ac
1621 dnl
1622 dnl  Special arch tuning
1623 dnl
1624 AC_ARG_WITH(tuning,
1625 [  --with-tuning=ARCH      enable special tuning for an architecture
1626                           (default Pentium 2 on IA-32 and G4 on PPC)])
1627 if test -n "${with_tuning}"; then
1628     if test "${with_tuning}" != "no"; then
1629         CFLAGS_TUNING="-mtune=${with_tuning}"
1630     fi
1631 else
1632     if test "${SYS}" = "darwin" -a "${host_cpu}" != "powerpc"; then
1633         CFLAGS_TUNING="-march=pentium-m -mtune=prescott"
1634     elif test "${host_cpu}" = "i686" -o "${host_cpu}" = "i586" -o "${host_cpu}" = "i486" -o "${host_cpu}" = "i386"; then
1635         CFLAGS_TUNING="-mtune=pentium2"
1636     elif test "${host_cpu}" = "x86_64"; then
1637         CFLAGS_TUNING="-mtune=athlon64"
1638     elif test "${host_cpu}" = "powerpc"; then
1639         CFLAGS_TUNING="-mtune=G4";
1640     fi
1641 fi

그리고 ubuntu 에서 sudo vlc 하면
$ sudo vlc
VLC is not supposed to be run as root. Sorry. If you need to use real-time priorities and/or privileged TCP ports
you can use vlc-wrapper (make sure it is Set-UID root and cannot be run by non-trusted users first).
라는 메시지가 출력되면서 실행되지 않는다. busybox나 대부분의 embeded 에서는 root로 할테니
크로스 컴파일 시에 root로 실행가능하도록 수정하고 (--enable-run-as-root)
cpu 최적화 부분을 꺼준다음 (--disable-mmx --disable-sse --with-tuning=no)
크로스 컴파일 되서 돌아갈 host를 지정해준다. (--host=sh4-linux)

좀 특이한(?) 점인데 --host=HOST_ARCH(==i686) --target=TARGET_ARCH(==sh4-linux)
처럼 입력이 되는게 아니라 host는 프로그램이 돌아갈 플랫폼을 의미한다.
즉, 일반적인 크로스 컴파일 옵션의 host, target 옵션이 바뀌어 build, host 로 인식한다.

$ ./configure --help

System types:
  --build=BUILD     configure for building on BUILD [guessed]
  --host=HOST       cross-compile to build programs to run on HOST [BUILD]

'프로그램 사용 > VLC' 카테고리의 다른 글

vlc-1.0.5 cross compile  (3) 2010.02.09
VLC cross compile시 오류 (vlc-1.0.4)  (0) 2010.02.03
의미는 없는 Linux / Windows VLC 차이  (0) 2010.01.26
VLC로 youtube 동영상 감상하기  (0) 2010.01.26
youtube mobile on VLC  (0) 2010.01.18
Posted by 구차니
일반적으로 Ctrl-R 옵션이나 Ctrl-H 옵션등으로
디렉토리 내의 모든 파일의 내용을 치환하는 것이 있다.

find ./ -exec grep "content" {} \; -exec sed -i "s/content/container/g" {} \;

[링크 : http://www.linux-forum.de/find-grep-replace-string-33557.html]

아무튼 위의 경우는 grep에 옵션이 들어가지 않았고, 모든 파일에 대해서 검색을 하므로
ctags 사용중에는 tags 파일까지 검색을 하게 된다.

크로스컴파일 목적으로 CC 라던가 LD 등을 고치려고 하면

find ./ -name Makefile -exec grep -w "= gcc" {} \; -exec sed -i "s/\= gcc/\= sh4-linux-gcc/g" {} \;

이렇게 find에 -name 옵션으로 파일을 지정하고(makefile 혹은 Makefile)
grep 옵션에 -w (Whole word matching) 으로 한정을 해주면 된다.

2010.02.04 추가
위의 예제는 "= gcc" 라고 들어있는 부분을 전체가 포함된 내용을 찾아 "= sh4-linux-gcc"로 변경해주는 것이다.
예를 들어 "= gcc3" 이런식으로 된 곳은  grep -w 옵션에 의해 무시된다.
그리고 tags 파일을 피하기 위해 find ./ -name Makefile 로 makefile에서만 수정을 하도록 제한한다.

2010/02/01 - [Linux] - grep에서 정확하게 찾기

Posted by 구차니
프로그램 사용/vi2010. 1. 29. 11:02
vi가 아쉬운 점은, 현재 편집중인 파일의 이름을 알수 없다는 점이다. (기본값으로)
아무튼 검색을 해보니 일시적으로 확인하려면
Ctrl-g나 :f로 하면 되지만 커서를 움직이면 사라진다.

이를 고정적으로 출력하기 위해서는 laststaus=2로 설정하면 된다.
다중창으로 편집중에는 출력되지만, 단일 창에서는 출력되지 않는다.

참고로 몇행:몇열 전체 % 라고 나오는 건 ruler 이다.
:set ruler
:set noruler로 토글가능하다.

Ctrl - G
:f
로 현재 편집중인 파일을 출력함

[링크 : http://kldp.org/node/92434]

:set laststatus=2

[링크 : http://vim.wikia.com/wiki/Displaying_status_line_always]

'laststatus' 'ls'    number    (default 1)
            global
            {not in Vi}
    The value of this option influences when the last window will have a
    status line:
        0: never
        1: only if there are at least two windows
        2: always
    The screen looks nicer with a status line if you have several
    windows, but it takes another screen line. |status-line|

[링크 : http://vimdoc.sourceforge.net/htmldoc/options.html#%27laststatus%27]

Posted by 구차니
프로그램 사용/vi2010. 1. 28. 17:27
여러개의 환경설정 파일이 존재 하지만,
가장 편하게 많은 사용자에게 적용하려면, 전역 환경변수를 수정하면된다.

/usr/share/vim/vimrc
    System wide Vim initializations.
~/.vimrc
    Your personal Vim initializations.

/usr/share/vim/gvimrc
    System wide gvim initializations.
~/.gvimrc
    Your personal gvim initializations.

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

Ubuntu 9.10에서는
set hlsearch
set nu
를 추가해주면 개발자가 편하게 사용할수있다.
Posted by 구차니