O velho maclinux tinha uma fazenda

Fuçando no seu Macintosh. Linux, BSD, Hardware, Gambiarra, Metareciclagem

Google

Monday, August 21, 2006

Netboot mini-howto

Esse eu achei aqui: http://penguinppc.org/bootloaders/yaboot/doc/netboot.shtml

This is a basic howto for setting up a bootp server to netboot a Newworld PowerMac.

You will need to install two packages on the server, bootp and tftpd. To enable these make sure you have the following lines in /etc/inetd.conf:

bootps dgram udp wait root /usr/sbin/bootpd bootpd -d -i -t 120
tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /tftpboot


You need to have the -d switch so bootp will log unknown MAC addresses (see below). Older versions of bootp may require a number such as -d 1.

Be sure to create a directory /tftpboot (or change that part in /etc/inetd.conf)

Next you need to setup an /etc/bootptab, here is an example:

socrates: hd=/tftpboot: bf=yaboot: ip=192.168.0.1: sm=255.255.255.0: sa=192.168.0.4: ha=000502F1ABBB:
Change the hostname to match the IP address that will be given to the netbooted host, this is found in /etc/hosts. Change the IP addresses and netmask to match your site. sa= is the server IP address, ip= is the client IP address. Probably the easiest way to find the hardware MAC address is to leave it out and try and netboot the mac, then look in the server log files (/var/log/daemon.log on Debian) and look for an entry like this:

Sep 8 23:51:55 plato bootpd[15297]: unknown client Ethernet address 00:05:02:F1:AB:BB

Now you have the MAC address and can add it to the bootptab file as shown above.

Next you need to create a /tftpboot/yaboot.conf file, here is an example:

device=enet:
partition=0
timeout=50
init-message="Debian GNU/Linux Network boot"
default=linux

image=vmlinux-2.2.17
label=linux
root=/dev/hda3
read-only
Change the root= entry to match your real root partition, or if your booting a ramdisk replace root= and read-only with initrd=root.bin and initrd-size=8192. You can also boot the system using an NFS export as a root filesystem, to do this remove read-only from the above yaboot.conf and change use root=/dev/nfs for a root partition.
Finally copy a precompiled uncompressed kernel image to /tftpboot along with a copy of yaboot, then run:

chmod 444 /tftpboot/*
chmod 755 /tftpboot


That should do it, boot the mac while holding down the `n' key again and you should get a yaboot prompt.

NFS root

This section was contributed by Brad Midgley

Another way to take advantage of netbooting is to have everything, including disk access, run over the network. It's not optimal, but it's a great way to work with GNU/Linux without disturbing your hard drive.

I back up my laptop (clam) verbatim to ant:/tftpboot/172.16.2.5/ so I can easily netboot a recent working backup. It was extremely useful recently after I had toasted my system :(

Also, NFS root is a great way to work if you are running an unstable kernel -- no fsck after a crash! (what? Linux crash?)

all this configuration is on the server (ant):

/tftpboot/vmlinux which must have been compiled with...

networking options
IP: kernel level autoconfiguration
IP: BOOTP support
file systems/network file systems
NFS file system support
Root file system on NFS
Setup your yaboot.conf like above, using root=/dev/nfs.

/etc/exports contains:

/tftpboot/172.16.2.5 172.16.2.5(rw,no_root_squash)

I am using dhcpd instead of bootpd. Your dhcpd must support the bootp protocol if you choose to use a dhcp daemon. In this case I have the softlink /172.16.2.5/yaboot pointing to usr/lib/yaboot/yaboot.

/etc/dhcpd.conf contains:

host clam {
filename "/172.16.2.5/yaboot";
server-name "ant";
next-server ant;
hardware ethernet 00:50:E4:D0:39:30;
fixed-address 172.16.2.5;
}

0 Comments:

Post a Comment

<< Home