From ba97b5ce78a833744e7bcb830c31b0d09e79867e Mon Sep 17 00:00:00 2001 From: "Gerd v. Egidy" Date: Wed, 14 Sep 2022 22:23:09 +0200 Subject: [PATCH] don't keep airootfs.sfs in ram twice when using archiso_http_srv (#56) Without this patch, airootfs.sfs is downloaded to /run/archiso/httpspace and then copied to /run/archiso/bootmnt. copytoram is automatically activated, which copies it to /run/archiso/copytoram and removes /run/archiso/bootmnt. The original /run/archiso/httpspace was kept, wasting ram. This patch gets rid of /run/archiso/httpspace and directly downloads to /run/archiso/bootmnt. This is then copied to copytoram and bootmnt removed, so we don't keep two copies in ram anymore. --- patches/archiso-v43-09-pxe_http.patch | 34 +++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 patches/archiso-v43-09-pxe_http.patch diff --git a/patches/archiso-v43-09-pxe_http.patch b/patches/archiso-v43-09-pxe_http.patch new file mode 100644 index 0000000..f9b6737 --- /dev/null +++ b/patches/archiso-v43-09-pxe_http.patch @@ -0,0 +1,34 @@ +diff -u -r archiso-43.orig/archiso/initcpio/hooks/archiso_pxe_http archiso-43/archiso/initcpio/hooks/archiso_pxe_http +--- archiso-43.orig/archiso/initcpio/hooks/archiso_pxe_http 2019-10-16 11:10:09.000000000 +0000 ++++ archiso-43/archiso/initcpio/hooks/archiso_pxe_http 2022-09-14 20:14:50.586664831 +0000 +@@ -23,7 +23,7 @@ + local _dst="${2}" + + msg ":: Downloading '${_url}'" +- if ! curl -L -f -o "/run/archiso/httpspace/${archisobasedir}${_dst}/${_url##*/}" --create-dirs "${_url}"; then ++ if ! curl -L -f -o "/run/archiso/bootmnt/${archisobasedir}${_dst}/${_url##*/}" --create-dirs "${_url}"; then + echo "ERROR: Downloading '${_url}'" + echo " Falling back to interactive prompt" + echo " You can try to fix the problem manually, log out when you are finished" +@@ -34,9 +34,9 @@ + archiso_pxe_http_mount_handler () { + newroot="${1}" + +- msg ":: Mounting /run/archiso/httpspace (tmpfs) filesystem, size='${archiso_http_spc}'" +- mkdir -p "/run/archiso/httpspace" +- mount -t tmpfs -o size="${archiso_http_spc}",mode=0755 httpspace "/run/archiso/httpspace" ++ msg ":: Mounting /run/archiso/bootmnt (tmpfs) filesystem, size='${archiso_http_spc}'" ++ mkdir -p "/run/archiso/bootmnt" ++ mount -t tmpfs -o size="${archiso_http_spc}",mode=0755 bootmnt "/run/archiso/bootmnt" + + _curl_get "${archiso_http_srv}${archisobasedir}/${arch}/airootfs.sfs" "/${arch}" + +@@ -47,8 +47,5 @@ + _curl_get "${archiso_http_srv}${archisobasedir}/${arch}/airootfs.sfs.sig" "/${arch}" + fi + +- mkdir -p "/run/archiso/bootmnt" +- mount -o bind /run/archiso/httpspace /run/archiso/bootmnt +- + archiso_mount_handler ${newroot} + }