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 8th July 2016
scottro's Avatar
scottro scottro is offline
Real Name: Scott Robbins
ISO Quartermaster
 
Join Date: Apr 2008
Location: NYC
Posts: 654
Default Where is PKG_PATH stored

I've duplicated this experience a few times. If I use the install59.fs from nycbug.org, and, during installation, use the ethernet connect, afterwards, PKG_PATH is set to nycbug's mirror. If I choose to not configure a network card during installation, it's not set, and I do it manually afterwards, like normal people.

By set to, I mean that after I boot up the new system, I can just do pkg_add whatever without having to manually set a package path.


However, what I'm wondering, is where is PKG_PATH being set. I can't find it in my .profile or root's, nor in /etc/pkg.conf. Not a big issue of course, but I'm just curious where else the variable gets set, and a few minutes of googling didn't help. I also tried grep -r -i pkg in /etc/ but that didn't help either.

I wonder if it's just something nycbug does with their image, but figured I'd ask here first.
Reply With Quote
  #2   (View Single Post)  
Old 8th July 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,984
Default

If you install filesets from the network, the installer will create a pkg.conf(5) file for you. If you install from media, the installer will not create the file.

The file will be used if the $PKG_PATH environment variable is not set, so that you can use the variable to override the configuration file.

There is an /etc/examples/pkg.conf file available, also.
Reply With Quote
  #3   (View Single Post)  
Old 8th July 2016
scottro's Avatar
scottro scottro is offline
Real Name: Scott Robbins
ISO Quartermaster
 
Join Date: Apr 2008
Location: NYC
Posts: 654
Default

No, there is no pkg.conf file created. I am using an installf59.fs file, burned to USB. It's provided by nycbug.org, and if I choose defaults, will use their mirrors.

Again, unimportant question, it is just that I had expected an /etc/pkg.conf but there wasn't one.

Last edited by scottro; 8th July 2016 at 02:47 PM.
Reply With Quote
  #4   (View Single Post)  
Old 8th July 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,984
Default

Let me restate, since you are using "install59.fs" from an official mirror.

OpenBSD is installed using the RAMDISK kernel (bsd.rd), which may be booted from a variety of media: diskette, optical drive, disk drive, or network. The options available depend upon the architecture.

In this case, the media you selected and put on USB is a disk-drive image containing both the bootable RAMDISK kernel, and all installable kernels and filesets. The only difference between the install59.fs image and the miniroot59.fs image is that the latter does not have any installable kernels or filesets.

No matter what media type you chose to use, or which variant you boot, the same bsd.rd kernel and the same script is used.

During install, you will be asked where the kernels and filesets for installation are located. They may be on local media, or they may be at a network location.
  • If you select a network location for kernels and filesets, you will have a pkg.conf file created for you.
  • If you select local media for kernels and filesets, you will not have a pkg.conf file created.
Reply With Quote
  #5   (View Single Post)  
Old 8th July 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,984
Default

Here are two excerpts from /usr/src/distrib/miniroot/install.sub for OpenBSD 5.9:
Code:
	# Bake a package path only if we installed from a mirror.
	PACKAGE_PATH=
	if [[ -n $_mirror ]]; then
		PACKAGE_PATH=$(print -r -- "$_url_base" |
			sed -E "/\/(snapshots|[0-9]\.[0-9])\/($ARCH)\/*$/!d
				s!!/%c/packages/%a/!;q")
	fi
.
.
.
	# Create or update pkg.conf with the new package path, if any.
	if [[ -n $PACKAGE_PATH ]]; then
		grep -v '^[ 	]*installpath[ 	]*=' /mnt/etc/pkg.conf 2>/dev/null >/tmp/pkgconf
		print -r -- "installpath = $PACKAGE_PATH" >>/tmp/pkgconf
		cp /tmp/pkgconf /mnt/etc/pkg.conf
	fi
The network location must be an official mirror. Installing from a private server will be treated like local media.

Last edited by jggimi; 8th July 2016 at 05:07 PM. Reason: clarity
Reply With Quote
  #6   (View Single Post)  
Old 8th July 2016
scottro's Avatar
scottro scottro is offline
Real Name: Scott Robbins
ISO Quartermaster
 
Join Date: Apr 2008
Location: NYC
Posts: 654
Default

Ah, by golly, so it is. Ok, I think I missed it first time around, but I see now, on the install, a created /etc/pkg.conf

Thanks.
Reply With Quote
  #7   (View Single Post)  
Old 8th July 2016
bsd-keith bsd-keith is offline
Real Name: Keith
Open Source Software user
 
Join Date: Jun 2014
Location: Surrey/Hants Border, England
Posts: 345
Default

When I install, I normally set it manually, by echoing it to my root .profile, & everything works.
Should I not do so?
__________________
Linux since 1999, & also a BSD user.
Reply With Quote
  #8   (View Single Post)  
Old 8th July 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,984
Default

Entirely up to you, Keith, depending on how you want to manage your package install path.

(I use pkg.conf, and override with $PKG_PATH when/if necessary.)
Reply With Quote
  #9   (View Single Post)  
Old 9th July 2016
bsd-keith bsd-keith is offline
Real Name: Keith
Open Source Software user
 
Join Date: Jun 2014
Location: Surrey/Hants Border, England
Posts: 345
Default

Thanks for confirming.
__________________
Linux since 1999, & also a BSD user.
Reply With Quote
Reply


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
PKG_PATH not changing Roydd85 OpenBSD Packages and Ports 12 7th April 2016 01:30 AM
export PKG_PATH betweendayandnight OpenBSD General 4 9th August 2015 12:07 PM
can't setup PKG_PATH after install of 5.5 spermwhale_warrior OpenBSD Packages and Ports 10 26th August 2014 09:29 PM
DMA with user accounts stored in a database Jtf General software and network 2 22nd July 2014 02:38 AM
pf tables how long values stored ijk FreeBSD Security 3 12th August 2008 11:45 AM


All times are GMT. The time now is 06:21 PM.


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