FS#12619 - PXE install requires USB?

Attached to Project: Release Engineering
Opened by Luke Camden (lukec) - Tuesday, 30 December 2008, 13:16 GMT
Last edited by Dieter Plaetinck (Dieter_be) - Sunday, 16 May 2010, 14:52 GMT
Task Type Feature Request
Category ArchISO
Status Closed
Assigned To Aaron Griffin (phrakture)
Thomas Bächler (brain0)
Dieter Plaetinck (Dieter_be)
Architecture All
Severity Low
Priority Normal
Reported Version None
Due in Version 2010.05
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
Instructions at http://wiki.archlinux.org/index.php/PXE seem to require a USB drive for the installer to run when installing over a network.

Is there any plan to change this requirement?

See

http://wiki.archlinux.org/index.php/Talk:Install_Arch_from_network_%28via_PXE%29

and

http://bbs.archlinux.org/viewtopic.php?id=51951

for discussion.
This task depends upon

Closed by  Dieter Plaetinck (Dieter_be)
Sunday, 16 May 2010, 14:52 GMT
Reason for closing:  Implemented
Comment by Aaron Griffin (phrakture) - Tuesday, 30 December 2008, 19:30 GMT
I know nothing about PXE booting, so it would take quite a lot of research on my part to figure out what needs doing. A more clear/concise FR is going to help here - what exactly needs doing for this to work?
Comment by Luke Camden (lukec) - Wednesday, 31 December 2008, 14:02 GMT
So I think that roughly what would been needed here is to release an installer initrd that contains all the data necessary for getting an http/ftp install going. The current image (as far as I understand) does not. It assumes that it has been loaded from a CD/USB drive and tries to load the rest of the installer from the CD/USB. In the event that the image has been loaded over a network the rest of the installer is not found and a kernel panic ensues. Fixing this may only require modification of an installer image from a previous version of Archlinux (say 2008.03), since in those versions the installer initrd could initiate an http/ftp install without having to load extra data from CD/USB.

The old initrd would require configuration because according this post (http://bbs.archlinux.org/viewtopic.php?pid=422941#p422941) "the repository structure and pacman changed". An attempt to use the old initrd with 2008.06 currently requires a non-trivial manual install of all packages using pacman.

The updated PXE initrd, kernel, pxelinux.0 etc could be released in a folder of the Archlinux CD iso (like Ubuntu) or could even be released as a package (in which case I may be posting this in completely the wrong place).

The above has been largely pieced together from forum posts and my very limited knowledge, so it would great if someone could correct what I've said.

Requiring a USB for a PXE boot largely defeats the purpose of a PXE install, since many machines can boot from USB anyway. Having machines (almost) autonomously downloading an Archlinux installer seems better than PXE clients having to manually download and burn the USB installer image and then boot with the USB stick in the drive.
Comment by Aaron Griffin (phrakture) - Wednesday, 31 December 2008, 16:38 GMT
Well, sticking the entire installer into an initrd is silly. I would prefer to, instead, have the initrd ALSO try to load things over NFS or something of the sort, instead of just USB or CD. Does that sound like a decent plan?
Comment by Tobias Powalowski (tpowa) - Friday, 02 January 2009, 11:15 GMT
if you want something like this you can use those here:
ftp://ftp.archlinux.org/iso/archboot/
Comment by Luke Camden (lukec) - Friday, 02 January 2009, 21:29 GMT
Ah ok. Perhaps I should mention that in the wiki? What do you think?
Comment by Dieter Plaetinck (Dieter_be) - Friday, 23 January 2009, 20:18 GMT
maybe you can be inspired by how fai works. http://www.informatik.uni-koeln.de/fai/
they load a root Fs over nfs iirc
Comment by Max Pray (synthead) - Monday, 09 February 2009, 22:46 GMT
Yeah, having to use a USB drive is really goofy. Really defeats the point. What about machines that you have no physical access to?
Comment by Aaron Griffin (phrakture) - Monday, 09 February 2009, 22:52 GMT
FOr clarity: having to use the a USB drive is not intended. I don't think any of us have even tried or thought of a PXE install when doing this. We will definitely work on this, but understand that the current images were not intended to have PXE functionality.
Comment by Gerardo Exequiel Pozzi (djgera) - Wednesday, 17 March 2010, 14:24 GMT
I done some work to support PXE booting. This currently works fine. Only needs nbd pkg from AUR. Also a dnsmasq is added to list of packages so live-medium can acts a server for PXE via NBD.

The archiso.img initramfs is incremented from 5M to 8M (because of all networks drivers and firmwares), small difference. I chosed NBD over NFS because is more simple. (I think)

More info at commits:
http://github.com/djgera/archiso/commit/830555f71a6ea4fcda93657e7a2220d753f26757 - [archiso] Add nbd hook, to make posible boot archiso from PXE via a NBD.
http://github.com/djgera/archiso/commit/1320c0ee9152b91e60972551b98942ea2b24d34f - [syslinux-iso] Add PXE support via NBD.

And:
http://mailman.archlinux.org/pipermail/arch-releng/2010-March/000911.html
Comment by Aaron Griffin (phrakture) - Wednesday, 17 March 2010, 15:27 GMT
So, Gerardo, do you think this work is ready to merge into master?
Comment by Gerardo Exequiel Pozzi (djgera) - Wednesday, 17 March 2010, 15:54 GMT
Maybe yes.

nbd (Maintainer: Gerbra) package need to be moved to [community] or [extra].

Reasons:
* Is working and does not affect normal boot process of archiso. [nbd] hook do the work only if ip= parameter is present at command line, that is automatic added when booting via PXE.

There is a small improvements that can be done anyway.
* if copytoram= option is added when booting from PXE there is no need to keep the connection to nbd-server alive.
* Add a small message at PXE prompt.
* For [syslinux-iso] the dirty server-launcher script can be added to overlay.

Of course if this will be merged, I can do it when I come back from my work.
Comment by Gerardo Exequiel Pozzi (djgera) - Thursday, 18 March 2010, 04:32 GMT
Done!

Thanks to Ionut thats adopted the package "nbd" and moved to [community] makes my life more easy.

Notable changes:
* Booting from PXE users will see exact syslinux menu from live-media with all options and background :)
* There is a simple script /arch/archiso-pxe-server (can be launched without any parameters) that do all the work, only an ip address must be assigned to eth0 (default) before launch this script.

Ready to merge if accepted.

http://github.com/djgera/archiso/commits/pxe_nbd/
Comment by Gerardo Exequiel Pozzi (djgera) - Thursday, 18 March 2010, 13:27 GMT
Only remain the minor detail about umount /bootmnt and disconect from server if copytoram=y, I will work today on this, will be done using a mount_hook.
Comment by Aaron Griffin (phrakture) - Thursday, 18 March 2010, 15:27 GMT
Thomas or Dieter, let me know if you think this stuff is a good idea or not. Something about needing a package in community for the official ISO bugs me a bit
Comment by Gerardo Exequiel Pozzi (djgera) - Thursday, 18 March 2010, 16:04 GMT
Done all the work!

Also the script archiso-pxe-server is now compatible with archiso2dual, so from PXE can boot: i686, x86_64 or x86_64/kernel with i686/userspace, x86test and memtest86+ :)
Comment by Gerardo Exequiel Pozzi (djgera) - Thursday, 18 March 2010, 23:05 GMT
Here [#1] is a link that show the diff against master in a single step, so can view more easy all the changes.

nbd package can be moved from [community] to [extra], anyway current .iso images (2009.08), use grub-gfx from [community]

[#1] http://github.com/djgera/archiso/compare/master...pxe_nbd
Comment by Dieter Plaetinck (Dieter_be) - Sunday, 21 March 2010, 21:45 GMT
> Thomas or Dieter, let me know if you think this stuff is a good idea or not. Something about needing a package in community for the official ISO bugs me a bit
I like pxe booting, and this implementation looks slick.
I like how the added functionality does not interfere with the normal stuf. the only downside is increased initcpio size, but i don't care about that and i doubt much users will.
nbd not being in extra should not be a deciding factor. If we merge this and nbd being in community is a problem then we move it. (it doesn't seem hard to maintain. simple PKGBUILD and infrequent releases.)

however:
- I think archiso-pxe-server - and it's dependency - dnsmasq should be something separate. It looks quite useful for those who want to setup something quickly, but it does not belong in archiso. maybe a separate project or just a "user script" for on the wiki.
- I didn't actually try this, but does the isolinux menu still make sense? I.e. the correct default boot option in both pxe and usb/cdrom scenarios, a sensible timeout, and alternative boot options where it makes sense?
Gerardo's "Booting from PXE users will see exact syslinux menu from live-media" makes me wonder.

So i would just add this to all our images, after stripping pxe-server/dnsmasq again and if the menu's still make sense.
Comment by Gerardo Exequiel Pozzi (djgera) - Sunday, 21 March 2010, 22:54 GMT
* I added support to boot in machine with more than one network card. (without this, archiso_pxe_boot can fail, because ipconfig will setup all network interfaces detected) this is done via BOOTIF parameter automagically added by PXELINUX.

@Dieter:
(1) About archiso-pxe-server is true, can be apart like is aif, anyway I like the idea of having it in the "packages.list" in a future (if users reclaim it of course), I can make a package in AUR.
(2) About the boot menu. This is done via archiso-pxe-server parsing installed "isolinux.cfg" and just change IPAPPEND from 0 to 1 (now to 3), and keep as-is instead of having another isolinux.cfg. If options makes sense or not, depends on what user want to do. Anyway this will be removed (1)
Comment by Gerardo Exequiel Pozzi (djgera) - Sunday, 21 March 2010, 23:20 GMT
* Removed archiso-pxe-server in pxe_nbd branch.

Big diff from master http://github.com/djgera/archiso/compare/master...pxe_nbd
Comment by Dieter Plaetinck (Dieter_be) - Monday, 22 March 2010, 20:47 GMT
okay good. don't forget to make your arch-pxe-server script public. on the wiki or something. i will gladly link to it.
I would merge this.
Comment by Aaron Griffin (phrakture) - Tuesday, 23 March 2010, 17:56 GMT
Ok, I merged everything into master and pushed it.

Out of curiosity, if I wanted to do this over PXE without archiso-pxe-server, how would I do it?
Comment by Gerardo Exequiel Pozzi (djgera) - Tuesday, 23 March 2010, 22:37 GMT
Thanks.

Without the script? a bit long to write, copy necesary files (vmlinuz, archiso.img, syslinux files) launch dnsmasq and nbd-server. See the script is easy to read.

I done a quick and dirty article in the wiki: http://wiki.archlinux.org/index.php/Archiso-as-pxe-server

Comment by Aaron Griffin (phrakture) - Tuesday, 23 March 2010, 22:40 GMT
I guess here's my big question - without archiso-pxe-server (or something similar), isn't the PXE support kinda useless? Or am I wrong? I've never done a PXE boot myself, so I don't know what it takes
Comment by Gerardo Exequiel Pozzi (djgera) - Tuesday, 23 March 2010, 23:03 GMT
Yes totally, without a server the network firmware in your NIC can't locate anything to boot.

Booting from PXE is... you have a motherboard, no disks, no usb keys, nothing!, only your onboard NIC with a firmware that tries to locate a DHCP server on boot.

dhcp server responds,
nic firmware gets pxelinux.0 boot program via TFTP
pxelinux.0 gets vmlinuz26 and archiso.img
pxelinux.0 launchs vmlinuz26
archiso_pxe_nbd is executed, and use a network block device to continue rest of boot.


So for example in my work (a school) I booted a custom image in one machine via USB and launched archiso-pxe-server. All rest of machines in the classroom booted from network (no disks, no usb), startx and happy XFCE with all tools that I needed :P
Comment by Dieter Plaetinck (Dieter_be) - Wednesday, 24 March 2010, 10:42 GMT
there are multiple ways to setup a server for pxe. dnsmasq is a way. dhcpd + tftpd is another. archiso-pxe-server is just a wrapper around dnsmasq to make the process very easy.
I've personally set up pxe servers in the past manually, it's a bit more work but no rocketscience. I definitely wouldn't say archiso-pxe-server is a must; it does make things more easy for "casual users".

Loading...