fdisk /dev/mmcblk0
/dev/mmcblk0p1 * 1 93 502732+ 83 Linux
/dev/mmcblk0p2 94 186 502758 82 Linux swap / Solaris
/dev/mmcblk0p3 187 1475 6968334 83 Linux
mkfs.ext2 /dev/mmcblk0p1
mkswap /dev/mmcblk0p2
mkfs.ext3 /dev/mmcblk0p3
mount /dev/mmcblk0p3 /mnt/mmcblk0p3
cd /mnt/mmcblk0p3
mkdir work
cd work
wget
http://ftp.debian.org/debian/pool/main/d/debootstrap/debootstrap-udeb_1.0.10lenny1_all.udeb
ar -x debootstrap-udeb_1.0.10lenny1_all.udeb
cd /
tar xzf /mnt/mmcblk0p2/work/data.tar.gz
/usr/sbin/debootstrap --arch armel lenny /mnt/mmcblk0p2
http://ftp.jp.debian.org/debian
LANG=C chroot /mnt/mmcblk0p2 /bin/bash
mount /proc
cd /dev
MAKEDEV generic
mknod mmcblk0 b 179 0
mknod mmcblk0p1 b 179 1
mknod mmcblk0p3 b 179 2
chmod 660 mmcblk0*
cat > /etc/fstab
/dev/mmcblk0p3 / ext3 defaults 0 1
/dev/mmcblk0p1 /boot ext2 ro,nosuid,nodev 0 2
proc /proc proc defaults 0 0
/dev/mmcblk0p2 swap swap defaults 0 0
#/dev/sda4 /mnt/sda4 ext3 defaults 0 2cat >> interfaces
# We always want the loopback interface.
#
auto lo
iface lo inet loopback
# To use fixed ip address
#
auto eth0
iface eth0 inet static
address 192.168.xxx.xxx
network 192.168.xxx.0
netmask 255.255.255.0
broadcast 192.168.xxx.255
gateway 192.168.xxx.xxx
cat /etc/resolv.conf
echo sheevaSD > /etc/hostname
cat > /etc/hosts
127.0.0.1 localhost sheevaSD
ifconfig eth0 down
ifconfig eth0 up
cat >> /etc/apt/sources.list
deb http://security.debian.org/ lenny/updates main
deb-src http://security.debian.org/ lenny/updates main
aptitude update
aptitude install locales
dpkg-reconfigure locales
ja_JP.EUC-JP, ja_JP.UTF-8 を選択し、デフォルトは NONEとした。
dpkg-reconfigure tzdata
Asia → Tokyo を設定
tasksel install standard
aptitude clean
aptitude install vim
vim /etc/vim/vimrc
syntax on
exit
reboot
まずは、uImageはNANDで、rootはSDカードからロードしてみます。
setenv bootargs console=ttyS0,115200 mtdparts=nand_mtd:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs) rw root=/dev/mmcblk0p3 rw ip=10.93.63.50:10.93.63.49:10.93.63.49:255.255.255.0:DB88FXX81:eth0:none
saveenv
reset
apt-get update
apt-get upgrade
apt-get install openssh-server ntp ntpdate
apt-get install bzip2 unzip udev
apt-get install gcc make libc-dev libc6-dev patch devio libncurses5 libncurses5-dev mtd-tools uboot-mkimage
adduser hoge
addgroup ggg
vim sshd_config
port nnnnn
PermitRootLogin no
PubkeyAuthentication yes
PasswordAuthentication no
/etc/init.d/ssh restart
login hoge
ssh-keygen
cd /home/hoge/.ssh
mv id_rsa.pub authorized_keys
id_rsaをclientにcopy
開発関連モジュールの導入
apt-get install gcc make libc6-dev patch devio libncurses5 libncurses5-dev mtd-tools uboot-mkimage
vi /etc/hosts
127.0.0.1 localhost sheevaSD
192.168.0.52 sheevaSD
vim /etc/hosts.allow
ALL: 127.0.0.1
sshd: 192.168.yyy.
sshd: 192.168.xxx.zzz
sshd: 192.168.xxx.yyy
sshd: 192.168.xxx.zzz
sshd: *.yyy.xxx.hate.com
vim /etc/hosts.deny
ALL: ALL
apt-get install samba
Workgroup/Domain Name:WORKGROUP
Modify smb.conf to use WINS settings from DHCP? ⇒ NO
vim /etc/samba/smb.conf
[toshiki_share]
comment = hoge share
read only = no
locking = no
path = /mnt/sda4/mnt/share/hoge
guest ok = no
/etc/init.d/samba restart
smbpasswd hoge
dpkg-reconfigure locales
ja_JP.UTF-8
dpkg-reconfigure exim4-config
General type of mail configuration: mail sent by smarthost; received via SMTP or fetchmail
System mail name: hostname
IP-addresses to listen on for incoming SMTP connections: 127.0.0.1
Other destinations for which mail is accepted: hostname
Machines to relay mail for:
IP address or host name of the outgoing smarthost: smtp.example.com::587
Hide local mail name in outgoing mail? YES
Visible domain name for local users: hostname
Keep number of DNS-queries minimal (Dial-on-Demand)? NO
Delivery method for local mail: mbox format in /var/mail/
Split configuration into small files? NO
Root and postmaster mail recipient:
cat /etc/exim4/update-exim4.conf.conf
dc_eximconfig_configtype='smarthost'
dc_other_hostnames='hostname'
dc_local_interfaces='127.0.0.1'
dc_readhost='hostname'
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets=''
dc_smarthost='smtp.example.com::587'
CFILEMODE='644'
dc_use_split_config='false'
dc_hide_mailname='true'
dc_mailname_in_oh='true'
dc_localdelivery='mail_spool'
vim /etc/email-addresses
root: hostname_sysadmin@domain.com
hoge: hostname_hoge@domain.com
vim /etc/exim4/passwd.client
smtp.example.com:login:password
vim /etc/aliases
root: hoge@example.com
newaliases
/etc/init.d/exim4 start
atp-get install logwatch
mkdir /var/cache/logwatch
vim /usr/share/logwatch/default.conf/logwatch.conf
Detail = High
/usr/sbin/logwatch --mailto root
apt-get install sudo
sudo制限
visudo
# User privilege specification
root ALL=(ALL) ALL
hoge ALL=(ALL) ALL