tftpboot/scripts/README.md

81 lines
4.2 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Scripts
1. [Description](#description)
2. [Scripts list](#scripts-list)
* [Download Debian](#download_debiansh)
* [Download Ubuntu](#download_ubuntush)
* [Make Debian Initrd with Firmware](#make_debian_initrd_with_firmwaresh)
* [Download diag tools](#download_diag_toolssh)
* [Debian late_command](#debian-late_command)
## Description
Set of scripts to download and generate necessary files to allow differents GNU/Linux distributions to boot through the network.
## Scripts list
### download_debian.sh
The script will provide netboot installers for all Debian (>=Stable) for both **i386** and **amd64**:
* Store the files to **/var/lib/tftpboot** (default).
* Download Debian Linux kernel and initrd files for all Debian distributions (Stable: **Jessie**; Testing: **Stretch**; Unstable: **Sid**) and for **i386** and **amd64** architectures.
* Offer an example menu file to use with a TFTP server (default_path/installer/debian/menu.cfg.example).
### download_ubuntu.sh
The script will provide netboot installers for the latest LTS and latest advanced Ubuntu distribution for both **i386** and **amd64**:
* Store the files to **/var/lib/tftpboot** (default).
* Download Ubuntu Linux kernel and initrd files for the two lasts Ubuntu distributions (LTS-16.04: **Xenial**; 15.10: **Wily**) and for **i386** and **amd64** architectures.
* Make a symlink to access to the LTS (default_path/installer/ubuntu/lts) instead of it's codename.
### make_debian_initrd_with_firmware.sh
The script will provide Debian's netboot installers with **additionnals firmwares** for all Debian (>=Stable) for **amd64** only:
* Store the files to **/var/lib/tftpboot** (default).
* Store temp files to **/tmp/tmp.XXXXXXXXXX** (with mktemp).
* Download Debian's initrd files for all Debian distributions (Stable: **Jessie**; Testing: **Stretch**; Unstable: **Sid**) for **amd64** architecture only.
* Download additionnals firmwares:
* **bnx2**: For Broadcom NetXtremeII network adapters.
* **linux-nonfree**: For Tigon network adapters.
* **myricom**: For Myricom Myri-10G Ethernet adapters (IBM server).
* **qlogic**: For QLogic Infiniband, SCSI, Fibre Channel/FCoE adapters.
* Extract initrd and firmwares packages to build a new initrd.
### download_diag_tools.sh
The script will download some diagnostic tools:
* memtest86 from [memtest86's official website][memtest official website].
### Debian late_command
#### Description
Some useful configurations after a Debian installation:
* Smarter rsyslog (more directories and less files in **/var/log**).
* Shorter configuration file and use more files from /etc/rsyslog.d/
* Move log files to directory:
* _kern_ logs from /var/log/kern.log to __/var/log/kernel/kernel.log__
* _user_ logs from /var/log/user.log to __/var/log/security/user.log__
* _mail_ logs from /var/log/mail.… to __/var/log/mail/mail.…__
* _daemon_ logs from /var/log/daemon.log to __/var/log/syslog/daemon.log__
* _auth_ logs from /var/log/auth.log to __/var/log/security/auth.log__
* _lpr_ logs from/var/log/lpr.log to __/var/log/lpr/lpr.log__
* _cron_ logs from /var/log/cron.log to __/var/log/cron/cron.log__
* _localX_ logs from /var/log/localX.log to __/var/log/syslog/localX.log__
* _syslog_ logs from /var/log/syslog.log to __/var/log/syslog/syslog.log__
* _authpriv_ logs from … to __/var/log/security/authpriv.log__
* Smarter logrotate (add timestamp, move some old log files to the same directory,…).
* Remove some useless packages.
* Permit root SSH login with password (no standard user…).
*
#### How-to use it
* First, make an archive of the script and directories:
```
cd scripts/ ;
tar czvf latecommand.tar.gz latecommand/
```
* Then, it can be use at the end of a Debian preseed file:
```
d-i preseed/late_command string in-target chsh -s /bin/zsh ; \
in-target /usr/bin/tftp ${IP.SRV.TFTP} -c get ${PATH/TO/TFTPD/ROOT}/scripts/latecommand.tar.gz /tmp/latecommand.tar.gz ; \
in-target tar xzf /tmp/latecommand.tar.gz -C /tmp/ ; \
in-target /bin/sh /tmp/latecommand/post.sh
```
[memtest official website]: http://www.memtest.org/#downiso "Memtest86+ download"