설명은 콘솔 출력을 /dev/console에서 다른걸로 돌려주는거라는데
kernel 부팅 인자로 console=ttyS0,115200n8 이런걸 넣어줘서
telnet 포트로 돌려줄려고 하니 안되는건 여전한듯..

# setconsole --help
BusyBox v1.14.2 (2011-01-24 14:35:28 KST) multi-call binary

Usage: setconsole [-r|--reset] [DEVICE]

Redirect system console output to DEVICE (default: /dev/tty)

Options:
        -r      Reset output to /dev/console 

# tty
/dev/pts/0

# setconsole /dev/pts/0
setconsole: TIOCCONS: Device or resource busy 


 
신고

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

busybox su가 안될 경우  (0) 2014.12.05
busybox tftp  (0) 2013.06.18
busybox - setconsole  (0) 2011.10.21
busybox ash "cannot open /dev/ttyAS1: no such device"  (0) 2010.04.20
busybox ps는 BSD 스타일?  (0) 2010.01.12
ifup / ifdown 을 통한 static <-> dhcp 변환  (0) 2009.12.29
Posted by 구차니

댓글을 달아 주세요

원인은 못찾았지만, 커널 옵션에서 quiet 주어도 나오길래, 최소한 커널 오류는 아닌것으로 판단
busybox에서 찾아보니

./shell/ash.c:4849:     ash_msg_and_raise_error("cannot open %s: %s", fname, errmsg(errno, "no such file"));

한녀석이 걸려 나온다.

특이한건, 이 소스가 있는 부분은 openredirect라는 함수.
음.. 머하는 녀석일려나?

static int
openredirect(union node *redir)
{
    char *fname;
    int f;

    switch (redir->nfile.type) {
    case NFROM:
        fname = redir->nfile.expfname;
        f = open(fname, O_RDONLY);
        if (f < 0)
            goto eopen;
        break;
    case NFROMTO:
        fname = redir->nfile.expfname;
        f = open(fname, O_RDWR|O_CREAT|O_TRUNC, 0666);
        if (f < 0)
            goto ecreate;
        break;
    case NTO:
        /* Take care of noclobber mode. */
        if (Cflag) {
            fname = redir->nfile.expfname;
            f = noclobberopen(fname);
            if (f < 0)
                goto ecreate;
            break;
        }
        /* FALLTHROUGH */
    case NCLOBBER:
        fname = redir->nfile.expfname;
        f = open(fname, O_WRONLY|O_CREAT|O_TRUNC, 0666);
        if (f < 0)
            goto ecreate;
        break;
    case NAPPEND:
        fname = redir->nfile.expfname;
        f = open(fname, O_WRONLY|O_CREAT|O_APPEND, 0666);
        if (f < 0)
            goto ecreate;
        break;
    default:
#if DEBUG
        abort();
#endif
        /* Fall through to eliminate warning. */
    case NTOFD:
    case NFROMFD:
        f = -1;
        break;
    case NHERE:
    case NXHERE:
        f = openhere(redir);
        break;
    }

    return f;
 ecreate:
    ash_msg_and_raise_error("cannot create %s: %s", fname, errmsg(errno, "nonexistent directory"));
 eopen:
    ash_msg_and_raise_error("cannot open %s: %s", fname, errmsg(errno, "no such file"));
}


2010.04.21 추가
inittab에 ttyAS1을 초기화 하는 부분이 있었는데, 커널에서(?) 사용하지 않도록 해놔서 계속 에러가 난 모양이다.
아무튼, /bin/sh에 ttyAS1을 열도록 해놓았기 때문에, busybox에서 ash이 sh을 대체하고,
그러다 보니 ash에서 에러발생. 머.. 문제 해결 끝!

$ cat target/etc/inittab
# Example Busybox inittab
::sysinit:/etc/init.d/rcS
ttyAS0::askfirst:/bin/sh
ttyAS1::askfirst:/bin/sh
::ctrlaltdel:/sbin/reboot
::shutdown:/sbin/swapoff -a
::shutdown:/bin/umount -a -r
::restart:/sbin/init

신고

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

busybox tftp  (0) 2013.06.18
busybox - setconsole  (0) 2011.10.21
busybox ash "cannot open /dev/ttyAS1: no such device"  (0) 2010.04.20
busybox ps는 BSD 스타일?  (0) 2010.01.12
ifup / ifdown 을 통한 static <-> dhcp 변환  (0) 2009.12.29
udhcpd 용 interface 예제  (0) 2009.12.23
Posted by 구차니

댓글을 달아 주세요

프로그램 사용/VLC2010.02.02 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
VLC 1.0.4 cross compile + busybox  (0) 2010.02.02
의미는 없는 Linux / Windows VLC 차이  (0) 2010.01.26
VLC로 youtube 동영상 감상하기  (0) 2010.01.26
youtube mobile on VLC  (0) 2010.01.18
Posted by 구차니

댓글을 달아 주세요

# ps
  PID USER       VSZ STAT COMMAND
    1 root      3120 S    init
    2 root         0 SW<  [ksoftirqd/0]
    3 root         0 SW   [watchdog/0]
    4 root         0 SW<  [events/0]

STAT의 값들을 보면 ps의 BSD style의 내용과 같다.

PROCESS STATE CODES
Here are the different values that the s, stat and state output specifiers (header "STAT" or "S") will display to
describe the state of a process.
D    Uninterruptible sleep (usually IO)
R    Running or runnable (on run queue)
S    Interruptible sleep (waiting for an event to complete)
T    Stopped, either by a job control signal or because it is being traced.
W    paging (not valid since the 2.6.xx kernel)
X    dead (should never be seen)
Z    Defunct ("zombie") process, terminated but not reaped by its parent.

For BSD formats and when the stat keyword is used, additional characters may be displayed:
<    high-priority (not nice to other users)
N    low-priority (nice to other users)
L    has pages locked into memory (for real-time and custom IO)
s    is a session leader
l    is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)
+    is in the foreground process group

그냥.. 안드로메다 스타일인가? -ㅁ-

아무튼, busybox의 ps에는 priority가 나오지 않는다.
이경우 수작업으로 확인하려면, /proc/{pid}/stat의 19번째 항목을 확인하면 된다.

stat - Status information about the process used by the ps(1) command. Fields are:

1. pid - Process id
2. comm - The executable filename
3. state - R (running), S(sleeping interruptable), D(sleeping), Z(zombie), or T(stopped on a signal).
4. ppid - Parent process ID
5. pgrp - Process group ID
6. session - The process session ID.
7. tty - The tty the process is using
8. tpgid - The process group ID of the owning process of the tty the current process is connected to.
9. flags - Process flags, currently with bugs
10. minflt - Minor faults the process has made
11. cminflt - Minor faults the process and its children have made.
12. majflt
13. cmajflt
14. utime - The number of jiffies (processor time) that this process has been scheduled in user mode
15. stime - in kernel mode
16. cutime - This process and its children in user mode
17. cstime - in kernel mode
18. counter - The maximum time of this processes next time slice.
19. priority - The priority of the nice(1) (process priority) value plus fifteen.
20. timeout - The time in jiffies of the process's next timeout.
21. itrealvalue - The time in jiffies before the next SIGALRM is sent to the process because of an internal timer.
22. starttime - Time the process started after system boot
23. vsize - Virtual memory size
24. rlim - Current limit in bytes of the rss of the process.
25. startcode - The address above which program text can run.
26. endcode - The address below which program text can run.
27. startstack - The address of the start of the stack
28. kstkesp - The current value of esp for the process as found in the kernel stack page.
29. kstkeip - The current 32 bit instruction pointer, EIP.
30. signal - The bitmap of pending signals
31. blocked - The bitmap of blocked signals
32. sigignore - The bitmap of ignored signals
33. sigcatch - The bitmap of catched signals
34. wchan - The channel in which the process is waiting. The "ps -l" command gives somewhat of a list.

[링크 : http://www.comptechdoc.org/os/linux/howlinuxworks/linux_hlproc.html]

# cat /proc/2/stat
2 (ksoftirqd/0) S 1 1 1 0 -1 32832 0 0 0 0 0 332 0 0 10 -5 1 0 5 0 0 4294967295 0 0 0 0 0 0 2147483647 0 0 2314662996 0 0 17 0 0 0

아무튼 이녀석은 -5 nice 값을 가지고, 0보다 우선권을 가지므로 ps에서
<를 출력해서 다른 것들보다 우선순위가 높음을 나타낸다.
신고
Posted by 구차니

댓글을 달아 주세요

busybox에서 라고 해야 하나,
아무튼, busybox의 경우에는 커널에서 부팅시에 ip를 설정한다.

TCP bic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
stmmaceth_open: MAC address 00:fa:e0:fa:e0:59
stmmac_init_phy: phy_id=0:03, phy_addr=0x3
IP-Config: Complete:
      device=eth0, addr=192.168.10.116, 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.10, rootpath=
Looking up port of RPC 100003/2 on 192.168.10.10
PHY: 0:03 - Link is Up - 100/Full
Looking up port of RPC 100005/1 on 192.168.10.10
VFS: Mounted root (nfs filesystem) readonly.
Freeing unused kernel memory: 100k freed
  Vendor: AXXEN     Model: SKYMIRROR         Rev: 1.00
  Type:   Direct-Access                      ANSI SCSI revision: 02
SCSI device sda: 4016128 512-byte hdwr sectors (2056 MB)
sda: assuming Write Enabled
sda: assuming drive cache: write through
SCSI device sda: 4016128 512-byte hdwr sectors (2056 MB)
sda: assuming Write Enabled
sda: assuming drive cache: write through
 sda: sda1
sd 1:0:0:0: Attached scsi removable disk sda
Welcome to STLinux BusyBox system

머.. 이건 중요한게 아니고, 아무튼, ifdown을 통해서 죽이고
ifup을 통해서 올리려고 하는데, ifup시 static ip가 설정이 되지 않고
초기 kernel argument로 넘긴 값으로 부팅이 되는 문제가 있다.

검색을 해보니

Re: ETH0 already configured durring boot
The U-boot uses its own network driver and only the MAC address set up by the U-boot affects the network driver under Linux.

The network is started by the script /etc/init.d/networking in Debian/Emdebian distribution.  The soft links are used in each run level start up directories /etc/rcX.d, where X is run level 0, 1, 2, etc.  The normal run level is 3.  You can remove the link in the directory to disable the network start up.

The text file /etc/network/interfaces configures the network interfaces.  It should be something like,

auto eth0
iface eth0 inet dhcp

You can also just remove everything in this file to disable the automatic start up of the network.

[링크 : http://glomation.net/smf/index.php?topic=111.0]

라고 되어있는데, 일단 커널레벨에서 설정하는 것과는 별개의 문제이다.

# cat /etc/network/interfaces
######################################################################
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
#
# A "#" character in the very first column makes the rest of the line
# be ignored. Blank lines are ignored. Lines may be indented freely.
# A "\" character at the very end of the line indicates the next line
# should be treated as a continuation of the current one.
#
# The "pre-up", "up", "down" and "post-down" options are valid for all
# interfaces, and may be specified multiple times. All other options
# may only be specified once.
#
# See the interfaces(5) manpage for information on what options are
# available.
######################################################################

# We always want the loopback interface.
#
# auto lo
# iface lo inet loopback

# An example ethernet card setup: (broadcast and gateway are optional)
#
# auto eth0
# iface eth0 inet static
#     address 192.168.0.42
#     network 192.168.0.0
#     netmask 255.255.255.0
#     broadcast 192.168.0.255
#     gateway 192.168.0.1

# A more complicated ethernet setup, with a less common netmask, and a downright
# weird broadcast address: (the "up" lines are executed verbatim when the
# interface is brought up, the "down" lines when it's brought down)
#
# auto eth0
# iface eth0 inet static
#     address 192.168.1.42
#     network 192.168.1.0
#     netmask 255.255.255.128
#     broadcast 192.168.1.0
#     up route add -net 192.168.1.128 netmask 255.255.255.128 gw 192.168.1.2
#     up route add default gw 192.168.1.200
#     down route del default gw 192.168.1.200
#     down route del -net 192.168.1.128 netmask 255.255.255.128 gw 192.168.1.2

# A more complicated ethernet setup with a single ethernet card with
# two interfaces.
# Note: This happens to work since ifconfig handles it that way, not because
# ifup/down handles the ':' any differently.
# Warning: There is a known bug if you do this, since the state will not
# be properly defined if you try to 'ifdown eth0' when both interfaces
# are up. The ifconfig program will not remove eth0 but it will be
# removed from the interfaces state so you will see it up until you execute:
# 'ifdown eth0:1 ; ifup eth0; ifdown eth0'
# BTW, this is "bug" #193679 (it's not really a bug, it's more of a
# limitation)
#
# auto eth0 eth0:1
# iface eth0 inet static
#     address 192.168.0.100
#     network 192.168.0.0
#     netmask 255.255.255.0
#     broadcast 192.168.0.255
#     gateway 192.168.0.1
# iface eth0:1 inet static
#     address 192.168.0.200
#     network 192.168.0.0
#     netmask 255.255.255.0

# "pre-up" and "post-down" commands are also available. In addition, the
# exit status of these commands are checked, and if any fail, configuration
# (or deconfiguration) is aborted. So:
#
# auto eth0
# iface eth0 inet dhcp
#     pre-up [ -f /etc/network/local-network-ok ]
#
# will allow you to only have eth0 brought up when the file
# /etc/network/local-network-ok exists.

# Two ethernet interfaces, one connected to a trusted LAN, the other to
# the untrusted Internet. If their MAC addresses get swapped (because an
# updated kernel uses a different order when probing for network cards,
# say), then they don't get brought up at all.
#
# auto eth0 eth1
# iface eth0 inet static
#     address 192.168.42.1
#     netmask 255.255.255.0
#     pre-up /path/to/check-mac-address.sh eth0 11:22:33:44:55:66
#     pre-up /usr/local/sbin/enable-masq
# iface eth1 inet dhcp
#     pre-up /path/to/check-mac-address.sh eth1 AA:BB:CC:DD:EE:FF
#     pre-up /usr/local/sbin/firewall

# Two ethernet interfaces, one connected to a trusted LAN, the other to
# the untrusted Internet, identified by MAC address rather than interface
# name:
#
# auto eth0 eth1
# mapping eth0 eth1
#     script /path/to/get-mac-address.sh
#     map 11:22:33:44:55:66 lan
#     map AA:BB:CC:DD:EE:FF internet
# iface lan inet static
#     address 192.168.42.1
#     netmask 255.255.255.0
#     pre-up /usr/local/sbin/enable-masq $IFACE
# iface internet inet dhcp
#     pre-up /usr/local/sbin/firewall $IFACE

# A PCMCIA interface for a laptop that is used in different locations:
# (note the lack of an "auto" line for any of these)
#
# mapping eth0
#    script /path/to/pcmcia-compat.sh
#    map home,*,*,*                  home
#    map work,*,*,00:11:22:33:44:55  work-wireless
#    map work,*,*,01:12:23:34:45:50  work-static
#
# iface home inet dhcp
# iface work-wireless bootp
# iface work-static static
#     address 10.15.43.23
#     netmask 255.255.255.0
#     gateway 10.15.43.1
#
# Note, this won't work unless you specifically change the file
# /etc/pcmcia/network to look more like:
#
#     if [ -r ./shared ] ; then . ./shared ; else . /etc/pcmcia/shared ; fi
#     get_info $DEVICE
#     case "$ACTION" in
#         'start')
#             /sbin/ifup $DEVICE
#             ;;
#         'stop')
#             /sbin/ifdown $DEVICE
#             ;;
#     esac
#     exit 0

# An alternate way of doing the same thing: (in this case identifying
# where the laptop is is done by configuring the interface as various
# options, and seeing if a computer that is known to be on each particular
# network will respond to pings. The various numbers here need to be chosen
# with a great deal of care.)
#
# mapping eth0
#    script /path/to/ping-places.sh
#    map 192.168.42.254/24 192.168.42.1 home
#    map 10.15.43.254/24 10.15.43.1 work-wireless
#    map 10.15.43.23/24 10.15.43.1 work-static
#
# iface home inet dhcp
# iface work-wireless bootp
# iface work-static static
#     address 10.15.43.23
#     netmask 255.255.255.0
#     gateway 10.15.43.1
#
# Note that the ping-places script requires the iproute package installed,
# and the same changes to /etc/pcmcia/network are required for this as for
# the previous example.


# Set up an interface to read all the traffic on the network. This
# configuration can be useful to setup Network Intrusion Detection
# sensors in 'stealth'-type configuration. This prevents the NIDS
# system to be a direct target in a hostile network since they have
# no IP address on the network. Notice, however, that there have been
# known bugs over time in sensors part of NIDS (for example see
# DSA-297 related to Snort) and remote buffer overflows might even be
# triggered by network packet processing.
#
# auto eth0
# iface eth0 inet manual
#     up ifconfig $IFACE 0.0.0.0 up
#       up ip link set $IFACE promisc on
#       down ip link set $IFACE promisc off
#       down ifconfig $IFACE down

# Set up an interface which will not be allocated an IP address by
# ifupdown but will be configured through external programs. This
# can be useful to setup interfaces configured through other programs,
# like, for example, PPPOE scripts.
#
# auto eth0
# iface eth0 inet manual
#       up ifconfig $IFACE 0.0.0.0 up
#       up /usr/local/bin/myconfigscript
#       down ifconfig $IFACE down

/etc/network/interfaces는 ifup / ifdown 에서 사용하는 내용으로 저러면 된다는데...
결국 미궁이다.. 후우...

[링크 : http://www.annodex.net/cgi-bin/man/man2html?interfaces]
[링크 : http://www.annodex.net/cgi-bin/man/man2html?8+ifup]
[링크 : http://www.annodex.net/cgi-bin/man/man2html?8+ifdown]


신고
Posted by 구차니

댓글을 달아 주세요

Linux2009.08.06 17:22
# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.10.0    *               255.255.255.0   U     0      0        0 eth0
default         192.168.10.1    0.0.0.0         UG    0      0        0 eth0

route 명령은 라우팅 테이블에 추가/삭제를 하는데 사용된다.
일단 눈에 들어 오는것은 Flags로 U / UG 라는 것이 있다.

       Flags  Possible flags include
              U (route is up)
              H (target is a host)
              G (use gateway)
              R (reinstate route for dynamic routing)
              D (dynamically installed by daemon or redirect)
              M (modified from routing daemon or redirect)
              A (installed by addrconf)
              C (cache entry)
              !  (reject route)

이러한 의미인데, UG라고 되어 있으면, route is up / use gateway라는 의미이다.
간단하게, 이 녀석이 게이트웨이라는 의미로 받아들이면 될 듯 하다.

아무튼,
ip route flush all로 모든 라우팅 테이블을 비우고 나서
route add default dev eth0를 하면

# route add default dev eth0
# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         *               0.0.0.0         U     0      0        0 eth0

이렇게 Genmask 값도 다르고, Flags도 U로 체크가 된다.

아무튼 의도대로 UG가 찍히게 하려면,
조금은 거리가 멀어 보이는 ifconfig를 이용해야 한다.

udhcpc의 default.script 내용인데
#!/bin/sh
# Sample udhcpc renew script

RESOLV_CONF="/etc/resolv.conf"

[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
[ -n "$subnet" ] && NETMASK="netmask $subnet"

/sbin/ifconfig $interface $ip $BROADCAST $NETMASK

if [ -n "$router" ]
then
        echo "deleting routers"
        while /sbin/route del default gw 0.0.0.0 dev $interface
        do :
        done

        metric=0
        for i in $router
        do
                /sbin/route add default gw $i dev $interface metric $((metric++))
        done
fi

이런식으로 라우팅 테이블을 추가하게 된다.



결론 : IP 관련 설정은 ifconfig - route 순으로 진행하면 된다.

----
2011.11.08 추가
여기서보면 flag 상태가 있는데 여기서 flag값의 의미는 다음과 같습니다.

U = Route is "UP"
H = Route is for a single host
G = Route requires a hop across a gateway

즉 다시 말씀드리자면 UP은 destination까지의 경로가 살아있다는 얘기입니다. 거의 대부분은 다 UP상태입니다. 그리고 H는 destination이 network 주소가 아니라 single host일 경우가 됩니다. 그리고 G는 destination까지의 경로가 router를 거친다는것을 의미합니다. 그리고 U만 있는경우는 destination이 network주소일 경우입니다.
 
[링크 : http://h30499.www3.hp.com/t5/HP-UX/route-add-및-delete-에-관한-자료/td-p/1165815?profile.language=ko ] 



신고
Posted by 구차니

댓글을 달아 주세요

제목이랑은 조금 심하게 다르지만..

busybox-1.10.1/networking/ping.c 의 소스를 보면
enum {
    DEFDATALEN = 56,
    MAXIPLEN = 60,
    MAXICMPLEN = 76,
    MAXPACKET = 65468,
    MAX_DUP_CHK = (8 * 128),
    MAXWAIT = 10,
    PINGINTERVAL = 1, /* 1 second */
};

라는 부분에 timeout 10초와 핑간격 1초가 정의되어 있다.
어짜피 alarm() 함수가 integer 만 받아서 소수점은 무리이므로
ping -c 를 이용하여 빠르게 핑 테스트는 힘들듯 하다.

다른 방법으로 접근을 하자면,
ping -c 1 ... ; ping -c 1 ...
이런식의 명령행으로 할 경우 1초 간격없이 빠르게 핑을 연속으로 보낼 수 있다.
신고
Posted by 구차니

댓글을 달아 주세요

Linux2009.07.31 18:59
ip - show / manipulate routing, devices, policy routing and tunnels

   ip route flush - flush routing tables
       this command flushes routes selected by some criteria.

       The arguments have the same syntax and semantics as the arguments of ip route show, but routing  tables  are  not
       listed but purged.  The only difference is the default action: show dumps all the IP main routing table but flush
       prints the helper page.

       With the -statistics option, the command becomes verbose. It prints out the number of deleted routes and the num-
       ber  of  rounds  made to flush the routing table. If the option is given twice, ip route flush also dumps all the
       deleted routes in the format described in the previous subsection.

ip link show [ DEVICE ]
ip route { list | flush } SELECTOR

ip route flush [dev]
라고 하면 한번에 플러시가 된다...

ex) ip route flush eth0

--------------
2009.08.05 해보니 안된다... ㄱ- 뭥미?

ip route flush all
하니 전체 플러시가 된다...(먼산)
신고
Posted by 구차니

댓글을 달아 주세요

  1. 대학시절 개발자가 되는게 꿈이었던 시절이 있었습니다.
    세상에 좀 눈을 뜨면서 인생관이 바뀌게 됐지만...
    구차니님의 포스팅을 접하면 알아먹지는 못해도..괜히...멋있어 보이네요..
    좋은밤 보내시고..즐거운 8월 맞으세요.

    2009.08.01 00:09 신고 [ ADDR : EDIT/ DEL : REPLY ]
    • 멋진건.. 아마도 살려고 아둥바둥 하는 모습이기 때문이 아닐까요? ㅎㅎ

      솔찍히 제 블로그는 지식의 외부저장장소로 사용이 되고 있답니다 ^^;(그래서 사람들이 안와요 ㅠ.ㅠ)

      2009.08.01 00:39 신고 [ ADDR : EDIT/ DEL ]
  2. 아 저렇게 라우팅테이블 날리는군요 좋은 정보감사해요 ㅎ

    2009.08.03 12:02 신고 [ ADDR : EDIT/ DEL : REPLY ]
    • 위에 적어 놨지만 인자가 다른지 busybox에서는 되는데, 보통의 시스템에서는 안되더라구요 ㅠ.ㅠ 한번 확인해봐야겠어요

      2009.08.03 12:28 신고 [ ADDR : EDIT/ DEL ]


#!/bin/sh

/bin/run-parts --arg=$1 /etc/udhcpc.d

[링크 : http://www.doit.org/udhcpc/udhcpc.script]

#!/bin/sh
# /etc/init.d/udhcpc: start or stop udhcpc client

set -e

PATH=/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/sbin/udhcpc

test -x $DAEMON || exit 0

case "$1" in
  start)
    echo -n "Starting DHCP client: udhcpc"
    start-stop-daemon --start --quiet --exec $DAEMON \
      -- --script=/etc/udhcpc.script || echo -n " already running"
    echo "."
  ;;

  restart)
    /etc/init.d/udhcpc stop
    /etc/init.d/udhcpc start
  ;;

  reload)
  ;;

  force-reload)
  ;;

  stop)
    echo -n "Stopping DHCP client: udhcpc"
    start-stop-daemon --stop --quiet --exec $DAEMON || echo -n " not running"
    echo "."
  ;;

  renew)
    start-stop-daemon --signal USR1 --stop --quiet --exec $DAEMON || echo -n " not running"
  ;;

  release)
    start-stop-daemon --signal USR2 --stop --quiet --exec $DAEMON || echo -n " not running"
  ;;

  *)
    echo "Usage: /etc/init.d/udhcpc {start|stop|restart|reload|force-reload}"
    exit 1
    ;;
esac

exit 0

[링크 : http://www.doit.org/udhcpc/udhcpc]

[링크 : http://www.doit.org/udhcpc/]
신고
Posted by 구차니

댓글을 달아 주세요

  1. ㅇㅇ

    자세히좀 적어놔라

    2009.08.01 03:08 신고 [ ADDR : EDIT/ DEL : REPLY ]

menu 'Build Options'

config CONFIG_STATIC
    bool "Build BusyBox as a static binary (no shared libs)"
    default n
    help
      If you want to build a static BusyBox binary, which does not
      use or require any shared libraries, then enable this option.
      This can cause BusyBox to be considerably larger, so you should
      leave this option false unless you have a good reason (i.e.
      your target platform does not support shared libraries, or
      you are building an initrd which doesn't need anything but
      BusyBox, etc).

      Most people will leave this set to 'N'.

[링크 : http://stablebox.googlecode.com/svn/trunk/Config.in]

비지박스를 컴파일 하면, 용량이 생각보다 크다.
이 경우에는 위의 옵션을 꺼주면 컴팩트해진다.

1.10.4 기준으로 1.6M에서 600K 정도로 용량이 줄어드는데,
확신할 수는 없지만, 이 옵션을 사용했기 때문에 DNS resolv를 하지 못하는 것 같다.
busybox에서 ping이나 telnet 이 resolv 실패가 뜨면

libresolv.so
libdns.so

를 복사 해주면 되는데, 이 옵션의 영향이 아닐까 생각이된다.
신고
Posted by 구차니

댓글을 달아 주세요