From 5ffaf42e5a16482d729d086423bf71d564c8a4aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szymon=20Karpi=C5=84ski?= Date: Mon, 3 Feb 2020 23:42:36 +0100 Subject: [PATCH] downloading squashfs over http for faster boot --- linux/initramfs/download.sh | 2 +- tftp/Dockerfile | 3 ++- tftp/http.xinetd.conf | 11 +++++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 tftp/http.xinetd.conf diff --git a/linux/initramfs/download.sh b/linux/initramfs/download.sh index c12b0fb..9a51dd7 100644 --- a/linux/initramfs/download.sh +++ b/linux/initramfs/download.sh @@ -1,7 +1,7 @@ #!/bin/sh . /scripts/functions configure_networking -tftp -g -r root.squashfs 192.168.14.2 +wget http://192.168.14.2/root.squashfs mkdir /mnt modprobe loop losetup /dev/loop0 diff --git a/tftp/Dockerfile b/tftp/Dockerfile index e851127..6f9ad64 100644 --- a/tftp/Dockerfile +++ b/tftp/Dockerfile @@ -1,4 +1,5 @@ FROM debian:buster -RUN apt update && apt install -y xinetd tftpd-hpa +RUN apt update && apt install -y xinetd tftpd-hpa busybox COPY tftp.xinetd.conf /etc/xinetd.d/tftp +COPY http.xinetd.conf /etc/xinetd.d/http CMD ["script", "-c", "/usr/sbin/xinetd -d"] diff --git a/tftp/http.xinetd.conf b/tftp/http.xinetd.conf new file mode 100644 index 0000000..8fd7603 --- /dev/null +++ b/tftp/http.xinetd.conf @@ -0,0 +1,11 @@ +service http +{ + socket_type = stream + protocol = tcp + wait = no + user = root + server = /bin/busybox + server_args = httpd -if -h /tftpboot + port = 80 + flags = IPv4 +}