1. prereq

curl -s -u cidusr:Passw0rd http://d01cid.ddns.net/sharel/bin/inst-httpd | bash
Tip this is only needed if u want 2 use altlinux below

2. installation

2.1. redhat

yum -y install tftp-server
mkdir -p /tftpboot
sed -i s~"-s /var/lib/tftpboot"~"-v -s /tftpboot/"~ /usr/lib/systemd/system/tftp.service
systemctl enable --now tftp.socket

2.2. debian

apt -y install tftpd-hpa
mkdir -p /tftpboot
sed -i s~"TFTP_DIRECTORY=.*"~'TFTP_DIRECTORY="/tftpboot/"'~ /etc/default/tftpd-hpa
sed -i s~"TFTP_OPTIONS=.*"~'TFTP_OPTIONS="-4 -s -v"'~ /etc/default/tftpd-hpa
systemctl enable --now tftpd-hpa.service

3. images

3.1. altlinux

mkdir -p /tftpboot/img/altlinux/
mkdir -p /mnt/cdrom/
wget -q --show-progress http://nightly.altlinux.org/sisyphus/current/regular-rescue-latest-x86_64.iso -P /tmp/
mount -o loop /tmp/regular-rescue-latest-x86_64.iso /mnt/cdrom/
cp -pv /mnt/cdrom/rescue /tftpboot/img/altlinux/
cp -pv /mnt/cdrom/boot/initrd.img /tftpboot/img/altlinux/
cp -pv /mnt/cdrom/boot/vmlinuz /tftpboot/img/altlinux/
umount /mnt/cdrom/
rm -f /tmp/regular-rescue-latest-x86_64.iso
mkdir -p /var/www/html/altlinux/
mount -o bind /tftpboot/img/altlinux/ /var/www/html/altlinux/
grep -q "altlinux" /etc/fstab || echo "/tftpboot/img/altlinux/ /var/www/html/altlinux/ auto    bind" >> /etc/fstab

3.2. redhat

mkdir -p /tftpboot/img/rocky9-u2/
wget -N -q --show-progress https://download.rockylinux.org/pub/rocky/9/BaseOS/x86_64/os/isolinux/initrd.img -P /tftpboot/img/rocky9-u2/
wget -N -q --show-progress https://download.rockylinux.org/pub/rocky/9/BaseOS/x86_64/os/isolinux/vmlinuz -P /tftpboot/img/rocky9-u2/

3.2.1. debian

mkdir -p /tftpboot/img/debain12-u1/
curl -s https://deb.debian.org/debian/dists/Debian12.1/main/installer-amd64/current/images/netboot/netboot.tar.gz | tar xzP -C /tmp/
cp -pv /tmp/debian-installer/amd64/initrd.gz /tftpboot/img/debain12-u1/
cp -pv /tmp/debian-installer/amd64/linux /tftpboot/img/debain12-u1/
rm -fr /tmp/debian-installer/

4. configuration

curl -s -u cidusr:Passw0rd http://d01cid.ddns.net/sharel/img/pxe/20230817.tgz | tar xzP -C /tftpboot/
mkdir -p /tftpboot/pxelinux.cfg
> /tftpboot/pxelinux.cfg/default
vi /tftpboot/pxelinux.cfg/default
#
default menu.c32
prompt 0
timeout 100
ontimeout local

menu title --- pxe ---

label local
    menu label local
    localboot 0

label altlinux
    menu label altlinux
    kernel /img/altlinux/vmlinuz
    append initrd=/img/altlinux/initrd.img vga=771 ipv6.disable=1 automatic=method:http,server:10.1.1.10,directory:/altlinux/ stagename=rescue ramdisk_size=700000 root=bootchain bootchain=fg,altboot changedisk fastboot live ip=dhcp port=22 rootpw=xx biosdevname=0 net.ifnames=0

label rocky9-u2
    menu label rocky9-u2
    kernel /img/rocky9-u2/vmlinuz
    append initrd=/img/rocky9-u2/initrd.img inst.text inst.ks=http://cidusr:Passw0rd@d01cid.ddns.net/sharel/rsp/ks/rocky9-u2.cfg ipv6.disable=1 vga=791 biosdevname=0 net.ifnames=0

label debian12-u1
    menu label debian12-u1
    kernel /img/debian12-u1/linux
    append initrd=/img/debian12-u1/initrd.gz auto=true priority=critical url=http://cidusr:Passw0rd@d01cid.ddns.net/sharel/rsp/seed/debian12-u1.cfg --- vga=771 biosdevname=0 net.ifnames=0 ipv6.disable=1