Page MenuHomeFreeBSD

pkg: Add -j and -r options
Needs ReviewPublic

Authored by des on Fri, Jul 10, 7:54 PM.
Tags
None
Referenced Files
F163055812: D58165.diff
Sun, Jul 19, 4:32 PM
F163055768: D58165.diff
Sun, Jul 19, 4:32 PM
F163042839: D58165.id181902.diff
Sun, Jul 19, 1:23 PM
F163036787: D58165.id181914.diff
Sun, Jul 19, 11:48 AM
Unknown Object (File)
Sat, Jul 18, 2:07 PM
Unknown Object (File)
Sat, Jul 18, 2:03 PM
Unknown Object (File)
Sat, Jul 18, 12:05 PM
Unknown Object (File)
Sat, Jul 18, 7:50 AM
Subscribers

Details

Summary

This allows pkg(7) to be used to bootstrap a chroot or jail, and to
recognize the -j and -r options and pass them through to pkg(8) if
already bootstrapped.

Note that this does not address the issue of repository keys. If using
a signed package repository, you will still need to copy /usr/share/keys
into the target environment before or after bootstrapping, or pkg will
be unable to verify package signatures.

MFC after: 1 week

Diff Detail

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

Event Timeline

des requested review of this revision.Fri, Jul 10, 7:54 PM
This revision is now accepted and ready to land.Sun, Jul 12, 5:16 PM
des retitled this revision from pkg: Add support for -r option to pkg: Add support for -r and -j.Mon, Jul 13, 12:57 PM
des edited the summary of this revision. (Show Details)
This revision now requires review to proceed.Mon, Jul 13, 12:57 PM
This revision is now accepted and ready to land.Mon, Jul 13, 2:59 PM
This revision was automatically updated to reflect the committed changes.
markj added inline comments.
usr.sbin/pkg/pkg.c
96

Why is rootd a global variable? And shouldn't it be initialized to AT_FDCWD?

des retitled this revision from pkg: Add support for -r and -j to pkg: Add -j and -r options.
des edited the summary of this revision. (Show Details)
des marked an inline comment as done.Sun, Jul 19, 7:07 AM
usr.sbin/pkg/pkg.c
96

It still doesn't need to be global AFAICS.

264

If the assertion is false, then the program has already triggered some memory corruption and the assertion might not catch it.

288
291

This will always be zero.

1150

What if localbase is just "/"? I think this construction doesn't quite work in that case, pkgpatch will contain "//sbin/pkg" and the +1 in the faccessat() call below won't behave as you want.

If localbase is the empty string, this also doesn't work, but I think that probably shouldn't happen.