Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
lpi2:pxe-bootserver [2017/02/16 15:00] |
lpi2:pxe-bootserver [2017/02/16 15:00] (aktuell) |
||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
+ | ===== Pakete ===== | ||
+ | openSuSE: ( 11.4 ) | ||
+ | dhcp-server tftp syslinux apache2 apache2-prefork | ||
+ | CentOS: ( 5.3 ) | ||
+ | dhcp tftp-server syslinux httpd | ||
+ | Debian: ( 7.0 ) | ||
+ | isc-dhcp-server pxelinux tftpd xinetd apache2 | ||
+ | === zum testen === | ||
+ | Zum Testen ist ''qemu'' sehr hilfreich | ||
+ | |||
+ | ===== PXE ===== | ||
+ | |||
+ | TODO: offenbar kann man statt tftp inzwischen auch http verwenden. siehe: http://etherboot.org/wiki/httpboot und http://www.syslinux.org/wiki/index.php?title=PXELINUX#HTTP_and_FTP | ||
+ | |||
+ | === openSuSE === | ||
+ | cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/ | ||
+ | mkdir /srv/tftpboot/opensuse114 | ||
+ | cd /srv/tftpboot/opensuse114 | ||
+ | wget http://download.opensuse.org/distribution/11.4/repo/oss/boot/i386/loader/{linux,initrd,isolinux.cfg} | ||
+ | ''/var/lib/tftpboot/pxelinux.cfg/default'' : | ||
+ | <file> | ||
+ | SERIAL 0 115200 | ||
+ | PROMPT 1 | ||
+ | TIMEOUT 200 | ||
+ | |||
+ | DEFAULT opensuse | ||
+ | |||
+ | #Superpraktisch zum testen neuer Eintraege im Bootmenu: | ||
+ | LABEL pxelinux | ||
+ | KERNEL pxelinux.0 | ||
+ | |||
+ | LABEL opensuse | ||
+ | KERNEL opensuse114/linux | ||
+ | APPEND initrd=opensuse114/initrd showopts ip=bootp install=http://download.opensuse.org/distribution/11.4/repo/oss vga=0x317 lang=de autoyast=http://notebook21/suse/autoyast.xml | ||
+ | </file> | ||
+ | |||
+ | === CentOS 6.4 === | ||
+ | cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/ | ||
+ | |||
+ | mkdir -p /var/lib/tftpboot/{centos64,pxelinux.cfg} | ||
+ | cd /var/lib/tftpboot/centos64 | ||
+ | wget http://centos/6/os/i386/isolinux/{vmlinuz,initrd.img,isolinux.cfg} | ||
+ | cd /var/lib/tftpboot | ||
+ | cp -a isolinux.cfg ../pxelinux.cfg/default | ||
+ | | ||
+ | ''/var/lib/tftpboot/pxelinux.cfg/default'' : | ||
+ | <file> | ||
+ | SERIAL 0 115200 | ||
+ | PROMPT 1 | ||
+ | TIMEOUT 200 | ||
+ | |||
+ | DEFAULT centos | ||
+ | |||
+ | #Superpraktisch zum testen neuer Eintraege im Bootmenu: | ||
+ | LABEL pxelinux | ||
+ | KERNEL pxelinux.0 | ||
+ | |||
+ | LABEL centos | ||
+ | KERNEL /centos64/vmlinuz | ||
+ | APPEND initrd=/centos64/initrd.img ramdisk_size=9216 resolution=1024x768 ksdevice=eth0 ks=http://notebook21/mirror6.ks | ||
+ | </file> | ||
+ | |||
+ | == testen == | ||
+ | Kernel und Initrd in qemu starten | ||
+ | qemu -kernel centos64/vmlinuz -initrd centos64/initrd.img -append "vga=normal console=ttyS0" -boot c -snapshot -nographic centos5/initrd.img | ||
+ | |||
+ | === CentOS 7.0 === | ||
+ | //noch nicht getestet// | ||
+ | cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/ | ||
+ | |||
+ | mkdir -p /var/lib/tftpboot/{centos7,pxelinux.cfg} | ||
+ | cd /var/lib/tftpboot/centos7 | ||
+ | wget http://centos/7/os/x86_64/isolinux/{vmlinuz,initrd.img,isolinux.cfg} | ||
+ | cd /var/lib/tftpboot | ||
+ | cp -a isolinux.cfg ../pxelinux.cfg/default | ||
+ | | ||
+ | ''/var/lib/tftpboot/pxelinux.cfg/default'' : | ||
+ | <file> | ||
+ | SERIAL 0 115200 | ||
+ | PROMPT 1 | ||
+ | TIMEOUT 200 | ||
+ | |||
+ | DEFAULT centos | ||
+ | |||
+ | #Superpraktisch zum testen neuer Eintraege im Bootmenu: | ||
+ | LABEL pxelinux | ||
+ | KERNEL pxelinux.0 | ||
+ | |||
+ | LABEL centos | ||
+ | KERNEL /centos64/vmlinuz | ||
+ | APPEND initrd=/centos64/initrd.img repo=http://centos/7/os/x86_64 | ||
+ | </file> | ||
+ | |||
+ | == testen == | ||
+ | Kernel und Initrd in qemu starten | ||
+ | qemu -kernel centos7/vmlinuz -initrd centos7/initrd.img -append "vga=normal console=ttyS0" -boot c -snapshot -nographic centos7/initrd.img | ||
+ | |||
+ | === Debian 8.0 === | ||
+ | mkdir /var/lib/tftpboot/ | ||
+ | ln -s /usr/lib/PXELINUX/pxelinux.0 /var/lib/tftpboot/ | ||
+ | |||
+ | cd /var/lib/tftpboot/ | ||
+ | mkdir debian80 | ||
+ | cd debian80 | ||
+ | wget http://ftp.de.debian.org/debian/dists/jessie/main/installer-amd64/current/images/netboot/debian-installer/amd64/{linux,initrd.gz} | ||
+ | (( | ||
+ | Der Debian-Installer enthält per Default keine Firmware, die nicht Debians strengen Lizenzrichtlinien entspricht. Eine Anleitung, wie man den Installer um nicht-freie Firmware ergänzen kann findet sich im [[https://wiki.debian.org/DebianInstaller/NetbootFirmware#Examples_for_Debian_7_.22Wheezy.22|Debian Wiki]] | ||
+ | )) | ||
+ | |||
+ | mkdir /var/lib/tftpboot/pxelinux.cfg | ||
+ | ''/var/lib/tftpboot/pxelinux.cfg/default'' : | ||
+ | <file> | ||
+ | SERIAL 0 115200 | ||
+ | PROMPT 1 | ||
+ | TIMEOUT 200 | ||
+ | |||
+ | DEFAULT debian | ||
+ | |||
+ | #Superpraktisch zum testen neuer Eintraege im Bootmenu: | ||
+ | LABEL pxelinux | ||
+ | KERNEL pxelinux.0 | ||
+ | |||
+ | LABEL debian | ||
+ | KERNEL debian80/linux | ||
+ | APPEND initrd=debian80/initrd.gz vga=normal -- DEBCONF_DEBUG=5 preseed/url=http://192.168.1.221/mirror80.cfg | ||
+ | </file> | ||
+ | |||
+ | == testen == | ||
+ | Kernel und Initrd in qemu starten | ||
+ | |||
+ | cd /var/lib/tftpboot/ | ||
+ | qemu-system-x86_64 -kernel debian80/linux -initrd debian80/initrd.gz -append "console=ttyS0" -boot c -snapshot -nographic debian80/initrd.gz | ||
+ | |||
+ | unter Debian 8 musste ich zusätzlich die folgenden Dateien ins tftp Verzeichnis kopieren: | ||
+ | cp /usr/lib/syslinux/modules/*/ldlinux.* . | ||
+ | qemu über simuliertes Netz starten: (( erfordert X, z.B. via ''ssh -X'' )) | ||
+ | qemu-system-x86_64 -boot n -tftp /var/lib/tftpboot/ -bootp /pxelinux.0 /dev/zero | ||
+ | |||
+ | ==== Bootlogo ==== | ||
+ | //optional// | ||
+ | === Pakete === | ||
+ | Debian 3.1: | ||
+ | syslinux gimp | ||
+ | |||
+ | === Schritte === | ||
+ | Orginal-Bild öffnen: | ||
+ | gimp logo_final.svg | ||
+ | |||
+ | * Bild->Modus->Indexiert: 16 Farben | ||
+ | * Datei->Speichern unter: logo_linuxhotel.ppm ( raw ) | ||
+ | * Exportiertes Bild öffnen | ||
+ | * Mit Pipette zwei Farben für Text Vordergrund und Hintergrund raussuchen | ||
+ | |||
+ | ppmtolss16 \#e8e6b6=0 \#28414a=7 < logo_linuxhotel.ppm > logo_linuxhotel.lss16 | ||
+ | |||
+ | * 0 ist die Vordergrund-Farbe, 7 die Hintergrundfarbe des //Textes// (!) | ||
+ | |||
+ | ===== TFTP ===== | ||
+ | TODO: durch systemd ersetzen | ||
+ | |||
+ | ''/etc/xinetd.d/tftp'' : | ||
+ | <file> | ||
+ | service tftp | ||
+ | { | ||
+ | socket_type = dgram | ||
+ | protocol = udp | ||
+ | wait = yes | ||
+ | user = nobody | ||
+ | server = /usr/sbin/in.tftpd | ||
+ | server_args = -s /var/lib/tftpboot/ | ||
+ | } | ||
+ | </file> | ||
+ | |||
+ | SuSE, Centos: | ||
+ | chkconfig tftp on | ||
+ | |||
+ | alle Distros: | ||
+ | service xinetd restart | ||
+ | |||
+ | === testen === | ||
+ | lsof -i :tftp | ||
+ | |||
+ | ===== DHCP ===== | ||
+ | ==== Grundkonfiguration ==== | ||
+ | [[dhcp|DHCP-Dienst mit festen IP-Adressen]] | ||
+ | |||
+ | ==== PXE Einstellungen ==== | ||
+ | ''/etc/dhcpd.conf'' : ( CentOS 5.3, openSuSE 11.4 ) | ||
+ | |||
+ | ''/etc/dhcp/dhcpd.conf'' : ( debian 6.0 ) | ||
+ | |||
+ | <file> | ||
+ | class "PXEClient:" { | ||
+ | match if substring (option vendor-class-identifier, 0,10) = "PXEClient:"; | ||
+ | default-lease-time 300; # 5 min | ||
+ | max-lease-time 600; # 10 min | ||
+ | filename "pxelinux.0"; | ||
+ | next-server 192.168.1.224; | ||
+ | } | ||
+ | </file> | ||
+ | CentOS 5.3, openSuSE 11.4: | ||
+ | service dhcpd restart | ||
+ | |||
+ | debian (ab 6.0): | ||
+ | service isc-dhcp-server restart | ||
+ | ==== Testen ==== | ||
+ | Prüfen der Konfiguration: | ||
+ | dhcpd -t | ||
+ | |||
+ | Nun sollte ein pxe-fähiger Rechner booten können. | ||
+ | |||
+ | ===== Apache ===== | ||
+ | ==== SuSE Repository ==== | ||
+ | |||
+ | mkdir /srv/www/htdocs/opensuse/{oss,non-oss,update} | ||
+ | cp -a /media/susedvd/. /srv/www/htdocs/suse/oss | ||
+ | (( geht davon aus, dass die SuSE DVD nach ''/media/susedvd'' gemountet ist )) | ||
+ | |||
+ | ==== Debian Repository ==== | ||
+ | |||
+ | mkdir /var/www/debian | ||
+ | cp -a /media/debian/. /var/www/debian | ||
+ | (( geht davon aus, dass die Debian DVD nach ''/media/debian'' gemountet ist )) | ||
+ | |||
+ | ===== Antwortdatei ===== | ||
+ | ==== SuSE / Auto-Yast ==== | ||
+ | Mit | ||
+ | yast2 autoyast | ||
+ | eine Konfigurationdatei erstellen und unter ''/srv/www/htdocs/suse/autoyast.xml'' speichern | ||
+ | |||
+ | ==== CentOS 5.3 / Kickstart ==== | ||
+ | Paket: system-config-kickstart | ||
+ | system-config-kickstart | ||
+ | |||
+ | ===== Links ===== | ||
+ | * [[http://www.sweb.cz/Frantisek.Rysanek/splash/isolinux-splash-HOWTO.html|Graphik konvertieren]] | ||
+ | * [[http://syslinux.zytor.com/faq.php|Display Datei Format]] | ||
+ | * http://www.centos.org/docs/5/html/5.2/Installation_Guide/ch-kickstart2.html | ||
+ | * http://wiki.debian.org/DebianInstaller/Preseed | ||