[arch-releng] [RFC] Improvements in PXE boot (add HTTP/FTP support)
Tested and worked fine both HTTP/FTP on differents servers. Feedback is welcomed! There is no resolver on initramfs so only IP is supported (at least for now). Note 1: This work is in a branch that uses mount from util-linux (mkinitcpio-git) Note 2: Due some issue in mkinitcpio in add_binary() you need curl installed in build enviroment. :: Running Hook [archiso_pxe_common] IP-Config: eth0 hardware address 52:54:00:12:34:57 mtu 1500 IP-Config: eth0 guessed broadcast address 192.168.0.255 IP-Config: eth0 guessed nameserver address 192.168.0.218 IP-Config: eth0 complete (from 192.168.0.218): address: 192.168.0.90 broadcast: 192.168.0.255 netmask: 255.255.255.0 gateway: 192.168.0.218 dns0 : 192.168.0.218 dns1 : 0.0.0.0 rootserver: 192.168.0.218 rootpath: filename : :: Running Hook [archiso_pxe_nbd] :: Running Hook [archiso_pxe_curl] :: Getting info of 'http://192.168.0.218/archlinux-2011.11.21-netinstall-i686.iso' :: Mounting /run/archiso/pxe_curl (tmpfs) filesystem, size='201326592' :: Downloading 'http://192.168.0.218/archlinux-2011.11.21-netinstall-i686.iso' % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 192M 100 192M 0 0 141M 0 0:00:01 0:00:01 --:--:-- 141M :: Mounting '/dev/disk/by-label/ARCH_201111' to '/run/archiso/bootmnt' :: Device '/dev/disk/by-label/ARCH_201111' mounted successfully.
One hook only setup the network device (archiso_pxe_common) the other
setup the NBD client (archiso_pxe_nbd).
New bootparam:
archiso_pxe_srv=IP
Allow to set an IP different from the PXE server.
Signed-off-by: Gerardo Exequiel Pozzi
It add support for downloading the iso via HTTP/FTP with curl.
The ISO is downloaded on /run (tmpfs) and setup a loop dev from it
(like in archiso_loop_mnt)
It must be located after archiso_pxe_nbd in mkinitcpio.conf, in that way
NBD is the default.
bootparm:
archiso_curl_url=http://192.168.0.7/archlinux/iso/archlinux.iso (absolute form)
Use an absolute URL.
archiso_curl_url=ftp://${pxeserver}/archlinux/iso/archlinux.iso (relative form)
Use the as IP the same server where PXE reside.
Signed-off-by: Gerardo Exequiel Pozzi
maybe add some documentation too. like, how does the http/ftp support work (downloads the full image first?) and how does it compare to nbd (less efficient?) Dieter
On 11/21/2011 04:58 AM, Dieter Plaetinck wrote:
maybe add some documentation too. like, how does the http/ftp support work (downloads the full image first?) and how does it compare to nbd (less efficient?)
Dieter
* download full image to RAM. This is curl only, not fuse with curlftpfs/httpfs. * compared to nbd, well... much much more memory is needed. Also more memory than when using nbd+copytoram, since copytoram only copies needed *.sfs. So for example if you boot with archiso_pxe_curl and fetch "core-dual.iso", ~700MiB of RAM is needed just for the iso, while using nbd+copytoram ~350MiB needed. Maybe, can be added in a near future a switch or hook to download only *.sfs from http/ftp ;) Now logic parts are split (setup network / pxe mount hook), so the doors are open for another archiso_pxe_*. -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
On Mon, 21 Nov 2011 08:53:45 -0300
Gerardo Exequiel Pozzi
On 11/21/2011 04:58 AM, Dieter Plaetinck wrote:
maybe add some documentation too. like, how does the http/ftp support work (downloads the full image first?) and how does it compare to nbd (less efficient?)
Dieter
* download full image to RAM. This is curl only, not fuse with curlftpfs/httpfs. * compared to nbd, well... much much more memory is needed. Also more memory than when using nbd+copytoram, since copytoram only copies needed *.sfs. So for example if you boot with archiso_pxe_curl and fetch "core-dual.iso", ~700MiB of RAM is needed just for the iso, while using nbd+copytoram ~350MiB needed.
Maybe, can be added in a near future a switch or hook to download only *.sfs from http/ftp ;) Now logic parts are split (setup network / pxe mount hook), so the doors are open for another archiso_pxe_*.
I suggest to document these thoughts in the documentation of archiso. Dieter
On 11/21/2011 08:55 AM, Dieter Plaetinck wrote:
On Mon, 21 Nov 2011 08:53:45 -0300 Gerardo Exequiel Pozzi
wrote: On 11/21/2011 04:58 AM, Dieter Plaetinck wrote:
maybe add some documentation too. like, how does the http/ftp support work (downloads the full image first?) and how does it compare to nbd (less efficient?)
Dieter
* download full image to RAM. This is curl only, not fuse with curlftpfs/httpfs. * compared to nbd, well... much much more memory is needed. Also more memory than when using nbd+copytoram, since copytoram only copies needed *.sfs. So for example if you boot with archiso_pxe_curl and fetch "core-dual.iso", ~700MiB of RAM is needed just for the iso, while using nbd+copytoram ~350MiB needed.
Maybe, can be added in a near future a switch or hook to download only *.sfs from http/ftp ;) Now logic parts are split (setup network / pxe mount hook), so the doors are open for another archiso_pxe_*.
I suggest to document these thoughts in the documentation of archiso.
Dieter
Yes but README is just a reference, a better explanation/tutorial must go to wiki. DRAFT is comming in fews days, (also for recent archiso_pxe_nfs)... -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
On 11/21/2011 04:58 AM, Dieter Plaetinck wrote:
maybe add some documentation too. like, how does the http/ftp support work (downloads the full image first?) and how does it compare to nbd (less efficient?)
Dieter
I now reworking this that add support for fetching only needed *.sfs. archiso_curl_url=http://192.168.0.7/archlinux/iso/arch.iso <- Fetch the whole ISO (url does not ends in "/") archiso_curl_url=http://192.168.0.7/archlinux/unpacked/ <- Fetch only needed *.sfs (url ends in "/") -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
participants (2)
-
Dieter Plaetinck
-
Gerardo Exequiel Pozzi