summaryrefslogtreecommitdiffstats
path: root/usr.sbin/syspatch/syspatch.sh (follow)
Commit message (Collapse)AuthorAgeFilesLines
* When asking to install patches and none are available, return 2.ajacoutot2020-12-071-1/+2
| | | | | man page and inputs from schwarze@ ok sthen@
* Check that SHA256.sig has at least three linestb2020-10-271-2/+2
| | | | | | | | | | | 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
* Print usage to stderr, print error messages in errx(3) fashionkn2020-10-081-14/+16
| | | | | | | While here, rename sg_err()/ug_err() to just err() and sync code between syspatch(8) and sysupgrade(8). Feedback OK naddy
* set -/+o pipefail around the magic loop in ls_missing() so that we can properlyajacoutot2020-07-181-8/+12
| | | | | | | | | | | 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).
* Our old ksh(1) bug where eval()uating a || compound list would terminate theajacoutot2020-07-041-4/+1
| | | | | | shell has been fixed by benno@; remove workaround. ok naddy@
* Small XXX.ajacoutot2020-07-041-1/+2
|
* Relax the filename checks to allow dashes as well. Starting withtb2020-05-241-4/+4
| | | | | | OpenBSD 6.9, we can use less awkward filenames. Initial diff by deraadt, ok aja
* Simplify: _BSDMP was only used once.ajacoutot2020-05-161-4/+4
|
* Just output a generic error message:ajacoutot2019-12-101-4/+4
| | | | | "Unsupported filesystem, aborting" for mfs, nfs and co.
* Drop non existent vars.ajacoutot2019-11-101-2/+2
|
* Wrap long lines.ajacoutot2019-10-261-6/+7
|
* use ftp -N option; ok jcaderaadt2019-10-261-4/+4
|
* Retracted a bit too much.ajacoutot2019-10-251-2/+3
|
* retract 1.151, now that ftp reports the failing url itself.deraadt2019-10-231-4/+2
| | | | with jca, ok aja
* Tweak and sync comment.ajacoutot2019-10-201-2/+2
|
* Determine the OS version in a way that won't break after 9.9.tb2019-10-191-2/+2
| | | | | | | Do it the same way in all three copies of the code. Based on a patch from Chris Waddey. with & ok ajacoutot
* Better error message when we fail to fetch SHA256.sig.ajacoutot2019-10-141-8/+12
| | | | | | | Add "syspatch:" to every error message so we know where it comes from. req. by deraddt@ ok deraadt@ tb@
* Add where missing and harmonize PATH to be _PATH_DEFPATH (without local norajacoutot2019-09-281-1/+2
| | | | | | | X11R6). Suggested by tb@ ok deraadt@ tb@ millert@
* Tell user to look at manually running /usr/libexec/reorder_kernel in caseajacoutot2019-07-071-4/+4
| | | | | | 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.
* For "unpriv -f file", chown file back to root once the command finishes,ajacoutot2019-05-051-3/+7
| | | | like install.sub and sysupgrade(8) do.
* Initialise variable.ajacoutot2019-05-051-2/+2
|
* Change variable name.ajacoutot2019-05-051-21/+21
|
* If we don't have a proper installurl, use cdn.openbsd.org.ajacoutot2019-04-261-2/+2
| | | | Idea from sysupgrade(8).
* Move release check up front.ajacoutot2019-02-261-6/+6
|
* Drop '-S' knob from install(1). It's the default and a no-op nowadays.ajacoutot2019-02-201-2/+2
| | | | ok deraadt@
* Don't return 1 if we rollback and there's no installed patches.ajacoutot2019-01-211-2/+2
|
* Warn user to reboot the machine when a new kernel is installed and let him knowajacoutot2019-01-211-2/+6
| | | | | | | where to look on the local machine for errata (/var/syspatch) so one can decide if a reboot is needed. ok Theos (tb@ deraadt@)
* Exit for real as soon as we update ourself.ajacoutot2019-01-161-3/+3
|
* Properly handle symlinks.ajacoutot2018-10-281-5/+9
|
* Stop trying to remove /bsd.syspatch. That's ancient stuff that we don'tajacoutot2018-10-161-3/+1
| | | | do anymore.
* Remove empty syspatch dir if we fail to extract.ajacoutot2018-05-091-2/+3
|
* Don't hide stderr; starting with 6.4 there will always be an SHA256.sig.ajacoutot2018-04-261-2/+2
|
* Allow fetching syspatches from ftp.ajacoutot2018-03-101-2/+2
| | | | | from Andrew Marks ok deraadt@
* Prevent syspatch from running and throw an error out if reorder_kernel isajacoutot2017-12-291-1/+3
| | | | | | | | 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@
* /usr/share/compile -> /usr/share/relink/kernelajacoutot2017-11-091-5/+5
| | | | | from semarie I meant to do that at p2k17 but totally forgot...
* Don't check for mirror availability but directly try to fetch SHA256.sig. Thatajacoutot2017-10-131-10/+3
| | | | | | | check was not safe (index needed to be enabled, top URL may not be available etc.). based on a comment from tj@
* Simplify and explicitely state when we cannot access our mirror.ajacoutot2017-10-121-6/+5
|
* Loosen up installurl(5) check: it's OK to have a trailing slash.ajacoutot2017-10-121-2/+2
|
* Better error if installurl points to a local directory.ajacoutot2017-10-121-3/+4
|
* Don't return 1 if the syspatch release directory does not exist; it justajacoutot2017-10-121-4/+6
| | | | means that no patch is available yet.
* While failing to relink the kernel is not fatal to syspatch, we still needajacoutot2017-08-291-14/+26
| | | | to warn the user and return a proper error code.
* Fix logic to not error out.ajacoutot2017-08-291-3/+3
|
* Inform the user when we are relinking the kernel.ajacoutot2017-08-281-2/+8
|
* Add support for KARL:ajacoutot2017-08-221-67/+27
| | | | | | | | | | | - 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.
* Set the automatically generated device variables as local to preventajacoutot2017-08-171-3/+4
| | | | | | accumulating the size of all patches we are applying. from "trondd" on tech@
* Fix checkfs() when running an MP kernel.ajacoutot2017-08-171-7/+11
|
* Honor TMPDIR if it is set to prevent erroring in some setup.ajacoutot2017-08-171-2/+2
| | | | reported by Igor Falcomata
* Only run mtree if we install a patch.ajacoutot2017-08-021-4/+6
|
* For the kernel binpatches, only deal with /bsd. On MP machines we do haveajacoutot2017-08-011-27/+17
| | | | | | | | | | /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.
* If syspatch is updating itself, exit after installing the new syspatch toajacoutot2017-07-301-2/+6
| | | | | stop installing further patches and warn the user he needs to run it again (so that it'll run with the new code).