# How to create a freebsd-update server in my LAN



## none (Feb 20, 2019)

Hi,

I have an old net5501 board as home router and have custom kernel on it (FreeBSD 11.2). As compiling kernel and userland on it takes 4 days, I searched for how to make it use freebsd-update tool. I got to the point that it won't work with custom kernels. So I got to see the guide from:









						Build Your Own FreeBSD Update Server
					

Building your own freebsd-update server allows a system administrator to perform fast updates for a number of machines from a local mirror




					www.freebsd.org
				




And then I began the road to make it happen. Has anyone tried this before?

I get all sorts of errors, beginning with checksum error for the iso downloaded. I used sha512 and sha256, for both DVD1 (as found on logs and the script code) and CD1. No good either. From there, all other commands reports errors. mdconfig and a mount are the two that follows.

The guide says there was an update on 2018, but the copyright info says 2013. So my bet is the code was born 2013 at best.

Can anyone help here?

The build machine is 11.2-RELEASE-p4 AMD64 and the target is i386.

If any more info is needed I can post here when I arrive home.

Thanks,

none


----------



## SirDice (Feb 20, 2019)

none said:


> So my bet is the code was born 2013 at best.


Probably a little older even. There are numerous references to 7.1 and 7.2 releases. Those were the supported versions between 2009 and 2010. So I suspect the article is at least 10 years old now. 

I've thought about setting up my own update server for -STABLE, but setting it up took too much effort compared to the easy procedure I've been using for at least decade or so. 

My firewall is a lowly Intel Atom and building world takes ages on it. So I do all the (world,kernel) building on my Core i3. I have /usr/obj and /usr/src NFS exported (read-only). On the i3 I do a regular buildkernel/buildworld (including all custom kernels). Once it's finished I NFS mount /usr/src and /usr/obj on the firewall and only run installkernel/installworld there. The only thing you really need to watch out for are the date/time settings. Both machines have to have the exact same date/time or you get some really weird errors. 



none said:


> The build machine is 11.2-RELEASE-p4 AMD64 and the target is i386.


In my case it's a little easier as both machines are 64 bit. But you should be able to do a cross-build on the AMD64 and build for i386. Alternatively, you could set up a 32 bit jail to do the building and export that. I've done this in the past when my firewall still had a 32 bit CPU. That was actually easier to do and set up than trying to figure out how to build a 32 bit world on a 64 bit machine.


----------



## Sebastian (Feb 20, 2019)

What about running poudriere inside a vm and create a binary update ? I don't know if poudriere does allow cross compiling , but if not . I would try to run your router plattform inside a vm and run poudriere there. I have never done it , I don't know if this really works, but I would try it this way. 

best regards, sebastian


----------



## SirDice (Feb 21, 2019)

Sebastian said:


> What about running poudriere inside a vm and create a binary update ?


That might be a good solution too. Although it's still being worked on so it may  not work properly yet. https://wiki.freebsd.org/PkgBase



Sebastian said:


> I don't know if poudriere does allow cross compiling


It does. You can even use it to create packages for ARM on a AMD64 machine.


----------



## none (Feb 21, 2019)

SirDice said:


> Probably a little older even. There are numerous references to 7.1 and 7.2 releases. Those were the supported versions between 2009 and 2010. So I suspect the article is at least 10 years old now.
> 
> I've thought about setting up my own update server for -STABLE, but setting it up took too much effort compared to the easy procedure I've been using for at least decade or so.
> 
> ...



It looks like the best option here is to create a vm for i386 and do the same you do for AMD64. I will try another time the code from freebsd-update and try to read the script, but won't use too much time on it as at least that code seems to be forgotten. I hoped that posting here I could get info on how to reach for the actual freebsd-update server code the project uses. Cause one thing is sure, there is a server working fine for the official server.

Thanks for all that wrote here 

none


----------



## none (Feb 25, 2019)

Small update: after reading the script, I got to get it running. The howto says to take the sha256 from the release page on www.freebsd.org, but the script uses the sha512. And the value for it on the release page won't work, must use the one on the very web folder the iso stands.

After this the script went on. But I never got to see it through, it used all my pc RAM and got it useless. The kernel had to kill several processes, and sshd was one of them. This is a 8GB RAM machine on amd64 hardware. I decided to create a i386 vm and compile it on faster hardware, then nfs share it.

The code works (to a certain point, never saw it through though), but needs a power machine.

none


----------

