Page MenuHomeFreeBSD

freebsd-update: Don't provide copiable commands in output
ClosedPublic

Authored by michaelo on Feb 1 2024, 2:03 PM.
Tags
None
Referenced Files
F83756080: D43700.diff
Tue, May 14, 11:25 AM
Unknown Object (File)
Thu, May 9, 9:43 AM
Unknown Object (File)
Thu, May 9, 7:50 AM
Unknown Object (File)
Thu, May 9, 7:44 AM
Unknown Object (File)
Wed, May 8, 11:14 PM
Unknown Object (File)
Thu, May 2, 7:40 PM
Unknown Object (File)
Thu, May 2, 7:38 PM
Unknown Object (File)
Thu, May 2, 7:37 PM
Subscribers

Details

Summary

Previously, freebsd-update provided ready-to-go commands for copying and
pasting into the terminal. This causes problems as soon as options are
used and not supplied again by the user, e.g., '-b' or '-d'.
Stop making them copiable and force the user to construct a valid command
line by himself to avoid failures.

PR: 276102
Approved by: jrm (mentor), otis (mentor), emaste, cperciva
MFC after: 1 month

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

@emaste, as discussed, here it is.

Guys review and let me know what you think. Also add anyone you think is reasonable. The reasoning behind this is: https://github.com/BastilleBSD/bastille/issues/658

My local output:

...
/var/db/services.db
/var/yp/Makefile.dist
To install the downloaded upgrades, run 'freebsd-update' with 'install' command (and options).
root@deblndw013x4v:~
# freebsd-update -j deblndw013x4v1j -d $(jls -j deblndw013x4v1j -h path | tail -1)/var/db/freebsd-update -f $(jls -j deblndw013x4v1j -h path | tail -1)/etc/freebsd-update.conf install
src component not installed, skipped
Installing updates...
Kernel updates have been installed.  Please reboot and run
'freebsd-update' with 'install' command (and options) again to finish
installing updates.
root@deblndw013x4v:~
# freebsd-update -j deblndw013x4v1j -d $(jls -j deblndw013x4v1j -h path | tail -1)/var/db/freebsd-update -f $(jls -j deblndw013x4v1j -h path | tail -1)/etc/freebsd-update.conf install
src component not installed, skipped
Installing updates...Scanning /usr/local/bastille/jails/deblndw013x4v1j/root/usr/share/certs/blacklisted for certificates...
Scanning /usr/local/bastille/jails/deblndw013x4v1j/root/usr/share/certs/trusted for certificates...
Scanning /usr/local/bastille/jails/deblndw013x4v1j/root/usr/local/share/certs for certificates...

Completing this upgrade requires removing old shared object files.
Please rebuild all installed 3rd party software (e.g., programs
installed from the ports tree) and then run 'freebsd-update' with
'install' command (and options) again to finish installing updates.
root@deblndw013x4v:~
# freebsd-update -j deblndw013x4v1j -d $(jls -j deblndw013x4v1j -h path | tail -1)/var/db/freebsd-update -f $(jls -j deblndw013x4v1j -h path | tail -1)/etc/freebsd-update.conf install
src component not installed, skipped
Installing updates... done.
usr.sbin/freebsd-update/freebsd-update.sh
2791

s/wit/with

michaelo added inline comments.
usr.sbin/freebsd-update/freebsd-update.sh
2791

Fixed.

Address comment.

Although this change looks good to me, we also should consider making -d default to $(-b)/var/db/freebsd-update. *THAT* left me with broken boot environment :-/ (I've used -b /path/to/be without -d /path/to/be/var/db/freebsd-update).

Although this change looks good to me, we also should consider making -d default to $(-b)/var/db/freebsd-update. *THAT* left me with broken boot environment :-/ (I've used -b /path/to/be without -d /path/to/be/var/db/freebsd-update).

You are looking for:

Since this one is fine, please formally approve.

@emaste, @cperciva, what do you think?

What do you think about something like Run 'freebsd-update [options] install' to proceed? It offers a reminder to include the user's necessary options but retains the example style.

What do you think about something like Run 'freebsd-update [options] install' to proceed? It offers a reminder to include the user's necessary options but retains the example style.

This is reasonable as well as long as it is not 1:1 copy and paste capable which it is not.

Address improvement proposal from @emaste.

This is now a minimal change, please have a look guys.

This revision is now accepted and ready to land.Mar 16 2024, 1:49 PM