Jumstart/​JET for FreeBSD (brain­storm­ing)

There are some HOW­TOs out there in the net which de­scribe some auto­mat­ic net­work based in­stall via PXE-​booting a ma­chine from a server which has a spe­cific FreeBSD re­lease in the PXE-​booting area and a non-​interactive con­fig for sys­in­stall to in­stall this FreeBSD ver­sion on the ma­chine which PXE-​boots this.

The setup of this is com­pletely manu­al and only al­lows to net­boot one FreeBSD ver­sion. The server-​side setup for the cli­ents is also com­pletely manu­al (and only al­lows to in­stall one cli­ent at a time, it seems). This is not very user-​friendly, and far away from the power of Jumpstart/​JET for Sol­ar­is where you cre­ate a tem­plate (may­be from an­other tem­plate with auto­mat­ic value (IP, name, MAC) re­place­ment) and can spe­cify dif­fer­ent OS re­leases for dif­fer­ent cli­ents and then just run a com­mand to gen­er­ate a good con­fig for this.

I thought a little bit how it could be done and de­cided to write down all the stuff (so far 160 lines, 830 words) to not for­get some de­tails. All in all I think this could be done (at least a sens­ible sub­set) in a week or two (full­time) if you have the hard­ware, mo­tiv­a­tion, and time. As al­ways, the prob­lems are with­in the de­tails, so I may be off with my es­tim­a­tion a little bit (also de­pends upon the knowledge-​level (shell, tftp, dh­cpd, in­stall–soft­ware) of the per­son do­ing this).

Un­for­tu­nately I do not know if I have the hard­ware at home to do some­thing like this. I have some un­used hard­disks which could be used in a ma­chine which is used tem­por­ary as a test-​install-​client (nor­mally I use this ma­chines as my Desktop… if I do not use my little Net­book in­stead, as I do not do much at home cur­rently), but I’ve nev­er checked if this ma­chine is PXE-​booting-​capable (VIA KT133 chip­set with a 3Com 3c905C-​TX Fast Eth­er­link XL). I also do not have the time to do this (with the cur­rent rate of free time I would ex­pect to need about a year), ex­cept may­be someone would call my boss and ne­go­ti­ate some­thing.

I can not re­mem­ber any re­quest to have some­thing like this on the freebsd-​current, freebsd-​arch or freebsd-​hackers list since I read them (and that is since about at least 3.0-RELEASE). Is this be­cause nearly nobody is in­ter­ested in some­thing like this, or are the cur­rent pos­sib­il­it­ies enough for your needs? Do you work at a place where this would be wel­come (= dir­ectly used when it would be done)? If you use a sim­ple solu­tion to make a net-​install, what is your ex­per­i­ence with this (pros/​cons)?

6 thoughts on “Jumstart/​JET for FreeBSD (brain­storm­ing)”

  1. I haven’t used net­boot­ing, but the main reas­on for that seems to be the very same reas­on that made you look in­to this.
    Every time I’ve looked up how to do it I’ve aban­doned the idea be­cause it seems trouble­some and in­flex­ible. In­deed, if some­thing like this would be in­cluded in FreeBSD I would likely use it at my place of em­ploy­ment.
    I guess what I’m try­ing to say is that just be­cause noone re­ques­ted it doesn’t mean noone would use it. Per­haps noone really knew net­boot­ing could be made a lot more flex­ible with a weeks work. I cer­taintly didn’t 🙂

  2. Can’t you se­lect dif­fer­ent OS ver­sions to boot via PXE in your dh­cpd con­fig­ur­a­tion?

    Sort of re­lated: there were some use­ful changes made to tft­pd in dragon­fly (to al­low for lar­ger boot im­ages etc) that ap­plied cleanly to FreeBSD tft­pd.

    1. It is not that you can not do it some­how by hand (I think this is just a mat­ter of con­fig files, and the 1 – 2 weeks of work I de­scribe is not about ex­tend­ing tft­pd or dh­cpd), it is about sim­pli­fic­a­tion so that you can let even a juinior-​admin add new ver­sions /​ ma­chines. So in­stead of a day or two (for someone who really knows what he does) to setup some­thing like this, it will only need may­be half an hour. And in­stead of an hour or two to add an­other OSVERSION, it could be just 5 – 10 minutes to add a new one. And in­stead of one machine-​install at a time (with con­fig changes in-​between), you could in­stall as many ma­chines in par­al­lel as your network/​server band­with al­lows it.

  3. I hacked up some­thing like this a couple of years back. The res­ult was a sys­tem where I could in­stall any FreeBSD ver­sion on any netboot-​capable ma­chine in a couple of minutes.

    dh­cpd first: it seems a bit like a hack to build ex­tra fields on­to the DHCP mes­sage, but DHCP is really the only sens­ible way to dis­trib­ute “boot from here” in­form­a­tion. Typ­ing the cor­rect in­cant­a­tions in the dh­cpd con­fig file is a sep­ar­ate tu­tori­al worthy.

    Since the pos­sib­il­it­ies of the FreeBSD non-​interactive in­stall­script really sucked and were en­tirely in­ad­equate for my needs, I ended up cre­at­ing a full dis­tri­bu­tion (make dis­tri­bu­tion) be­fore­hand, open­ing as a ch­root and in­stalling any ports, and mak­ing all rel­ev­ant changes to con­fig­ur­a­tion files, and then archiv­ing the dis­tri­bu­tion files on my file server. The archive would then con­tain a tar­ball for every FreeBSD ver­sion + con­fig­ur­a­tion com­bin­a­tion I needed.

    I then poin­ted the pxe­load­er at a stripped-​down ram­disk FreeBSD in­stall­a­tion with the sole task of run­ning a cus­tom rc.local script which would form­at the hard­disk, fetch the dis­tri­bu­tion tar­ball from the file server via NFS and write the tar­ball to the disk. For my light­weight dis­tri­bu­tion this took ca. 2 minutes, MUCH faster than run­ning through a tra­di­tion­al non-​interactive in­stall pro­cess. The rc.local script con­tained the lo­gic to se­lect the the cor­rect dis­tri­bu­tion (ver­sion + con­fig) on the file server, al­though I had to change the script when I wanted an­other ver­sion (un­less I al­ways wanted HEAD). The con­fig was chosen auto­mat­ic­ally based on the MAC ad­dress of the ma­chine.

    I ended up set­ting up a TFTP server only for the ram­disk in­stall­a­tion. It would be really nice if the pxe­load­er sup­por­ted fetch­ing via HTTP too, in ad­di­tion to NFS and TFTP.

    As these were throw-​away in­stall­a­tions in­ten­ded to run tests, I needed to also be able to nuke the in­stall­a­tion and in­stall a new ver­sion auto­mat­ic­ally. I did this by set­ting the hard­disk as primary boot op­tion in the BIOS and net­boot as second op­tion. When I needed to re­in­stall the ma­chine, I just nuked the MBR and let the ma­chine re­boot.

    If you find the time for your pro­ject, con­sider hack­ing up an easy way of cre­at­ing cus­tom, fully-​functional dis­tri­bu­tions fast on a build ma­chine. Some­thing like Nan­oBSD. The in­stall­a­tion pro­cess would then only in­volve cre­at­ing a ramdisk-​based FreeBSD dis­tri­bu­tion and writ­ing a sim­ple rc.local in­stall­a­tion script that pre­pares the sys­tem disk, se­lects a dis­tri­bu­tion based on some lo­gic and pipes the files to the disk.

    1. PXE HTTP sup­port: this was a Google Sum­mer of Code pro­ject in 2007.

      Re­gard­ing your sug­ges­tion: My idea is a little bit more com­plex than wat you have in mind. It would only work for suit­able re­leases – ones which come with pc-​sysinstall (and may­be the net­in­stall rc scripts… which have to be writ­ten first off-​course) – but then you have some­thing like the Sol­ar­is JET out-​of-​the-​box (ex­cept for the dh­cpd) in FreeBSD. I try to get some time next week to write a blog post of what I have in mind.

  4. You will find the people look­ing for prop­er net­in­stall mech­an­isms – i.e. on freebsd-​isp this is a top­ic to come up more reg­u­larly.
    Some friends and I used scrip­ted sys­in­st back in 2001 and I’m sur­prised how rarely it is be­ing used, and even more that it wasn’t re­placed by now.
    Non­ethe­less it worked like a charm, PXE boot, disk setup, freebsd in­stall.

    I think most people are just not aware of the op­tion and by today it’s of course out­dated. No ZFS root with that. 😉

    But I think bsdin­staller has some net­work­ing, at least some guy from the pro­ject asked for my old notes…
    Any­way, I don’t wan­na go in­to tech­nic­al op­tions here, just say­ing there are al­ways people in­ter­ested in PXE and some jumpstart-​ish cap­ab­il­it­ies.

Leave a Reply

Your email address will not be published. Required fields are marked *