3

I have comp54.tgz installed.

# cd /root && ftp http://ftp.openbsd.org/pub/OpenBSD/`uname -r`/src.tar.gz && tar -xzf /root/src.tar.gz -C /usr/src
# uname -r
5.4
# pwd
/usr/src
# ls -la
total 124
drwxrwxr-x   17 root  wsrc     512 Apr 13 19:35 .
drwxr-xr-x   17 root  wheel    512 Jul 30  2013 ..
drwxr-xr-x    2 root  wsrc     512 Jul 29  2013 CVS
-rw-r--r--    1 root  wsrc    3456 Jul 24  2013 Makefile
-rw-r--r--    1 root  wsrc   16419 Jul  7  2013 Makefile.cross
drwxr-xr-x   36 root  wsrc    1024 Jul 29  2013 bin
drwxr-xr-x   31 root  wsrc     512 Jul 29  2013 distrib
drwxr-xr-x   35 root  wsrc    2560 Jul 29  2013 etc
drwxr-xr-x   44 root  wsrc    1024 Jul 29  2013 games
drwxr-xr-x    9 root  wsrc     512 Jul 29  2013 gnu
drwxr-xr-x    7 root  wsrc    2048 Jul  7  2013 include
drwxr-xr-x   11 root  wsrc     512 Jul 29  2013 kerberosV
drwxr-xr-x   40 root  wsrc    1024 Jul 29  2013 lib
drwxr-xr-x   40 root  wsrc    1024 Jul 29  2013 libexec
drwxr-xr-x   15 root  wsrc     512 Jul 10  2010 regress
drwxr-xr-x   78 root  wsrc    1536 Jul 29  2013 sbin
drwxr-xr-x   14 root  wsrc     512 Jul 29  2013 share
drwxr-xr-x  228 root  wsrc    4096 Jul 29  2013 usr.bin
drwxr-xr-x  144 root  wsrc    2560 Jul 29  2013 usr.sbin
# which gcc
/usr/bin/gcc
# 
# ftp http://ftp.openbsd.org/pub/OpenBSD/patches/5.4/common/001_pflow.patch  
Trying 129.128.5.191...
Requesting http://ftp.openbsd.org/pub/OpenBSD/patches/5.4/common/001_pflow.patch
100% |*******************************************************|   803       00:00    
803 bytes received in 0.00 seconds (11.10 MB/s)
# 
# patch -p0 < 001_pflow.patch                                               
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Apply by doing:
|       cd /usr/src
|       patch -p0 < 001_pflow.patch
|
|Then build and install a new kernel.
|
|Index: sys/net/if_pflow.c
|===================================================================
|RCS file: /vol/openbsd/cvs/src/sys/net/if_pflow.c,v
|retrieving revision 1.32
|diff -u -p -r1.32 if_pflow.c
|--- sys/net/if_pflow.c 5 Jul 2013 17:14:27 -0000       1.32
|+++ sys/net/if_pflow.c 7 Nov 2013 16:48:45 -0000
--------------------------
File to patch: # what do I need to write here???????
No file found--skip this patch? [n] 
patch: **** can't find #
# 

My question: how do I get past of the "File to patch: "?

1
  • 1
    Do you have a fully populated /usr/src?
    – Flup
    Commented Apr 9, 2014 at 10:08

3 Answers 3

5

You have an incomplete source tree - kernel sources are in /usr/src/sys which ls shows missing. The file you're attempting to patch should be in: /usr/src/sys/net/if_pflow.c
You'll need to get the sys.tar.gz sources to patch & compile the kernel. Be sure to follow the procedure closly

  1. http://www.openbsd.org/anoncvs.html#starting
  2. http://www.openbsd.org/stable.html
2

Since OpenBSD 6.1 (April 2017), the easiest way to follow the -stable branch on the i386 and amd64 architectures is by using syspatch. The arm64 architecture also uses syspatch since release 6.2 (October 2017).

Patching an OpenBSD-release or OpenBSD-stable system on either of these architectures is as easy as

$ doas syspatch

or, if you don't have doas(1) configured,

$ su root -c syspatch

This requires that /etc/installurl is present and contains a single line with an URL pointing to the preferred OpenBSD mirror, for example

https://cdn.openbsd.org/pub/OpenBSD/

You don't need to have fetched the OpenBSD CVS repositories to use syspatch, it applies binary patches.

To be notified of new patches automatically, let root run syspatch -c as a nightly cron job.

See also syspatch(8), installurl(5), and the OpenBSD FAQ section on Security Updates.

1

You can skip source patching for i386, amd64, and arm platforms by using M:Tier's stable updates service.

Details at https://stable.mtier.org/

They also have a nice program called openup that helps automate the process. I use it and it was a huge timesaver yesterday patching all my servers.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .