ajout tout, get-distrub.sh a modif

main
Grégory Lebreton 1 year ago
parent c80ee7c1c3
commit dbe5df9151

@ -0,0 +1,4 @@
#!ipxe
dhcp
chain http://$192.168.1.52/install.ipxe

@ -0,0 +1,89 @@
default-lease-time 7200;
max-lease-time 7200;
allow unknown-clients;
#authoritative;
option subnet-mask 255.255.255.0;
###PXE###
option space PXE;
option PXE.mtftp-ip code 1 = ip-address;
option PXE.mtftp-cport code 2 = unsigned integer 16;
option PXE.mtftp-sport code 3 = unsigned integer 16;
option PXE.mtftp-tmout code 4 = unsigned integer 8;
option PXE.mtftp-delay code 5 = unsigned integer 8;
option arch code 93 = unsigned integer 16;
option space ipxe;
option ipxe-encap-opts code 175 = encapsulate ipxe;
option ipxe.priority code 1 = signed integer 8;
option ipxe.keep-san code 8 = unsigned integer 8;
option ipxe.skip-san-boot code 9 = unsigned integer 8;
option ipxe.syslogs code 85 = string;
option ipxe.cert code 91 = string;
option ipxe.privkey code 92 = string;
option ipxe.crosscert code 93 = string;
option ipxe.no-pxedhcp code 176 = unsigned integer 8;
option ipxe.bus-id code 177 = string;
option ipxe.san-filename code 188 = string;
option ipxe.bios-drive code 189 = unsigned integer 8;
option ipxe.username code 190 = string;
option ipxe.password code 191 = string;
option ipxe.reverse-username code 192 = string;
option ipxe.reverse-password code 193 = string;
option ipxe.version code 235 = string;
option iscsi-initiator-iqn code 203 = string;
# Feature indicators
option ipxe.pxeext code 16 = unsigned integer 8;
option ipxe.iscsi code 17 = unsigned integer 8;
option ipxe.aoe code 18 = unsigned integer 8;
option ipxe.http code 19 = unsigned integer 8;
option ipxe.https code 20 = unsigned integer 8;
option ipxe.tftp code 21 = unsigned integer 8;
option ipxe.ftp code 22 = unsigned integer 8;
option ipxe.dns code 23 = unsigned integer 8;
option ipxe.bzimage code 24 = unsigned integer 8;
option ipxe.multiboot code 25 = unsigned integer 8;
option ipxe.slam code 26 = unsigned integer 8;
option ipxe.srp code 27 = unsigned integer 8;
option ipxe.nbi code 32 = unsigned integer 8;
option ipxe.pxe code 33 = unsigned integer 8;
option ipxe.elf code 34 = unsigned integer 8;
option ipxe.comboot code 35 = unsigned integer 8;
option ipxe.efi code 36 = unsigned integer 8;
option ipxe.fcoe code 37 = unsigned integer 8;
option ipxe.vlan code 38 = unsigned integer 8;
option ipxe.menu code 39 = unsigned integer 8;
option ipxe.sdi code 40 = unsigned integer 8;
option ipxe.nfs code 41 = unsigned integer 8;
###RESEAUX###
subnet 192.168.1.0 netmask 255.255.255.0 {
option broadcast-address 192.168.1.255;
option routers 192.168.1.254;
option domain-name-servers 8.8.8.8, 1.1.1.1;
range 192.168.1.150 192.168.1.199;
ping-check = 1;
next-server IP;
# PXE
if option arch = 00:07 or option arch = 00:09 {
if exists user-class and option user-class = "iPXE" {
filename "http://IP/install.ipxe";
} else {
filename "ipxe/ipxe.efi";
}
} else if option arch = 00:06 {
if exists user-class and option user-class = "iPXE" {
filename "http://IP/install.ipxe";
} else {
filename "ipxe/ipxe32.efi";
}
} else {
if exists user-class and option user-class = "iPXE" {
filename "http://IP/install.ipxe";
} else {
filename "undionly.kpxe";
}
}
}

@ -0,0 +1,16 @@
#/etc/exports: the access control list for filesystems which may be exported
# to NFS clients. See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check)
#
# POUR TOUTES LES DISTRIBS (ACCES FICHIERS)
/var/lib/tftpboot/ *(async,no_root_squash,no_subtree_check,ro)
# POUR UBUNTU (ACCES FICHIERS)
#/var/lib/tftpboot/ubuntu-live *(async,no_root_squash,no_subtree_check,ro)

@ -0,0 +1,214 @@
#!ipxe
### VARIABLES
set menu-timeout 72000
set submenu-timeout ${menu-timeout}
isset ${menu-default} || set menu-default item1
set server_ip 192.168.1.100
# HS
#console --picture http://boot.ipxe.org/ipxe.png
##################### MENU #####################
menu
item --gap --
item --gap -- - LINUX 64 BITS -
item --gap -- -------------DEBIAN-11------------------
item debian-11 Debian-11-Bullseye
item --gap -- -------------DEBIAN-12-------------
item debian-12 Debian-12-Bookworm
item --gap --
item --gap -- ----------------------------------------
item --gap -- - LINUX 32 BITS -
item --gap -- -------------DEBIAN-BOOKWORM-32-------------
item debian-12-32 Debian-12-32-bits
item --gap -- -------------Q4OS-INSTALL-32------------
item q4os-32 Q4os-32
item --gap -- -------------UBUNTU-TRINITY-32------------
item ubuntu-trinity-32 Ubuntu-Trinity-32
item --gap -- -------------DEBIAN-LXQT-32------------
item debian-lxqt-32 Debian-LXQT-32
item --gap --
item --gap -- ----------------------------------------
item --gap -- - LINUX LIVE -
item --gap -- -------------UBUNTU-24----------------
item ubuntu-live Ubuntu-Live
item --gap -- -------------BUNSEN-LABS-LIVE-32------------
item bunsenlabs-live-32 BunsenLabs-live-32
item --gap -- -------------ARCHBANG-LIVE-32------------
item archbang-live-32 Archbang-Live-32
item --gap -- -------------PORTEUS-OPENBOX-LIVE-32------------
item porteus-openbox-32 Porteus-Openbox-32
item --gap -- -------------DEBIAN-11-LIVE-64-------------
item debian-live-64 Debian-live-64
item --gap -- -------------KALI-LIVE-64---------------
item kali-live-64 Kali-Live-64
item --gap -- -------------LMDE-LIVE-32---------------
item lmde-32 LMDE-live-32
item --gap -- -------------LMDE-LIVE-64---------------
item lmde-64 LMDE-live-64
item --gap --
item --gap -- ----------------------------------------
item --gap -- - LINUX TOOLS -
item --gap -- -------------SHREDOS-64-----------------
item shredos-64 Shredos-64 (nwipe)
item --gap -- -------------GPARTED-LIVE-64------------
item gparted-live-64 Gparted-live-64
item --gap --
item --gap -- -------------SORTIR---------------------
item shell Shell iPXE
item exit Exit
choose --timeout ${menu-timeout} --default ${menu-default} target && goto ${target}
##################### DISTRIBS #####################
#Paramètres de démarrage pour DEBIAN-11
:debian-11
kernel http://${server_ip}/tftpboot/debian-64/debian-installer/amd64/linux
initrd http://${server_ip}/tftpboot/debian-64/debian-installer/amd64/initrd.gz
imgargs linux DEBIAN_FRONTEND=newt --- net.ifnames=0
boot || goto menu
#Paramètres de démarrage pour DEBIAN-12
:debian-12
kernel http://${server_ip}/tftpboot/debian-12/64/linux
initrd http://${server_ip}/tftpboot/debian-12/64/initrd.gz
imgargs linux DEBIAN_FRONTEND=newt --- net.ifnames=0
boot || goto menu
#Paramètres de démarrage pour DEBIAN-12-32
:debian-12-32
kernel http://${server_ip}/tftpboot/debian-12/32/linux
initrd http://${server_ip}/tftpboot/debian-12/32/initrd.gz
imgargs linux DEBIAN_FRONTEND=newt --- net.ifnames=0
boot || goto menu
#GOOD WINPE
#:winpe
#kernel http://${server_ip}/tftpboot/windows/wimboot
#initrd http://${server_ip}/tftpboot/windows/win10/bootmgr bootmgr
#initrd http://${server_ip}/tftpboot/windows/winpe/boot/bcd bcd
#initrd http://${server_ip}/tftpboot/windows/winpe/boot/boot.sdi boot.sdi
#initrd http://${server_ip}/tftpboot/windows/winpe/sources/boot.wim boot.wim
#boot || goto menu
#TEST BRICE
#Paramètres de démarrage pour SLITAZ-LIVE-32 -- TESTING
:slitaz-live-32
kernel http://192.168.1.100/tftpboot/slitaz-live-32/boot/bzImage
initrd http://192.168.1.100/tftpboot/slitaz-live-32/boot/rootfs1.gz
imgargs bzImage ip=dhcp quiet splash
boot || goto menu
:bunsenlabs-live-32
kernel http://${server_ip}/tftpboot/bunsenlabs-32/install/gtk/vmlinuz
initrd http://${server_ip}/tftpboot/bunsenlabs-32/install/gtk/initrd.gz
imgargs vmlinuz initrd=initrd root=/dev/nfs components netboot=nfs nfsroot=${server_ip}:/var/lib/tftpboot/bunsenlabs-32 ip=dhcp quiet splash --
boot || goto menu
#Q4OS : fonctionne
:q4os-32
kernel http://${server_ip}/tftpboot/q4os-32/install.386/vmlinuz
initrd http://${server_ip}/tftpboot/q4os-32/install.386/initrd.gz
imgargs vmlinuz initrd=initrd root=/dev/nfs components netboot=nfs nfsroot=${server_ip}:/var/lib/tftpboot/q4os-32
boot || goto menu
## Ubuntu Trinity : le live se lance mais l'installeur (ubuquity) plante
:ubuntu-trinity-32
kernel http://${server_ip}/tftpboot/ubuntu-trinity-32/casper/vmlinuz
initrd http://${server_ip}/tftpboot/ubuntu-trinity-32/casper/initrd
imgargs vmlinuz initrd=initrd root=/dev/nfs boot=casper netboot=nfs nfsroot=${server_ip}:/var/lib/tftpboot/ubuntu-trinity-32 ip=dhcp quiet splash --
boot || goto menu
#Debian LXQT 32 bits : Ne marche pas. Le live reste bloqué sur un splash screen Debian. Et l'installeur cherche le cdrom comme support d'installation...
:debian-lxqt-32
kernel http://${server_ip}/tftpboot/debian-lxqt-32/d-i/gtk/vmlinuz
initrd http://${server_ip}/tftpboot/debian-lxqt-32/d-i/gtk/initrd.gz
imgargs vmlinuz initrd=initrd root=/dev/nfs netboot=nfs nfsroot=${server_ip}:/var/lib/tftpboot/debian-lxqt-32 ip=dhcp --
boot || goto menu
# ArchBang : Ne marche pas. "No more network". Charger 'intel-ucode.img' en plus de initramfs-linux.img' ?
:archbang-live-32
kernel http://${server_ip}/tftpboot/archbang-live-32/arch/boot/i686/vmlinuz-linux
initrd http://${server_ip}/tftpboot/archbang-live-32/arch/boot/i686/initramfs-linux.img
imgargs vmlinuz initrd=initrd archisobasedir=arch archisolabel=ARCHBANG_3112 cow_spacesize=2G root=/dev/nfs netboot=nfs nfsroot=${server_ip}:/var/lib/tftpboot/archbang-live-32 ip=dhcp --
boot || goto menu
## Porteus Openbox Live
:porteus-openbox-32
kernel http://${server_ip}/tftpboot/porteus-openbox-32/boot/syslinux/vmlinuz
initrd http://${server_ip}/tftpboot/porteus-openbox-32/boot/syslinux/initrd.xz
imgargs vmlinuz initrd=initrd nomagic base_only norootcopy root=/dev/nfs netboot=nfs nfsroot=${server_ip}:/var/lib/tftpboot/porteus-openbox-32 ip=dhcp --
boot || goto menu
#####################################OS-LIVE###############################################
#Paramètres de démarrage pour UBUNTU-LIVE -- OK
:ubuntu-live
kernel http://${server_ip}/tftpboot/ubuntu-live/casper/vmlinuz
initrd http://${server_ip}/tftpboot/ubuntu-live/casper/initrd
imgargs vmlinuz initrd=initrd root=/dev/nfs boot=casper netboot=nfs nfsroot=${server_ip}:/tftpboot/ubuntu-live ip=dhcp quiet splash --
boot || goto menu
#Paramètres de démarrage pour DEBIAN-LIVE-64 -- OK
:custom-debian
kernel http://${server_ip}/tftpboot/custom-debian/live/vmlinuz
initrd http://${server_ip}/tftpboot/custom-debian/live/initrd.gz
imgargs vmlinuz initrd=initrd root=/dev/nfs boot=live components netboot=nfs nfsroot=${server_ip}:/tftpboot/custom-debian ip=dhcp quiet splash --
boot
#Paramètres de démarrage pour DEBIAN-LIVE-64 -- OK
:debian-live-64
kernel http://${server_ip}/tftpboot/debian-live-64/live/vmlinuz-5.10.0-20-amd64
initrd http://${server_ip}/tftpboot/debian-live-64/live/initrd.img-5.10.0-20-amd64
imgargs vmlinuz-5.10.0-20-amd64 initrd=initrd root=/dev/nfs boot=live components netboot=nfs nfsroot=${server_ip}:/tftpboot/debian-live-64 ip=dhcp quiet splash --
boot
#Paramètres de démarrage pour KALI-LIVE-64 -- OK
:kali-live-64
kernel http://${server_ip}/tftpboot/kali-live-64/live/vmlinuz
initrd http://${server_ip}/tftpboot/kali-live-64/live/initrd.img
imgargs vmlinuz initrd=initrd root=/dev/nfs boot=live components netboot=nfs nfsroot=${server_ip}:/var/lib/tftpboot/kali-live-64 ip=dhcp quiet splash --
boot || goto menu
#Paramètres de démarrage pour SHRED OS-64 -- OK
:shredos-64
kernel http://${server_ip}/tftpboot/shredos-64/boot/bzImage console=tty3 quiet loglevel=0
boot || goto menu
#Paramètres de démarrage pour LMDE-LIVE-32 OK
:lmde-32
kernel http://${server_ip}/tftpboot/lmde-live-32/live/vmlinuz
initrd http://${server_ip}/tftpboot/lmde-live-32/live/initrd.lz
imgargs vmlinuz initrd=initrd boot=live user=mint initrd=initrd root=/dev/nfs netboot=nfs nfsroot=${server_ip}:/var/lib/tftpboot/lmde-live-32 ip=dhcp quiet nosplash --
boot || goto menu
#Paramètres de démarrage pour LMDE-LIVE-64 OK
:lmde-64
kernel http://${server_ip}/tftpboot/lmde-live-64/live/vmlinuz
initrd http://${server_ip}/tftpboot/lmde-live-64/live/initrd.lz
imgargs vmlinuz initrd=initrd boot=live user=mint initrd=initrd root=/dev/nfs netboot=nfs nfsroot=${server_ip}:/var/lib/tftpboot/lmde-live-64 ip=dhcp quiet nosplash --
boot || goto menu
#Paramètres de démarrage pour GPARTED-LIVE-64 OK
:gparted-live-64
kernel http://${server_ip}/lib/tftpboot/gparted-live-64/live/vmlinuz
initrd http://${server_ip}/tftpboot/gparted-live-64/live/initrd.img
imgargs vmlinuz initrd=initrd boot=live config components union=overlay username=user language=fr console-setup/layoutcode?=fr noswap noeject vga=788 netboot=nfs nfsroot=${server_ip}:/var/lib/tftpboot/gparted-live-64 quiet nosplash --
boot
:shell
shell
:exit
exit

@ -0,0 +1,17 @@
# Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf).
#DHCPDv4_CONF=/etc/dhcp/dhcpd.conf
#DHCPDv6_CONF=/etc/dhcp/dhcpd6.conf
# Path to dhcpd's PID file (default: /var/run/dhcpd.pid).
#DHCPDv4_PID=/var/run/dhcpd.pid
#DHCPDv6_PID=/var/run/dhcpd6.pid
# Additional options to start dhcpd with.
# Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead
#OPTIONS=""
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACESv4=NETINTERFACE
INTERFACESv6=""

@ -0,0 +1,243 @@
#
# Sample configuration file for the Samba suite for Debian GNU/Linux.
#
#
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options most of which
# are not shown in this example
#
# Some options that are often worth tuning have been included as
# commented-out examples in this file.
# - When such options are commented with ";", the proposed setting
# differs from the default Samba behaviour
# - When commented with "#", the proposed setting is the default
# behaviour of Samba but the option is considered important
# enough to be mentioned here
#
# NOTE: Whenever you modify this file you should run the command
# "testparm" to check that you have not made any basic syntactic
# errors.
#======================= Global Settings =======================
[global]
## Browsing/Identification ###
# Change this to the workgroup/NT-domain name your Samba server will part of
workgroup = WORKGROUP
#### Networking ####
# The specific set of interfaces / networks to bind to
# This can be either the interface name or an IP address/netmask;
# interface names are normally preferred
; interfaces = 127.0.0.0/8 eth0
# Only bind to the named interfaces and/or networks; you must use the
# 'interfaces' option above to use this.
# It is recommended that you enable this feature if your Samba machine is
# not protected by a firewall or is a firewall itself. However, this
# option cannot handle dynamic or non-broadcast interfaces correctly.
; bind interfaces only = yes
#### Debugging/Accounting ####
# This tells Samba to use a separate log file for each machine
# that connects
log file = /var/log/samba/log.%m
# Cap the size of the individual log files (in KiB).
max log size = 1000
# We want Samba to only log to /var/log/samba/log.{smbd,nmbd}.
# Append syslog@1 if you want important messages to be sent to syslog too.
logging = file
# Do something sensible when Samba crashes: mail the admin a backtrace
panic action = /usr/share/samba/panic-action %d
####### Authentication #######
# Server role. Defines in which mode Samba will operate. Possible
# values are "standalone server", "member server", "classic primary
# domain controller", "classic backup domain controller", "active
# directory domain controller".
#
# Most people will want "standalone server" or "member server".
# Running as "active directory domain controller" will require first
# running "samba-tool domain provision" to wipe databases and create a
# new domain.
server role = standalone server
obey pam restrictions = yes
# This boolean parameter controls whether Samba attempts to sync the Unix
# password with the SMB password when the encrypted SMB password in the
# passdb is changed.
unix password sync = yes
# For Unix password sync to work on a Debian GNU/Linux system, the following
# parameters must be set (thanks to Ian Kahan <<kahan@informatik.tu-muenchen.de> for
# sending the correct chat script for the passwd program in Debian Sarge).
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
# This boolean controls whether PAM will be used for password changes
# when requested by an SMB client instead of the program listed in
# 'passwd program'. The default is 'no'.
pam password change = yes
# This option controls how unsuccessful authentication attempts are mapped
# to anonymous connections
map to guest = bad user
########## Domains ###########
#
# The following settings only takes effect if 'server role = classic
# primary domain controller', 'server role = classic backup domain controller'
# or 'domain logons' is set
#
# It specifies the location of the user's
# profile directory from the client point of view) The following
# required a [profiles] share to be setup on the samba server (see
# below)
; logon path = \\%N\profiles\%U
# Another common choice is storing the profile in the user's home directory
# (this is Samba's default)
# logon path = \\%N\%U\profile
# The following setting only takes effect if 'domain logons' is set
# It specifies the location of a user's home directory (from the client
# point of view)
; logon drive = H:
# logon home = \\%N\%U
# The following setting only takes effect if 'domain logons' is set
# It specifies the script to run during logon. The script must be stored
# in the [netlogon] share
# NOTE: Must be store in 'DOS' file format convention
; logon script = logon.cmd
# This allows Unix users to be created on the domain controller via the SAMR
# RPC pipe. The example command creates a user account with a disabled Unix
# password; please adapt to your needs
; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u
# This allows machine accounts to be created on the domain controller via the
# SAMR RPC pipe.
# The following assumes a "machines" group exists on the system
; add machine script = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u
# This allows Unix groups to be created on the domain controller via the SAMR
# RPC pipe.
; add group script = /usr/sbin/addgroup --force-badname %g
############ Misc ############
# Using the following line enables you to customise your configuration
# on a per machine basis. The %m gets replaced with the netbios name
# of the machine that is connecting
; include = /home/samba/etc/smb.conf.%m
# Some defaults for winbind (make sure you're not using the ranges
# for something else.)
; idmap config * : backend = tdb
; idmap config * : range = 3000-7999
; idmap config YOURDOMAINHERE : backend = tdb
; idmap config YOURDOMAINHERE : range = 100000-999999
; template shell = /bin/bash
# Setup usershare options to enable non-root users to share folders
# with the net usershare command.
# Maximum number of usershare. 0 means that usershare is disabled.
# usershare max shares = 100
# Allow users who've been granted usershare privileges to create
# public shares, not just authenticated ones
usershare allow guests = yes
#======================= Share Definitions =======================
[homes]
comment = Home Directories
browseable = no
# By default, the home directories are exported read-only. Change the
# next parameter to 'no' if you want to be able to write to them.
read only = yes
# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
create mask = 0700
# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
directory mask = 0700
# By default, \\server\username shares can be connected to by anyone
# with access to the samba server.
# The following parameter makes sure that only "username" can connect
# to \\server\username
# This might need tweaking when using external authentication schemes
valid users = %S
# Un-comment the following and create the netlogon directory for Domain Logons
# (you need to configure Samba to act as a domain controller too.)
;[netlogon]
; comment = Network Logon Service
; path = /home/samba/netlogon
; guest ok = yes
; read only = yes
# Un-comment the following and create the profiles directory to store
# users profiles (see the "logon path" option above)
# (you need to configure Samba to act as a domain controller too.)
# The path below should be writable by all users so that their
# profile directory may be created the first time they log on
;[profiles]
; comment = Users profiles
; path = /home/samba/profiles
; guest ok = no
; browseable = no
; create mask = 0600
; directory mask = 0700
[printers]
comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
guest ok = no
read only = yes
create mask = 0700
# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = no
# Uncomment to allow remote administration of Windows print drivers.
# You may need to replace 'lpadmin' with the name of the group your
# admin users are members of.
# Please note that you also need to set appropriate Unix permissions
# to the drivers directory for these users to have write rights in it
; write list = root, @lpadmin
[win10]
path = /var/lib/tftpboot/windows/
browseable = no
writable = no
guest ok = yes
create mask = 0775
directory mask = 0775

@ -0,0 +1,5 @@
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/var/lib/tftpboot"
TFTP_ADDRESS="IP:69"
TFTP_OPTIONS="--secure"
RUN_DAEMON="yes"

@ -0,0 +1,100 @@
#!/bin/bash
# GET ISO FILES
# LMDE-LIVE-64 - OK
cd /tmp
url="https://ftp.crifo.org/mint-cd/debian/lmde-5-cinnamon-64bit.iso"
wget $url
sudo mount -o loop lmde-5-cinnamon-64bit.iso /mnt
sudo cp -r /mnt/. /var/lib/tftpboot/lmde-live-64
sudo umount /mnt
sudo rm -rf /tmp/lmde-5-cinnamon-64bit.iso
# LMDE-LIVE-32 - OK
url="https://ftp.crifo.org/mint-cd/debian/lmde-5-cinnamon-32bit.iso"
wget $url
sudo mount -o loop ./lmde-5-cinnamon-32bit.iso /mnt
sudo cp -r /mnt/. /var/lib/tftpboot/lmde-live-32
sudo umount /mnt
sudo rm -rf /tmp/lmde-5-cinnamon-32bit.iso
# DEBIAN-64 - OK
url="https://ftp.debian.org/debian/dists/buster/main/installer-amd64/current/images/netboot/netboot.tar.gz"
wget $url
mkdir netboot
tar -xzvf netboot.tar.gz -C netboot
sudo cp -r netboot/. /var/lib/tftpboot/debian-64
sudo rm -rf netboot netboot.tar.gz
# DEBIAN-32(netboot)
url="https://cdimage.debian.org/debian-cd/current/i386/iso-cd/debian-11.3.0-i386-netinst.iso"
wget $url
sudo mount -o loop ./debian-11.3.0-i386-netinst.iso /mnt
sudo cp -r /mnt/. /var/lib/tftpboot/debian-32
sudo umount /mnt
sudo rm -rf /tmp/debian-11.3.0-i386-netinst.iso
# DEBIAN-LIVE-64 - OK
url="https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/debian-live-11.6.0-amd64-gnome.iso"
wget $url
sudo mount -o loop ./debian-live-11.6.0-amd64-gnome.iso /mnt
sudo cp -r /mnt/. /var/lib/tftpboot/debian-live-64/
sudo umount /mnt
sudo rm -rf /tmp/debian-live-11.6.0-amd64-gnome.iso
# DEBIAN-LIVE-32
url="https://cdimage.debian.org/debian-cd/current-live/i386/iso-hybrid/debian-live-11.3.0-i386-gnome.iso"
wget $url
sudo mount -o loop ./debian-live-11.3.0-i386-gnome.iso /mnt
sudo cp -r /mnt/. /var/lib/tftpboot/debian-live-32/
sudo umount /mnt
sudo rm -rf /tmp/debian-live-11.3.0-i386-gnome.iso
# KALI-LIVE-64 - OK
url= "https://cdimage.kali.org/kali-2022.4/kali-linux-2022.4-live-amd64.iso"
wget $url
sudo mount -o loop ./kali-linux-2022.4-live-amd64.iso /mnt
sudo cp -r /mnt/. /var/lib/tftpboot/kali-live-64
sudo umount /mnt
sudo rm -rf /tmp/kali-linux-2022.4-live-amd64.iso
# SHREDOS-64
url="https://github.com/PartialVolume/shredos.x86_64/releases/download/v2021.08.2_21_x86-64_0.32.023/shredos-2021.08.2_21_x86-64_0.32.023_20220126.iso"
wget $url
sudo mount -o loop ./shredos-2021.08.2_21_x86-64_0.32.023_20220126.iso /mnt
sudo cp -r /mnt/. /var/lib/tftpboot/shredos-64
sudo umount /mnt
sudo rm -rf /tmp/shredos-2021.08.2_21_x86-64_0.32.023_20220126.iso
# SHREDOS-32
url="https://github.com/PartialVolume/shredos.x86_64/releases/download/v2021.08.2_21_x86-64_0.32.023/shredos-2021.08.2_21_i586_0.32.023_20220126.iso"
wget $url
sudo mount -o loop ./shredos-2021.08.2_21_i586_0.32.023_20220126.iso /mnt
sudo cp -r /mnt/. /var/lib/tftpboot/shredos-32
sudo umount /mnt
sudo rm -rf /tmp/shredos-2021.08.2_21_i586_0.32.023_20220126.iso
# GPARTED-LIVE-64 - OK
url="https://downloads.sourceforge.net/gparted/gparted-live-1.4.0-1-amd64.iso"
wget $url
sudo mount -o loop ./gparted-live-1.4.0-1-amd64.iso /mnt
sudo cp -r /mnt/. /var/lib/tftpboot/gparted-live-64
sudo umount /mnt
sudo rm -rf /tmp/gparted-live-1.4.0-1-amd64.iso
# GPARTED-LIVE-32 - OK
url="https://downloads.sourceforge.net/gparted/gparted-live-1.4.0-1-i686.iso"
wget $url
sudo mount -o loop ./gparted-live-1.4.0-1-i686.iso /mnt
sudo cp -r /mnt/. /var/lib/tftpboot/gparted-live-32
sudo umount /mnt
sudo rm -rf /tmp/gparted-live-1.4.0-1-i686.iso
# UBUNTU-LIVE - OK
url="https://releases.ubuntu.com/22.04/ubuntu-22.04.1-desktop-amd64.iso"
wget $url
sudo mount -o loop ./ubuntu-22.04.1-desktop-amd64.iso /mnt
sudo cp -r /mnt/. /var/lib/tftpboot/ubuntu-live
sudo umount /mnt
sudo rm -rf /tmp/ubuntu-22.04.1-desktop-amd64.iso

@ -0,0 +1,83 @@
#!/bin/bash
# VARIABLES
IP=$(ip route get 1.2.3.4 | awk '{print $7}')
INTERFACE="$(ip addr show | awk '/inet.*brd/{print $NF; exit}')"
# DEPENDANCES
sudo apt update -y
sudo apt install wget -y
#sudo apt install wimboot mkisofs cabextract -y
# DHCP SERVICE
sudo apt install isc-dhcp-server -y
mv /etc/default/isc-dhcp-server /etc/default/isc-dhcp-server.BAK
sed -i "s/NETINTERFACE/$INTERFACE/" ./configs/isc-dhcp-server; sudo cp ./configs/isc-dhcp-server /etc/default/isc-dhcp-server
mv /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.BAK
sed -i "s/IP/$IP/g" ./configs/dhcpd.conf; sudo cp ./configs/dhcpd.conf /etc/dhcp/
# TFTP
sudo apt install tftpd-hpa -y
sudo mkdir -p /var/lib/tftpboot
sed -i "s/IP/$IP/" ./configs/tftpd-hpa; cp ./configs/tftpd-hpa /etc/default/tftpd-hpa
sudo service isc-dhcp-server restart
# NFS
sudo apt install nfs-kernel-server -y
# LAMP
sudo apt install apache2 php libapache2-mod-php php-mysql php-curl php-gd php-intl php-json php-mbstring php-xml php-zip -y
ln -s /var/lib/tftpboot /var/www/html/tftpboot
cd /var/lib/tftpboot
sudo wget http://boot.ipxe.org/undionly.kpxe
sudo wget http://boot.ipxe.org/ipxe.efi
cd -
# CHAIN.IPXE
#cd /tmp
#git clone git://git.ipxe.org/ipxe.git
#cd /tmp/ipxe/src
#sed -i "s/IP/$IP/" ./configs/chain.ipxe; sudo cp ./configs/chain.ipxe /tmp/ipxe/src/chain.ipxe
# INSTALL.IPXE (MENU)
sudo sed -i "s/IP/$IP/" ./configs/install.ipxe; sudo cp ./configs/install.ipxe /var/www/html/install.ipxe
sudo ln -s /var/www/html/install.ipxe /var/lib/tftpboot/
# ALLOW SHARING IN THE NFS CONF FILE :
sudo echo "/var/lib/tftpboot/ *(async,no_root_squash,no_subtree_check,ro) /etc/exports"
sudo systemctl restart nfs-kernel-server
# SAMBA FOR WIN INSTALLS
sudo apt install samba -y
sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.BAK
sudo cp ./configs/smb.conf /etc/samba/smb.conf
sudo systemctl enable smbd
sudo systemctl restart smbd
# CREATION DES DOSSIERS DISTRIBS
cd /var/lib/tftpboot
sudo mkdir debian-32 debian-64 debian-live-32 debian-live-64 lmde-live-32 lmde-live-64 ubuntu-live kali-live-32 kali-live-64 shredos-32 shredos-64 gparted-live-32 gparted-live-64 windows
cd -
# REDEMARRAGE TFTPD-HPA
sudo service tftpd-hpa restart
# INSTALL DES DISTRIBS (SCRIPT MAX)
sudo ./get-distribs.sh
# WINDOWS PE -- TODO
# INSTALL DEPENDANCES
# PLACEMENT FICHIERS WINPE + AUTRES WINDOWS
# PRE CONFIG WINPE POUR AUTOBOOT (NETUSE DANS STARTCMD)
# GOOD RIGHTS (voir pour windows...)
sudo chown -R root:root /var/lib/tftpboot
sudo chmod 755 /var/lib/tftpboot
# REBOOT
echo "redémarrage!"
sudo reboot
Loading…
Cancel
Save