DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Installation and Upgrading

OpenBSD Installation and Upgrading Installing and upgrading OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 24th July 2015
hanzer's Avatar
hanzer hanzer is offline
Real Name: Adam Jensen
just passing through
 
Join Date: Oct 2013
Location: EST USA
Posts: 267
Default Build kernel & userland as root?

The FAQ mentions a nifty way to build ports as a user (in group wsrc) - 15.3.3 - Configuration of the ports system

Could something similar be done so the kernel/userland and xenocara could be updated and compiled by users in the wsrc group?

I am tempted to just try:
# find /usr/src -type d -exec chmod g+w {} \;
# find /usr/xenocara -type d -exec chmod g+w {} \;
# chmod g+w /usr/obj
# chmod g+w /usr/xobj

then try an update or build but it would be nice to hear what the more experienced folk have to say about it first.
Reply With Quote
  #2   (View Single Post)  
Old 24th July 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,944
Default

On a default installation, you will note that there are three build directories in /usr: src, obj, and xobj. All three are owned root:wsrc, with chmod 775 (drwxrwxr-x). The ports and xenocara directories do not yet exist.

There are two official guides to building the OS. FAQ 5, and release(8). Both indicate where superuser authority is required, either via su(8) or sudo(8). Your users in the wsrc group must have the authority to be superuser granted through one of these methods to complete a build, and also the optional release. This authority is needed to install kernels, binaries, and libraries, and if building a release, to additionally manipulate vnd(4) devices and associated mounts in order create installation media image files.
Reply With Quote
  #3   (View Single Post)  
Old 24th July 2015
hanzer's Avatar
hanzer hanzer is offline
Real Name: Adam Jensen
just passing through
 
Join Date: Oct 2013
Location: EST USA
Posts: 267
Default

I've been updating the source as root but here's a test as non-root:
Code:
hanzer[/usr/xenocara]$ userinfo hanzer
login   hanzer
passwd  *
uid     1000
groups  hanzer wheel wsrc
change  NEVER
class   staff
gecos   Adam Jensen
dir     /home/hanzer
shell   /bin/ksh
expire  NEVER

hanzer[/usr/xenocara]$ cvs -d$CVSROOT up -rOPENBSD_5_7 -Pd
The authenticity of host 'anoncvs3.usa.openbsd.org (192.43.244.161)' can't be established.
ECDSA key fingerprint is SHA256:UAjbt7WxQff1I2ZEp5Vgkpr0JGN5MmFX8PYMaZgIP24.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'anoncvs3.usa.openbsd.org,192.43.244.161' (ECDSA) to the list of known hosts.
cvs update: cannot open CVS/Tag: Permission denied
cvs update: cannot open CVS/Tag: Permission denied
cvs server: Updating .
cvs update: cannot open CVS/Tag: Permission denied
cvs update: cannot open CVS/Tag: Permission denied
cvs server: Updating app
^c
That didn't work.

Trying a kernel build.
/etc/mk.conf
Code:
SUDO=/usr/bin/sudo
USE_SYSTRACE=Yes
Code:
hanzer[/usr/src/sys/arch/i386/conf]$ config GENERIC.MP                                                                                      
config: config: remove(machine): Permission denied
config: config: symlink(machine -> ../../../../arch/i386/include): File exists
config: config: remove(i386): Permission denied
config: config: symlink(i386 -> machine): File exists
*** Stop.
That didn't work.

The FAQ demonstrates updating and building as root but some steps in the release(8) examples have a $ prompt and other steps have # prompt.

I guess since I followed the FAQ approach and did the initial source checkouts and updates as root that accounts for the failures (above).

It's curious that, in release(8), the userland build makes use of the SUDO environment variable but the kernel # make install explicitly does not. Hmm, I wonder what is going on there?
Reply With Quote
  #4   (View Single Post)  
Old 24th July 2015
bsd-keith bsd-keith is offline
Real Name: Keith
Open Source Software user
 
Join Date: Jun 2014
Location: Surrey/Hants Border, England
Posts: 138
Default

.......& will it soon use the new doas......
__________________
Linux since 1999, & now an OpenBSD user.
Reply With Quote
  #5   (View Single Post)  
Old 24th July 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,944
Default

Quote:
Originally Posted by hanzer View Post
I've been updating the source as root...
Your permission errors require the use of the famous ls(1) command. Your CVS/Tag files, at the very least, are either not owned by group wsrc or do not have write access by the group. Or both.

There are many ways to correct this. The fastest would be to use find(1) with xargs(1) and either chown(1) or chmod(1). Or both.

Here's an example command to change ownership. Be careful. I'm just typing this from between my assumptions, and have not tested this. I may have syntax errors, or ... worse. Deploy some test files in /tmp and test something similar there, before doing this to your source tree.

# find /usr/src -name Tag | xargs chown root:wsrc

You can also delete and then recreate the source tree from CVS as the user hanzer, if you prefer, though that takes much longer.
Reply With Quote
  #6   (View Single Post)  
Old 24th July 2015
hanzer's Avatar
hanzer hanzer is offline
Real Name: Adam Jensen
just passing through
 
Join Date: Oct 2013
Location: EST USA
Posts: 267
Default

The release(8) manpage contains most of the key information for building as non-root (thanks for the hint!). I just got this box together so I'll probably tinker with other stuff and wait for 5.8-release, fresh install, and set up the updating & build process by following the release(8) method rather than FAQ method.

For the near term, I need to explore lean backup & clean restore methods so I can start mucking about entirely reckless with absolute impunity. Mwah ha ha haaaa!
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
kernel, userland, and ports CFLAGS hanzer OpenBSD Packages and Ports 5 15th February 2015 09:52 PM
Why to build a new userland? batence NetBSD Installation and Upgrading 2 5th January 2015 07:44 PM
how to determine if kernel & userland are synchronized? daemonfowl OpenBSD General 4 10th May 2012 03:02 PM
commands to build a kernel desreguard FreeBSD General 2 4th June 2011 05:20 PM
Problem during kernel-build for a 6.x-to-7 upgrade clevershark FreeBSD Installation and Upgrading 2 1st February 2009 10:45 PM


All times are GMT. The time now is 09:53 AM.


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