Page MenuHomeFreeBSD

cloudware: purge pkg cache after installation
AbandonedPublic

Authored by dch on Apr 12 2024, 11:07 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jun 14, 10:20 AM
Unknown Object (File)
Fri, Jun 13, 9:08 PM
Unknown Object (File)
Wed, Jun 11, 8:12 PM
Unknown Object (File)
Fri, Jun 6, 6:58 AM
Unknown Object (File)
Sat, May 31, 4:46 PM
Unknown Object (File)
Apr 22 2025, 12:01 PM
Unknown Object (File)
Apr 14 2025, 6:43 PM
Unknown Object (File)
Mar 23 2025, 11:29 PM
Subscribers

Details

Reviewers
lwhsu
cperciva

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 57072
Build 53960: arc lint + arc unit

Event Timeline

dch requested review of this revision.Apr 12 2024, 11:07 PM
zlei added inline comments.
release/tools/vmimage.subr
144
# man 5 pkg.conf
...
     AUTOCLEAN: boolean
                      Automatically cleanout the content of PKG_CACHEDIR after
                      each non dry-run call to pkg-install(8) or
                      pkg-upgrade(8).

A cleanout on each iteration looks heavy-weighted.

Shall we batch installing and finally do the cleaning out ? i.e.,

/usr/sbin/pkg install -y ${p1} ${p2} ${p3} ...
release/tools/vmimage.subr
144

in what way is this "heavy", in context of the overall build?

The intent is to reduce as much as possible overall image size,
as even the temporary writes use blocks that aren't truly freed,
from the perspective of a compressed raw image format.

The ever-increasing python install for cloudinit images makes a
big impact.

I would actually prefer to mount a tmpfs in /var/cache/pkg, or
move the pkg dir out completely during the install to avoid this
entirely, but I don't think that's possible.

release/tools/vmimage.subr
144

Sorry, for "heavy" I meant /usr/sbin/pkg install may re-download dependencies those are shared by packages.

I would actually prefer to mount a tmpfs in /var/cache/pkg, or
move the pkg dir out completely during the install to avoid this
entirely, but I don't think that's possible.

Why not ? I think nullfs can help.

dch added inline comments.
release/tools/vmimage.subr
144

I checked and it doesn't re-fetch dependencies its already installed.
I am not sure if the CLOUDWARE built images are always done as root.
If they are, we can use tmpfs overlay to avoid all writes, which is
even better. If not, this is better than the default.