2007/6/13, Junior Polegato - Linux <[EMAIL PROTECTED]>:
Gerson Henrique Diesel escreveu: > 6. Não é possível pegar o IP da configuração do Grub? > Interessante. Não havia pensando nisto. Para isto eu teria que: > - No momento em que inicializar o initramfs, montar o /dev/fd0; > - Cat | grep | cut no menu.lst do disquete, para pegar o ip. > Vou tentar. Se der certo não é necessário mais ter um initramfs para > cada terminal. > Gostei da idéia. > Colocarei os resultados. E se tentar assim: 1. No Grub dos disquetes: title Boot Remoto Terminal 1 ifconfig --address=<IP do Terminal 1> --mask=<máscara de rede> --server=<servidor de boot remoto> kernel (nd)/2.6.20.9-ltsp-1/bzImage-2.6.20.9-ltsp-1 ip=<IP do Terminal 1>... initrd (nd)/2.6.20.9-ltsp-1/initramfs.gz title Boot Remoto Terminal 2 ifconfig --address=<IP do Terminal 2> --mask=<máscara de rede> --server=<servidor de boot remoto> kernel (nd)/2.6.20.9-ltsp-1/bzImage-2.6.20.9-ltsp-1 ip=<IP do Terminal 2>... initrd (nd)/2.6.20.9-ltsp-1/initramfs.gz etc. Assim, no initramfs acho que não é preciso fazer mais nada, pois o próprio kernel se vira com o parâmetro IP... Tem também a opção de passar o IP por uma variável definida por nós, tipo: kernel (nd)/2.6.20.9-ltsp-1/bzImage-2.6.20.9-ltsp-1 ip_terminal=<IP do Terminal 2> E então basta ler o arquivo /proc/cmdline e pegar esta variável, sacou? Segue como funciona o parâmetro "ip" do kernel: ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf> This parameter tells the kernel how to configure IP addresses of devices and also how to set up the IP routing table. It was originally called `nfsaddrs', but now the boot-time IP configuration works independently of NFS, so it was renamed to `ip' and the old name remained as an alias for compatibility reasons. If this parameter is missing from the kernel command line, all fields are assumed to be empty, and the defaults mentioned below apply. In general this means that the kernel tries to configure everything using both RARP and BOOTP (depending on what has been enabled during kernel confi- guration, and if both what protocol answer got in first). <client-ip> IP address of the client. If empty, the address will either be determined by RARP or BOOTP. What protocol is used de- pends on what has been enabled during kernel configuration and on the <autoconf> parameter. If this parameter is not empty, neither RARP nor BOOTP will be used. <server-ip> IP address of the NFS server. If RARP is used to determine the client address and this parameter is NOT empty only replies from the specified server are accepted. To use different RARP and NFS server, specify your RARP server here (or leave it blank), and specify your NFS server in the `nfsroot' parameter (see above). If this entry is blank the address of the server is used which answered the RARP or BOOTP request. <gw-ip> IP address of a gateway if the server is on a different subnet. If this entry is empty no gateway is used and the server is assumed to be on the local network, unless a value has been received by BOOTP. <netmask> Netmask for local network interface. If this is empty, the netmask is derived from the client IP address assuming classful addressing, unless overridden in BOOTP reply. <hostname> Name of the client. If empty, the client IP address is used in ASCII notation, or the value received by BOOTP. <device> Name of network device to use. If this is empty, all devices are used for RARP and BOOTP requests, and the first one we receive a reply on is configured. If you have only one device, you can safely leave this blank. <autoconf> Method to use for autoconfiguration. If this is either 'rarp' or 'bootp', the specified protocol is used. If the value is 'both' or empty, both protocols are used so far as they have been enabled during kernel configura- tion. 'off' means no autoconfiguration. The <autoconf> parameter can appear alone as the value to the `ip' parameter (without all the ':' characters before) in which case auto- configuration is used. -- Atenciosamente, Junior Polegato Um peregrino de problemas; Um pergaminho de soluções! Página Profissional: http://www.juniorpolegato.com.br
Gostei deste de ler parâmetros por nós (/proc/cmdline). Funciona. Acho que o parâmetro IP Do kernel não funcionaria, pois no initramfs ainda seria necessário comentar as linhas referentes ao dhcpcd. Além disto, no initramfs também existem instruções para montar o diretório NFS (caminho ROOTPATH) que é enviado pelo DHCP. Posso também enviar o ROOTPATH através de parâmetro de nó. Ótima alternativa. -- Gerson Henrique Diesel MSN - [EMAIL PROTECTED]