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 27th September 2015
e1-531g e1-531g is offline
VPN Cryptographer
 
Join Date: Mar 2014
Posts: 366
Default Changing directory for fetching of source code

Hello,
I would like sometimes experiment with some options/custom config in kernel. On the other hand that is not supported by OpenBSD. Suppose I need to reproduce problem with original kernel. I think good solution for me would be to have two directories for OpenBSD's code. Instead of /usr/src/sys/ I would have:
1. /usr/src/original/sys/
2. /usr/src/modified/sys/

1. Does changing the path to source code directory is supported by OpenBSD? I mean this as the only one change to build process covered by FAQ. No other changes are going to be made.
2. I assume that if I want to replace one build by another I need to have two exactly the same source codes in aforementioned directories. Not going from older to newer and vice versa, even if this is 5 minutes newer/older. How to do this using CVS? Can I replicate/copy code from one local directory to other using CVS command? If not how to manage my goal of having two directories with exactly the same source code (of course in one of them there will be modifications)?
Reply With Quote
  #2   (View Single Post)  
Old 27th September 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,934
Default

You don't need to do this. You can create as many kernels as you like, with different customizations. Each time, create a new configuration file with a new name. When you config(8) each new kernel, a new directory structure will be created automatically under /usr/src/sys/arch/<arch>/compile for you.

Custom kernel building is described in FAQ 5.7.
Reply With Quote
  #3   (View Single Post)  
Old 27th September 2015
e1-531g e1-531g is offline
VPN Cryptographer
 
Join Date: Mar 2014
Posts: 366
Default

Lets suppose my changes are not limited to config, but also to souce code. And that I am not experienced in using patch utility, and patches are not organized well. It will be time consuming to clean the code from these changes. And I don't want to lose them.
For this it will be much easier for me to just have two separate directories with OpenBSD's code. Does it is supported to build OpenBSD in another directory?
For second question I have found " -D date_spec" option for CVS, but I haven't tested it yet. I think it could resolve my second problem.
Reply With Quote
  #4   (View Single Post)  
Old 27th September 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,934
Default

Quote:
Originally Posted by e1-531g View Post
Lets suppose my changes are not limited to config, but also to souce code....
It has been my experience that it is possible to configure and build kernels with source trees in other locations. This is because config(8) -- by default -- operates on relative paths, and relative paths are provisioned by config(8) in the resulting Makefile in ../compile/SYSTEMNAME.

Userland and Xenocara source in non-standard locations is possible (if not supported), through the setting of environment variables. See /usr/share/mk/bsd.README and /usr/xenocara/README for applicable variables. A subset are discussed in FAQ 5.3, 5.4, and release(8).
Quote:
....And that I am not experienced in using patch utility, and patches are not organized well. It will be time consuming to clean the code from these changes. And I don't want to lose them.
I recommend learning to use cvs(1) instead. It will be easier to manage your local modifications than having separate trees, and, should you develop something you would like to share with the Project, you can use cvs(1) to produce patches in Unified diff(1) form with your entire set of customizations for discussion on the tech@ mailing list.

Last edited by jggimi; 27th September 2015 at 09:00 PM. Reason: typo
Reply With Quote
  #5   (View Single Post)  
Old 3rd October 2015
e1-531g e1-531g is offline
VPN Cryptographer
 
Join Date: Mar 2014
Posts: 366
Default

From misc mailing list:
Quote:
Originally Posted by Ted Unangst
you can build the kernel from sources in any directory. building everything
else requires editing mk.conf, see the man page.
Thanks for answers. They are also valuable.

Last edited by e1-531g; 3rd October 2015 at 09:17 PM.
Reply With Quote
  #6   (View Single Post)  
Old 3rd October 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,934
Default

I'm sorry I wasn't clear. I'd written:
Quote:
Originally Posted by jggimi View Post
This is because config(8) -- by default -- operates on relative paths, and relative paths are provisioned by config(8) in the resulting Makefile in ../compile/SYSTEMNAME.
You can put your .../sys structures anywhere you want. Userland builds require setting environment variables, which Ted notes can be placed in /etc/mk.conf. Many variables are noted within its man page -- while definitive requirements are described in the READMEs I pointed you to above.

Last edited by jggimi; 3rd October 2015 at 09:49 PM. Reason: clarity
Reply With Quote
  #7   (View Single Post)  
Old 4th October 2015
e1-531g e1-531g is offline
VPN Cryptographer
 
Join Date: Mar 2014
Posts: 366
Default

Thank you jggimi. I just wanted information that building kernel somewhere else is supported or not supported.

I have tested switch -D for cvs. It seems to work. It resolves my problem which had caused second question.
Now I have kernel from official snapshot:
Code:
sysctl kern.version                                                          
kern.version=OpenBSD 5.8-current (GENERIC.MP) #1417: Sat Oct  3 23:33:39 MDT 2015
    deraadt@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
From above text I have date of build. Date of building of Xenocara is specified in log:
Code:
grep 'Build Date' /var/log/Xorg.0.log
I have updated date to slightly more recent, because maybe CVS mirror was fetching code with delay or something. Now I have two scripts to update code:
Code:
#!/bin/sh

export CVSROOT=anoncvs@ftp.hostserver.de:/cvs
cd /usr/src
cvs -d$CVSROOT up -D "2015-10-04 04:20" -Pd
cd /usr/originalKernel
cvs -d$CVSROOT up -D "2015-10-04 04:20" -Pd
sync && sleep 1
Code:
#!/bin/sh

cd /usr
export CVSROOT=anoncvs@ftp.hostserver.de:/cvs
cvs -d$CVSROOT up -D "2015-10-04 06:20" -Pd
sync && sleep 1
Reply With Quote
Reply

Tags
cvs, fetching source code

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
Other Open-source typeface “Hack” brings design to source code J65nko News 1 31st August 2015 03:06 PM
IRC server had backdoor in source code for months J65nko News 2 15th June 2010 04:36 PM
explore source code for installed program bsdnewbie999 OpenBSD General 1 23rd February 2009 06:13 AM
Trying to compile GLUT source code on freebsd. welkin Programming 0 11th January 2009 03:15 PM
Source code for ed? matt FreeBSD Ports and Packages 1 21st October 2008 08:18 PM


All times are GMT. The time now is 09:37 PM.


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