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
Unknown Object (File)
Wed, Dec 4, 3:01 PM
Unknown Object (File)
Mon, Nov 18, 2:31 AM
Unknown Object (File)
Oct 17 2024, 10:12 AM
Unknown Object (File)
Oct 3 2024, 5:17 AM
Unknown Object (File)
Oct 1 2024, 11:06 PM
Unknown Object (File)
Sep 30 2024, 6:18 AM
Unknown Object (File)
Sep 27 2024, 8:45 AM
Unknown Object (File)
Sep 26 2024, 1:29 AM
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 56260
Build 53148: arc lint + arc unit

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