Page MenuHomeFreeBSD

sysutils/firstboot-pkg-upgrade: New port
Needs ReviewPublic

Authored by ziaee on Mon, Apr 13, 7:32 PM.
Tags
None
Referenced Files
F153084166: D56381.id175593.diff
Sun, Apr 19, 12:55 AM
Unknown Object (File)
Sat, Apr 18, 6:32 PM
Unknown Object (File)
Sat, Apr 18, 9:41 AM
Unknown Object (File)
Sat, Apr 18, 9:41 AM
Unknown Object (File)
Sat, Apr 18, 9:41 AM
Unknown Object (File)
Sat, Apr 18, 9:41 AM
Unknown Object (File)
Sat, Apr 18, 9:41 AM
Unknown Object (File)
Sat, Apr 18, 9:41 AM
Subscribers
None

Details

Summary

I am not really sure about anything, but I noticed that we need this,
because the latest GCE images use pkgbase, so I adapted it from the one
cperciva wrote for freebsd-update.

Sponsored by: Google (they gave me a vm, right?)

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 72236
Build 69119: arc lint + arc unit

Event Timeline

ziaee requested review of this revision.Mon, Apr 13, 7:32 PM
ziaee created this revision.
sysutils/firstboot-pkg-upgrade/files/firstboot_freebsd_update.in
13 ↗(On Diff #175451)

I don't know if this is true

27 ↗(On Diff #175451)

i don't know if it's reasonable to prefix the logs with pkg: because it seems reasonable to me but could cause confusion since this isn't actually pkg, or maybe it will print as pkg: pkg:

44 ↗(On Diff #175451)

this HTTP_TIMEOUT is cargo culting, I don't know if pkg even reads this

remove HTTP_TIMEOUT since I didn't see that in the pkg code. Add -y so
that pkg upg can run non-interactive.

ok, i figured out how to test this, and fixed the errors. it's working
on my machine by touching /firstboot. this may be ready for review now.

sysutils/firstboot-pkg-upgrade/files/firstboot_pkg_upgrade.in
44

Can you add functionality here to limit this to a particular repo?

In particular I'd like to be able to tell EC2 (and probably other cloud) images to update FreeBSD-base packages (since those updates will be security and errata updates) but not FreeBSD-ports packages (since those will include functional changes).

Limited to FreeBSD-base repo and tested on my laptop. Thanks Colin!

Sorry, I should have been clearer. Can you make limiting to a specific repository *optional*? There may be people who want to update everything, especially if they build their own images which access internal repositories.

adjust logic to accept a firstboot_pkg_upgrade_repos variable that
limits the repos to specific repos if provided. i adapted the logic
from sysutils/firstboot-pkgs, but this is the most complex rc.d script
ive tried to write, so i don't know what i dont know. thanks Colin!

i also rewrapped the comment for my workflow.

sysutils/firstboot-pkg-upgrade/files/firstboot_pkg_upgrade.in
52

you should run pkg upgrade -r ${repo1} -r ${repo2} ... -y
it will help the solver doing a bette job.

apply bapt feedback. note that a bogus repo being specified will abort all the others. im not sure if i need to initialize the empty variable first, but that's what i did. thanks @bapt!

delphij added inline comments.
sysutils/firstboot-pkg-upgrade/files/firstboot_pkg_upgrade.in
33

I think 'pkg' don't have to be quoted here because it's one single word constant.

56

OPTIONAL: Purely personal opinion: It might be reasonable to pass AUTOCLEAN=on here. If we downloaded some packages for a fresh installed system, the packages are used for installation but probably never read from again.

On sidenote, I wish we could have a way to tell if pkg upgrade really did some actions (and possibly also what changes it has made) instead of requesting reboot regardless, but for the initial implementation let's keep it simple for now.

This revision is now accepted and ready to land.Thu, Apr 16, 5:55 PM

remove log prefix overquoting and add autoclean to pkg. thanks @delphij!
overquoting is ugly and confusing, and autoclean is definitely ideal.
the space savings will be a lot across the entire cloud.

This revision now requires review to proceed.Thu, Apr 16, 6:28 PM