2011/05/29

Startup Sequence Example

Startup Sequence of my mini2440 board:

/etc/init.d/rcS
#! /bin/sh PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin: runlevel=S prevlevel=N umask 022 export PATH runlevel prevlevel # # Trap CTRL-C &c only in this shell so we can interrupt subprocesses. # trap ":" INT QUIT TSTP /bin/hostname FriendlyARM /bin/mount -n -t proc none /proc /bin/mount -n -t sysfs none /sys /bin/mount -n -t usbfs none /proc/bus/usb /bin/mount -t ramfs none /dev echo /sbin/mdev > /proc/sys/kernel/hotplug /sbin/mdev -s /bin/hotplug # mounting file system specified in /etc/fstab mkdir -p /dev/pts mkdir -p /dev/shm /bin/mount -n -t devpts none /dev/pts -o mode=0622 /bin/mount -n -t tmpfs tmpfs /dev/shm /bin/mount -n -t ramfs none /tmp /bin/mount -n -t ramfs none /var mkdir -p /var/empty mkdir -p /var/log mkdir -p /var/lock mkdir -p /var/run mkdir -p /var/tmp /sbin/hwclock -s syslogd /etc/rc.d/init.d/netd start echo " " > /dev/tty1 echo "Starting networking..." > /dev/tty1 sleep 1 /etc/rc.d/init.d/httpd start echo " " > /dev/tty1 echo "Starting web server..." > /dev/tty1 sleep 1 /etc/rc.d/init.d/leds start echo " " > /dev/tty1 echo "Starting leds service..." > /dev/tty1 echo " " sleep 1 /sbin/ifconfig lo 127.0.0.1 /etc/init.d/ifconfig-eth0 /bin/qtopia & echo " " > /dev/tty1 echo "Starting Qtopia, please waiting..." > /dev/tty1

DHCP Config

How to configure DHCP client of a embedded Linux device running a busy box?

1. Make sure you have udhcpc installed.
2. Find the configuration file at busybox-1.13.3 (this is the version of udhcp on my platform) /examples/udhcp/sample.renew.
3. Copy a configuration file to /usr/share/udhcpc/default.script, and change the RESOLV_CONF path to /etc/resolv.conf the content of the file looks like below:

#!/bin/sh # Sample udhcpc bound 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 echo -n > $RESOLV_CONF [ -n "$domain" ] && echo domain $domain >> $RESOLV_CONF for i in $dns do echo adding dns $i echo nameserver $i >> $RESOLV_CONF done


4. To get the new ip
#udhcpc eth0

reference:
http://tinyurl.com/3pd45s8

2011/05/24

TFTP configure

yum install tftp tftp-server
mkdir /tftpboot
chmod o+w /tftpboot
/sbin/chkconfig --level 345 xinetd on
/sbin/chkconfig --level 345 tftp on
service xinetd restart

NFS config

Server side

add following lines to /etc/exports
/opt/perth *(rw,no_root_squash,no_all_squash)
/home/xgu/src/ *(rw,no_root_squash,no_all_squash)

service nfs stop
service nfs start


Client Side

mount 10.132.10.87:/opt/perth/refsw/BSEAV/bin /mnt/nfs/


For Ubuntu
to install
# sudo apt-get install nfs-kernel-server

to start service
# sudo /etc/init.d/nfs-kernel-server restart

2011/05/22

Topics to Start

仕事の話
旅、食べ物の話
趣味の話
季節、気候の話
仲が良い人の話
家族の話

Post Code on Blogger

Simplest way to post code to blogger for me: <pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black;overflow-x:...