|
1 Introduction
Installation de l'environnement de boot des cartes processeur sur un portable UBUNTU,
puis sur les 2 pizza boxes qui seront envoyées en Namibie.
2 Portable Ubuntu
Cette installation permet de simuler l'environnement en vu d'effectuer des développement un châssis en Allemagne.
2.1 Environnement
2.2 Serveur TFTP
- Installation
# apt-get install tftpd
# ln -s /media/sda2/hess/tftp /tftpboot
# mkdir -p /media/sda2/hess/tftp
# cd !$
# ln -s /media/sda2/hess/target15/zImage.rio zImage15
- Configuration : fichier /etc/inetd.conf
tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /tftpboot
- Test
# tail -f /var/log/daemon.log
remote$ tftp 134.158.153.212
tftp> get /tftpboot/zImage15
Received 1379043 bytes in 0.8 seconds
tftpd: trying to get file: /tftpboot/zImage15
tftpd: read: Connection refused
tftp> ^D
remote$ md5sum zImage15
2.3 Serveur NFS
- Installation
# apt-get install nfs-kernel-server
# cd /media/sda2/hess
# ssh root@192.168.1.9 "cd /opt/CES/shl-3.2.3/eldk && tar -zcf - ppc_74xx_c15" | tar -zxf -
# ln -s ppc_74xx_c15 target15
# ln -s /media/sda2/hess /opt/CES
# sed -i -e "s!/home/!/opt/ces/home/!" /media/sda2/hess/target15/etc/fstab.local
- Configuration : fichier /etc/exports
/media/sda2/hess/target15 *(rw,no_root_squash,no_all_squash)
/media/sda2/hess/home *(rw,sync,no_root_squash,no_all_squash)
- Test
# /etc/init.d/nfs-kernel-server restart
# exportfs
# tail -f /var/log/daemon.log
remote# mkdir dir
remote# mount -t nfs 134.158.153.212:/opt/CES/target15 dir
mountd[5370]: authenticated mount request...
remote# umount dir
mountd[5370]: authenticated unmount request...
remote# mount -t nfs 134.158.153.212:/opt/CES/home/guevara dir
2.4 Changer d'IP
Le portable simule les 2 serveurs N1N9 et N1N3.
3 Pizza Boxes
Il s'agit de copier puis migrer l'environnement de développement présent sur N1N9 sur les 2 pizza box N1N40 et N1N41.
3.1 Environnement
3.2 Serveur TFTP
Attention, le réseau hess est protégé par un firerwall sur n1n3.
A priori le trafic tftp passe depuis n1n9 vers l'extérieur seulement (pas depuis n1n40 et n1n41).
- Installation
# rpm -qa | grep tftp
# yum search tftp
# yum install tftp.i686 tftp-server.i686
Installing : 2:xinetd-2.3.14-28.fc12.i686
Installing : tftp-0.49-5.fc12.i686
Installing : tftp-server-0.49-5.fc12.i686
# rpm -qa | grep tftp
# ln -s /data/tftp /tftpboot
# mkdir /data/tftp
# cd !$
# for i in 12 13 14 15 16 17; do ln -s /data/CES/target$i/zImage.rio zImage$i; done
# yum install tftp.x86_64
- Configuration : fichier /etc/xinetd.d/tftp
Attention aux parametres server_args et disable :
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
# server_args = -s /var/lib/tftpboot
server_args = /tftpboot -v
disable = no
per_source = 11
cps = 100 2
flags = IPv4
}
- Firewall : il faut ouvrir le port 69.
# system-config-firewall
Firewall: [*] Enabled
Customize
[*] TFTP
Close
OK
Yes
- Test
# /etc/init.d/xinetd stop
# killall in.tftpd
# touch toto.txt
# /usr/sbin/in.tftpd -L
camera15$ tftp n1n40
tftp> get /tftpboot/toto.txt
Received 10 bytes in 0.1 seconds
# tail -f /var/log/messages
in.tftpd[]: tftpd: read(ack): Connection refused
# /etc/init.d/xinetd start
camera15$ tftp n1n40
tftp> get /tftpboot/zImage15
in.tftpd[]: RRQ from 192.168.1.166 filename /tftpboot/zImage15
tftp> ^D
remote$ md5sum zImage15
3.3 Serveur NFS
- Installation
# cd /opt/
# ln -s /data/CES CES
- Configuration : fichier /etc/exports
/data/CES/target10 192.168.1.0/255.255.255.0(rw,no_root_squash,no_all_squash)
/data/CES/target11 192.168.1.0/255.255.255.0(rw,no_root_squash,no_all_squash)
/data/CES/target12 192.168.1.0/255.255.255.0(rw,no_root_squash,no_all_squash)
/data/CES/target13 192.168.1.0/255.255.255.0(rw,no_root_squash,no_all_squash)
/data/CES/target14 192.168.1.0/255.255.255.0(rw,no_root_squash,no_all_squash)
/data/CES/target15 192.168.1.0/255.255.255.0(rw,no_root_squash,no_all_squash)
/data/CES/target16 192.168.1.0/255.255.255.0(rw,no_root_squash,no_all_squash)
/data/CES/target17 192.168.1.0/255.255.255.0(rw,no_root_squash,no_all_squash)
/data/CES/target19 192.168.1.0/255.255.255.0(rw,no_root_squash,no_all_squash)
- Firerwall: attention, NFSD utilise des ports dynamiques.
Decommenter les ports par default dans le fichier /etc/sysconfig/nfs :
LOCKD_TCPPORT=32803
LOCKD_UDPPORT=32769
MOUNTD_PORT=892
STATD_PORT=662
Ajouter ces ports aux regles du firewall dans le fichier /etc/sysconfig/iptables :
# NFS
-A INPUT -m state --state NEW -m tcp -p tcp --dport 111 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 111 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 662 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 662 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 892 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 892 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 2049 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 2049 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 32803 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 32803 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 32769 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 32769 -j ACCEPT
(Re)lancer les service :
# /sbin/chkconfig nfs on
# /etc/init.d/iptables restart
# /etc/init.d/nfs restart
# /etc/init.d/nfslock restart
- Test
# /etc/init.d/nfs restart
# exportfs
# tail -f /var/log/messages
camera16# mkdir dir
camera16# mount -t nfs 192.168.1.40:/opt/CES/target15 dir
mountd[5370]: authenticated mount request...
camera16# umount dir
mountd[5370]: authenticated unmount request...
# /sbin/chkconfig | grep nfs
# serviceconf
3.4 Test et FAQ
- Boot depuis camera15 dans le châssis PCI isolé ok.
- Cross-Compilation ok.
- ne marche pas avec
MTU=9000 mais avec MTU=1500 sur n1n41.
- re-export NFS
> > Is it possible to mount a fs via nfs, and then reexport it via nfs?
>
> No.
>
> The protocol doesn't really support it, and the (Linux-kernel)
> implementation definately doesn't support it.
definitelly the kernel implementation cannot manage the loops a re-export
would imply.
>
> I think the user-space nfs server can do it. It has other problems,
> but it might work for you.
yes, you have to run both rpc.mountd and rpc.nfsd with the -r option.I
used this one year ago, and it was really stable with 10 nfs clients
(physicaly the partition was on an AIX server, mounted on a linux server
and then re-exported on many linux clients), but the physical FS status
could not be really coherent in front of what the nfs re-export server
thinks it should be.
- Comment n1n4[12] montent-ils les homes ?
Il y a des pages jaunes sur n1n3. Cf le fichier /etc/ntp.conf :
server 192.168.1.3 dynamic
|