From 251f56befd83b570e552f3cd1c415454ff3b2149 Mon Sep 17 00:00:00 2001 From: elishl Date: Sat, 6 May 2017 15:38:13 +0300 Subject: [PATCH] Corrections for PXE boot (#266) * Correction for a faulty condition The current condition works for checking existence of the .sfs files on the local file system. The proposed condition checks for the existence of the .sfs files on a remote server. * Correction for NFS & NBD & HTTP boot By default, Calamares searches for the .sfs files in the "bootmnt" directory. When "copytoram==y" (relevant for NFS & NBD & HTTP boot), the .sfs files are stored in the "copytoram" directory. The proposed code binds the "copytoram" dir with "bootmnt" so Calamares can "see" the .sfs. files. --- initcpio/hooks/miso | 2 ++ initcpio/hooks/miso_pxe_http | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/initcpio/hooks/miso b/initcpio/hooks/miso index 19adcde..e51d34e 100644 --- a/initcpio/hooks/miso +++ b/initcpio/hooks/miso @@ -237,6 +237,8 @@ miso_mount_handler() { if [[ "${copytoram}" == "y" ]]; then umount -d /run/miso/bootmnt + mkdir -p /run/miso/bootmnt/${misobasedir}/${arch} + mount -o bind /run/miso/copytoram /run/miso/bootmnt/${misobasedir}/${arch} fi } diff --git a/initcpio/hooks/miso_pxe_http b/initcpio/hooks/miso_pxe_http index 0907b20..b472bc2 100644 --- a/initcpio/hooks/miso_pxe_http +++ b/initcpio/hooks/miso_pxe_http @@ -41,7 +41,7 @@ miso_pxe_http_mount_handler () { local _src=${miso_http_srv}${misobasedir}/${arch} for sfs in livefs mhwdfs desktopfs rootfs;do - if [[ -f "${_src}/${sfs}.sfs" ]]; then + if [[ ! -z "$( curl -s --head "${_src}/${sfs}.sfs" | grep "OK" )" ]]; then _curl_get "${_src}/${sfs}.sfs" "/${arch}" if [[ "${checksum}" == "y" ]]; then