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.
This commit is contained in:
Gerd v. Egidy 2022-09-14 22:23:09 +02:00
parent 99b906f21f
commit ba97b5ce78

View file

@ -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}
}