2816f Installing FreeBSD 9 source - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Miscellaneous > Howtos & FAQs

Howtos & FAQs Would you like to share some of your solutions for certain problems? Tips or tricks? Post here.

Reply
 
Thread Tools Display Modes
  #1  
Old January 24th, 2012, 00:55
wblock@'s Avatar
wblock@ wblock@ is offline
Moderator
 
Join Date: Sep 2009
Location: Milky Way galaxy
Posts: 7,701
Thanks: 429
Thanked 1,757 Times in 1,456 Posts
Default Installing FreeBSD 9 source

First, sysinstall is mostly dead. Avoid it if possible. It won't install the source distribution for you any more.

There are two ways to get the source. Okay, maybe a lot more, but only two will be covered here.
  1. Download the tar file that matches the version you installed.
    i386: ftp://ftp.freebsd.org/pub/FreeBSD/re...ELEASE/src.txz
    amd64: ftp://ftp.freebsd.org/pub/FreeBSD/re...ELEASE/src.txz

    Unpack the archive to /usr/src:
    # tar -C / -xvzf src.txz

    Be aware that this will only get you the code for FreeBSD-9.0-RELEASE, not anything that has been added since then.

  2. svn(1)
    SVN (Subversion) is a newer source control system. It is not part of the base system, so install devel/subversion. Then check out the source:
    # svn checkout https://svn0.us-west.FreeBSD.org/base/releng/9.0/ /usr/src

    Other versions of FreeBSD have different URLs, like https://svn0.us-west.FreeBSD.org/base/stable/9/ for 9-STABLE. svn includes a larger history and can take up to twice the amount of disk space as a CVS checkout.

    When using HTTPS, the first checkout will ask about the server certificate.
    Code:
    Error validating server certificate for 'https://svn0.us-west.freebsd.org:443':
     - The certificate is not issued by a trusted authority. Use the
       fingerprint to validate the certificate manually!
    Certificate information:
     - Hostname: svnmir.ysv.FreeBSD.org
     - Valid: from Fri, 24 Aug 2012 22:04:04 GMT until Sat, 24 Aug 2013 22:04:04 GMT
     - Issuer: clusteradm, FreeBSD.org, CA, US
     - Fingerprint: 79:35:8f:ca:6d:34:d9:30:44:d1:00:af:33:4d:e6:11:44:4d:15:ec
    (R)eject, accept (t)emporarily or accept (p)ermanently?
    The certificate can be accepted temporarily or permanently, or rejected if you doubt that machine's identity. Other protocols have different authentication methods.

    See the Handbook SVN mirror list for alternate servers which may be faster for you.

Last edited by wblock@; January 21st, 2013 at 18:10. Reason: remove csup method, update svn method
Reply With Quote
The Following 34 Users Say Thank You to wblock@ For This Useful Post:
aragon (January 24th, 2012), asavah (June 21st, 2012), bartku (March 12th, 2012), bbzz (January 24th, 2012), big_girl (May 19th, 2012), blodan (September 5th, 2012), bthomson (March 16th, 2013), darkdevil (June 22nd, 2012), Demontager (January 2nd, 2013), drhowarddrfine (January 24th, 2012), efrat (February 26th, 2013), fdduran (April 10th, 2012), fegu (May 22nd, 2012), fonz (January 24th, 2012), gqgunhed (October 31st, 2012), hjj (October 30th, 2012), jmck (March 4th, 2013), kpa (January 24th, 2012), kriss (August 21st, 2012), lbc (October 9th, 2012), markfisher (June 29th, 2012), MindFiddler (February 25th, 2012), MNIHKLOM (November 22nd, 2012), nickednamed (September 23rd, 2012), Nukama (April 17th, 2013), paulfrottawa (April 16th, 2013), rajl (July 27th, 2012), Sabbasth (July 26th, 2012), scottro (January 13th, 2013), Sebulon (November 28th, 2012), surlyjake (February 16th, 2012), swa (April 15th, 2012), vask (June 15th, 2012), YZMSQ (February 5th, 2012)
  #2  
Old January 24th, 2012, 04:18
drhowarddrfine drhowarddrfine is offline
Member
 
Join Date: Nov 2008
Location: St. Louis, Missouri
Posts: 635
Thanks: 30
Thanked 123 Times in 71 Posts
Default

But what about the noobs? Won't someone think of the noobs?!
Reply With Quote
The Following User Says Thank You to drhowarddrfine For This Useful Post:
laufdi (May 3rd, 2013)
  #3  
Old January 24th, 2012, 22:06
aragon aragon is offline
Giant Locked
 
Join Date: Nov 2008
Location: Cape Town, South Africa
Posts: 2,031
Thanks: 68
Thanked 253 Times in 203 Posts
Default

Quote:
Originally Posted by drhowarddrfine View Post
But what about the noobs? Won't someone think of the noobs?!
The Foundation should make a GUI for this!

:p
Reply With Quote
  #4  
Old January 25th, 2012, 11:40
OH OH is offline
Member
 
Join Date: Aug 2009
Location: The Netherlands
Posts: 208
Thanks: 4
Thanked 31 Times in 27 Posts
Default

If we're on the subject, I have a few follow-up questions:
  • Is there a preferred method?
  • Would (for example) starting with method 1 and then keeping up with 2 or 3 save on bandwidth / lighten the load on the servers and mirrors involved?
  • Will the handbook ever get updated to reflect the difference between net/cvsup and csup?
Reply With Quote
  #5  
Old January 25th, 2012, 11:48
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,694
Thanks: 47
Thanked 2,021 Times in 1,860 Posts
Default

Quote:
Originally Posted by OH View Post
Is there a preferred method?
Currently it's method 2 but it might move to method 3 in the near future. CVS has been mostly deprecated in favor of SVN. Method 2 works on a clean base OS without any ports installed.

Quote:
Would (for example) starting with method 1 and then keeping up with 2 or 3 save on bandwidth / lighten the load on the servers and mirrors involved?
The sources have to come from somewhere. It really doesn't matter if you download the tarball first or not. It'll only take a little longer for method 2 and 3 if there's nothing when you first run it.

Quote:
Will the handbook ever get updated to reflect the difference between net/cvsup and csup?
It already is?
Quote:
Note: The csup utility is a rewrite of the CVSup software in C. Its biggest advantage is, that it is faster and does not depend on the Modula-3 language, thus you do not need to install it as a requirement. Moreover you can use it out-of-the-box, since it is included in the base system. If you decided to use csup, just skip the steps on the installation of CVSup and substitute the references of CVSup with csup while following the remainder of this article.
Granted, I'd much rather see CVSup completely removed from the handbook.
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
  #6  
Old January 25th, 2012, 16:58
wblock@'s Avatar
wblock@ wblock@ is offline
Moderator
 
Join Date: Sep 2009
Location: Milky Way galaxy
Posts: 7,701
Thanks: 429
Thanked 1,757 Times in 1,456 Posts
Default

Quote:
Originally Posted by OH View Post
Will the handbook ever get updated to reflect the difference between net/cvsup and csup?
It needs to be done, yes. It's an easier change than usual, because in most cases instructions on installing cvsup from ports will be removed. Could be a good opportunity for someone looking to help with documentation by submitting patches.
Reply With Quote
  #7  
Old February 5th, 2012, 08:49
rossiya rossiya is offline
Junior Member
 
Join Date: Mar 2010
Posts: 28
Thanks: 2
Thanked 5 Times in 4 Posts
Default

Damn people if you have the DVD just # mount_cd9660 /dev/acd0 /cdrom and then # tar -C / /cdrom/usr/freebsd-dist/src.txz

Sorry couldn't find the code button

Last edited by phoenix; February 6th, 2012 at 02:41. Reason: Please format your posts! Type the tags manually!
Reply With Quote
  #8  
Old February 5th, 2012, 11:04
vand777 vand777 is offline
Member
 
Join Date: Jun 2010
Location: London
Posts: 282
Thanks: 29
Thanked 33 Times in 27 Posts
Default

Quote:
Originally Posted by rossiya View Post
Damn people if you have the dvd just mount_cd9660 /dev/acd0 /cdrom and then tar -C / /cdrom/usr/freebsd-dist/src.txz

Sorry couldn't find the code button
The source code on DVD/CD does not contain security patches (if any discovered after the release).
Reply With Quote
  #9  
Old February 5th, 2012, 14:32
jalla's Avatar
jalla jalla is offline
Member
 
Join Date: Aug 2009
Location: Bergen, Norway
Posts: 334
Thanks: 11
Thanked 67 Times in 58 Posts
Default

Those who routinely check out src for several machines, or like to play around with different versions could consider keeping a local repository. Just set release=cvs in the supfile.

Code:
*default host=X.Y.FreeBSD.org
*default base=/usr/local
*default prefix=/CVS
*default release=cvs
*default delete use-rel-suffix compress

src-all
ports-all
doc-all
Then checkout any branch, or src from a specific point-in-time from your local /CVS

Code:
gnome:/usr# cvs -d /CVS co -r RELENG_9 src/UPDATING
U src/UPDATING
gnome:/usr# cvs -d /CVS co -D 1/1/2012 -r RELENG_8 src/etc/defaults/rc.conf
U src/etc/defaults/rc.conf
gnome:/usr#
__________________
Practical latin
Amicule, deliciae, num is sum qui mentiar tibi?
But dear, could I ever lie to you?

Last edited by jalla; February 5th, 2012 at 14:36. Reason: fixed typo
Reply With Quote
The Following User Says Thank You to jalla For This Useful Post:
MNIHKLOM (November 22nd, 2012)
  #10  
Old February 6th, 2012, 22:05
rossiya rossiya is offline
Junior Member
 
Join Date: Mar 2010
Posts: 28
Thanks: 2
Thanked 5 Times in 4 Posts
Default

Quote:
Originally Posted by vand777 View Post
The source code on DVD/CD does not contain security patches (if any discovered after the release).
Sure, but on fresh machines namely the 9.0 Live DVD with /usr/src and /usr/obj bolted onto my hard drive with null_fs NOTHING compiled. Not 9.0-RELENG, 9 STABLE. Nor did the freebsd-update work because the system is at 8.2 STABLE. So I had to untar the base tarball at the command line to make my "upgrade" to 9.0.

Generally X.0-RELENG releases of FreeBSD suck in terms of building the source system. I had to do this because I was building a fresh drive and don't want to play with it later when I need it. So no I have NO security patches because the patches to make RELENG-9.0 compile haven't somehow migrated to the csup servers. I don't think I should be making problem reports for release base system compilation failures. Perhaps STABLE will build somewhere around summertime.

Last edited by DutchDaemon; February 6th, 2012 at 23:56.
Reply With Quote
  #11  
Old February 7th, 2012, 00:05
wblock@'s Avatar
wblock@ wblock@ is offline
Moderator
 
Join Date: Sep 2009
Location: Milky Way galaxy
Posts: 7,701
Thanks: 429
Thanked 1,757 Times in 1,456 Posts
Default

Source upgrades from 8-stable to 9-stable have worked for me on at least two systems so far. Source was updated with csup(1). If that doesn't work, please start a new thread.
Reply With Quote
  #12  
Old February 7th, 2012, 01:56
jb_fvwm2 jb_fvwm2 is offline
Senior Member
 
Join Date: Nov 2008
Posts: 1,385
Thanks: 60
Thanked 145 Times in 130 Posts
Default

Quote:
Originally Posted by rossiya View Post
Sure, but on fresh machines namely the 9.0 Live DVD with /usr/src and /usr/obj bolted onto my hard drive with null_fs NOTHING compiled. Not 9.0-RELENG, 9 STABLE. Nor did the freebsd-update work because the system is at 8.2 STABLE. So I had to untar the base tarball at the command line to make my "upgrade" to 9.0.

Generally X.0-RELENG releases of FreeBSD suck in terms of building the source system. I had to do this because I was building a fresh drive and don't want to play with it later when I need it. So no I have NO security patches because the patches to make RELENG-9.0 compile haven't somehow migrated to the csup servers. I don't think I should be making problem reports for release base system compilation failures. Perhaps STABLE will build somewhere around summertime.
Not sure (sorry!) if it would help in that case, but I found that if one has a thumbdrive with already compiled /usr/src; /usr/obj mounted as such
Code:
 mount -t ufs -o union /dev/da0 /usr
where the /src /obj are at the root of the thumbdrive, one can install (vs build) from the thumbdrive. (I did a short howto writeup...)
Reply With Quote
  #13  
Old February 7th, 2012, 09:18
rossiya rossiya is offline
Junior Member
 
Join Date: Mar 2010
Posts: 28
Thanks: 2
Thanked 5 Times in 4 Posts
Default

Quote:
Originally Posted by jb_fvwm2 View Post
Code:
 mount -t ufs -o union /dev/da0 /usr
Oh yes I threw many tarballs around for that reason alone. But back in 2001 I did a lot of builds because many of the dual-pentium machines were dodgy, so burn-ins were the stress test. No, even when I used clang exclusively this system didn't build. That's supposed to be the grail supposedly. I'm sure there are days when sup'ing the code would yield a clean build. Timing is everything. /usr/src gets a lot more buildable around subversion 2, historically.

Even worse I had an inconsistent build on a second machine. That blew my nvidia driver which was running perfectly fine on the prior machine for the last four years. As the machine is my firewall, I kept trying to DHCP a public IP from my 2wire. It was then I learned it had cloned my firewall machine identity. Now the entire LAN was down. Since there was no X11 there was no browser and hence no way to fixate the 2wire on the right identity. I browsed with other boxes and played musical clones with the 2wire for half an hour. It played wackamole that long. Finally lady luck came to my rescue and the right id gave me a public IP. Out of the matrix at last.

Apparently the dumbed-down 2wire interface uses dumbed-down programming internally as well.

Anyway the firewall will stay at 8.2 until -RELEASE, -STABLE or something in between ultimately builds. Must keep the faith.

Last edited by DutchDaemon; February 8th, 2012 at 03:49.
Reply With Quote
  #14  
Old February 10th, 2012, 00:21
rossiya rossiya is offline
Junior Member
 
Join Date: Mar 2010
Posts: 28
Thanks: 2
Thanked 5 Times in 4 Posts
Default

Yo I got builds working. Turns out a sub mirror, cvsup10, has old obsolete files, likely mixed in, and was generally stale. I switched to another randomly, in my case cvsup5, and everything built nicely on STABLE9. Well, except for the wireless code, which I had to block in /etc/src.conf.

Also, I could not get the nvidia driver module working or even loading in 8.2 after I moved it to another Nvidia card. But typical for FreeBSD it came right up on STABLE9. Despite the driver from nvidia.com directly blocking FreeBSD 9 in its Makefile. Apparently the driver ONLY works on FreeBSD 9!

Last edited by DutchDaemon; February 10th, 2012 at 05:34.
Reply With Quote
  #15  
Old March 9th, 2012, 11:40
zennybsd zennybsd is offline
Member
 
Join Date: Mar 2011
Posts: 122
Thanks: 36
Thanked 7 Times in 7 Posts
Default

I installed src and ports from the fbsd FreeBSD 9-Stable DVD itself while installing. Now what confuses me is how could I update the src and ports to the latest RELENG_9 in order to have the updated CVS tree?

I tried with /usr as the default prefix in the supfile and it messed up everything. Just confused.

Last edited by DutchDaemon; March 9th, 2012 at 17:57. Reason: AGAIN: Proper formatting: http://forums.freebsd.org/showthread.php?t=8816
Reply With Quote
  #16  
Old March 9th, 2012, 11:49
kpa kpa is online now
Senior Member
 
Join Date: Jul 2010
Location: People's Technocratic Republic of Finland
Posts: 1,984
Thanks: 44
Thanked 460 Times in 390 Posts
Default

You need the proper supfile for RELENG_9, /usr/share/examples/cvsup/stable-supfile. You can use it as it is if you give a hostname on the command line:

# csup -h cvsup.freebsd.org /usr/share/examples/cvsup/stable-supfile

Use of the main cvsup site is not necessary of course, you can select a mirror site as well.

Oh, and it's best to move the old 9.0-RELEASE sources out of the way before fetching 9-STABLE sources.

Last edited by kpa; March 9th, 2012 at 13:20.
Reply With Quote
  #17  
Old March 10th, 2012, 13:57
zennybsd zennybsd is offline
Member
 
Join Date: Mar 2011
Posts: 122
Thanks: 36
Thanked 7 Times in 7 Posts
Default

@kpa: Thanks.

Since I installed from the FreeBSD9-STABLE, how does it affect if I use /usr/share/examples/cvsup/stable-supfile with csup? I am asking this because the stable-supfile still defaults to RELENG_9 in the default line. Or did I miss something?

Which one is the right statement in supfile for FreeBSD9-STABLE installation?

Last edited by DutchDaemon; March 11th, 2012 at 01:20. Reason: Proper formatting: http://forums.freebsd.org/showthread.php?t=8816
Reply With Quote
  #18  
Old March 10th, 2012, 14:19
kpa kpa is online now
Senior Member
 
Join Date: Jul 2010
Location: People's Technocratic Republic of Finland
Posts: 1,984
Thanks: 44
Thanked 460 Times in 390 Posts
Default

http://www.freebsd.org/doc/en_US.ISO.../cvs-tags.html

RELENG_9 is 9-STABLE.
Reply With Quote
  #19  
Old March 23rd, 2012, 19:38
Beeblebrox's Avatar
Beeblebrox Beeblebrox is offline
Member
 
Join Date: Sep 2010
Posts: 713
Thanks: 39
Thanked 76 Times in 68 Posts
Default

I've been using SVN since about Nov '11. SVN is so much faster than CVS. I would like to see GIT implemented for ports but that's a long way off (bringing ports into SVN structure is a greater priority). I had asked about ports on git here, but that's another issue.

My point: Recommend SVN for /src above anything else.
__________________
branch:head - root on zfs - amd64
BLUES, ELWOOD
ILLINOIS LICENSE : B263-1655-2187
CURRENTLY UNDER SUSPENSION
WARRANTS OUTSTANDING : PARKG. 116
MOVING VIOLATIONS : 56
ARREST DRIVER ... IMPOUND VEHICLE
Reply With Quote
  #20  
Old April 14th, 2012, 11:46
melanie melanie is offline
Junior Member
 
Join Date: Apr 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi, I have a question in this context: is there any integrity checking done when I download the source with one of the above methods? Digital signatures, secure tunneling, checksums -- anything? I was told on IRC that this is not the case but I found this rather hard to believe. I mean, seriously, I am by far not one of the most paranoid people -- but mitm-attacks are nothing fancy nowadays at all. I also don't really understand the situation since I _was_ told that when I use ports with portsnap, THEN there is integrity checking done. Now, providing a more secure method for transferring ports than for the base system does not make much sense to me.

How do you guys work with this situation?

Thanks a lot,
mel

Last edited by DutchDaemon; April 15th, 2012 at 02:15.
Reply With Quote
  #21  
Old April 26th, 2012, 03:10
nixuser nixuser is offline
Junior Member
 
Join Date: Apr 2012
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default

I need to cut a custom kernel.

I downloaded the source using method (3):

# svn checkout svn://svn.freebsd.org/base/releng/9.0/ /usr/src

but it downloaded everything except the bit I wanted... the process left /usr/src/sys empty.

I've done something wrong obviously. Can anyone point me in the right direction?

I believe it downloaded everything except "sys".
Reply With Quote
  #22  
Old April 26th, 2012, 03:47
wblock@'s Avatar
wblock@ wblock@ is offline
Moderator
 
Join Date: Sep 2009
Location: Milky Way galaxy
Posts: 7,701
Thanks: 429
Thanked 1,757 Times in 1,456 Posts
Default

Try again. A fresh checkout I tried just now had sys.
Reply With Quote
  #23  
Old April 26th, 2012, 04:56
nixuser nixuser is offline
Junior Member
 
Join Date: Apr 2012
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Same problem:

Reply With Quote
  #24  
Old April 26th, 2012, 14:56
wblock@'s Avatar
wblock@ wblock@ is offline
Moderator
 
Join Date: Sep 2009
Location: Milky Way galaxy
Posts: 7,701
Thanks: 429
Thanked 1,757 Times in 1,456 Posts
Default

Is it missing in -stable?
# svn checkout svn://svn.freebsd.org/base/stable/9 /usr/src
Reply With Quote
The Following 2 Users Say Thank You to wblock@ For This Useful Post:
MNIHKLOM (November 22nd, 2012), nixuser (April 27th, 2012)
  #25  
Old April 27th, 2012, 13:08
nixuser nixuser is offline
Junior Member
 
Join Date: Apr 2012
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default

I just downloaded stable and thankfully sys did get downloaded with it.

For my purpose I guess I can cut my kernel from stable. So that fixes my immediate issue, but it does leave the original mystery outstanding.

Last edited by DutchDaemon; April 27th, 2012 at 22:59.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
FreeBSD update: binary vs source kriscom Installing & Upgrading 7 January 14th, 2012 08:42
How is the FreeBSD source code documented? caesius FreeBSD Development 4 October 2nd, 2010 14:57
[Solved] Source for FreeBSD-9.0-CURRENT-201002-i386 quakerdoomer Installing & Upgrading 4 March 8th, 2010 16:54
FreeBSD 8.0 built from source Seeker Installing & Upgrading 4 February 24th, 2010 12:25
Installing programs from source to other folder deluxwww Installation and Maintenance of FreeBSD Ports or Packages 4 February 1st, 2009 13:16


All times are GMT +1. The time now is 12:46.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0