Page MenuHomeFreeBSD

freebsd-base.7: Add examples for converting
Needs ReviewPublic

Authored by ziaee on Mon, Feb 23, 1:34 PM.
Tags
None
Referenced Files
F146402549: D55458.id172950.diff
Mon, Mar 2, 10:20 AM
F146380131: D55458.id172994.diff
Mon, Mar 2, 5:48 AM
F146366785: D55458.id172950.diff
Mon, Mar 2, 3:06 AM
F146361376: D55458.id172957.diff
Mon, Mar 2, 2:06 AM
Unknown Object (File)
Sun, Mar 1, 2:24 PM
Unknown Object (File)
Sun, Mar 1, 10:42 AM
Unknown Object (File)
Sun, Mar 1, 10:38 AM
Unknown Object (File)
Sun, Mar 1, 3:41 AM
Subscribers

Details

Reviewers
ivy
bapt
phk
fuz
adrian
Group Reviewers
manpages
pkgbase
Summary
MFC after:              3 days
Discussed with:            bapt, des, emaste, ivy, phk, pi
Differential Revision:  https://reviews.freebsd.org/D55458
Test Plan

Someone is going to have to do it.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 71104
Build 67987: arc lint + arc unit

Event Timeline

ziaee requested review of this revision.Mon, Feb 23, 1:34 PM

i would like to see a bit more prose to explain what this command actually does, probably in its own (sub)section. in particular, explain that it unregisters the packages without removing the files ("depkgbasify" is inside baseball terminology, users won't know what this means), and explain why you'd want to do that: mainly, because it prevents the package database from becoming inconsistent with the installed system. also, should mention that it's not easily reversible and would require the system be re-pkgbasified to undo.

share/man/man7/freebsd-base.7
225

this should be FreeBSD-*, there are no pkgbase packages whose names start with FreeBSD-base-.

225

also, you might need -f here, at least if you have ports installed, because of dependency issues.

227

don't use > as this will overwrite the contents of any existing file the user might have created. also, bsdinstall creates its own file called FreeBSD-base.conf, which is the one you'd want to change.

i suggest replacing this with prose: in most cases, /usr/local/etc/pkg/repos/FreeBSD-base.conf can simply be deleted, since the base repository is disabled by default in /etc/pkg/FreeBSD.conf.

228

this should not be necessary since pkg shouldn't remove itself. that would only happen if you did pkg unregister -a.

also: there are ports packages whose names begin with freebsd- (in lowercase); i think pkg is now case sensitive here, but someone should test that to make sure it won't randomly unregister those ports.

des added inline comments.
share/man/man7/freebsd-base.7
225

concur with @ivy + would add pkg remove FreeBSD-src-\* as a first step since presumably they're going to git clone it instead. Oh, and asterisks need to be escaped.

share/man/man7/freebsd-base.7
225

also also, you need quotes here: pkg unregister 'FreeBSD-*', to prevent the shell doing glob expansion.

225

my last comment crossed with yours, ofc using \* is also fine.

+ add pkg del freebsd-src
+ escape wildcard
+ change echo redirection to append
+ remove pkg bootstrap

Refactoring this entire examples section into something that will look
nice with subsections is out of scope of this commit. It's a good sized,
bikesheddable job just in of itself. Lets get this in, if it's accurate
now, and one of us can attempt that next.

one other thing that comes to mind is that pkg unregister was added in pkg 2.5.0, but, iirc, we only shipped 2.4.something on the 15.0 media. that won't be an issue for most people because you can just update pkg, but if you did an offline install of 15.0, and wanted to depkgbasify it before doing anything else, this wouldn't work. this will be a non-issue once 15.1 comes out and maybe it's minor enough to not be worth mentioning...

share/man/man7/freebsd-base.7
225

the two packages we want to remove here are FreeBSD-src and FreeBSD-src-sys.

share/man/man7/freebsd-base.7
225

Are these normally marked vital if installed? If so, you need -f to remove them.

emaste added inline comments.
share/man/man7/freebsd-base.7
221

It's not clear what "De-pkgbasify" means -- the "pkgbase" short name does not appear anywhere in this page prior to this change, and this doesn't explain what effect this command will have on the system. The user might think it's going to remove their base system packages.

Maybe something like "Remove base system pkg(8) metadata, for use with ..."

We could also mention that it can be done for building from src or use with freebsd-update.

share/man/man7/freebsd-base.7
221

Or "Delete src packages and remove base system metadata for the remaining packages"

share/man/man7/freebsd-base.7
225

no, but FreeBSD-set-src is, which i forgot about. so to remove all three we'd need -f. it might be easier to just tell the user to unregister everything then delete /usr/src if they want to clone it...

remove de-pkgbasify
remove src removal. unregister everything, then managing their source
tree is part of their source build phase.

Thanks, this looks good. The only thing I think we should add is a warning about the consequence of doing so -- i.e., that the user will not be able to update via base system packages.

@emaste good point. I tweaked everything a bit too.

share/man/man7/freebsd-base.7
229

i'm still not sure this makes sense because you'll end up with a file containing

FreeBSD-base: { enabled: yes }
FreeBSD-base: { enabled: no }

which is strange and confusing. it's better to explain that the user should disable the base repository, e.g. by removing this file, so it's clear why we're doing this.

share/man/man7/freebsd-base.7
229

I am open to concrete suggestions to improve this, but we should have working examples. The example should be explained well enough to understand what's going on. I do not want to implement that change because I want to have working examples.

share/man/man7/freebsd-base.7
229

I am open to concrete suggestions to improve this,

i doubt this, because i suggested several and your response was "this is out of scope" (because we can't have prose in EXAMPLES, or something). so whatever.

ziaee retitled this revision from freebsd-base.7: Document de-pkgbasify to freebsd-base.7: Add an example for depkgbase.Thu, Feb 26, 6:59 AM

i doubt this,

Rude.

because i suggested several and your response was "this is out of scope" (because we can't have prose in EXAMPLES, or something). so whatever.

You gave some instruction to one of our teammates how to do something that wasn't written down. I am just trying to write it down so that we can have one less of this problem where "how to use pkgbase" is a secret that people can only get from talking to you. This is not about not having prose in EXAMPLES where it obviously is in every single manual page that has examples, it's that having blocks of prose in a single example requires me to produce subsections for all the other examples. This is both yak shaving and very obviously out of the scope of this commit.

You do not have to make me shave this yak in order to have any progress at all. Nevertheless, at 2 A.M. I have shaved this yak for you in what is now added as the parent revision.

  • forgot to quote FreeBSD-\*
  • switch to rm freebsd-base repo conf
  • switch to example 7, this should be proceeded by an enrolling example
ziaee retitled this revision from freebsd-base.7: Add an example for depkgbase to freebsd-base.7: Add examples for converting.Fri, Feb 27, 5:07 AM
ziaee edited the summary of this revision. (Show Details)
ziaee edited the test plan for this revision. (Show Details)

rewrite with converting to pkgbase so we can think hollistically.

ziaee marked 14 inline comments as done.Fri, Feb 27, 5:14 AM
ziaee edited the test plan for this revision. (Show Details)

add info about repos. notably, i am lying about pkg unregister -r,
i know pkg unregister doesn't support repos yet, but i am proposing
it does, or that someone else proposes how we are supposed to do this,
or admits that we have no plan how people are supposed to upgrade.

remove example numbers. note they are requested in style.mdoc(5).

share/man/man7/freebsd-base.7
230

the user may have an existing FreeBSD.conf, especially if they upgraded from 14.x or earlier. i suggest not recommend to unconditionally overwrite this.

241

this is not correct if the existing system doesn't match the pkg repository (e.g., src.conf differences). converting an existing system to pkgbase is a rather complicated process and i'm not sure this should be documented in the manpage at all... it might make more sense to include this in the 16.0 release notes, assuming we drop freebsd-update at that time.

252

it's not, pkg unregister is fully supported.

255

do they? why? i thought this had been fixed by making pkg case sensitive by default.

260

would rather say something like "via make installworld". you can upgrade pkgbase systems from source without depkgbasifying them.

270

again, the user may have existing content in this file that we can't just unconditionally delete.

i don't think the expanded scope of this diff is necessary. can we just document how to depkgbasify a system? that is the more important case, because we need to support people who install from disc1.iso with pkgbase and now need to depkgbasify to upgrade via installworld.

Yes, let's start with just deregistering packages to allow for installworld.

share/man/man7/freebsd-base.7
260

I assume you mean by building packages from that source and installing them? Good point, "upgrade in-place via source" does not need to imply installworld.

share/man/man7/freebsd-base.7
260

yes, precisely that.