DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Packages and Ports

OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 11th February 2015
acampbell acampbell is offline
Real Name: Anthony Campbell
Shell Scout
 
Join Date: Sep 2014
Location: London, UK
Posts: 106
Default Location for ports tree?

I set up my system originally with the default partitions, which gave me /usr = 2.0G.

I followed the FAQ and put the ports tree in /usr, which resulted in an overfull partition. As a result upgrading to -current failed today until I deleted the ports tree.

Is there any reason why ports shouldn't go somewhere else, e.g. /usr/src or /usr/obj, which are currently unused?
Reply With Quote
  #2   (View Single Post)  
Old 11th February 2015
acampbell acampbell is offline
Real Name: Anthony Campbell
Shell Scout
 
Join Date: Sep 2014
Location: London, UK
Posts: 106
Default

Sorry to reply to myself but I think I've found two possible solutions.

http://unix.stackexchange.com/questi...-i-build-ports

suggests making /etc/mk.conf, but the alternative of making a symlink in /usr seems simpler.
Reply With Quote
  #3   (View Single Post)  
Old 11th February 2015
ibara's Avatar
ibara ibara is offline
Real-life IT professor
 
Join Date: Jan 2014
Posts: 708
Default

Quote:
Originally Posted by acampbell View Post
but the alternative of making a symlink in /usr seems simpler.
It is not and is the wrong way to go.
Reply With Quote
  #4   (View Single Post)  
Old 11th February 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,681
Default

The "default" partitions are determined by the size of the drive, and won't necessarily fit any particular system's needs. Yours, or mine. See disklabel(8), under AUTOMATIC DISK ALLOCATION.

You can put $PORTSDIR anywhere you desire, but /usr/src would not be my recommendation. That directory is for the system source tree and is used when patching your -release, building -stable, or building -current. (Either applying errata patches to -release or running -stable are recommended over running -release in production.)

Building ports can take many GBs, especially of some of the larger workstation applications (Gnome, Libreoffice, etc.) and you may want to place $WRKOBJDIR in a separate large partition if you do significant port building.

You can use a symbolic link for /usr/ports -- but not /usr, as ibara already recommended to you. If you do this, you may want to set $PORTSDIR manually. Some ports tools may require it. (I have not found it necessary, myself, but my use of the tools in /usr/ports/infrastructure/bin is fairly limited.)

Last edited by jggimi; 11th February 2015 at 01:54 PM. Reason: clarity
Reply With Quote
  #5   (View Single Post)  
Old 11th February 2015
ibara's Avatar
ibara ibara is offline
Real-life IT professor
 
Join Date: Jan 2014
Posts: 708
Default

I meant not to use a symlink at all. See ports(7).
Reply With Quote
  #6   (View Single Post)  
Old 11th February 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,681
Default

That man page doesn't address the use of symbolic links for $PORTSDIR. Which I've gotten away with in the past. I'm lucky, perhaps. bsd.port.mk(5) explicitly permits symbolic link use for some targets, such as $WRKDIR.

I will revise my recommendation:

You can place $PORTSDIR anywhere you like, just explicitly set the variable.
Reply With Quote
  #7   (View Single Post)  
Old 11th February 2015
acampbell acampbell is offline
Real Name: Anthony Campbell
Shell Scout
 
Join Date: Sep 2014
Location: London, UK
Posts: 106
Default

Thanks to all for comments.

Yes, I meant a symlink to /usr/ports. Sorry if that wasn't clear. Anyway, in the light of comments I'll probably use the $PORTSDIR variable and put the tree in $HOME if I use it at all, but I don't expect to be doing any serious ports building any time soon.
Reply With Quote
  #8   (View Single Post)  
Old 12th February 2015
hanzer's Avatar
hanzer hanzer is offline
Real Name: Adam Jensen
just passing through
 
Join Date: Oct 2013
Location: EST USA
Posts: 314
Default

Can you start again with a fresh installation? I typically find installing/configuring/compiling to be a useful exercise. A disk partition scheme on one of my home machines looks like this:

$ df -h
Code:
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/sd0a     1007M   66.0M    891M     7%    /
/dev/sd0o     21.2G    3.0G   17.1G    15%    /home
/dev/sd0d      3.9G    8.0K    3.7G     0%    /tmp
/dev/sd0g      2.0G    343M    1.5G    18%    /usr
/dev/sd0k     1007M    179M    777M    19%    /usr/X11R6
/dev/sd0h     15.8G    5.0G   10.0G    33%    /usr/local
/dev/sd0l      2.0G    2.0K    1.9G     0%    /usr/obj
/dev/sd0i      3.9G    410M    3.3G    11%    /usr/ports
/dev/sd0j      2.0G    828M    1.1G    43%    /usr/src
/dev/sd0n      2.0G    584M    1.3G    30%    /usr/xenocara
/dev/sd0m      2.0G    2.0K    1.9G     0%    /usr/xobj
/dev/sd0e      7.9G   47.5M    7.4G     1%    /var
/dev/sd0f      7.9G    1.5G    6.0G    20%    /var/polipo
Reply With Quote
  #9   (View Single Post)  
Old 12th February 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,681
Default

Quote:
Originally Posted by hanzer View Post
Code:
/dev/sd0i      3.9G    410M    3.3G    11%    /usr/ports
Excellent example of a variation of requirements. That partition may be fine for the occasional build of individual ports, but it's way undersized for large application builds. When I was regularly building around 1500 or so ports for i386 and amd64, I would often need 20+GB. Even with $BULK set to Yes, which clears $WRKOBJDIR after packages are built.

If anyone ever needs to build a lot of packages, I recommend dpb(1). This tool is the bee's knees, the fly's forarm, and the wasp's nipples. It is the entire set of erogenous zones of every major flying insect of the world. [1] It a wonderful tool which makes the process of large scale ports building much easier to direct, manage, monitor, and support. [2]

---

[1] Stolen shamelessly from So Long, and Thanks for All the Fish, by Douglas Adams, ISBN 978-0756948160, and badly adapted for use here.

[2] I no longer bulk build, as I no longer have a use case.
Reply With Quote
Old 12th February 2015
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,302
Default

Quote:
Originally Posted by jggimi View Post
...I recommend dpb(1).
While I agree that dpb(8) is preferrable in that it parallelizes port building, it does not come without understanding the fundamental issues with parallelization -- most notably memory requirements. Other factors exist too.

In my experience, building ports using amd64 is less cantankerous than i386 even with changing the memory profile in login.conf(5) & ksh(1)'s ulimit command. Watching dpb's error log sometimes necessitates restarts or resorting to make install as described in Section 15.3.5 of the FAQ.

Having said that, dpb is a great addition to the port building toolkit.
Reply With Quote
Old 12th February 2015
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,302
Default

Quote:
Originally Posted by jggimi View Post
That partition may be fine for the occasional build of individual ports, but it's way undersized for large application builds.
Agreed. I find that the biggest culprit of needing vast amounts of disk space is /usr/ports/pobj/. As jggimi admonishes, those contemplating port building need to thoughtfully consider the potential disk requirements.

How? Trial & error. Make an educated guess, & if this works, great. If it doesn't, use a larger partition size.
Reply With Quote
Old 12th February 2015
hanzer's Avatar
hanzer hanzer is offline
Real Name: Adam Jensen
just passing through
 
Join Date: Oct 2013
Location: EST USA
Posts: 314
Default

Quote:
Originally Posted by ocicat View Post
Agreed. I find that the biggest culprit of needing vast amounts of disk space is /usr/ports/pobj/.
I suppose if one were in a pinch for ports build space, the WRKOBJDIR environment variable could be set to /tmp/pobj; though I haven't tried it.

Yep, a 4GB /usr/ports partition seems to be okay for the occasional # make install clean=all of a 3rd party application.

I would actually like finer grained partitioning of the disk in that little OpenBSD machine, but [if memory serves] each disk can only have 16[?] partitions.

Last edited by hanzer; 12th February 2015 at 10:18 PM.
Reply With Quote
Old 12th February 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,681
Default

Quote:
Originally Posted by ocicat View Post
...it does not come without understanding the fundamental issues with parallelization...
I agree, but I would like to mention that dpb has key operational values -- logging, job control, prioritorization -- which are advantageous even when there is a single platform with a single core, where only a single build at a time will be running.
Quote:
Originally Posted by hanzer View Post
...but [if memory serves] each disk can only have 16[?] partitions.
Correct, "a" through "p". However, only 15 can be used for partitioning, as "c" is reserved for the drive itself, and always contains all addressable sectors.
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
Got my ports tree deleted after attempting ports update bsdnotbdsm FreeBSD Ports and Packages 2 18th May 2014 01:58 PM
OpenBSD ports tree now locked ocicat News 0 21st January 2011 03:30 PM
OpenBSD 4.8 ports tree locked! ocicat News 0 2nd August 2010 07:31 PM
Is my ports tree corrupt or sth? TerryP FreeBSD Ports and Packages 1 29th June 2010 09:51 PM
GCC in src tree or in ports tree vigol FreeBSD Ports and Packages 2 6th December 2009 04:34 PM


All times are GMT. The time now is 05:42 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick