OpenBSD CVS

CVS log for src/libexec/reorder_kernel/reorder_kernel.sh


[BACK] Up to [local] / src / libexec / reorder_kernel

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.13 / (download) - annotate - [select for diffs], Mon Nov 7 15:55:56 2022 UTC (19 months ago) by kn
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, HEAD
Changes since 1.12: +4 -4 lines
Diff to previous 1.12 (colored)

Use variable and shorter logic for NFS check

No need to hardcode a parent path if we can reuse an existing variable for
the specific path that is in being used.

Negate the file system type in df(1) so the `|| exit 1' can be dropped
in favour of the errexit option, as is done for everything else in there.

Clarify the comment how this is intentionally NOT logged, i.e. the test
happens before the error trap/syslog/logfile handling.

OK millert

Revision 1.12 / (download) - annotate - [select for diffs], Mon Nov 7 11:03:14 2022 UTC (19 months ago) by kn
Branch: MAIN
Changes since 1.11: +7 -5 lines
Diff to previous 1.11 (colored)

Set up logger(1) traps earlier to catch logfile setup failures

If /usr is mounted read-only, kernel relinking fails silently without any
log trace:

	# /usr/libexec/reorder_kernel
	/usr/libexec/reorder_kernel[35]: cannot create /usr/share/relink/kernel/GENERIC.MP/relink.log: Read-only file system

This stderr line does not show up anywhere because init(8) redirects stdout
and stderr to /dev/null, executes rc(8) which inherits it and thus executes
reorder_kernel with both streams discarded.

So install the error handler first, then try to set up a log file.

Introduce ERRMSG to provide error messages to users, i.e. not say
"see .../relink.log" when creating this file is what failed:

	# ksh ./reorder_kernel.sh
	./reorder_kernel.sh[40]: cannot create /usr/share/relink/kernel/GENERIC.MP/relink.log: Read-only file system
	# tail -n1 /var/log/message	# or xconsole(1)
	Nov  7 10:51:00 eru reorder_kernel.sh: failed

OK tb

Revision 1.11 / (download) - annotate - [select for diffs], Fri May 13 13:20:16 2022 UTC (2 years ago) by sthen
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.10: +3 -2 lines
Diff to previous 1.10 (colored)

If $KERNEL_DIR.tgz exists, reorder_kernel updates the destination for
logged stdout output, but forgot to handle stderr. Fix that so that
the error log includes stderr output in that case (otherwise the log
is usually empty). From Lauri Tirkkonen, plus comment adjusted. ok tb

Revision 1.10 / (download) - annotate - [select for diffs], Mon Sep 13 11:49:21 2021 UTC (2 years, 8 months ago) by robert
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.9: +2 -1 lines
Diff to previous 1.9 (colored)

introduce /etc/bsd.re-config which can be used to configure the kernel
using config(8);

the contents of this configuration file will be fed to config(8) after
kernel relinking is done, so on the next boot the new kernel will have
all the configuration changes set by the user

this comes handy if you still want to use KARL while making changes
to the GENERIC kernel

diff from Paul de Weerd with input from several developers

Revision 1.9 / (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_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.8: +2 -2 lines
Diff to previous 1.8 (colored)

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

ok deraadt@ tb@ millert@

Revision 1.8 / (download) - annotate - [select for diffs], Tue Jul 30 13:44:00 2019 UTC (4 years, 10 months ago) by deraadt
Branch: MAIN
Changes since 1.7: +2 -2 lines
Diff to previous 1.7 (colored)

shorten the failure message, it should not wrap a line.

Revision 1.7 / (download) - annotate - [select for diffs], Thu Jun 20 20:53:56 2019 UTC (4 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.6: +2 -1 lines
Diff to previous 1.6 (colored)

after installing new kernel, do a sync(8) to encourage lazy buffers to
make it to disk (discussion with tedu)

Revision 1.6 / (download) - annotate - [select for diffs], Sun Feb 10 21:11:42 2019 UTC (5 years, 3 months ago) by kn
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.5: +2 -3 lines
Diff to previous 1.5 (colored)

Simplify NFS check

Instead of getting all filesystems with df(1), filter /usr/share/ and check
with mount(1) whether it's NFS, make df error out directly if the
filesystem type matches nfs.

OK sthen tb

Revision 1.5 / (download) - annotate - [select for diffs], Tue May 1 09:45:39 2018 UTC (6 years, 1 month ago) by rpe
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.4: +12 -2 lines
Diff to previous 1.4 (colored)

Add an explanation to relink.log what a failed checksum of /bsd
means and show how to re-enable KARL.

Prodded by and OK deraadt
Feedback and OK tb

Revision 1.4 / (download) - annotate - [select for diffs], Sun Nov 5 10:29:24 2017 UTC (6 years, 7 months ago) by rpe
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.3: +9 -9 lines
Diff to previous 1.3 (colored)

Consolidate lib.so.*.a, ld.so.a and the kernel relink kit into
one location under /usr/share/relink.

Be more specific in src/etc/rc reorder_libs() what filesystems
need r/w remount and ensure that their mount state is restored.

Idea and positive feedback from deraadt@
OK aja@ tb@

Revision 1.3 / (download) - annotate - [select for diffs], Fri Aug 25 18:59:55 2017 UTC (6 years, 9 months ago) by rpe
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.2: +3 -1 lines
Diff to previous 1.2 (colored)

It's a standalone script now, so explicitly set a sane PATH.

Revision 1.2 / (download) - annotate - [select for diffs], Fri Aug 25 18:27:41 2017 UTC (6 years, 9 months ago) by rpe
Branch: MAIN
Changes since 1.1: +2 -2 lines
Diff to previous 1.1 (colored)

Fix detection whether /usr/share is on a nfs mounted filesystem.

Revision 1.1 / (download) - annotate - [select for diffs], Mon Aug 21 21:24:11 2017 UTC (6 years, 9 months ago) by rpe
Branch: MAIN

Move the kernel relinking code from /etc/rc into a seperate script
/usr/libexec/reorder_kernel. Requested by ajacoutot@ to be able to
relink the kernel from within syspatch(8).

OK deraadt@ tb@

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.