Changes

Jump to navigation Jump to search
7,145 bytes added ,  05:57, 15 August 2023
use systemctl rather than service (for restart)
Line 3: Line 3:  
== smeserver-tftp-server ==
 
== smeserver-tftp-server ==
 
Maintainer: [mailto:smeserver@batley.id.au Trevor Batley]<br>
 
Maintainer: [mailto:smeserver@batley.id.au Trevor Batley]<br>
{{ #smeversion: smeserver-tftp-server }}
+
{{#smeversion: smeserver-tftp-server }}
    
=== Description ===
 
=== Description ===
Line 11: Line 11:     
=== Requires ===
 
=== Requires ===
*smeserver >= 7.0
+
*smeserver >= 10.0
*tftp-server >= 0.39
+
*tftp-server >= 0.49
 +
 
 +
For a lot of linux distros you will need nfs support
 +
 
 +
https://wiki.koozali.org/NFS
 +
 
 +
You will a /etc/exports line similar to this:
 +
 
 +
/tftpboot/ *(ro,sync,no_wdelay,insecure_locks,no_root_squash,insecure)
 +
<syntaxhighlight lang="bash">
 +
mkdir -p /etc/e-smith/templates-custom/etc/exports/
 +
echo "/tftpboot/ *(ro,sync,no_wdelay,insecure_locks,no_root_squash,insecure)" > /etc/e-smith/templates-custom/etc/exports/30tftp
 +
expand-template /etc/exports
 +
</syntaxhighlight>
 +
/tftpboot/images/ubunturescue_1104/ *(ro,sync,no_wdelay,insecure_locks,no_root_squash,insecure)
 +
if you have installed smeserver-nfs
    
=== Installation ===
 
=== Installation ===
Line 23: Line 38:  
  yum --enablerepo=smecontribs --enablerepo=base install smeserver-tftp-server
 
  yum --enablerepo=smecontribs --enablerepo=base install smeserver-tftp-server
   −
Officially you should then need to apply the database changes etc. Whilst this is not required to be able to run the tftp server straight away, it will be required at some stage, and the server manager will remind you, until you do.
+
The tftp status can be controlled via the Thin Clients server-manager panel if you have installed my [[Thinclient|smeserver-thinclient]] contrib.
 
  −
signal-event post-upgrade
  −
signal-event reboot
  −
 
  −
The tftpd status is controlled via the Thin Clients server-manager panel if you have installed my [[Thinclient|smeserver-thinclient]] contrib.
     −
If you haven't, you'll need to enable the tftp server
+
If you haven't, you'll need to enable the tftp server manually from the shell (logged in as root)
  config setprop tftpd status enabled
+
  config setprop tftp status enabled
  signal-event tftpd-conf
+
  signal-event smeserver-tftp-server-update
    
If for any reason the tftp server isn't running, try:
 
If for any reason the tftp server isn't running, try:
  service tftpd restart
+
  systemctl restart tftp
    
=== Defaults ===
 
=== Defaults ===
Line 81: Line 91:  
|
 
|
 
|-
 
|-
| refuse*
+
| blksize <sup>1</sup>
 +
|
 +
| Value between 512-65464
 +
| e.g. equivalent to -B [512-65464]
 +
|-
 +
| refuse <sup>2</sup>
 
|  
 
|  
 
| any tftp parameter
 
| any tftp parameter
Line 89: Line 104:     
These settings can be set/changed via
 
These settings can be set/changed via
  config setprop tftpd <prop> <value>
+
  config setprop tftp <prop> <value>
  signal-event tftpd-conf
+
  signal-event smeserver-tftp-server-update
 +
 
 +
<nowiki>*1</nowiki> blksize does not have a default entry  in the configuration database. It can be added as above or removed via
 +
 
 +
see Bug 10646 for updated tftp contrib with addition of default setting
 +
config delprop tftp blksize
 +
signal-event smeserver-tftp-server-update
 +
 
 +
<nowiki>*2</nowiki> refuse does not have a default entry in the configuration database. It can be added as above or removed via
 +
config delprop tftp refuse
 +
signal-event smeserver-tftp-server-update
 +
 
 +
===Setup PXE Booting===
 +
 
 +
Some rough notes on setting up PXE booting for linux using syslinux
 +
 
 +
https://wiki.syslinux.org/wiki/index.php?title=PXELINUX
 +
 
 +
To use a menu we need a copy of pxelinux.0
 +
 
 +
From the syslinux wiki link above:
 +
 
 +
On the TFTP server, create the directory "/tftpboot", and copy "pxelinux.0" (from the Syslinux distribution) and any kernel or initrd images that you want to boot.
 +
[5.00+] Also copy "ldlinux.c32" from the Syslinux distribution to the "/tftpboot" directory on the TFTP server.
 +
Finally, create the directory "/tftpboot/pxelinux.cfg". The configuration file (equivalent of syslinux.cfg -- see the SYSLINUX FAQ for the options here) will live in this directory.
 +
 
 +
The actual linux image and any associated files need to be extracted from a source distribution ISO here:
 +
 
 +
/tftpboot/images/{name_of_distro}
 +
 
 +
 
 +
====Menus====
 +
 
 +
We can create a menu system with sub menus as well.
 +
 
 +
Yu will need this from the syslinux ISO:
 +
 
 +
/tftpboot/com32/vesamenu.c32
 +
 
 +
You can add a background image like this:
 +
 
 +
/tftpboot/images/graphics/background.png
 +
 
 +
 
 +
Example /tftpboot/pxelinux.cfg/default:
 +
 
 +
<pre>
 +
menu title --== SME Linux, PXE Main Menu ==--
 +
menu background graphics/background.png
 +
menu tabmsgrow 22
 +
menu cmdlinerow 22
 +
menu endrow 24
 +
 
 +
menu color title                1;34;49    #eea0a0ff #cc333355 std
 +
menu color sel                  7;37;40    #ff000000 #bb9999aa all
 +
menu color border              30;44      #ffffffff #00000000 std
 +
menu color pwdheader            31;47      #eeff1010 #20ffffff std
 +
menu color hotkey              35;40      #90ffff00 #00000000 std
 +
menu color hotsel              35;40      #90000000 #bb9999aa all
 +
menu color timeout_msg          35;40      #90ffffff #00000000 none
 +
menu color timeout              31;47      #eeff1010 #00000000 none
 +
 
 +
prompt 0
 +
noescape 1
 +
allowoptions 0
 +
timeout 0
 +
 
 +
default com32/vesamenu.c32
 +
 
 +
label linuxmenu
 +
menu label ^Linux Boot Disks Menu
 +
kernel com32/vesamenu.c32
 +
append pxelinux.cfg/linux_boot_disks
 +
 
 +
label Arch
 +
menu label ^Arch Boot Disks Menu
 +
kernel com32/vesamenu.c32
 +
append pxelinux.cfg/arch
 +
 
 +
label bootimg
 +
menu label ^Other Boot Images
 +
kernel com32/vesamenu.c32
 +
append pxelinux.cfg/bootimg
 +
</pre>
 +
 
 +
We then need to create separate sub menu configuration files in the same directory. Note the use of NFS is required for some of the setups here.
 +
 
 +
{{Note box|These are old configs that have not been tested recently but should give an idea. Please update with any recent information}}
 +
 
 +
Sample for /tftpboot/pxelinux.cfg/linux_boot_disks
 +
 
 +
The symbol ^ as per eg "Back to ^Main" is used to create an underlined shortcut key M in this instance.
 +
 
 +
<pre>
 +
menu title --== Linux Boot Images ==--
 +
menu background graphics/background.png
 +
menu tabmsgrow 22
 +
menu cmdlinerow 22
 +
menu endrow 24
 +
 
 +
menu color title                1;34;49    #eea0a0ff #cc333355 std
 +
menu color sel                  7;37;40    #ff000000 #bb9999aa all
 +
menu color border              30;44      #ffffffff #00000000 std
 +
menu color pwdheader            31;47      #eeff1010 #20ffffff std
 +
menu color hotkey              35;40      #90ffff00 #00000000 std
 +
menu color hotsel              35;40      #90000000 #bb9999aa all
 +
menu color timeout_msg          35;40      #90ffffff #00000000 none
 +
menu color timeout              31;47      #eeff1010 #00000000 none
 +
 
 +
prompt 0
 +
noescape 1
 +
allowoptions 0
 +
timeout 0
 +
 
 +
default com32/vesamenu.c32
 +
 
 +
label main
 +
menu label Back to ^Main Menu
 +
kernel com32/vesamenu.c32
 +
append pxelinux.cfg/default
 +
 
 +
 
 +
label Mint 12
 +
menu label ^Mint 12
 +
kernel images/mint_12/vmlinuz
 +
append boot=casper initrd=images/mint_12/initrd.lz
 +
 
 +
label Debian Mint
 +
menu label ^Debian Mint
 +
kernel images/debian_mint/vmlinuz
 +
append boot=casper netboot=nfs nfsroot=192.168.10.1:/home/e-smith/files/ibays/computer/files/debian_mint initrd=images/debian_mint/initrd.lz
 +
     
 +
label Xubuntu
 +
menu label ^Xubuntu
 +
kernel images/xubuntu_1110/vmlinuz
 +
append boot=casper netboot=nfs nfsroot=192.168.10.1:/home/e-smith/files/ibays/computer/files/xubuntu_1110 initrd=images/xubuntu_1110/initrd.lz
 +
 +
label Clonezilla-live
 +
MENU LABEL Clonezilla Live (Ramdisk)
 +
KERNEL images/clonezilla/vmlinuz
 +
APPEND initrd=images/clonezilla/initrd.img boot=live username=user union=overlay config components quiet noswap edd=on nomodeset nodmraid locales=en_GB.UTF-8 keyboard-layouts=uk keyboard-layouts= ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_live_batch=no net.ifnames=0 nosplash noprompt fetch=tftp://192.168.10.1//images/clonezilla/filesystem.squashfs
 +
 
 +
label systemrescue
 +
menu label ^System Rescue
 +
kernel images/recovery/systemrescue/rescuecd
 +
initrd images/recovery/systemrescue/initram.igz
 +
append setkmap=us netboot=http://192.168.0.10/iso/sysrescue/sysrcd.dat
 +
 
 +
label riplinux32
 +
menu label ^Rescue Is Possible Linux (32-bit kernel)
 +
kernel images/recovery/riplinux/kernel32
 +
append vga=normal video=640x400 nokeymap initrd=images/recovery/riplinux/rootfs.cgz root=/dev/ram0 rw
 +
 
 +
label riplinux64
 +
menu label Rescue ^Is Possible Linux (64-bit kernel)
 +
kernel images/recovery/riplinux/kernel64
 +
append vga=normal video=640x400 nokeymap initrd=images/recovery/riplinux/rootfs.cgz root=/dev/ram0 rw
 +
 
 +
LABEL -
 +
MENU LABEL SeaTools for DOS V2.23 (Seagate/Maxtor)
 +
TEXT HELP
 +
GUI version. Test PATA/IDE/SATA drives by instructing the drive to run its
 +
built-in Drive Self Test (DST) and give either a pass or fail status.
 +
ENDTEXT
 +
#COM32 linux.c32 memdisk
 +
kernel images/memdisk
 +
INITRD images/UBCD/ubcd/images/seatool2.img.gz
 +
 
 +
label GParted Live
 +
MENU LABEL ^GParted Live
 +
kernel /images/gparted/vmlinuz
 +
append initrd=initrd.img boot=live config components union=overlay username=user noswap noeject ip= vga=788 fetch=http://192.168.10.1/computer/filesystem.squashfs
 +
</pre>
 +
 
 +
===Voip Phones===
 +
 
 +
You can use tftpd with your Voip phones.
 +
 
 +
More advanced phones will allow you to choose a directory for your firmware where. More basic phones may not be able to you anything other than the default root directory.
 +
 
 +
e.g
 +
I have some old Mitel phones use /tftpboot only
 +
I have a number of new Grandstream phones that can load from /tftpboot/some_directory
 +
 
 +
Most Voip phone scan read a config file based on their MAC address to configure themselves during boot.
 +
This can take a while to set up but is a massive time saver.
 +
 
 +
===Related Contribs===
 +
 
 +
[[Thinclient|smeserver-thinclient]]
   −
<nowiki>*</nowiki>refuse does not have a default entry in the configuration database. It can be added as above or removed via
+
This can aid with basic tftp setup.
config delprop tftpd refuse
  −
signal-event tftpd-conf
      
=== Uninstall ===
 
=== Uninstall ===
Line 101: Line 303:     
If you want to fully clean up, by removing the entries from the configuration database
 
If you want to fully clean up, by removing the entries from the configuration database
  config delete tftpd
+
  config delete tftp
    
=== Source ===
 
=== Source ===
371

edits

Navigation menu