Copyright (C) 2008-2020 Oliver Bohlen.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled "GNU Free Documentation License".
This documentation comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law.
This part describes how I boot client-PCs over the network. For this I use PXE, DHCP, TFTP and NFS.
For UEFI Grub do
cd /gtc/pxe ; grub-mkstandalone -d /usr/lib/grub/x86_64-efi/ -O x86_64-efi --fonts="unicode" -o bootx64.efi boot/grub/grub.cfg
If you want to use this solution you need the following howto(s) finished:
emerge net-fs/nfs-utils emerge sys-boot/syslinux emerge net-ftp/tftp-hpa
File permissions:
Owner: root
Group: root
Permissions: -rw-r--r--
Click here for a download of the complete file: /etc/conf.d/in.tftpd
Changed on 04.04.10Path for PXE files and necessary bootoptions for tftpd.
INTFTPD_OPTS="-R 4096:32767 -s ${INTFTPD_PATH}"After change
INTFTPD_PATH="/gtc/pxe" #INTFTPD_OPTS="-R 4096:32767 -s ${INTFTPD_PATH} --refuse blksize --refuse tsize --refuse blksize2 --user nobody -vvv" INTFTPD_OPTS="-p -u nobody -s ${INTFTPD_PATH} -vvv"
File permissions:
Owner: root
Group: root
Permissions: -rw-r--r--
Click here for a download of the complete file: /etc/conf.d/nfs
Changed on 10.03.10Thist starts the rpc.idmapd for UID/GID Mapping on NFSv4. It hast to be startet at the clientside too. If this Service is not started all UIDs/GIDs are mapped to ID 4294967294. The Configurationfile /etc/idmapd.conf should be the same on Client and Server
NFS_NEEDED_SERVICES=""After change
NFS_NEEDED_SERVICES="rpc.idmapd"
Allow a maximum of 20 Clients at the same time on your NFS Server
#OPTS_RPC_NFSD="8"After change
OPTS_RPC_NFSD="20"
The rpc mountd should listen on port 32767 (needed for some firewall settings).
#OPTS_RPC_MOUNTD=""After change
OPTS_RPC_MOUNTD="-p 32767"
The rpc statd should listen on port 32765 and send outgoing connections over port 32766 (needed for some firewall settings).
#OPTS_RPC_STATD=""After change
OPTS_RPC_STATD="-p 32765 -o 32766"
File permissions:
Owner: root
Group: root
Permissions: -rwx------
Click here for a download of the complete file: /etc/cron.daily/pxe.cron
Changed on 13.01.09PXE Update workaround. If syslinux is updated the new pxelinux.0 or/and menu.c32 file are stored in /usr/share/syslinux. For our use this files have to stay in /srv/thinclient/pxe. So once a day the file is copied to the correct place. A symlink (because of TFTP) or hardlink (because of different filesystems) doesn't work for me. I didn't find a better solution. If you have one let me know ;-)
#!/bin/bash mkdir -p /gtc/pxe cp -p /usr/share/syslinux/pxelinux.0 /gtc/pxe/ cp -p /usr/share/syslinux/menu.c32 /gtc/pxe/ cp -p /usr/share/syslinux/ldlinux.c32 /gtc/pxe cp -p /usr/share/syslinux/libutil.c32 /gtc/pxe
File permissions:
Owner: root
Group: root
Permissions: -rw-r--r--
Click here for a download of the complete file: /etc/dhcp/dhcpd.conf
Changed on 06.09.08This is for starting the syslinux (pxelinux) bootmanager for thinclients booting over pxe.
next-server my.lan.ip.addr; option architecture-type code 93 = unsigned integer 16; if option architecture-type = 00:09 { filename "bootx64.efi"; } elsif option architecture-type = 00:07 { filename "bootx64.efi"; } else { filename "pxelinux.0"; }
File permissions:
Owner: root
Group: root
Permissions: -rw-r--r--
Click here for a download of the complete file: /etc/exports
Changed on 23.12.08NFS4-configuration for test and production environment of the Thinclients.
/gtc my.lan.network.ip/XXX.XXX.XXX.XXX(ro,fsid=0,no_subtree_check,async,no_root_squash,ro,insecure) /gtc/test my.lan.network.ip/XXX.XXX.XXX.XXX(no_subtree_check,async,ro,no_root_squash,insecure) /gtc/stable my.lan.network.ip/XXX.XXX.XXX.XXX(no_subtree_check,async,ro,no_root_squash,insecure,nohide)
File permissions:
Owner: root
Group: root
Permissions: -rw-r--r--
Click here for a download of the complete file: /gtc/pxe/pxelinux.cfg/default
Changed on 06.09.08Boot menu configuration for PXE boots.
default menu.c32 prompt 0 menu title GTC-PXELinux Boot Menu NOESCAPE 1 ALLOWOPTIONS 1 MENU AUTOBOOT Starting Gentoo Thinclient in # seconds label stable timeout 100 menu default menu label ^Gentoo Stable Thinclient 4.19.101 kernel /kernel-genkernel-x86_64-4.19.101-gentoo append initrd=/initramfs-genkernel-x86_64-4.19.101-gentoo root=/dev/nfs nfsroot=my.lan.ip.addr:/gtc/stable ramdisk_size=256000 acpi_sleep=s3_bios real_root=/dev/nfs raid=noautodetect consoleblank=0 clocksource=hpet ipappend 3 label test menu label ^Gentoo Test Thinclient 4.19.107 kernel /kernel-genkernel-x86_64-4.19.107-gentoo append initrd=/initramfs-genkernel-x86_64-4.19.107-gentoo root=/dev/nfs nfsroot=my.lan.ip.addr:/gtc/test ramdisk_size=256000 acpi_sleep=s3_bios real_root=/dev/nfs raid=noautodetect consoleblank=0 clocksource=hpet ipappend 3 label bootlocal menu label ^Boot from local Disk localboot 0
File permissions:
Owner: root
Group: root
Permissions: -rw-r--r--
Click here for a download of the complete file: /gtc/test/etc/thinclient/server-profile/etc/exports
Changed on 23.12.08NFS(4)-configuration for test and production environment of the Thinclients.
/opt/gtcroot *(fsid=0,crossmnt,no_subtree_check,async,ro,no_root_squash,insecure,nohide)
File permissions:
Owner: root
Group: root
Permissions: -rwx------
Click here for a download of the complete file: /usr/local/sbin/mkgtcstable.sh
Changed on 29.06.09This is a small script for creating the stable environment from the test environment.
#!/bin/bash /etc/init.d/rsyncd stop #mv /gtc/test/usr/portage/distfiles/jre* /srv/tmp rm -f /gtc/test/usr/portage/distfiles/* #mv /srv/tmp/jre* /gtc/test/usr/portage/distfiles/ if mount | grep -q "on /gtc type btrfs" then btrfs subvolume delete /gtc/stable btrfs subvolume snapshot /gtc/test /gtc/stable btrfs property set /gtc/stable ro false else rsync -aXAHv --delete /gtc/test/ /gtc/stable/ --exclude=/_gtcroot/ --exclude=/gtcdvd/ --exclude=/proc/ --exclude=/sys/ --exclude=/tmp/ --exclude=/var/tmp --exclude=/root fi mkdir -p /gtc/stable/proc mkdir -p /gtc/stable/sys mkdir -p /gtc/stable/tmp mkdir -p /gtc/stable/root chmod 0700 /gtc/stable/root chmod 1777 /gtc/stable/tmp mkdir -p /gtc/stable/var/tmp/portage chmod 1777 /gtc/stable/var/tmp mkdir -p /gtc/stable/_gtcroot for i in `find /gtc/stable/var/log/ -type f` do >$i done for i in `find /gtc/stable/usr/src -maxdepth 1 -type d | grep linux` do cd $i make clean cd - done btrfs property set /gtc/stable ro true /etc/init.d/rsyncd start /etc/init.d/nfs restart /gtc/pxe/linkkernel.sh
For starting the new service after system reboot you should add it to a runlevel with the following command(s):
rc-update add nfs rc-update add in.tftpd rc-update add rpc.idmapd default
Please send a feedback to: doc<at>gabosh.net
Howto listingHere you can find the official Gentoo Linux Forums where you can find a lot of answers.
Here a link to the official Gentoo Linux Homepage.