Add a script to download PXE files for Clonezilla

This commit is contained in:
Jeremy Gardais 2016-07-26 17:14:22 +02:00
parent 46b4ce5651
commit 764990e01f
2 changed files with 66 additions and 5 deletions

View File

@ -5,8 +5,9 @@
* [Download Debian](#download_debiansh) * [Download Debian](#download_debiansh)
* [Download Ubuntu](#download_ubuntush) * [Download Ubuntu](#download_ubuntush)
* [Make Debian Initrd with Firmware](#make_debian_initrd_with_firmwaresh) * [Make Debian Initrd with Firmware](#make_debian_initrd_with_firmwaresh)
* [Download diag tools](#download_diag_toolssh)
* [Debian late_command](#debian-late_command) * [Debian late_command](#debian-late_command)
* [Download diag tools](#download_diag_toolssh)
* [Download Clonezilla](#download_clonezillash)
## Description ## Description
Set of scripts to download and generate necessary files to allow differents GNU/Linux distributions to boot through the network. Set of scripts to download and generate necessary files to allow differents GNU/Linux distributions to boot through the network.
@ -37,10 +38,6 @@ The script will provide Debian's netboot installers with **additionnals firmware
* **qlogic**: For QLogic Infiniband, SCSI, Fibre Channel/FCoE adapters. * **qlogic**: For QLogic Infiniband, SCSI, Fibre Channel/FCoE adapters.
* Extract initrd and firmwares packages to build a new initrd. * 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 ### Debian late_command
#### Description #### Description
@ -76,5 +73,17 @@ in-target /usr/bin/tftp ${IP.SRV.TFTP} -c get ${PATH/TO/TFTPD/ROOT}/scripts/late
in-target tar xzf /tmp/latecommand.tar.gz -C /tmp/ ; \ in-target tar xzf /tmp/latecommand.tar.gz -C /tmp/ ; \
in-target /bin/sh /tmp/latecommand/post.sh in-target /bin/sh /tmp/latecommand/post.sh
``` ```
### download_diag_tools.sh
The script will download some diagnostic tools:
* memtest86 from [memtest86's official website][memtest official website].
### download_clonezilla.sh
* Download PXE files for Clonezilla live from [OSDN][OSDN url]. A Sourceforge repository is also available but…; see the [Clonezilla download page][clonezilla download] for more informations.
* Download for both **amd64** and **i686**.
* Make a example configuration file.
* More informations on the [Clonezilla website][clonezilla via pxe server].
[memtest official website]: http://www.memtest.org/#downiso "Memtest86+ download" [memtest official website]: http://www.memtest.org/#downiso "Memtest86+ download"
[OSDN url]: https://osdn.jp/projects/clonezilla/
[clonezilla dowload]: http://clonezilla.org/downloads/download.php?branch=stable
[clonezilla via pxe server]: http://clonezilla.org/livepxe.php "Clonezilla Live on PXE server"

52
scripts/download_clonezilla.sh Executable file
View File

@ -0,0 +1,52 @@
#!/bin/bash
# This script do the following:
# Download Clonezilla Stable for amd64 and i686
# Make a PXE's config file (aka menu.cfg)
TFTP_ROOT="/var/lib/tftpboot"
CZ_INSTALLER_DIR="${TFTP_ROOT}/installer/clonezilla"
CZ_CONFIG_PXE="${CZ_INSTALLER_DIR}/menu.cfg.example"
CZ_VERSION="2.4.7-8"
# Create directories and config file
rm -rf "${CZ_INSTALLER_DIR}"
mkdir -p "${CZ_INSTALLER_DIR}"
touch "${CZ_CONFIG_PXE}"
for ARCH in amd64 i686; do # For available classic architecture
CZ_URL="https://osdn.jp/dl/clonezilla/clonezilla-live-${CZ_VERSION}-${ARCH}.zip"
CZ_TEMP_FILE="/tmp/clonezilla-live-"${CZ_VERSION}"-"${ARCH}".zip "
# Create and go into directory
mkdir -p ${CZ_INSTALLER_DIR}/${ARCH}
pushd ${CZ_INSTALLER_DIR}/${ARCH}
# Download and extract only PXE files
wget "${CZ_URL}" -O "${CZ_TEMP_FILE}"
unzip -j "${CZ_TEMP_FILE}" live/vmlinuz live/initrd.img live/filesystem.squashfs -d .
rm -f "${CZ_TEMP_FILE}"
popd
# Config file
/bin/cat >> "${CZ_CONFIG_PXE}" << EOF
label live${ARCH}
menu label Clonezilla Live ^${ARCH}
kernel installer/clonezilla/${ARCH}/vmlinuz
APPEND initrd=installer/clonezilla/${ARCH}/initrd.img boot=live username=user union=overlay config components quiet noswap edd=on nomodeset nodmraid locales= keyboard-layouts= ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_live_batch=no net.ifnames=0 nosplash noprompt fetch=tftp://129.20.27.239/installer/clonezilla/${ARCH}/filesystem.squashfs
EOF
done
# Config file
/bin/cat >> "${CZ_CONFIG_PXE}" << EOF
label separator
menu label -----
label mainmenu
menu label ^Back..
menu exit
EOF
exit 0