On Fri, May 07, 2021 at 06:00:03AM +0000, Chris Bennett wrote:
> I'm having an error getting doas make install. Also fails when using root
> for make package and when I moved the directory over into /usr/ports/devel/

You must avoid using root for the ports work.
Also no need for 'doas make install', `make install` will call onto doas.

> and mk.conf
> 
> CX ~ $ cat /etc/mk.conf
> SUDO=/usr/bin/doas
> FETCH_PACKAGES=-Dsnap
> DISTDIR=/usr/distfiles
> PACKAGE_REPOSITORY=/usr/packages
> WRKOBJDIR=/usr/Pobj
> LOCKDIR=/usr/Pobj/locks
> #LOCK_VERBOSE=Yes

I've ran into such errors using non-default locations as above.
Why not set everything inside /usr/ports with all on different partitions
if necessary.

> 
> .include "/usr/ports/infrastructure/templates/mk.conf.template"
> 
> _-----------------------------------------_
> 
> I see that a lot of changes have been made to porting.
> I've been reading the manual pages for ports, package, packages, bsd.port.mk, 
> etc.
> I've also read the Porter's Handbook pages.
> 
> All of the make steps work fine, as they did before. I'm not sure exactly 
> where to
> look for this problem. I've been running sysupgrade for a long time. Might 
> there be
> some step that didn't take right (likely my fault) and I need to do a fresh 
> install?
> 
> Hmm,
> Chris Bennett

You don't need a fresh install, maybe refetch the ports tree at most.
This is all that is required in mk.conf, if you keep/mount in the default 
locations.

/etc/mk.conf
PORTS_PRIVSEP=Yes
SUDO=doas
FETCH_PACKAGES=-Dsnap

If sls is your default user, as root do:

# usermod sls -G wsrc
# chown -R sls:wsrc /usr/ports
# chmod 775 /usr/ports
# cd /usr/ports && make fix-permissions

You need to expand default example doas.conf as follows:
Set proper user in PORTS_TREE_OWNER below.
You can add TRUSTED_PKG_PATH and TERM below if required
for pkg_add/pkg_delete.

/etc/doas.conf
permit setenv { \
    FTPMODE PKG_CACHE PKG_PATH SM_PATH SSH_AUTH_SOCK \
    DESTDIR DISTDIR FETCH_CMD FLAVOR GROUP MAKE MAKECONF \
    MULTI_PACKAGES NOMAN OKAY_FILES OWNER PKG_DBDIR \
    PKG_DESTDIR PKG_TMPDIR PORTSDIR RELEASEDIR SHARED_ONLY \
    SUBPACKAGE WRKOBJDIR SUDO_PORT_V1 PORTS_TREE_OWNER=sls \
    FAKE_TREE_OWNER=_pbuild } :wsrc

Then you can use ports as your default user `sls`
$ make build
$ make package
$ make install

Reply via email to