프로그램 사용/u-boot2016. 11. 8. 10:53

설명 상으로는 server_args에 넣으면 될 거 같은데

--blocksize max-block-size, -B max-block-size

Specifies the maximum permitted block size. The permitted range for this parameter is from 512 to 65464. Some embedded clients request large block sizes and yet do not handle fragmented packets correctly; for these clients, it is recommended to set this value to the smallest MTU on your network minus 32 bytes (20 bytes for IP, 8 for UDP, and 4 for TFTP; less if you use IP options on your network.) For example, on a standard Ethernet (MTU 1500) a value of 1468 is reasonable. 

[링크 : https://linux.die.net/man/8/in.tftpd]


12.04 에서는 blksize 옵션이 지원안하나?

[링크 : http://askubuntu.com/questions/644031/tftpd-hpa-how-can-i-set-blksize-option]


tftpd32 for win으로 받으면 이런 로그가 뜨는데 블럭 사이즈가 1468로 늘어나 있다.

Connection received from 192.168.10.184 on port 1084 [08/11 10:59:16.826]

Read request for file <tt.yaffs2>. Mode octet [08/11 10:59:16.827]

OACK: <timeout=1,tsize=43625472,blksize=1468,> [08/11 10:59:16.827]

Using local port 56906 [08/11 10:59:16.827]

TIMEOUT waiting for Ack block #6872  [08/11 10:59:29.583] 


블럭 사이즈는 512가 기본.. 1468은 1MTU

[링크 : https://blackfin.uclinux.org/doku.php?id=setting_up_a_tftp_server]


12.04에서 man으로 보니 BSD쪽 tftpd라 표준을 따르는 듯?

TFTPD(8)                BSD System Manager's Manual                TFTPD(8)


NAME

     tftpd — DARPA Trivial File Transfer Protocol server


SYNOPSIS

     tftpd [-n] [-s] [directory ...]


DESCRIPTION

     Tftpd is a server which supports the DARPA Trivial File Transfer Pro‐

     tocol.  The TFTP server operates at the port indicated in the ‘tftp’

     service description; see services(5).  The server is normally started

     by inetd(8).


     The use of tftp(1) does not require an account or password on the

     remote system.  Due to the lack of authentication information, tftpd

     will allow only publicly readable files to be accessed.  Files may be

     written only if they already exist and are publicly writable.  Note

     that this extends the concept of “public” to include all users on all

     hosts that can be reached through the network; this may not be appro‐

     priate on all systems, and its implications should be considered

     before enabling tftp service.  The server should have the user ID with

     the lowest possible privilege.


     Access to files may be controlled by invoking tftpd with a list of

     directories by including pathnames as server program arguments in

     /etc/inetd.conf.  In this case access is restricted to files whose

     names are prefixed by the one of the given directories. If no directo‐

     ries are supplied the default is /tftpboot.  To give out access to the

     whole filesystem, should this be desired for some reason, supply / as

     an argument.


     Unfortunately, on multi-homed systems, it is impossible for tftpd to

     determine the address on which a packet was received. As a result,

     tftpd uses two different mechanisms to guess the best source address

     to use for replies. If the socket that inetd(8) passed to tftpd is

     bound to a particular address, tftpd uses that address for replies.

     Otherwise, tftpd uses ``UDP connect'' to let the kernel choose the

     reply address based on the destination of the replies and the routing

     tables. This means that most setups will work transparently, while in

     cases where the reply address must be fixed, the virtual hosting fea‐

     ture of inetd(8) can be used to ensure that replies go out from the

     correct address.  These considerations are important, because most

     tftp clients will reject reply packets that appear to come from an

     unexpected address.


     The options are:


     -n      Suppresses negative acknowledgement of requests for nonexis‐

             tent relative filenames.


     -s      All absolute filenames are treated as if they were preceded by

             the first directory argument, or /tftpboot if there is none.


SEE ALSO

     tftp(1), inetd(8)


HISTORY

     The tftpd command appeared in 4.2BSD.


Linux NetKit (0.17)            July 29, 2000            Linux NetKit (0.17)


tftpd 클라이언트로 받아보니 이렇게 뜬다.

tftp> get tt.yaffs2

getting from localhost:tt.yaffs2 to tt.yaffs2 [netascii]

sent RRQ <file=tt.yaffs2, mode=netascii>

received DATA <block=10926, 512 bytes>

discarded 2 packets

received DATA <block=1, 512 bytes>

sent ACK <block=1> 

RFC에 따라 512 byte가 기본인듯



물론 

ubuntu 12.04 tftp 를 이용해서 tftpd32의 것을 받으니.. 여전히 512로 받는데..

클라이언트와 서버 둘다 표준을 준수하는(?) 착한 녀석들 이라 그런 듯

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

uboot filesize 환경변수  (0) 2016.11.17
tftpd-hpa  (0) 2016.11.08
uboot bootargs 기본값 설정하기  (0) 2015.02.09
uboot 메모리 관련 명령어  (0) 2015.01.08
u-boot 포팅 가이드  (0) 2013.08.31
Posted by 구차니
프로그램 사용/vi2016. 11. 4. 15:31

12.04 LTS에서 기본으로 vi가 연결되어 있는데

이래서 뜬금없이 X server 연결한다고 경고가 떴구나 싶은데..


$ alias

alias vi='vim -X' 


$ man vim

      -X          Don't connect to the X server.  Shortens startup time in a terminal, but the window title and

                   clipboard will not be used. 


도대체 왜 이걸 기본으로 해둔거지?

[링크 : http://stackoverflow.com/questions/12961680/why-does-vim-connect-to-x-by-default]

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

vi ctrl-s / ctrl-q  (0) 2016.11.09
vim 버전별 옵션 차이  (0) 2016.11.08
vi 버전 차이?  (0) 2016.07.09
vi 문자열 치환  (0) 2015.08.04
vi 사각형 선택하기  (0) 2014.09.11
Posted by 구차니

으아 복잡해 -_-!!!

결론 : svn에서 복구 하려면 복사본 만들고 삭제해라!


cp -a ori back 

svn delete –force ori

svn revert ori

cp -a back ori 


[링크 : http://k44.kr/?p=2908]

Posted by 구차니

TextFX는 기본이었나? 기억이 안나네..

없으면 깔고 ㅋ


TextFX - TextFX Viz 에서

Visible / InVisible 관련 copy / delete를 하면된다.

그런데.. Copy Visible Selection을 하면 엔터가 죄다 날아가서 붙는지라

가장 편한건(?) 원본을 복사해서 접은 다음 Delete Invisible Selection을 해서 삭제하고


접혔던 부분은 공백으로 남아 버리니

편집 - 줄단위 편집 - 빈줄 제거 (공백 문자 포함)

해주는게 가장 안정적인 방법인 듯

[링크 : https://sourceforge.net/p/notepad-plus/discussion/331754/thread/54db02cc/]

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

notepad++ ascii만 검색하기  (0) 2017.06.15
notepad++ 정규표현식을 이용한 아이피 추출  (0) 2017.02.09
notepad++ timestamp 찍기  (0) 2016.08.10
notepad++ 플러그인(ctags/vi)  (0) 2015.01.08
notepad2 와 notepad++  (16) 2008.12.30
Posted by 구차니
프로그램 사용/screen2016. 10. 22. 10:28

예전에 잠시 해보고 잊고 있었는데

다시 시도..


$ tty

/dev/pts/1


$ screen

$ tty

/dev/pts/6


ctrl-a,c

$ tty

/dev/pts/7


ctrl-a,n

window change


ctrl-a,d detach

[detached from 4014.pts-1.odroid_1]

// detach 시에는 다른 창을 만들어 두었더라도 전부 같이 떨어진다.


$ ps -ef | grep -i screen

odroid    4014     1  0 11:49 ?        00:00:00 SCREEN


$ screen -r

reattach


ctrl-a,? 도움말

                       Screen key bindings, page 1 of 2.


                       Command key:  ^A   Literal ^A:  a


  break       ^B b         license     ,            removebuf   =

  clear       C            lockscreen  ^X x         reset       Z

  colon       :            log         H            screen      ^C c

  copy        ^[ [         login       L            select      '

  detach      ^D d         meta        a            silence     _

  digraph     ^V           monitor     M            split       S

  displays    *            next        ^@ ^N sp n   suspend     ^Z z

  dumptermcap .            number      N            time        ^T t

  fit         F            only        Q            title       A

  flow        ^F f         other       ^A           vbell       ^G

  focus       ^I           pow_break   B            version     v

  hardcopy    h            pow_detach  D            width       W

  help        ?            prev        ^H ^P p ^?   windows     ^W w

  history     { }          quit        \            wrap        ^R r

  info        i            readbuf     <            writebuf    >

  kill        K k          redisplay   ^L l         xoff        ^S s

  lastmsg     ^M m         remove      X            xon         ^Q q


                  [Press Space for next page; Return to end.]


                       Screen key bindings, page 2 of 2.


^]   paste .

"    windowlist -b

-    select -

0    select 0

1    select 1

2    select 2

3    select 3

4    select 4

5    select 5

6    select 6

7    select 7

8    select 8

9    select 9

I    login on

O    login off

]    paste .

|    split -v

:kB: focus prev



                        [Press Space or Return to end.]  


한개 터미널에서 screen 실행중에 다른 터미널에서 확인한 결과

$ ps -ef | grep -i screen

odroid    4014     1  0 11:49 ?        00:00:00 SCREEN

odroid   17153  1554  0 11:57 pts/1    00:00:00 screen -r 


실수로 screen 안에서 screen -r 하니 이런 에러가 뜨네

$ screen -r

There is a screen on:

        4014.pts-1.odroid_1     (22/10/16 11:49:14)     (Attached)

There is no screen to be resumed. 


두개 터미널에서 detach 하니 이렇게 뜬다.

detach한 pts 번호가 뜨니 골라서 붙이면 된다.

물론 프로세스 정보 상으로는 tty가 ?로 뜸

$ screen -r

There are several suitable screens on:

        24631.pts-12.odroid_1   (22/10/16 12:02:24)     (Detached)

        4014.pts-1.odroid_1     (22/10/16 11:49:13)     (Detached)

Type "screen [-d] -r [pid.]tty.host" to resume one of them. 


$ ps -ef | grep -i screen

odroid    4014     1  0 11:49 ?        00:00:00 SCREEN

odroid   24631     1  0 12:02 ?        00:00:00 SCREEN


머랄까.. screen 프로그램이 중재자로

자신을 통해서 여러개의 pts를 오갈수 있는 컨셉?


[링크 : https://www.rackaid.com/blog/linux-screen-tutorial-and-how-to/]

2012/07/07 - [Linux] - ssh 를 통해 프로그램 실행후 로그아웃 해도 종료되지 않게 하기

2012/07/09 - [Linux/Ubuntu] - screen 유틸의 프로세스 구조(?)


Posted by 구차니

DISTCC_HOSTS는 왼쪽 부터 오른쪽 순서로 우선순위가 결정된다.

왼쪽이 가장 선호되는 호스트 이고, 가장 마지막이 선호도가 낮아진다.

그런 이유로 가장 마지막에 localhost를 넣어 주는게 좋다고 한다.


Host Specifications


A "host list" tells distcc which machines to use for compilation. In order, distcc looks in the $DISTCC_HOSTS environment variable, the user's $DISTCC_DIR/hosts file, and the system-wide host file. If no host list can be found, distcc emits a warning and compiles locally.

The host list is a simple whitespace separated list of host specifications. The simplest and most common form is a host names, such as


localhost red green blue

distcc prefers hosts towards the start of the list, so machines should be listed in descending order of speed. In particular, when only a single compilation can be run (such as from a configure script), the first machine listed is used (but see --randomize below). 


--randomize

Randomize the order of the host list before execution.


[링크 : https://linux.die.net/man/1/distcc]

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

rpi distcc with ccache 실패 ㅠㅠ  (0) 2021.04.30
rpi distcc 성공인데 실패  (0) 2021.04.28
distcc-pump 시도..  (0) 2016.10.18
distcc 를 DHCP 에서.. 2?  (0) 2016.10.18
distcc /etc/distcc/hosts와 DISTCC_HOSTS  (0) 2016.10.17
Posted by 구차니

돌아는 가는데.. 

왜 라즈베리만 돌고, odroid_1은 놀고 있지? 흐음...


$ cat /etc/distcc/hosts

# As described in the distcc manpage, this file can be used for a global

# list of available distcc hosts.

#

# The list from this file will only be used, if neither the

# environment variable DISTCC_HOSTS, nor the file $HOME/.distcc/hosts

# contains a valid list of hosts.

#

# Add a list of hostnames in one line, seperated by spaces, here.

#+zeroconf

odroid_1,cpp,lzo

odroid_2,cpp,lzo

raspberrypi,cpp,lzo 


위와 같이 cpp,lzo를 주고 make 하니 이런 경고가 발생하는데

$ make -j12 CC=distcc

distcc[7640] Warning: INCLUDE_SERVER_PORT not set - did you forget to run under 'distcc-pump'?

distcc[7640] (dcc_build_somewhere) Warning: failed to get includes from include server, preprocessing locally 


distcc-pump 를 실행해주면 자동으로 데몬처럼 작동하는데 죽이질 못하네?

$ distcc-pump --startup

export INCLUDE_SERVER_PID='7700'

export INCLUDE_SERVER_DIR='/tmp/distcc-pump.fyGaPI'

export INCLUDE_SERVER_PORT='/tmp/distcc-pump.fyGaPI/socket'

export PATH='/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games'



$ distcc-pump make -j12 CC="distcc gcc -std=gnu99"

__________Using distcc-pump from /usr/bin

__________Using 3 distcc servers in pump mode

  CHK     include/linux/version.h

  CHK     include/generated/kernelversion.h

  HOSTCC  scripts/basic/fixdep


...


  LD      arch/arm/vfp/vfp.o

  LD      arch/arm/vfp/built-in.o

__________Warning: 1 pump-mode compilation(s) failed on server, but succeeded locally.

__________Distcc-pump was demoted to plain mode.  See the Distcc Discrepancy Symptoms section in the include_server(1) man page.

__________Shutting down distcc-pump include server

 


셧다운 해줘도 안 죽어!!! 머지?

$ distcc-pump --help

Usage:

    pump COMMAND [ARG...]

or

    pump --startup

    pump --shutdown 


[링크 : https://lists.samba.org/archive/distcc/2012q4/004315.html]

[링크 : https://wiki.archlinux.org/index.php/Distcc]

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

rpi distcc 성공인데 실패  (0) 2021.04.28
distcc hosts 파일과 순서  (0) 2016.10.19
distcc 를 DHCP 에서.. 2?  (0) 2016.10.18
distcc /etc/distcc/hosts와 DISTCC_HOSTS  (0) 2016.10.17
distcc zeroconf 와 avahi  (0) 2016.10.17
Posted by 구차니

생각을 해보니..

distcc를 구동할때

/etc/default/distcc에서 설정된 값을 통해 listen할 ip를 설정하게 되는데


/etc/hosts에 의해 자기 자신의 이름을 resolve하게 되니

항상 127.0.0.1 밖에 설정이 안될거고


그런 이유로 samba를 통해서 resolve하게 하려고 했더니

/etc/hosts에서 삭제하고


/etc/rc?.d 에서 distcc가 rc.local 보다 일찍 수행되는 바람에

삼바가 구동되기 이전에 distcc 실행되서 자기 자신의 아이피를 resolve 할 수 없는 상황..


그러니까..

'hostname -I'를 이용해서 자기 아이피를 받아 올 수 있으면...

가능하려나?


이것저것 넣어 보는데 안됨 ㅠㅠ

$ vi /etc/init.d/distcc

 55 # construct access list

 56 ALLOW=""

 57 for net in $ALLOWEDNETS

 58 do

 59         ALLOW="$ALLOW --allow $net"

 60 done 


 66 if test -n "$LISTENER"; then

 67         DAEMON_ARGS="$DAEMON_ARGS --listen $LISTENER"

 68 fi

그냥.. distcc init 스크립트를 손봐야 하나?



일단은.. 이 정도로 만족 중.. 집에 가서 여러 대 놓고 해봐야지

$ cat /etc/default/distcc

ALLOWEDNETS=$(printf "%s/24" $(hostname -I))

LISTENER="$(hostname -I)" 


[링크 : http://stackoverflow.com/.../how-can-i-concatenate-string-variables-in-bash]


그래도 서비스로 자동 구동되는건 실패... ㅠㅠ

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

distcc hosts 파일과 순서  (0) 2016.10.19
distcc-pump 시도..  (0) 2016.10.18
distcc /etc/distcc/hosts와 DISTCC_HOSTS  (0) 2016.10.17
distcc zeroconf 와 avahi  (0) 2016.10.17
distcc 를 DHCP 에서..  (0) 2016.09.28
Posted by 구차니

export DISTCC_HOSTS도 좋지만

이렇게 파일로 박아 둘수도 있는데.. 얘가 wins resolve가 가능하려나?

$ cat /etc/distcc/hosts

# As described in the distcc manpage, this file can be used for a global

# list of available distcc hosts.

#

# The list from this file will only be used, if neither the

# environment variable DISTCC_HOSTS, nor the file $HOME/.distcc/hosts

# contains a valid list of hosts.

#

# Add a list of hostnames in one line, seperated by spaces, here.

#+zeroconf

odroid_1,cpp,lzo

odroid_2,cpp,lzo

raspberrypi,cpp,lzo 


$ distcc --show-hosts

odroid_1,cpp,lzo

odroid_2,cpp,lzo

raspberrypi,cpp,lzo 


pump mode 쓰려고 cpp만 넣었더니 lzo도 같이 넣어야 한다고 배짼다 -_-

$ distcc --show-hosts

distcc[6919] (dcc_get_protover_from_features) ERROR: pump mode (',cpp') requires compression (',lzo')

distcc[6919] (dcc_parse_options) ERROR: invalid host options: ,cpp

odroid_2,cpp

raspberrypi,cpp 



커널 빌드 해보니.. 영 되질 않네.. ㅠㅠ

distcc[3645] Warning: INCLUDE_SERVER_PORT not set - did you forget to run under 'distcc-pump'?

distcc[3645] (dcc_build_somewhere) Warning: failed to get includes from include server, preprocessing locally 


[링크 : https://linux.die.net/man/1/include_server]


음.. cpp,lzo 뺴고 하는데 시도는 하는데 받는 쪽에서 배째는 중 ㅠㅠ

distcc[4515] ERROR: nonblocking connect to 192.168.219.139:3632 failed: Connection refused 


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

distcc-pump 시도..  (0) 2016.10.18
distcc 를 DHCP 에서.. 2?  (0) 2016.10.18
distcc zeroconf 와 avahi  (0) 2016.10.17
distcc 를 DHCP 에서..  (0) 2016.09.28
distcc kernel compile 재시도..  (0) 2016.09.28
Posted by 구차니


+zeroconf

This option is only available if distcc was compiled with Avahi support enabled at configure time. When this special entry is present in the hosts list, distcc will use Avahi Zeroconf DNS Service Discovery (DNS-SD) to locate any available distccd servers on the local network. This avoids the need to explicitly list the host names or IP addresses of the distcc server machines. The distccd servers must have been started with the "--zeroconf" option to distccd. An important caveat is that in the current implementation, pump mode (",cpp") and compression (",lzo") will never be used for hosts located via zeroconf. 

[링크 : https://linux.die.net/man/1/distcc]


avahi 데몬이 있어야 zeroconf가 가능하대서 확인해보니 없.. 다?!

ubuntu 14.04 LTS for odroid

$ distcc -v

Using built-in specs.

COLLECT_GCC=/usr/bin/gcc-4.8.real

COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.8/lto-wrapper

Target: arm-linux-gnueabihf

Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.8.4-2ubuntu1~14.04.3' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --disable-libitm --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-armhf/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-armhf --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-armhf --with-arch-directory=arm --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --enable-multilib --disable-sjlj-exceptions --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb --disable-werror --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf

Thread model: posix

gcc version 4.8.4 (Ubuntu/Linaro 4.8.4-2ubuntu1~14.04.3) 


요건 라즈베리 jessie

음따!

$ distcc -v

Using built-in specs.

COLLECT_GCC=cc

COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.9/lto-wrapper

Target: arm-linux-gnueabihf

Configured with: ../src/configure -v --with-pkgversion='Raspbian 4.9.2-10' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libitm --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-armhf/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-armhf --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-armhf --with-arch-directory=arm --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-sjlj-exceptions --with-arch=armv6 --with-fpu=vfp --with-float=hard --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf

Thread model: posix

gcc version 4.9.2 (Raspbian 4.9.2-10) 


고로.. zeroconf는 사용불가!


export DISTCC_HOSTS="+zeroconf"

[링크 : https://wiki.debian.org/Distcc]

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

distcc 를 DHCP 에서.. 2?  (0) 2016.10.18
distcc /etc/distcc/hosts와 DISTCC_HOSTS  (0) 2016.10.17
distcc 를 DHCP 에서..  (0) 2016.09.28
distcc kernel compile 재시도..  (0) 2016.09.28
distcc-pump error  (0) 2016.09.25
Posted by 구차니