Build Your Own FreeBSD Update Server

Very useful indeed. The only thing that remains a bit unclear is where one would make customisations to the kernel, or rather if those would have to be made to the GENERIC configuration or by adding a custom one and setting KERNELPARTS to that target?

Thanks in advance for clarifying.
 
Also it seems that scripts/init.sh using old naming scheme when fetching iso images, so it fails when I tried to run initial build for 8.1-RELEASE:

Code:
>./scripts/init.sh i386 8.1-RELEASE
Fri Mar  4 11:47:53 MSK 2011 Starting fetch for FreeBSD/i386 8.1-RELEASE
fetch: ftp://ftp4.ru.freebsd.org/pub/FreeBSD/releases/i386/ISO-IMAGES/8.1/8.1-RELEASE-i386-disc1.iso: Not Found

But:
Code:
> fetch -s 'ftp://ftp4.ru.freebsd.org/pub/FreeBSD/releases/i386/ISO-IMAGES/8.1/FreeBSD-8.1-RELEASE-i386-disc1.iso'
676384768
 
Yeah i noticed that too. You need to make these changes to scripts/build.subr.

Code:
--- scripts/build.subr.orig	2011-03-04 11:09:38.000000000 +0100
+++ scripts/build.subr	2011-02-14 15:10:33.000000000 +0100
@@ -301,7 +301,7 @@
 
 	# Figure out where the disc1 ISO image is
 	RELNUM=${REL%-*}
-	ISO=${FTP}/${TARGET}/ISO-IMAGES/${RELNUM}/${REL}-${TARGET}-disc1.iso
+	ISO=${FTP}/${TARGET}/ISO-IMAGES/${RELNUM}/FreeBSD-${REL}-${TARGET}-disc1.iso
 
 	# Fetch the ISO image.  We consider the ISO image to be
 	# the One True Release and don't look at the files used
 
Thanks, I see now it would be easy to modify the procedure and make it check the iso image before trying to fetch anything.
 
fadolf said:
Very useful indeed. The only thing that remains a bit unclear is where one would make customisations to the kernel, or rather if those would have to be made to the GENERIC configuration or by adding a custom one and setting KERNELPARTS to that target?

Thanks in advance for clarifying.

You would need to modify the actual release to include a new kernel, or modify GENERIC. If you add a new kernel, you would need to alter KERNELPARTS for your additional kernel support, and be aware of it in the jail creation, as well. If you just patch GENERIC, you would not need to do anything else. It literally could be a 0 level patch to the distribution.
 
copypaiste said:
Is there any way to avoid downloading during initial build run? I'd like to use already fetched iso image.

You just need to modify the fetchiso location you are downloading from in build.subr. You could simply create an anonymous ftp server locally, even.
 
fadolf said:
Yeah i noticed that too. You need to make these changes to scripts/build.subr.

Code:
--- scripts/build.subr.orig	2011-03-04 11:09:38.000000000 +0100
+++ scripts/build.subr	2011-02-14 15:10:33.000000000 +0100
@@ -301,7 +301,7 @@
 
 	# Figure out where the disc1 ISO image is
 	RELNUM=${REL%-*}
-	ISO=${FTP}/${TARGET}/ISO-IMAGES/${RELNUM}/${REL}-${TARGET}-disc1.iso
+	ISO=${FTP}/${TARGET}/ISO-IMAGES/${RELNUM}/FreeBSD-${REL}-${TARGET}-disc1.iso
 
 	# Fetch the ISO image.  We consider the ISO image to be
 	# the One True Release and don't look at the files used

Yes, this is due to recent updates to the naming of the iso when built. fetchiso routine can be modified on a per release basis in build.subr under the scripts/architecture/x.x-RELEASE/ to account for differences in 7.x and 8.x releases
 
9.0-release

I am currently in the process of trying to get updates for 9.0-RELEASE built. A lot has changed in the layout of the .iso file. If anyone is interested, I would be happy to collaborate. I can get pretty much everything except the kernel built correctly.
 
Wow, I was really horrible about reporting back. It worked great. We are now in production serving up FreeBSD 9.0-RELEASE via freebsd-update on our internal network.
 
Hi all. I am new to FreeBSD and want to use a server to upgrade the internal network, just like @silverglade00. I just don't know how to reconfigure the build.subr for 9.1 or 9.2. I used http://www.freebsd.org/doc/de/articles/freebsd-update-server/build.html as a reference, but it doesn't work. It starts getting weird with sh scriüts/init.sh amd64 9.1-RELEASE. Is there any new documentation about it? Thanks a lot.

Greetings
 
Last edited by a moderator:
Hello,

Yes, it's still broken with a fresh 9.2-RELEASE. I've figured out about the FTP site format, but the new ISO format is a problem and I haven't made it past that yet. I haven't built a working freebsd-update server before, so it's tricky to change so much when I don't even know if I'm following the instructions properly. :)

Note: I notice that my build.subr has the proper ISO= format (both lines really, the second line overloading the first), so that doesn't need changing.

This looks to be the most up to date thread, and if the link above (http://www.freebsd.org/cgi/cvsweb.cgi/p ... ate-server) would work, it may answer my questions.

If anyone else has made progress,let me know - I'm going to see where I can get with it today.
 
Wow, I was really horrible about reporting back. It worked great. We are now in production serving up FreeBSD 9.0-RELEASE via freebsd-update on our internal network.

Great, thanks. I'm glad the article helped you. Currently, I am trying to verify the article for 10.2, but am not able to get a build without errors. Are you still running this process successfully? I would love to see your notes on how you were able to get this to build properly. Please share.

Thanks!
-jgh
 
I'm still a bit confused here. What I would like to do is enable freebsd-update in my network to fetch from my own server and have a version there that's built with some /etc/src.conf options. For building, I have checked out /usr/src from the RELENG branch for 11.1.

Now, looking at this, it seems freebsd-update-server does a build itself and always wants the base release version plus all patches separately? Is there an easier way?
 
Back
Top