Compare commits

..

No commits in common. 'dcbf9a9a0de7bb9e07ed0e8d52baa5eb090b0180' and '0245fac66994f9c3948c14c079be1a1b5dbd6fcb' have entirely different histories.

  1. 28
      Dockerfile
  2. 6
      Readme.md
  3. 4
      scripts/receive.sh
  4. 4
      scripts/send.sh
  5. BIN
      src/tftpboot/ldlinux.c32
  6. BIN
      src/tftpboot/pxelinux.0

@ -3,43 +3,25 @@ FROM debian:buster
RUN apt update RUN apt update
RUN apt install -y make debootstrap supervisor isc-dhcp-server tftpd-hpa busybox squashfs-tools RUN apt install -y make debootstrap supervisor isc-dhcp-server tftpd-hpa busybox squashfs-tools
# Downloads base Debian 10 to /linux/build/cache. The Makefile in linux/ would # Linux image
# download base debian system to linux/build/cache itself, but to speed up
# rebuilding this Docker container the download is run separately to avoid
# repeating it in future builds.
ADD linux /linux ADD linux /linux
RUN mkdir -p linux/build && debootstrap buster linux/build/cache RUN mkdir -p linux/build && debootstrap buster linux/build/cache
# Copies src/tftpboot directory to /tftpboot
ADD src/tftpboot /tftpboot
# Downloads Syslinux and moves ldlinux.c32 and pxelinux.0 files to /tftpboot
RUN wget https://mirrors.edge.kernel.org/pub/linux/utils/boot/syslinux/syslinux-6.03.tar.gz && \
tar -xzvf syslinux-6.03.tar.gz && \
cp syslinux-6.03/bios/core/pxelinux.0 /tftpboot/pxelinux.0 && \
cp syslinux-6.03/bios/com32/elflink/ldlinux/ldlinux.c32 /tftpboot/ldlinux.c32
# Builds Linux with its Makefile
RUN cd /linux && make RUN cd /linux && make
# Creates and populates /tftpboot directory. Files stored there will be served # Files to be served
# by TFTP and HTTP (on port 8014). ADD src/tftpboot /tftpboot
RUN cp /linux/build/rootfs/initrd.img /tftpboot/initrd.img && \ RUN cp /linux/build/rootfs/initrd.img /tftpboot/initrd.img && \
cp /linux/build/rootfs/vmlinuz /tftpboot/vmlinuz && \ cp /linux/build/rootfs/vmlinuz /tftpboot/vmlinuz && \
mksquashfs /linux/build/rootfs /tftpboot/root.squashfs mksquashfs /linux/build/rootfs /tftpboot/root.squashfs
# Supervisor's config # Supervisor
COPY src/supervisor.conf /supervisor.conf COPY src/supervisor.conf /supervisor.conf
# DHCP server config # DHCP server
RUN mkdir -p /var/lib/dhcp && touch /var/lib/dhcp/dhcpd.leases RUN mkdir -p /var/lib/dhcp && touch /var/lib/dhcp/dhcpd.leases
COPY src/dhcpd.conf /etc/dhcp/dhcpd.conf COPY src/dhcpd.conf /etc/dhcp/dhcpd.conf
# The run.sh script setups networking and starts supervisor.
COPY src/run.sh /run.sh COPY src/run.sh /run.sh
RUN chmod +x /run.sh RUN chmod +x /run.sh
# Interface on which the server will be listening. Set with `-e INTERFACE=eth1`
ENV INTERFACE=eth0 ENV INTERFACE=eth0
CMD ["/run.sh"] CMD ["/run.sh"]

@ -36,7 +36,7 @@ An example run command might look like this:
docker run -e INETRFACE=eth42 --privileged --net host hugo/images docker run -e INETRFACE=eth42 --privileged --net host hugo/images
``` ```
After starting the server, all PCs connected to the network, when in network boot mode, should boot specialised Linux for cloning and present the user with a menu. After starting the server, all PCs connected to the network, when in network boot mode, should boot linux for cloning and present the user with a menu.
## Technical details ## Technical details
@ -60,9 +60,9 @@ The boot process of a computer connected to the server consists of the following
### Linux ### Linux
The Linux system being server is based on minimal Debian 10 Buster and boots to a menu allowing to send/receive: The Linux system served boots to a menu allowing to send/receive:
1. MBR of `/dev/sda` (raw copy of first 512 bytes, made by `dd`) 1. MBR of `/dev/sda` (raw copy of first 512 bytes, made by `dd`)
2. Partition table (in `sfdisk` format) 2. Partition table (in `sfdisk`'s format)
3. Image of `/dev/sda1` partition (in `partimage` format) 3. Image of `/dev/sda1` partition (in `partimage` format)
Both sending and receiving is done with UDP broadcast with `udpsender`/`udpreceiver`. Any custom action can be performed with root shell. See `linux/scripts` for more details. Both sending and receiving is done with UDP broadcast with `udpsender`/`udpreceiver`. Any custom action can be performed with root shell. See `linux/scripts` for more details.

@ -0,0 +1,4 @@
#!/bin/bash
INTERFACE=$1
udp-receiver --interface $INTERFACE

@ -0,0 +1,4 @@
#!/bin/bash
INTERFACE=$1
udp-sender --interface $INTERFACE

Binary file not shown.

Binary file not shown.
Loading…
Cancel
Save