OpenBSD CVS

CVS log for src/usr.sbin/syspatch/syspatch.sh


[BACK] Up to [local] / src / usr.sbin / syspatch

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.168 / (download) - annotate - [select for diffs], Wed Dec 13 17:50:23 2023 UTC (5 months, 3 weeks ago) by ajacoutot
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, HEAD
Changes since 1.167: +4 -3 lines
Diff to previous 1.167 (colored)

Match what reorder_kernel is doing and use kern.osversion to find out whether
we are running an MP kernel or not.

based on a reworked submission from kris at devtty dot one via deraadt@
input and ok robert@

Revision 1.167 / (download) - annotate - [select for diffs], Mon Dec 7 21:19:28 2020 UTC (3 years, 6 months ago) by ajacoutot
Branch: MAIN
CVS Tags: OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.166: +2 -1 lines
Diff to previous 1.166 (colored)

When asking to install patches and none are available, return 2.

man page and inputs from schwarze@
ok sthen@

Revision 1.166 / (download) - annotate - [select for diffs], Tue Oct 27 17:42:05 2020 UTC (3 years, 7 months ago) by tb
Branch: MAIN
Changes since 1.165: +2 -2 lines
Diff to previous 1.165 (colored)

Check that SHA256.sig has at least three lines

If there are fewer than three syspatches, this utility currently won't
see them due to a small thinko from r1.164 that checks whether SHA256
has at least three lines (two lines signature + 1 line with a syspatch)
instead of doing the same on SHA256.sig. Adjust the check so it works
as intended with no need for brilliantly ugly workarounds from robert.

found by tj
ok ajacoutot

Revision 1.165 / (download) - annotate - [select for diffs], Thu Oct 8 14:26:34 2020 UTC (3 years, 8 months ago) by kn
Branch: MAIN
Changes since 1.164: +16 -14 lines
Diff to previous 1.164 (colored)

Print usage to stderr, print error messages in errx(3) fashion

While here, rename sg_err()/ug_err() to just err() and sync code between
syspatch(8) and sysupgrade(8).

Feedback OK naddy

Revision 1.164 / (download) - annotate - [select for diffs], Sat Jul 18 14:08:07 2020 UTC (3 years, 10 months ago) by ajacoutot
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.163: +12 -8 lines
Diff to previous 1.163 (colored)

set -/+o pipefail around the magic loop in ls_missing() so that we can properly
error out if ftp(1) or tar(1) fails; this happened to swarte@ a few months
(something to do with /home on NFS without -maproot IIRC).

Check that the signature file is at least 3 lines long (meaning that it contains
at least 1 syspatch) before entering the magic loop otherwise `grep -q' will
abort the script due to pipefail.

While here, revove a useless use of sort(1).

Revision 1.163 / (download) - annotate - [select for diffs], Sat Jul 4 18:30:46 2020 UTC (3 years, 11 months ago) by ajacoutot
Branch: MAIN
Changes since 1.162: +1 -4 lines
Diff to previous 1.162 (colored)

Our old ksh(1) bug where eval()uating a || compound list would terminate the
shell has been fixed by benno@; remove workaround.

ok naddy@

Revision 1.162 / (download) - annotate - [select for diffs], Sat Jul 4 14:08:27 2020 UTC (3 years, 11 months ago) by ajacoutot
Branch: MAIN
Changes since 1.161: +2 -1 lines
Diff to previous 1.161 (colored)

Small XXX.

Revision 1.161 / (download) - annotate - [select for diffs], Sun May 24 16:47:43 2020 UTC (4 years ago) by tb
Branch: MAIN
Changes since 1.160: +4 -4 lines
Diff to previous 1.160 (colored)

Relax the filename checks to allow dashes as well. Starting with
OpenBSD 6.9, we can use less awkward filenames.

Initial diff by deraadt, ok aja

Revision 1.160 / (download) - annotate - [select for diffs], Sat May 16 12:36:01 2020 UTC (4 years ago) by ajacoutot
Branch: MAIN
Changes since 1.159: +4 -4 lines
Diff to previous 1.159 (colored)

Simplify: _BSDMP was only used once.

Revision 1.159 / (download) - annotate - [select for diffs], Tue Dec 10 17:11:06 2019 UTC (4 years, 5 months ago) by ajacoutot
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.158: +4 -4 lines
Diff to previous 1.158 (colored)

Just output a generic error message:
"Unsupported filesystem, aborting"
for mfs, nfs and co.

Revision 1.158 / (download) - annotate - [select for diffs], Sun Nov 10 14:12:22 2019 UTC (4 years, 6 months ago) by ajacoutot
Branch: MAIN
Changes since 1.157: +2 -2 lines
Diff to previous 1.157 (colored)

Drop non existent vars.

Revision 1.157 / (download) - annotate - [select for diffs], Sat Oct 26 08:37:24 2019 UTC (4 years, 7 months ago) by ajacoutot
Branch: MAIN
Changes since 1.156: +7 -6 lines
Diff to previous 1.156 (colored)

Wrap long lines.

Revision 1.156 / (download) - annotate - [select for diffs], Sat Oct 26 04:04:20 2019 UTC (4 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.155: +4 -4 lines
Diff to previous 1.155 (colored)

use ftp -N option; ok jca

Revision 1.155 / (download) - annotate - [select for diffs], Fri Oct 25 11:14:31 2019 UTC (4 years, 7 months ago) by ajacoutot
Branch: MAIN
Changes since 1.154: +3 -2 lines
Diff to previous 1.154 (colored)

Retracted a bit too much.

Revision 1.154 / (download) - annotate - [select for diffs], Wed Oct 23 16:50:14 2019 UTC (4 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.153: +2 -4 lines
Diff to previous 1.153 (colored)

retract 1.151, now that ftp reports the failing url itself.
with jca, ok aja

Revision 1.153 / (download) - annotate - [select for diffs], Sun Oct 20 09:10:43 2019 UTC (4 years, 7 months ago) by ajacoutot
Branch: MAIN
Changes since 1.152: +2 -2 lines
Diff to previous 1.152 (colored)

Tweak and sync comment.

Revision 1.152 / (download) - annotate - [select for diffs], Sat Oct 19 13:14:23 2019 UTC (4 years, 7 months ago) by tb
Branch: MAIN
Changes since 1.151: +2 -2 lines
Diff to previous 1.151 (colored)

Determine the OS version in a way that won't break after 9.9.
Do it the same way in all three copies of the code.

Based on a patch from Chris Waddey.
with & ok ajacoutot

Revision 1.151 / (download) - annotate - [select for diffs], Mon Oct 14 06:56:54 2019 UTC (4 years, 7 months ago) by ajacoutot
Branch: MAIN
Changes since 1.150: +12 -8 lines
Diff to previous 1.150 (colored)

Better error message when we fail to fetch SHA256.sig.
Add "syspatch:" to every error message so we know where it comes from.

req. by deraddt@
ok deraadt@ tb@

Revision 1.150 / (download) - annotate - [select for diffs], Sat Sep 28 17:30:07 2019 UTC (4 years, 8 months ago) by ajacoutot
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.149: +2 -1 lines
Diff to previous 1.149 (colored)

Add where missing and harmonize PATH to be _PATH_DEFPATH (without local nor
X11R6).
Suggested by tb@

ok deraadt@ tb@ millert@

Revision 1.149 / (download) - annotate - [select for diffs], Sun Jul 7 11:11:22 2019 UTC (4 years, 11 months ago) by ajacoutot
Branch: MAIN
Changes since 1.148: +4 -4 lines
Diff to previous 1.148 (colored)

Tell user to look at manually running /usr/libexec/reorder_kernel in case
it fails at the end of the syspatch run.
Because a kernel syspatch was installed, a user could think the kernel
was updated accordingly; which is not the case if reorder_kernel fails.

Revision 1.148 / (download) - annotate - [select for diffs], Sun May 5 10:34:01 2019 UTC (5 years, 1 month ago) by ajacoutot
Branch: MAIN
Changes since 1.147: +7 -3 lines
Diff to previous 1.147 (colored)

For "unpriv -f file", chown file back to root once the command finishes,
like install.sub and sysupgrade(8) do.

Revision 1.147 / (download) - annotate - [select for diffs], Sun May 5 10:24:00 2019 UTC (5 years, 1 month ago) by ajacoutot
Branch: MAIN
Changes since 1.146: +2 -2 lines
Diff to previous 1.146 (colored)

Initialise variable.

Revision 1.146 / (download) - annotate - [select for diffs], Sun May 5 10:22:57 2019 UTC (5 years, 1 month ago) by ajacoutot
Branch: MAIN
Changes since 1.145: +21 -21 lines
Diff to previous 1.145 (colored)

Change variable name.

Revision 1.145 / (download) - annotate - [select for diffs], Fri Apr 26 20:42:46 2019 UTC (5 years, 1 month ago) by ajacoutot
Branch: MAIN
Changes since 1.144: +2 -2 lines
Diff to previous 1.144 (colored)

If we don't have a proper installurl, use cdn.openbsd.org.
Idea from sysupgrade(8).

Revision 1.144 / (download) - annotate - [select for diffs], Tue Feb 26 18:52:35 2019 UTC (5 years, 3 months ago) by ajacoutot
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.143: +6 -6 lines
Diff to previous 1.143 (colored)

Move release check up front.

Revision 1.143 / (download) - annotate - [select for diffs], Wed Feb 20 08:50:00 2019 UTC (5 years, 3 months ago) by ajacoutot
Branch: MAIN
Changes since 1.142: +2 -2 lines
Diff to previous 1.142 (colored)

Drop '-S' knob from install(1). It's the default and a no-op nowadays.

ok deraadt@

Revision 1.142 / (download) - annotate - [select for diffs], Mon Jan 21 23:50:36 2019 UTC (5 years, 4 months ago) by ajacoutot
Branch: MAIN
Changes since 1.141: +1 -1 lines
Diff to previous 1.141 (colored)

Don't return 1 if we rollback and there's no installed patches.

Revision 1.141 / (download) - annotate - [select for diffs], Mon Jan 21 23:44:26 2019 UTC (5 years, 4 months ago) by ajacoutot
Branch: MAIN
Changes since 1.140: +6 -2 lines
Diff to previous 1.140 (colored)

Warn user to reboot the machine when a new kernel is installed and let him know
where to look on the local machine for errata (/var/syspatch) so one can decide
if a reboot is needed.

ok Theos (tb@ deraadt@)

Revision 1.140 / (download) - annotate - [select for diffs], Wed Jan 16 22:29:12 2019 UTC (5 years, 4 months ago) by ajacoutot
Branch: MAIN
Changes since 1.139: +3 -3 lines
Diff to previous 1.139 (colored)

Exit for real as soon as we update ourself.

Revision 1.137.2.1 / (download) - annotate - [select for diffs], Fri Nov 2 16:12:59 2018 UTC (5 years, 7 months ago) by bluhm
Branch: OPENBSD_6_4
Changes since 1.137: +13 -1 lines
Diff to previous 1.137 (colored) next main 1.138 (colored)

Properly handle symlinks.
from ajacoutot@ tb@

OpenBSD 6.4 errata 002

Revision 1.135.2.1 / (download) - annotate - [select for diffs], Fri Nov 2 16:12:27 2018 UTC (5 years, 7 months ago) by bluhm
Branch: OPENBSD_6_3
Changes since 1.135: +13 -1 lines
Diff to previous 1.135 (colored) next main 1.136 (colored)

Properly handle symlinks.
from ajacoutot@ tb@

OpenBSD 6.3 errata 021

Revision 1.139 / (download) - annotate - [select for diffs], Sun Oct 28 09:00:07 2018 UTC (5 years, 7 months ago) by ajacoutot
Branch: MAIN
Changes since 1.138: +9 -5 lines
Diff to previous 1.138 (colored)

Properly handle symlinks.

Revision 1.138 / (download) - annotate - [select for diffs], Tue Oct 16 07:09:13 2018 UTC (5 years, 7 months ago) by ajacoutot
Branch: MAIN
Changes since 1.137: +1 -3 lines
Diff to previous 1.137 (colored)

Stop trying to remove /bsd.syspatch. That's ancient stuff that we don't
do anymore.

Revision 1.137 / (download) - annotate - [select for diffs], Wed May 9 10:22:06 2018 UTC (6 years, 1 month ago) by ajacoutot
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE
Branch point for: OPENBSD_6_4
Changes since 1.136: +3 -2 lines
Diff to previous 1.136 (colored)

Remove empty syspatch dir if we fail to extract.

Revision 1.136 / (download) - annotate - [select for diffs], Thu Apr 26 12:50:41 2018 UTC (6 years, 1 month ago) by ajacoutot
Branch: MAIN
Changes since 1.135: +2 -2 lines
Diff to previous 1.135 (colored)

Don't hide stderr; starting with 6.4 there will always be an SHA256.sig.

Revision 1.135 / (download) - annotate - [select for diffs], Sat Mar 10 12:34:53 2018 UTC (6 years, 3 months ago) by ajacoutot
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE
Branch point for: OPENBSD_6_3
Changes since 1.134: +2 -2 lines
Diff to previous 1.134 (colored)

Allow fetching syspatches from ftp.

from Andrew Marks
ok deraadt@

Revision 1.134 / (download) - annotate - [select for diffs], Fri Dec 29 18:56:36 2017 UTC (6 years, 5 months ago) by ajacoutot
Branch: MAIN
Changes since 1.133: +3 -1 lines
Diff to previous 1.133 (colored)

Prevent syspatch from running and throw an error out if reorder_kernel is
running. This is to prevent syspatch from installing new kernel object
files while reordering is in progress (typically after an install/upgrade
on slow machines).

req. by and OK sthen@

Revision 1.133 / (download) - annotate - [select for diffs], Thu Nov 9 14:59:07 2017 UTC (6 years, 7 months ago) by ajacoutot
Branch: MAIN
Changes since 1.132: +5 -5 lines
Diff to previous 1.132 (colored)

/usr/share/compile -> /usr/share/relink/kernel

from semarie
I meant to do that at p2k17 but totally forgot...

Revision 1.132 / (download) - annotate - [select for diffs], Fri Oct 13 06:16:27 2017 UTC (6 years, 7 months ago) by ajacoutot
Branch: MAIN
Changes since 1.131: +3 -10 lines
Diff to previous 1.131 (colored)

Don't check for mirror availability but directly try to fetch SHA256.sig. That
check was not safe (index needed to be enabled, top URL may not be available
etc.).

based on a comment from tj@

Revision 1.131 / (download) - annotate - [select for diffs], Thu Oct 12 15:52:44 2017 UTC (6 years, 7 months ago) by ajacoutot
Branch: MAIN
Changes since 1.130: +5 -6 lines
Diff to previous 1.130 (colored)

Simplify and explicitely state when we cannot access our mirror.

Revision 1.130 / (download) - annotate - [select for diffs], Thu Oct 12 15:26:08 2017 UTC (6 years, 7 months ago) by ajacoutot
Branch: MAIN
Changes since 1.129: +1 -1 lines
Diff to previous 1.129 (colored)

Loosen up installurl(5) check: it's OK to have a trailing slash.

Revision 1.129 / (download) - annotate - [select for diffs], Thu Oct 12 15:24:06 2017 UTC (6 years, 7 months ago) by ajacoutot
Branch: MAIN
Changes since 1.128: +3 -2 lines
Diff to previous 1.128 (colored)

Better error if installurl points to a local directory.

Revision 1.128 / (download) - annotate - [select for diffs], Thu Oct 12 14:48:30 2017 UTC (6 years, 7 months ago) by ajacoutot
Branch: MAIN
Changes since 1.127: +6 -4 lines
Diff to previous 1.127 (colored)

Don't return 1 if the syspatch release directory does not exist; it just
means that no patch is available yet.

Revision 1.127 / (download) - annotate - [select for diffs], Tue Aug 29 10:21:23 2017 UTC (6 years, 9 months ago) by ajacoutot
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.126: +26 -14 lines
Diff to previous 1.126 (colored)

While failing to relink the kernel is not fatal to syspatch, we still need
to warn the user and return a proper error code.

Revision 1.126 / (download) - annotate - [select for diffs], Tue Aug 29 10:18:07 2017 UTC (6 years, 9 months ago) by ajacoutot
Branch: MAIN
Changes since 1.125: +3 -3 lines
Diff to previous 1.125 (colored)

Fix logic to not error out.

Revision 1.125 / (download) - annotate - [select for diffs], Mon Aug 28 09:53:14 2017 UTC (6 years, 9 months ago) by ajacoutot
Branch: MAIN
Changes since 1.124: +8 -2 lines
Diff to previous 1.124 (colored)

Inform the user when we are relinking the kernel.

Revision 1.124 / (download) - annotate - [select for diffs], Tue Aug 22 13:32:50 2017 UTC (6 years, 9 months ago) by ajacoutot
Branch: MAIN
Changes since 1.123: +27 -67 lines
Diff to previous 1.123 (colored)

Add support for KARL:
- only extract the according /usr/share/compile/GENERIC{,.MP}
- if a "kernel" patch was properly installed (or rolled back), run
  /usr/libexec/reorder_kernel _once_ just before exiting
- don't backup /bsd anymore, reorder_kernel already does it for us
- drop 2 now unused functions: install_kernel() and sp_cleanup()

While it appears to work fine after some quick testing, it should still be
considered WIP.

Revision 1.123 / (download) - annotate - [select for diffs], Thu Aug 17 20:32:14 2017 UTC (6 years, 9 months ago) by ajacoutot
Branch: MAIN
Changes since 1.122: +4 -3 lines
Diff to previous 1.122 (colored)

Set the automatically generated device variables as local to prevent
accumulating the size of all patches we are applying.

from "trondd" on tech@

Revision 1.122 / (download) - annotate - [select for diffs], Thu Aug 17 20:18:02 2017 UTC (6 years, 9 months ago) by ajacoutot
Branch: MAIN
Changes since 1.121: +11 -7 lines
Diff to previous 1.121 (colored)

Fix checkfs() when running an MP kernel.

Revision 1.121 / (download) - annotate - [select for diffs], Thu Aug 17 07:35:19 2017 UTC (6 years, 9 months ago) by ajacoutot
Branch: MAIN
Changes since 1.120: +2 -2 lines
Diff to previous 1.120 (colored)

Honor TMPDIR if it is set to prevent erroring in some setup.

reported by Igor Falcomata

Revision 1.120 / (download) - annotate - [select for diffs], Wed Aug 2 05:58:29 2017 UTC (6 years, 10 months ago) by ajacoutot
Branch: MAIN
Changes since 1.119: +6 -4 lines
Diff to previous 1.119 (colored)

Only run mtree if we install a patch.

Revision 1.119 / (download) - annotate - [select for diffs], Tue Aug 1 11:13:23 2017 UTC (6 years, 10 months ago) by ajacoutot
Branch: MAIN
Changes since 1.118: +17 -27 lines
Diff to previous 1.118 (colored)

For the kernel binpatches, only deal with /bsd. On MP machines we do have
/bsd.sp by default for now but it maybe de-selected during the installation and
the opposite is true for SP machines (MP is *not* installed but may end up
being selected for installation). Having to deal with this is too error prone.
This makes things much simpler and less confusing.

If you have a machine that goes from MP to SP or vice-versa, just
`syspatch -R && syspatch' so the proper kernel is updated.

Revision 1.118 / (download) - annotate - [select for diffs], Sun Jul 30 09:02:57 2017 UTC (6 years, 10 months ago) by ajacoutot
Branch: MAIN
Changes since 1.117: +6 -2 lines
Diff to previous 1.117 (colored)

If syspatch is updating itself, exit after installing the new syspatch to
stop installing further patches and warn the user he needs to run it again
(so that it'll run with the new code).

Revision 1.117 / (download) - annotate - [select for diffs], Sun Jul 30 08:30:46 2017 UTC (6 years, 10 months ago) by ajacoutot
Branch: MAIN
Changes since 1.116: +2 -2 lines
Diff to previous 1.116 (colored)

`-R' requires root privileges.

Revision 1.116 / (download) - annotate - [select for diffs], Sat Jul 22 09:59:08 2017 UTC (6 years, 10 months ago) by ajacoutot
Branch: MAIN
Changes since 1.115: +7 -7 lines
Diff to previous 1.115 (colored)

Cleanup previous release patches and backup kernel _before_ applying new
patches. This will mitigate possible /var overflow (previous behavior was
to clean up _after_ applying all patches which means we would have rollback
patches from the previous and current release before the previous ones got
cleaned).

Revision 1.115 / (download) - annotate - [select for diffs], Tue Jul 4 20:25:53 2017 UTC (6 years, 11 months ago) by ajacoutot
Branch: MAIN
Changes since 1.114: +10 -8 lines
Diff to previous 1.114 (colored)

Detect upfront whether we have a particular set installed and if not, do *not*
list a matching syspatch as available. This will allow to skip the syspatches
for the X sets for example if we don't have them installed. If we do install
these sets a posteriori, then syspatch *will* list the X syspatches if there are
any.

req. by many
ok robert@

Revision 1.114 / (download) - annotate - [select for diffs], Fri Jun 9 07:37:38 2017 UTC (7 years ago) by ajacoutot
Branch: MAIN
Changes since 1.113: +2 -2 lines
Diff to previous 1.113 (colored)

Drop uneeded return from rollback_patch().

Revision 1.113 / (download) - annotate - [select for diffs], Fri Jun 9 07:32:26 2017 UTC (7 years ago) by ajacoutot
Branch: MAIN
Changes since 1.112: +5 -6 lines
Diff to previous 1.112 (colored)

/etc/mtree/BSD.x11.dist is part of base, not X; so check for
/var/sysmerge/xetc.tgz to detect whether we have the x sets installed.

Revision 1.112 / (download) - annotate - [select for diffs], Sat May 27 09:05:25 2017 UTC (7 years ago) by ajacoutot
Branch: MAIN
Changes since 1.111: +5 -4 lines
Diff to previous 1.111 (colored)

When running from cron, the ftp(1) progress bar is not shown; that's all fine
and dandy except that if there's fetch/verify error, we may not know which
syspatch caused this. So if we're not associated with a terminal, just echo
what ftp -VD would (without the progress bar).

Revision 1.111 / (download) - annotate - [select for diffs], Fri May 26 15:28:00 2017 UTC (7 years ago) by ajacoutot
Branch: MAIN
Changes since 1.110: +2 -2 lines
Diff to previous 1.110 (colored)

Don't try to revert the same patch in a loop if it returns an error.

Revision 1.110 / (download) - annotate - [select for diffs], Fri May 26 14:43:25 2017 UTC (7 years ago) by ajacoutot
Branch: MAIN
Changes since 1.109: +3 -2 lines
Diff to previous 1.109 (colored)

Fix logic.

Revision 1.109 / (download) - annotate - [select for diffs], Wed May 24 11:21:13 2017 UTC (7 years ago) by ajacoutot
Branch: MAIN
Changes since 1.108: +2 -2 lines
Diff to previous 1.108 (colored)

Preserve the modification time when install(1)ing.

Revision 1.108 / (download) - annotate - [select for diffs], Wed May 24 08:32:16 2017 UTC (7 years ago) by ajacoutot
Branch: MAIN
Changes since 1.107: +4 -1 lines
Diff to previous 1.107 (colored)

Don't fill up /tmp when installing or reverting multiple patches at once.

Revision 1.107 / (download) - annotate - [select for diffs], Wed May 24 08:30:31 2017 UTC (7 years ago) by ajacoutot
Branch: MAIN
Changes since 1.106: +3 -1 lines
Diff to previous 1.106 (colored)

Also trap INT when reverting a patch.

Revision 1.106 / (download) - annotate - [select for diffs], Tue May 23 13:08:28 2017 UTC (7 years ago) by ajacoutot
Branch: MAIN
Changes since 1.105: +2 -2 lines
Diff to previous 1.105 (colored)

Hide sh(1) error message when /etc/installurl does not exist; we already
error out with a message in this case since _MIRROR is empty.

reported by tedu@

Revision 1.105 / (download) - annotate - [select for diffs], Tue May 23 12:05:53 2017 UTC (7 years ago) by ajacoutot
Branch: MAIN
Changes since 1.104: +5 -4 lines
Diff to previous 1.104 (colored)

Only install /bsd.mp on SP machines if it's already there (a default
installation will not have it).

Revision 1.104 / (download) - annotate - [select for diffs], Tue May 23 12:01:53 2017 UTC (7 years ago) by ajacoutot
Branch: MAIN
Changes since 1.103: +13 -13 lines
Diff to previous 1.103 (colored)

Shorten varname.

Revision 1.103 / (download) - annotate - [select for diffs], Thu May 18 12:02:06 2017 UTC (7 years ago) by ajacoutot
Branch: MAIN
Changes since 1.102: +2 -2 lines
Diff to previous 1.102 (colored)

Don't pass `-m' to ftp(1). Instead let isatty() decide whether we display the
progress bar or not for better cron(1)/logger(1) output.

req. by henning@

Revision 1.102 / (download) - annotate - [select for diffs], Wed May 17 13:23:58 2017 UTC (7 years ago) by ajacoutot
Branch: MAIN
Changes since 1.101: +5 -4 lines
Diff to previous 1.101 (colored)

Tweak remote fs check.

Revision 1.101 / (download) - annotate - [select for diffs], Fri May 12 15:04:07 2017 UTC (7 years ago) by ajacoutot
Branch: MAIN
Changes since 1.100: +4 -2 lines
Diff to previous 1.100 (colored)

Make sure we have a valid URL in /etc/installurl to prevent ending up stuck in
ftp(1) interactive mode.

reported by and OK sthen@

Revision 1.100 / (download) - annotate - [select for diffs], Mon May 8 09:45:14 2017 UTC (7 years, 1 month ago) by ajacoutot
Branch: MAIN
Changes since 1.99: +3 -2 lines
Diff to previous 1.99 (colored)

Only test the mirror if it's remote (and not a local directory).

Revision 1.99 / (download) - annotate - [select for diffs], Fri May 5 08:07:36 2017 UTC (7 years, 1 month ago) by ajacoutot
Branch: MAIN
Changes since 1.98: +8 -7 lines
Diff to previous 1.98 (colored)

Add a `-R' switch that reverts all patches.

prodded by deraadt@
knobs sorting input jmc@
ok sthen@

Revision 1.98 / (download) - annotate - [select for diffs], Thu May 4 12:28:14 2017 UTC (7 years, 1 month ago) by ajacoutot
Branch: MAIN
Changes since 1.97: +3 -3 lines
Diff to previous 1.97 (colored)

Expand comment and bump copyright while here.

Revision 1.97 / (download) - annotate - [select for diffs], Wed May 3 17:23:34 2017 UTC (7 years, 1 month ago) by ajacoutot
Branch: MAIN
Changes since 1.96: +10 -5 lines
Diff to previous 1.96 (colored)

Output explicit error messages for:
- trying to install files mounted on a remote FS (diskless clients etc.)
- read-only FS
- not enough space on FS

These were all properly catched before (syspatch would refuse to do anything)
but the error message was a bit cryptic.

Revision 1.96 / (download) - annotate - [select for diffs], Wed May 3 12:26:52 2017 UTC (7 years, 1 month ago) by ajacoutot
Branch: MAIN
Changes since 1.95: +9 -4 lines
Diff to previous 1.95 (colored)

- Don't make an empty syspatch/ repo an error; having no available patch
is perfectly legit.
- Abort immediately if we cannot reach our mirror server listed in
installurl.
- Return a proper error code when running without arguments and we cannot
list the available patches.

Revision 1.95 / (download) - annotate - [select for diffs], Sun Apr 30 13:41:10 2017 UTC (7 years, 1 month ago) by ajacoutot
Branch: MAIN
Changes since 1.94: +2 -2 lines
Diff to previous 1.94 (colored)

Tweak error message when running on an unsupported release.

Revision 1.94 / (download) - annotate - [select for diffs], Tue Apr 4 21:20:22 2017 UTC (7 years, 2 months ago) by ajacoutot
Branch: MAIN
Changes since 1.93: +2 -2 lines
Diff to previous 1.93 (colored)

Also remove non syspatch hidden files/dirs.

Revision 1.93 / (download) - annotate - [select for diffs], Fri Mar 31 16:02:31 2017 UTC (7 years, 2 months ago) by ajacoutot
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.92: +3 -2 lines
Diff to previous 1.92 (colored)

Be quiet in case /var/syspatch/ is empty and that there's no remote sig
file yet (i.e. when we are in release mode but not released yet).

ok deraadt@

Revision 1.92 / (download) - annotate - [select for diffs], Mon Feb 13 14:59:09 2017 UTC (7 years, 3 months ago) by ajacoutot
Branch: MAIN
Changes since 1.91: +2 -2 lines
Diff to previous 1.91 (colored)

Reverse output when installing a patch; it's more logical (first get, then
install). While here, match the installer output a bit more:
Get/Verify ...
Installing ...

prodded by a mail exchange with "bytevolcano"
discussed with robert@ sthen@
ok robert@

Revision 1.91 / (download) - annotate - [select for diffs], Mon Jan 30 15:36:20 2017 UTC (7 years, 4 months ago) by ajacoutot
Branch: MAIN
Changes since 1.90: +1 -2 lines
Diff to previous 1.90 (colored)

Drop empty line.

Revision 1.90 / (download) - annotate - [select for diffs], Thu Jan 26 04:38:27 2017 UTC (7 years, 4 months ago) by rpe
Branch: MAIN
Changes since 1.89: +2 -2 lines
Diff to previous 1.89 (colored)

Remove unused _REL variable

OK aja@

Revision 1.89 / (download) - annotate - [select for diffs], Thu Jan 26 04:34:51 2017 UTC (7 years, 4 months ago) by rpe
Branch: MAIN
Changes since 1.88: +4 -3 lines
Diff to previous 1.88 (colored)

Move setting _OSrev to immediately after verifying _KERNV and exit
early if _OSrev is empty.

OK aja@

Revision 1.88 / (download) - annotate - [select for diffs], Thu Jan 26 04:08:50 2017 UTC (7 years, 4 months ago) by rpe
Branch: MAIN
Changes since 1.87: +2 -2 lines
Diff to previous 1.87 (colored)

No need to escape '.' in shell patterns - it has no special meaning.

OK aja@

Revision 1.87 / (download) - annotate - [select for diffs], Thu Jan 26 03:55:25 2017 UTC (7 years, 4 months ago) by rpe
Branch: MAIN
Changes since 1.86: +3 -3 lines
Diff to previous 1.86 (colored)

Spacing and use arithmetic test

OK aja@

Revision 1.86 / (download) - annotate - [select for diffs], Thu Jan 19 23:41:57 2017 UTC (7 years, 4 months ago) by ajacoutot
Branch: MAIN
Changes since 1.85: +9 -17 lines
Diff to previous 1.85 (colored)

Simplify: bundle stripcom().

Revision 1.85 / (download) - annotate - [select for diffs], Thu Jan 19 23:04:48 2017 UTC (7 years, 4 months ago) by ajacoutot
Branch: MAIN
Changes since 1.84: +4 -4 lines
Diff to previous 1.84 (colored)

/etc/mirror.conf -> /etc/installurl
discussed with deraadt@ beck@ rpe@

Revision 1.84 / (download) - annotate - [select for diffs], Thu Jan 19 09:08:45 2017 UTC (7 years, 4 months ago) by ajacoutot
Branch: MAIN
Changes since 1.83: +19 -6 lines
Diff to previous 1.83 (colored)

ls_missing(): as a precaution, don't output anything on stdout when running
ftp(1) to prevent corrupting the patch list; we are already running in silent
mode but better safe than sorry.

Read the syspatch mirror base URL using stripcom() /etc/mirror.conf for the time
being; discussed with deraadt@ and rpe@ -- naming is not set in stone yet.

Revision 1.83 / (download) - annotate - [select for diffs], Thu Jan 19 08:45:23 2017 UTC (7 years, 4 months ago) by ajacoutot
Branch: MAIN
Changes since 1.82: +1 -2 lines
Diff to previous 1.82 (colored)

Use the _syspatch user.

Revision 1.82 / (download) - annotate - [select for diffs], Thu Jan 19 08:31:53 2017 UTC (7 years, 4 months ago) by ajacoutot
Branch: MAIN
Changes since 1.81: +2 -3 lines
Diff to previous 1.81 (colored)

Drop the _FETCH variable. It's useless, we are using ftp(1) specific options
that are different on the two invocations; it's not like we'll support using
wget|curl to fetch syspatches anyway.

Revision 1.81 / (download) - annotate - [select for diffs], Wed Jan 11 12:22:13 2017 UTC (7 years, 4 months ago) by ajacoutot
Branch: MAIN
Changes since 1.80: +7 -10 lines
Diff to previous 1.80 (colored)

Match what the installer does:
- verify SHA256.sig and create SHA256 out of it
- get the list of syspatches from the verified SHA256
- use sha256 against the verified SHA256 to checksum the syspatches

Revision 1.80 / (download) - annotate - [select for diffs], Wed Jan 11 08:11:19 2017 UTC (7 years, 4 months ago) by ajacoutot
Branch: MAIN
Changes since 1.79: +1 -1 lines
Diff to previous 1.79 (colored)

Drop FTP_KEEPALIVE, it's unused.

Revision 1.79 / (download) - annotate - [select for diffs], Sat Dec 31 15:52:36 2016 UTC (7 years, 5 months ago) by ajacoutot
Branch: MAIN
Changes since 1.78: +2 -2 lines
Diff to previous 1.78 (colored)

The syspatch test repo can now be accessed over https.

Revision 1.78 / (download) - annotate - [select for diffs], Thu Dec 8 09:47:37 2016 UTC (7 years, 6 months ago) by ajacoutot
Branch: MAIN
Changes since 1.77: +6 -4 lines
Diff to previous 1.77 (colored)

Make it possible to install patches even if we don't have all sets installed
(e.g. no x sets); in this case, syspatch will skip the patch *but* it will still
be listed as available. This will allow applying the patch in case sets are
installed later on.

Revision 1.77 / (download) - annotate - [select for diffs], Wed Dec 7 15:36:50 2016 UTC (7 years, 6 months ago) by ajacoutot
Branch: MAIN
Changes since 1.76: +1 -1 lines
Diff to previous 1.76 (colored)

Cleanup syspatch directories that do not contain a tarball; it means it
was not applied properly.

Revision 1.76 / (download) - annotate - [select for diffs], Tue Dec 6 16:16:12 2016 UTC (7 years, 6 months ago) by ajacoutot
Branch: MAIN
Changes since 1.75: +1 -1 lines
Diff to previous 1.75 (colored)

Missed in previous.

Revision 1.75 / (download) - annotate - [select for diffs], Tue Dec 6 16:01:02 2016 UTC (7 years, 6 months ago) by ajacoutot
Branch: MAIN
Changes since 1.74: +14 -19 lines
Diff to previous 1.74 (colored)

Better matching and remove a useless use of sort(1).

Revision 1.74 / (download) - annotate - [select for diffs], Tue Dec 6 11:10:00 2016 UTC (7 years, 6 months ago) by ajacoutot
Branch: MAIN
Changes since 1.73: +2 -3 lines
Diff to previous 1.73 (colored)

Catch mtree(8) error; it's only run when applying patches and we already
check for read-only... in this case.

Revision 1.73 / (download) - annotate - [select for diffs], Tue Dec 6 10:29:04 2016 UTC (7 years, 6 months ago) by ajacoutot
Branch: MAIN
Changes since 1.72: +2 -1 lines
Diff to previous 1.72 (colored)

Tweak comment.

Revision 1.72 / (download) - annotate - [select for diffs], Mon Dec 5 16:11:17 2016 UTC (7 years, 6 months ago) by ajacoutot
Branch: MAIN
Changes since 1.71: +1 -1 lines
Diff to previous 1.71 (colored)

Explicit error when running on unsupported release.

Revision 1.71 / (download) - annotate - [select for diffs], Mon Dec 5 15:34:21 2016 UTC (7 years, 6 months ago) by ajacoutot
Branch: MAIN
Changes since 1.70: +18 -16 lines
Diff to previous 1.70 (colored)

If we end up creating a rollback tarball from an empty list of files, it means
we are missing a base set. In this case, error out right away or we may end up
having the patch supposedly installed but without its corresponding rollback
tarball.
For now we only support *full* installations.

installed patches mismatch reported by Marc Benslahdine

Revision 1.70 / (download) - annotate - [select for diffs], Mon Dec 5 13:17:31 2016 UTC (7 years, 6 months ago) by ajacoutot
Branch: MAIN
Changes since 1.69: +0 -36 lines
Diff to previous 1.69 (colored)

Remove the ugly temporary quirks.

Revision 1.69 / (download) - annotate - [select for diffs], Fri Dec 2 10:59:27 2016 UTC (7 years, 6 months ago) by ajacoutot
Branch: MAIN
Changes since 1.68: +2 -2 lines
Diff to previous 1.68 (colored)

Simplify.

Revision 1.68 / (download) - annotate - [select for diffs], Fri Dec 2 08:34:28 2016 UTC (7 years, 6 months ago) by ajacoutot
Branch: MAIN
Changes since 1.67: +8 -9 lines
Diff to previous 1.67 (colored)

Few consistency fixes (no intended change in behaviour).
Fix logic in the error path of rollback_patch().

Revision 1.67 / (download) - annotate - [select for diffs], Thu Dec 1 10:58:54 2016 UTC (7 years, 6 months ago) by ajacoutot
Branch: MAIN
Changes since 1.66: +4 -6 lines
Diff to previous 1.66 (colored)

Fix kernel matching installation:
bsd -> /bsd (sp) | /bsd.sp (mp)
bsd.mp -> /bsd (mp) | /bsd.mp (sp)

issue reported by Ossi Salmi, thanks!

Revision 1.66 / (download) - annotate - [select for diffs], Wed Nov 30 15:19:16 2016 UTC (7 years, 6 months ago) by ajacoutot
Branch: MAIN
Changes since 1.65: +21 -27 lines
Diff to previous 1.65 (colored)

Simplify:
- consistency in integer checks
- drop apply_patches(), better call ther actual apply_patch() function from
within the script itself

Revision 1.65 / (download) - annotate - [select for diffs], Wed Nov 30 13:53:14 2016 UTC (7 years, 6 months ago) by ajacoutot
Branch: MAIN
Changes since 1.64: +6 -9 lines
Diff to previous 1.64 (colored)

During early testing, hardcode the syspatch repo to 'syspatch.openbsd.org'
which points to ftp.fr. This will change once 6.1 is out.

discussed with deraadt@

Revision 1.64 / (download) - annotate - [select for diffs], Wed Nov 30 12:58:28 2016 UTC (7 years, 6 months ago) by ajacoutot
Branch: MAIN
Changes since 1.63: +85 -76 lines
Diff to previous 1.63 (colored)

Change the hierarchy under /var/syspatch/ so that the output of installed or
missing patches matches the official names.
e.g.
$ doas syspatch -c
015_libssl

Add a bit more output on what we are doing.
Tighten a few checks and rename some vars.

People playing with syspatch on 6.0 should update syspatch.sh asap from current
as I will soon remove the temporary quirks glue.

Revision 1.63 / (download) - annotate - [select for diffs], Sun Nov 27 11:38:50 2016 UTC (7 years, 6 months ago) by ajacoutot
Branch: MAIN
Changes since 1.62: +7 -8 lines
Diff to previous 1.62 (colored)

Remove the backup kernel in rollback_patch() instead of the cleanup
function.
Consistent use of install(1).

Revision 1.62 / (download) - annotate - [select for diffs], Sun Nov 27 08:55:48 2016 UTC (7 years, 6 months ago) by ajacoutot
Branch: MAIN
Changes since 1.61: +1 -0 lines
Diff to previous 1.61 (colored)

Explicitely set umask.

Revision 1.61 / (download) - annotate - [select for diffs], Fri Nov 25 09:56:45 2016 UTC (7 years, 6 months ago) by ajacoutot
Branch: MAIN
Changes since 1.60: +2 -2 lines
Diff to previous 1.60 (colored)

Check args.

Revision 1.60 / (download) - annotate - [select for diffs], Tue Nov 22 14:20:39 2016 UTC (7 years, 6 months ago) by ajacoutot
Branch: MAIN
Changes since 1.59: +1 -1 lines
Diff to previous 1.59 (colored)

Make sure /var/syspatch/$OSREV is not on a read-only mount-point when doing
a rollback.

Revision 1.59 / (download) - annotate - [select for diffs], Tue Nov 22 10:53:37 2016 UTC (7 years, 6 months ago) by ajacoutot
Branch: MAIN
Changes since 1.58: +24 -21 lines
Diff to previous 1.58 (colored)

Allow passing an explicit return code to sp_err() in case we don't want to exit
right away.
Factorise some common stuff.
Be consistent in variables subtitution.

Revision 1.58 / (download) - annotate - [select for diffs], Mon Nov 21 16:27:36 2016 UTC (7 years, 6 months ago) by ajacoutot
Branch: MAIN
Changes since 1.57: +21 -15 lines
Diff to previous 1.57 (colored)

Use the same basename for the rollback tarball as the original patch.sig.

Revision 1.57 / (download) - annotate - [select for diffs], Mon Nov 21 14:43:52 2016 UTC (7 years, 6 months ago) by ajacoutot
Branch: MAIN
Changes since 1.56: +2 -2 lines
Diff to previous 1.56 (colored)

Tweak comment. Reverse cmp logic while here.

Revision 1.56 / (download) - annotate - [select for diffs], Thu Nov 17 15:15:49 2016 UTC (7 years, 6 months ago) by ajacoutot
Branch: MAIN
Changes since 1.55: +4 -0 lines
Diff to previous 1.55 (colored)

Re-add the root user checks in the quirks; that part is to be removed soon.

Revision 1.55 / (download) - annotate - [select for diffs], Thu Nov 17 14:05:46 2016 UTC (7 years, 6 months ago) by ajacoutot
Branch: MAIN
Changes since 1.54: +28 -23 lines
Diff to previous 1.54 (colored)

Drop priv. to the _pkgfetch (for now) user when running ftp(1) and signify(1).
Similar to what the installer does.

Listing installed patches and displaying the usage are now the only actions
allowed to a non-privileged user.

discussed with deraadt@

Revision 1.54 / (download) - annotate - [select for diffs], Wed Nov 16 16:11:31 2016 UTC (7 years, 6 months ago) by ajacoutot
Branch: MAIN
Changes since 1.53: +8 -10 lines
Diff to previous 1.53 (colored)

Merge comments altogether, it's easier to understand this way.
And drop some duplicate while here.

Revision 1.53 / (download) - annotate - [select for diffs], Wed Nov 16 15:27:52 2016 UTC (7 years, 6 months ago) by ajacoutot
Branch: MAIN
Changes since 1.52: +8 -0 lines
Diff to previous 1.52 (colored)

If we install a new kernel, add /bsd twice (for size checking) when:
- we are on an MP system (/bsd.mp does not exist there)
- /bsd.syspatchXX is not present (create_rollback will add it)

Revision 1.52 / (download) - annotate - [select for diffs], Wed Nov 16 14:54:26 2016 UTC (7 years, 6 months ago) by ajacoutot
Branch: MAIN
Changes since 1.51: +13 -10 lines
Diff to previous 1.51 (colored)

/bsd.rollbackXX -> bsd.syspatchXX to make it more obvious where it comes from
and less prone to conflict.
Simplify ls_installed while here.

Revision 1.51 / (download) - annotate - [select for diffs], Tue Nov 15 14:46:00 2016 UTC (7 years, 6 months ago) by ajacoutot
Branch: MAIN
Changes since 1.50: +13 -5 lines
Diff to previous 1.50 (colored)

checkfs: ignore nonexistent files and extend comment. There's actually no need
to double the size since files are replaced one by one.

create_rollback: create release directory with explicit permissions.

ls_installed: create release directory if it does not exist (temporary XXX) for
early testers without a 6.1 hier(7); issue reported by Marc Benslahdine

Revision 1.50 / (download) - annotate - [select for diffs], Tue Nov 15 09:49:48 2016 UTC (7 years, 6 months ago) by ajacoutot
Branch: MAIN
Changes since 1.49: +3 -3 lines
Diff to previous 1.49 (colored)

Double the required size to make sure we have enough space for install(1) safe
copy, the rollback tarball and in case we add new files.

Revision 1.49 / (download) - annotate - [select for diffs], Mon Nov 14 15:45:40 2016 UTC (7 years, 6 months ago) by ajacoutot
Branch: MAIN
Changes since 1.48: +13 -4 lines
Diff to previous 1.48 (colored)

Check for available space before installing a patch.

Revision 1.48 / (download) - annotate - [select for diffs], Mon Nov 14 09:09:20 2016 UTC (7 years, 6 months ago) by ajacoutot
Branch: MAIN
Changes since 1.47: +4 -2 lines
Diff to previous 1.47 (colored)

uniq -> sort -u

Revision 1.47 / (download) - annotate - [select for diffs], Sat Nov 12 22:22:25 2016 UTC (7 years, 6 months ago) by halex
Branch: MAIN
Changes since 1.46: +3 -3 lines
Diff to previous 1.46 (colored)

Improve the cleanup error handling to make sure the exit code is
really preserved.

Noticed by, discussed with, and fix approved tb@

Revision 1.46 / (download) - annotate - [select for diffs], Thu Nov 10 13:56:57 2016 UTC (7 years, 6 months ago) by ajacoutot
Branch: MAIN
Changes since 1.45: +5 -5 lines
Diff to previous 1.45 (colored)

Simplify checkfs() and fix read-only/remote fs detection.

Revision 1.45 / (download) - annotate - [select for diffs], Thu Nov 10 10:39:09 2016 UTC (7 years, 6 months ago) by ajacoutot
Branch: MAIN
Changes since 1.44: +2 -1 lines
Diff to previous 1.44 (colored)

Extend mtree(8) comment.

Revision 1.44 / (download) - annotate - [select for diffs], Thu Nov 10 10:27:31 2016 UTC (7 years, 6 months ago) by ajacoutot
Branch: MAIN
Changes since 1.43: +1 -1 lines
Diff to previous 1.43 (colored)

Remove redundant check.

Revision 1.43 / (download) - annotate - [select for diffs], Thu Nov 10 10:20:48 2016 UTC (7 years, 6 months ago) by ajacoutot
Branch: MAIN
Changes since 1.42: +5 -5 lines
Diff to previous 1.42 (colored)

Create the bsd rollback kernel in create_rollback() (it is contained in
the rollback tarball anyway but that's impractical if the new bsd does
not boot ;-)).
While here, make sure /bsd actually exists before saving it.

Revision 1.42 / (download) - annotate - [select for diffs], Tue Nov 8 16:39:57 2016 UTC (7 years, 7 months ago) by ajacoutot
Branch: MAIN
Changes since 1.41: +23 -12 lines
Diff to previous 1.41 (colored)

syspatch-60-001_foobar -> syspatch60-001_foobar to match base system sets name.

Should be transparent to the early testers as long as you have the most recent
syspatch.sh checkout from cvs(1).

Revision 1.41 / (download) - annotate - [select for diffs], Tue Nov 8 12:11:22 2016 UTC (7 years, 7 months ago) by ajacoutot
Branch: MAIN
Changes since 1.40: +13 -16 lines
Diff to previous 1.40 (colored)

Few fixes and consistency.

Revision 1.40 / (download) - annotate - [select for diffs], Sun Nov 6 19:12:58 2016 UTC (7 years, 7 months ago) by halex
Branch: MAIN
Changes since 1.39: +7 -7 lines
Diff to previous 1.39 (colored)

Rework the cleanup trap handling using the EXIT trap;

  trap 'cleanup; goes; here' EXIT
  trap exit HUP INT TERM ERR FOO BAR BAZ

This makes sure the cleanup is always done (unless we exec), and
preserves the exit code, such as SIGINT => 130.

Also trap less signals. Special signals are special.

tested and OK ajacoutot@

Revision 1.39 / (download) - annotate - [select for diffs], Fri Nov 4 16:03:45 2016 UTC (7 years, 7 months ago) by ajacoutot
Branch: MAIN
Changes since 1.38: +3 -4 lines
Diff to previous 1.38 (colored)

Be verbose when PATCH_PATH is not set (that is temporary until we agree on
a way to point to a syspatch mirror).

Revision 1.38 / (download) - annotate - [select for diffs], Fri Nov 4 15:32:13 2016 UTC (7 years, 7 months ago) by ajacoutot
Branch: MAIN
Changes since 1.37: +2 -1 lines
Diff to previous 1.37 (colored)

One more XXX.

Revision 1.37 / (download) - annotate - [select for diffs], Fri Nov 4 14:55:29 2016 UTC (7 years, 7 months ago) by ajacoutot
Branch: MAIN
Changes since 1.36: +2 -2 lines
Diff to previous 1.36 (colored)

Zap extra space.

Revision 1.36 / (download) - annotate - [select for diffs], Fri Nov 4 14:18:45 2016 UTC (7 years, 7 months ago) by ajacoutot
Branch: MAIN
Changes since 1.35: +17 -3 lines
Diff to previous 1.35 (colored)

Make sure our filesystems are local and not read-only.

Revision 1.35 / (download) - annotate - [select for diffs], Fri Nov 4 11:42:14 2016 UTC (7 years, 7 months ago) by ajacoutot
Branch: MAIN
Changes since 1.34: +4 -2 lines
Diff to previous 1.34 (colored)

Use 'rm -f' to remove the rollback tarball if we have an errir; it may
be because we have a read-only /var.

Revision 1.34 / (download) - annotate - [select for diffs], Thu Nov 3 17:14:31 2016 UTC (7 years, 7 months ago) by ajacoutot
Branch: MAIN
Changes since 1.33: +1 -1 lines
Diff to previous 1.33 (colored)

Missing local.

Revision 1.33 / (download) - annotate - [select for diffs], Thu Nov 3 16:12:23 2016 UTC (7 years, 7 months ago) by ajacoutot
Branch: MAIN
Changes since 1.32: +2 -2 lines
Diff to previous 1.32 (colored)

rollback -> revert where it makes sense.

Revision 1.32 / (download) - annotate - [select for diffs], Thu Nov 3 15:54:10 2016 UTC (7 years, 7 months ago) by ajacoutot
Branch: MAIN
Changes since 1.31: +2 -1 lines
Diff to previous 1.31 (colored)

XXX match with installed sets (comp, x...)?

Revision 1.31 / (download) - annotate - [select for diffs], Thu Nov 3 15:34:31 2016 UTC (7 years, 7 months ago) by ajacoutot
Branch: MAIN
Changes since 1.30: +2 -3 lines
Diff to previous 1.30 (colored)

Hardlinks are properly handled; for the rest, we'll see if we need to care
or not (XXX).

Revision 1.30 / (download) - annotate - [select for diffs], Thu Nov 3 14:36:54 2016 UTC (7 years, 7 months ago) by ajacoutot
Branch: MAIN
Changes since 1.29: +1 -4 lines
Diff to previous 1.29 (colored)

Make sure PATCH_PATH is an URL that ftp(1) can cope with.

Revision 1.29 / (download) - annotate - [select for diffs], Thu Nov 3 14:13:15 2016 UTC (7 years, 7 months ago) by ajacoutot
Branch: MAIN
Changes since 1.28: +8 -12 lines
Diff to previous 1.28 (colored)

Merge ls_avail() into ls_missing(), it's only used once.
While here, cope with a missing index.txt or other ftp(1) error.

Revision 1.28 / (download) - annotate - [select for diffs], Thu Nov 3 12:40:08 2016 UTC (7 years, 7 months ago) by ajacoutot
Branch: MAIN
Changes since 1.27: +2 -3 lines
Diff to previous 1.27 (colored)

Use hw.ncpufound.

Revision 1.27 / (download) - annotate - [select for diffs], Thu Nov 3 12:27:34 2016 UTC (7 years, 7 months ago) by ajacoutot
Branch: MAIN
Changes since 1.26: +6 -9 lines
Diff to previous 1.26 (colored)

Simplify for loops; prompted by a comment from rpe@

Revision 1.26 / (download) - annotate - [select for diffs], Wed Nov 2 18:04:50 2016 UTC (7 years, 7 months ago) by ajacoutot
Branch: MAIN
Changes since 1.25: +1 -0 lines
Diff to previous 1.25 (colored)

Be verbose when reverting a patch.

committing now to please espie@

Revision 1.25 / (download) - annotate - [select for diffs], Tue Nov 1 21:51:44 2016 UTC (7 years, 7 months ago) by ajacoutot
Branch: MAIN
Changes since 1.24: +3 -7 lines
Diff to previous 1.24 (colored)

Simplify.

Revision 1.24 / (download) - annotate - [select for diffs], Tue Nov 1 20:46:02 2016 UTC (7 years, 7 months ago) by ajacoutot
Branch: MAIN
Changes since 1.23: +37 -30 lines
Diff to previous 1.23 (colored)

Tap SIGINT while install(1)ing so that we can properly rollback and not
be left in an inconsistent state.

Revision 1.23 / (download) - annotate - [select for diffs], Tue Nov 1 18:12:44 2016 UTC (7 years, 7 months ago) by ajacoutot
Branch: MAIN
Changes since 1.22: +1 -0 lines
Diff to previous 1.22 (colored)

Add an XXX.

Revision 1.22 / (download) - annotate - [select for diffs], Tue Nov 1 16:21:47 2016 UTC (7 years, 7 months ago) by ajacoutot
Branch: MAIN
Changes since 1.21: +7 -5 lines
Diff to previous 1.21 (colored)

Only run sp_cleanup() when applying or reverting a patch (needs root).

Revision 1.21 / (download) - annotate - [select for diffs], Tue Nov 1 16:05:53 2016 UTC (7 years, 7 months ago) by ajacoutot
Branch: MAIN
Changes since 1.20: +8 -2 lines
Diff to previous 1.20 (colored)

Also remove non matching release rollback kernel.
Temporary unhook the cleanup function during tests.

Revision 1.20 / (download) - annotate - [select for diffs], Tue Nov 1 15:51:04 2016 UTC (7 years, 7 months ago) by ajacoutot
Branch: MAIN
Changes since 1.19: +18 -2 lines
Diff to previous 1.19 (colored)

Add a cleanup function to remove non matching release content from
/var/syspatch and the rollback kernel if all kernel syspatches have been
reverted.

While here, make sure _RELINT and _REL are declared properly.

Revision 1.19 / (download) - annotate - [select for diffs], Tue Nov 1 14:45:46 2016 UTC (7 years, 7 months ago) by ajacoutot
Branch: MAIN
Changes since 1.18: +10 -10 lines
Diff to previous 1.18 (colored)

Simplify fetch_and_verify(), no need for a loop here.

Revision 1.18 / (download) - annotate - [select for diffs], Tue Nov 1 12:41:46 2016 UTC (7 years, 7 months ago) by ajacoutot
Branch: MAIN
Changes since 1.17: +14 -9 lines
Diff to previous 1.17 (colored)

Add a few error messages so we know where we fail.
Regular operation is mostly quiet, i.e:
Applying syspatch-60-001_cp.tgz 100% |***********************| 65247       00:03

Move trap after we create the temporary directory so that we can remove it
on failure and fix a typo in readonly vars.

Revision 1.17 / (download) - annotate - [select for diffs], Tue Nov 1 10:30:01 2016 UTC (7 years, 7 months ago) by ajacoutot
Branch: MAIN
Changes since 1.16: +25 -25 lines
Diff to previous 1.16 (colored)

install_patch -> apply_patch to remove confusion with install_kernel and
install_file.

Revision 1.16 / (download) - annotate - [select for diffs], Tue Nov 1 10:25:43 2016 UTC (7 years, 7 months ago) by ajacoutot
Branch: MAIN
Changes since 1.15: +7 -5 lines
Diff to previous 1.15 (colored)

We don't want to run on -stable (i.e. locally built release) but only on
official release.
Remove the half cooked rollback patch if we run into an error.

Revision 1.15 / (download) - annotate - [select for diffs], Sun Sep 11 13:10:59 2016 UTC (7 years, 8 months ago) by ajacoutot
Branch: MAIN
Changes since 1.14: +8 -7 lines
Diff to previous 1.14 (colored)

First compute the variables, then set them readonly. So that we can catch
errors (e.g. mktemp(1) failing).

Revision 1.14 / (download) - annotate - [select for diffs], Sun Sep 11 11:50:34 2016 UTC (7 years, 8 months ago) by ajacoutot
Branch: MAIN
Changes since 1.13: +21 -22 lines
Diff to previous 1.13 (colored)

Indent cleanup.
Fix apply_patches return code while here.

Revision 1.13 / (download) - annotate - [select for diffs], Sat Sep 10 16:19:14 2016 UTC (7 years, 8 months ago) by ajacoutot
Branch: MAIN
Changes since 1.12: +8 -10 lines
Diff to previous 1.12 (colored)

Drop syspatch_trap, it's simple enough for trap no needing its own function.
Introduce sp_err() which will get used for error messages.

Revision 1.12 / (download) - annotate - [select for diffs], Sat Sep 10 16:07:33 2016 UTC (7 years, 8 months ago) by ajacoutot
Branch: MAIN
Changes since 1.11: +7 -6 lines
Diff to previous 1.11 (colored)

apply_patches should not take any arguments.
Few tweaks while here.

Revision 1.11 / (download) - annotate - [select for diffs], Wed Sep 7 16:01:48 2016 UTC (7 years, 9 months ago) by ajacoutot
Branch: MAIN
Changes since 1.10: +6 -4 lines
Diff to previous 1.10 (colored)

Don't fetch all patches at once but instead fetch+verify+patch one by one.

Revision 1.10 / (download) - annotate - [select for diffs], Wed Sep 7 15:41:23 2016 UTC (7 years, 9 months ago) by ajacoutot
Branch: MAIN
Changes since 1.9: +4 -5 lines
Diff to previous 1.9 (colored)

Don't put bsd.mp twice in the GENERIC.MP rollback tarball.

Revision 1.9 / (download) - annotate - [select for diffs], Wed Sep 7 15:19:33 2016 UTC (7 years, 9 months ago) by ajacoutot
Branch: MAIN
Changes since 1.8: +19 -36 lines
Diff to previous 1.8 (colored)

syspatch goal is not to act as a package manager but to sync the system to the
corresponding stable. So prevent rollbacking a specific binpatch but instead
always rollback the latest one. It's the only way we can know the system is
consistent.

discussed with halex@ jasper@ robert@

Revision 1.8 / (download) - annotate - [select for diffs], Tue Sep 6 14:33:42 2016 UTC (7 years, 9 months ago) by ajacoutot
Branch: MAIN
Changes since 1.7: +3 -6 lines
Diff to previous 1.7 (colored)

Drop useless variable and check.

Revision 1.7 / (download) - annotate - [select for diffs], Tue Sep 6 14:32:06 2016 UTC (7 years, 9 months ago) by ajacoutot
Branch: MAIN
Changes since 1.6: +9 -18 lines
Diff to previous 1.6 (colored)

Greatly simplify patch type detection and make things more generic.

Revision 1.6 / (download) - annotate - [select for diffs], Tue Sep 6 13:55:40 2016 UTC (7 years, 9 months ago) by ajacoutot
Branch: MAIN
Changes since 1.5: +7 -6 lines
Diff to previous 1.5 (colored)

Sort and set readonly global vars.

Revision 1.5 / (download) - annotate - [select for diffs], Mon Sep 5 12:05:13 2016 UTC (7 years, 9 months ago) by ajacoutot
Branch: MAIN
Changes since 1.4: +9 -7 lines
Diff to previous 1.4 (colored)

Make sure the file exists before putting it in the rollback tarball.

Revision 1.4 / (download) - annotate - [select for diffs], Mon Sep 5 11:32:28 2016 UTC (7 years, 9 months ago) by ajacoutot
Branch: MAIN
Changes since 1.3: +12 -12 lines
Diff to previous 1.3 (colored)

Missing local.
Shorter var name.

Revision 1.3 / (download) - annotate - [select for diffs], Mon Sep 5 11:29:34 2016 UTC (7 years, 9 months ago) by robert
Branch: MAIN
Changes since 1.2: +5 -4 lines
Diff to previous 1.2 (colored)

use a for loop for mtree for the two spec files
and add a better comment

ok ajacoutot@

Revision 1.2 / (download) - annotate - [select for diffs], Mon Sep 5 11:26:18 2016 UTC (7 years, 9 months ago) by ajacoutot
Branch: MAIN
Changes since 1.1: +10 -11 lines
Diff to previous 1.1 (colored)

No need to install the /var/syspatch/$REL directory, the binpatch does it for us.
Put /var/syspatch into a variable, it's used more than 10 times.

prodded by robert@

Revision 1.1 / (download) - annotate - [select for diffs], Mon Sep 5 11:04:45 2016 UTC (7 years, 9 months ago) by ajacoutot
Branch: MAIN

Welcome syspatch(8), a binary patch management utility for the base system.

This is currently a POC, maybe it will become something, maybe not.
Therefore it will not be hooked to the build before we are happy with it.

Workflow would be something like:
- fetch and verify signed tarballs containing the patched binaries from a mirror
- create a rollback tarball of the files we are about to replace
- extract and install the patched files

*** BIG FAT RED DISCLAIMER ***
This is very much WIP, it does *NOT* work, don't bikeshed, don't use it!

"get it in" deraadt@

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.