pkgbase: Are we there yet ? Emmanuel Vadot manu@FreeBSD.org - - PowerPoint PPT Presentation

pkgbase are we there yet
SMART_READER_LITE
LIVE PREVIEW

pkgbase: Are we there yet ? Emmanuel Vadot manu@FreeBSD.org - - PowerPoint PPT Presentation

pkgbase: Are we there yet ? Emmanuel Vadot manu@FreeBSD.org EuroBSDCon Lillehammer, Norway September 19 22, 2019 Who am I Emmanuel Vadot (manu@FreeBSD.Org) FreeBSD user since 2004 FreeBSD src commiter since 2016 FreeBSD


slide-1
SLIDE 1

pkgbase: Are we there yet ?

Emmanuel Vadot manu@FreeBSD.org EuroBSDCon Lillehammer, Norway September 19 – 22, 2019

slide-2
SLIDE 2

Who am I

◮ Emmanuel Vadot (manu@FreeBSD.Org) ◮ FreeBSD user since 2004 ◮ FreeBSD src commiter since 2016 ◮ FreeBSD ports commiter since 2018 ◮ Freelance developer

slide-3
SLIDE 3

What is pkgbase ?

◮ Using pkg(8) for packaging and updating base

slide-4
SLIDE 4

What is pkgbase ?

◮ Using pkg(8) for packaging and updating base ◮ pkg(8) is the default package manager since FreeBSD 10.0

slide-5
SLIDE 5

What is pkgbase ?

◮ Using pkg(8) for packaging and updating base ◮ pkg(8) is the default package manager since FreeBSD 10.0 ◮ Splits base into multiple packages

slide-6
SLIDE 6

What is pkgbase ?

◮ Using pkg(8) for packaging and updating base ◮ pkg(8) is the default package manager since FreeBSD 10.0 ◮ Splits base into multiple packages ◮ Started in 2015 (yeah ...) by bapt@

slide-7
SLIDE 7

Goals

◮ Binary upgrades for RELEASE, STABLE and CURRENT

slide-8
SLIDE 8

Goals

◮ Binary upgrades for RELEASE, STABLE and CURRENT ◮ Fine grain installation (no sendmail, no toolchain etc ...)

slide-9
SLIDE 9

Goals

◮ Binary upgrades for RELEASE, STABLE and CURRENT ◮ Fine grain installation (no sendmail, no toolchain etc ...) ◮ Let pkg(8) deal with conf file updates

slide-10
SLIDE 10

Goals

◮ Binary upgrades for RELEASE, STABLE and CURRENT ◮ Fine grain installation (no sendmail, no toolchain etc ...) ◮ Let pkg(8) deal with conf file updates ◮ Allow developers to provide package for users to test

slide-11
SLIDE 11

Goals (2)

◮ In the build system (make packages)

slide-12
SLIDE 12

Goals (2)

◮ In the build system (make packages) ◮ Run as user

slide-13
SLIDE 13

Goals (2)

◮ In the build system (make packages) ◮ Run as user ◮ Cross arch creation of packages

slide-14
SLIDE 14

Goals (2)

◮ In the build system (make packages) ◮ Run as user ◮ Cross arch creation of packages ◮ I want people to create FreeBSD “distros”

slide-15
SLIDE 15

How packages are generated

◮ Install a “fake” root during target worldstage/kernelstage

slide-16
SLIDE 16

How packages are generated

◮ Install a “fake” root during target worldstage/kernelstage ◮ Uses -DNO ROOT and METALOG (mtree file)

slide-17
SLIDE 17

How packages are generated

◮ Install a “fake” root during target worldstage/kernelstage ◮ Uses -DNO ROOT and METALOG (mtree file) ◮ Add tags into the METALOG with the destination package

slide-18
SLIDE 18

How packages are generated

◮ Install a “fake” root during target worldstage/kernelstage ◮ Uses -DNO ROOT and METALOG (mtree file) ◮ Add tags into the METALOG with the destination package ◮ Defaults to FreeBSD-utilities package

slide-19
SLIDE 19

How packages are generated

◮ Install a “fake” root during target worldstage/kernelstage ◮ Uses -DNO ROOT and METALOG (mtree file) ◮ Add tags into the METALOG with the destination package ◮ Defaults to FreeBSD-utilities package ◮ Makefiles can override the package with PACKAGE=XXX

slide-20
SLIDE 20

How packages are generated

◮ Install a “fake” root during target worldstage/kernelstage ◮ Uses -DNO ROOT and METALOG (mtree file) ◮ Add tags into the METALOG with the destination package ◮ Defaults to FreeBSD-utilities package ◮ Makefiles can override the package with PACKAGE=XXX ◮ ucls (package definition) are in release/packages

slide-21
SLIDE 21

How packages are generated

◮ Install a “fake” root during target worldstage/kernelstage ◮ Uses -DNO ROOT and METALOG (mtree file) ◮ Add tags into the METALOG with the destination package ◮ Defaults to FreeBSD-utilities package ◮ Makefiles can override the package with PACKAGE=XXX ◮ ucls (package definition) are in release/packages ◮ plist (package content) automatically generated

slide-22
SLIDE 22

How packages are generated

◮ Install a “fake” root during target worldstage/kernelstage ◮ Uses -DNO ROOT and METALOG (mtree file) ◮ Add tags into the METALOG with the destination package ◮ Defaults to FreeBSD-utilities package ◮ Makefiles can override the package with PACKAGE=XXX ◮ ucls (package definition) are in release/packages ◮ plist (package content) automatically generated ◮ Package and repository are created by make packages target

slide-23
SLIDE 23

How base is split

slide-24
SLIDE 24

How base is split

◮ Current split isn’t final

slide-25
SLIDE 25

How base is split

◮ Current split isn’t final ◮ FreeBSD-kernel-$kernconf : Each Kernel in its own package

(based on the config)

slide-26
SLIDE 26

How base is split

◮ Current split isn’t final ◮ FreeBSD-kernel-$kernconf : Each Kernel in its own package

(based on the config)

◮ FreeBSD-bootloader contain bootloaders and configuration

files (lua or forth)

slide-27
SLIDE 27

How base is split

◮ Current split isn’t final ◮ FreeBSD-kernel-$kernconf : Each Kernel in its own package

(based on the config)

◮ FreeBSD-bootloader contain bootloaders and configuration

files (lua or forth)

◮ FreeBSD-clibs contain the C runtime (ld-elf.so.1, libc, libthr

etc ...)

slide-28
SLIDE 28

How base is split

◮ Current split isn’t final ◮ FreeBSD-kernel-$kernconf : Each Kernel in its own package

(based on the config)

◮ FreeBSD-bootloader contain bootloaders and configuration

files (lua or forth)

◮ FreeBSD-clibs contain the C runtime (ld-elf.so.1, libc, libthr

etc ...)

◮ FreeBSD-runtime contain everything for booting to single user

and repair an installation

slide-29
SLIDE 29

How base is split

◮ Current split isn’t final ◮ FreeBSD-kernel-$kernconf : Each Kernel in its own package

(based on the config)

◮ FreeBSD-bootloader contain bootloaders and configuration

files (lua or forth)

◮ FreeBSD-clibs contain the C runtime (ld-elf.so.1, libc, libthr

etc ...)

◮ FreeBSD-runtime contain everything for booting to single user

and repair an installation

◮ FreeBSD-rc contain the rc subsystem

slide-30
SLIDE 30

How base is split

◮ Current split isn’t final ◮ FreeBSD-kernel-$kernconf : Each Kernel in its own package

(based on the config)

◮ FreeBSD-bootloader contain bootloaders and configuration

files (lua or forth)

◮ FreeBSD-clibs contain the C runtime (ld-elf.so.1, libc, libthr

etc ...)

◮ FreeBSD-runtime contain everything for booting to single user

and repair an installation

◮ FreeBSD-rc contain the rc subsystem ◮ FreeBSD-utilities is the default package so contain a lot of

different thing

slide-31
SLIDE 31

How base is split

◮ Current split isn’t final ◮ FreeBSD-kernel-$kernconf : Each Kernel in its own package

(based on the config)

◮ FreeBSD-bootloader contain bootloaders and configuration

files (lua or forth)

◮ FreeBSD-clibs contain the C runtime (ld-elf.so.1, libc, libthr

etc ...)

◮ FreeBSD-runtime contain everything for booting to single user

and repair an installation

◮ FreeBSD-rc contain the rc subsystem ◮ FreeBSD-utilities is the default package so contain a lot of

different thing

◮ Some stuff will be moved out of it

slide-32
SLIDE 32

How base is split (cont.)

slide-33
SLIDE 33

How base is split (cont.)

◮ Every package is split with -debug -development -profile

package

slide-34
SLIDE 34

How base is split (cont.)

◮ Every package is split with -debug -development -profile

package

◮ On 64 bits arch with 32 bits support some -lib32 packages are

created

slide-35
SLIDE 35

How base is split (cont.)

◮ Every package is split with -debug -development -profile

package

◮ On 64 bits arch with 32 bits support some -lib32 packages are

created

◮ Every lib/programs from contrib/ in their own package (Easier

for SA/EN)

slide-36
SLIDE 36

How base is split (cont.)

◮ Every package is split with -debug -development -profile

package

◮ On 64 bits arch with 32 bits support some -lib32 packages are

created

◮ Every lib/programs from contrib/ in their own package (Easier

for SA/EN)

◮ FreeBSD-tests contain all the testsuite (should we put kyua

there ?)

slide-37
SLIDE 37

How base is split (cont.)

◮ Every package is split with -debug -development -profile

package

◮ On 64 bits arch with 32 bits support some -lib32 packages are

created

◮ Every lib/programs from contrib/ in their own package (Easier

for SA/EN)

◮ FreeBSD-tests contain all the testsuite (should we put kyua

there ?)

◮ Other packages are application or lib specifics, e.g. :

FreeBSD-bluetooth/FreeBSD-wpa/FreeBSD-ssh/FreeBSD- libarchive ...

slide-38
SLIDE 38

How base is split (cont.)

◮ Every package is split with -debug -development -profile

package

◮ On 64 bits arch with 32 bits support some -lib32 packages are

created

◮ Every lib/programs from contrib/ in their own package (Easier

for SA/EN)

◮ FreeBSD-tests contain all the testsuite (should we put kyua

there ?)

◮ Other packages are application or lib specifics, e.g. :

FreeBSD-bluetooth/FreeBSD-wpa/FreeBSD-ssh/FreeBSD- libarchive ...

◮ Will continue to move things out of utilities when it make

sense (nfs ? kerberos ?)

slide-39
SLIDE 39

Number of packages

◮ It apparently matters to some people

slide-40
SLIDE 40

Number of packages

◮ It apparently matters to some people ◮ It matters to me only for time spent installing/upgrading

slide-41
SLIDE 41

Number of packages

◮ It apparently matters to some people ◮ It matters to me only for time spent installing/upgrading ◮ Total : 392 (529MB with xz compression)

slide-42
SLIDE 42

Number of packages

◮ It apparently matters to some people ◮ It matters to me only for time spent installing/upgrading ◮ Total : 392 (529MB with xz compression) ◮ Current count without -debug/-development/-profile : 118

(158MB with xz compression)

slide-43
SLIDE 43

Number of packages

◮ It apparently matters to some people ◮ It matters to me only for time spent installing/upgrading ◮ Total : 392 (529MB with xz compression) ◮ Current count without -debug/-development/-profile : 118

(158MB with xz compression)

◮ Current count without -debug/-development/-profile/-lib32 :

80 (150MB with xz compression)

slide-44
SLIDE 44

Number of packages

◮ It apparently matters to some people ◮ It matters to me only for time spent installing/upgrading ◮ Total : 392 (529MB with xz compression) ◮ Current count without -debug/-development/-profile : 118

(158MB with xz compression)

◮ Current count without -debug/-development/-profile/-lib32 :

80 (150MB with xz compression)

◮ Number of packages will only go up starting now

slide-45
SLIDE 45

WITH /WITHOUT interaction

◮ WITH and WITHOUT control what we build (see

src.conf(7))

slide-46
SLIDE 46

WITH /WITHOUT interaction

◮ WITH and WITHOUT control what we build (see

src.conf(7))

◮ Some simply exclude one componant from the system

(WITHOUT APM or WITHOUT AMD)

slide-47
SLIDE 47

WITH /WITHOUT interaction

◮ WITH and WITHOUT control what we build (see

src.conf(7))

◮ Some simply exclude one componant from the system

(WITHOUT APM or WITHOUT AMD)

◮ Some change binaries (WITHOUT KERBEROS or

WITHOUT CAPSICUM)

slide-48
SLIDE 48

WITH /WITHOUT interaction

◮ WITH and WITHOUT control what we build (see

src.conf(7))

◮ Some simply exclude one componant from the system

(WITHOUT APM or WITHOUT AMD)

◮ Some change binaries (WITHOUT KERBEROS or

WITHOUT CAPSICUM)

◮ No real solution for this now, we would need flavors like in

ports

slide-49
SLIDE 49

How to bootstrap packages (the correct way)

slide-50
SLIDE 50

How to bootstrap packages (the correct way)

◮ Define WITH REPRODUCIBLE BUILD in src.conf

slide-51
SLIDE 51

How to bootstrap packages (the correct way)

◮ Define WITH REPRODUCIBLE BUILD in src.conf ◮ Define SOURCE DATE EPOCH in env

slide-52
SLIDE 52

How to bootstrap packages (the correct way)

◮ Define WITH REPRODUCIBLE BUILD in src.conf ◮ Define SOURCE DATE EPOCH in env ◮ Pass REPODIR to make(1)

slide-53
SLIDE 53

How to bootstrap packages (the correct way)

◮ Define WITH REPRODUCIBLE BUILD in src.conf ◮ Define SOURCE DATE EPOCH in env ◮ Pass REPODIR to make(1) ◮ make packages

slide-54
SLIDE 54

How to generate packages for -p updates

slide-55
SLIDE 55

How to generate packages for -p updates

◮ Define WITH REPRODUCIBLE BUILD in src.conf

slide-56
SLIDE 56

How to generate packages for -p updates

◮ Define WITH REPRODUCIBLE BUILD in src.conf ◮ Define SOURCE DATE EPOCH in env (same one as the

bootstrap one)

slide-57
SLIDE 57

How to generate packages for -p updates

◮ Define WITH REPRODUCIBLE BUILD in src.conf ◮ Define SOURCE DATE EPOCH in env (same one as the

bootstrap one)

◮ Pass PKG VERSION to make(1) (same value as the bootstrap

  • ne)
slide-58
SLIDE 58

How to generate packages for -p updates

◮ Define WITH REPRODUCIBLE BUILD in src.conf ◮ Define SOURCE DATE EPOCH in env (same one as the

bootstrap one)

◮ Pass PKG VERSION to make(1) (same value as the bootstrap

  • ne)

◮ Use a temporary REPODIR

slide-59
SLIDE 59

How to generate packages for -p updates

◮ Define WITH REPRODUCIBLE BUILD in src.conf ◮ Define SOURCE DATE EPOCH in env (same one as the

bootstrap one)

◮ Pass PKG VERSION to make(1) (same value as the bootstrap

  • ne)

◮ Use a temporary REPODIR ◮ Compare packages with the bootstrap ones

slide-60
SLIDE 60

How to generate packages for -p updates

◮ Define WITH REPRODUCIBLE BUILD in src.conf ◮ Define SOURCE DATE EPOCH in env (same one as the

bootstrap one)

◮ Pass PKG VERSION to make(1) (same value as the bootstrap

  • ne)

◮ Use a temporary REPODIR ◮ Compare packages with the bootstrap ones ◮ Regenerate package with new SOURCE DATE EPOCH and

new PKG VERSION

slide-61
SLIDE 61

How to generate packages for -p updates

◮ Define WITH REPRODUCIBLE BUILD in src.conf ◮ Define SOURCE DATE EPOCH in env (same one as the

bootstrap one)

◮ Pass PKG VERSION to make(1) (same value as the bootstrap

  • ne)

◮ Use a temporary REPODIR ◮ Compare packages with the bootstrap ones ◮ Regenerate package with new SOURCE DATE EPOCH and

new PKG VERSION

◮ rm packages from original repo, copy new ones and re-run pkg

repo

slide-62
SLIDE 62

How to generate packages for -p updates

◮ Define WITH REPRODUCIBLE BUILD in src.conf ◮ Define SOURCE DATE EPOCH in env (same one as the

bootstrap one)

◮ Pass PKG VERSION to make(1) (same value as the bootstrap

  • ne)

◮ Use a temporary REPODIR ◮ Compare packages with the bootstrap ones ◮ Regenerate package with new SOURCE DATE EPOCH and

new PKG VERSION

◮ rm packages from original repo, copy new ones and re-run pkg

repo

◮ User now only have to download/install package(s) affected

by the SA/EN

slide-63
SLIDE 63

pkg groups

◮ Meta-pkg at the repo level

slide-64
SLIDE 64

pkg groups

◮ Meta-pkg at the repo level ◮ Installer install “FreeBSD-base” “FreeBSD-debug”

“FreeBSD-lib32” etc ...

slide-65
SLIDE 65

pkg groups

◮ Meta-pkg at the repo level ◮ Installer install “FreeBSD-base” “FreeBSD-debug”

“FreeBSD-lib32” etc ...

◮ New packages are installed automatically on update

slide-66
SLIDE 66

pkg groups

◮ Meta-pkg at the repo level ◮ Installer install “FreeBSD-base” “FreeBSD-debug”

“FreeBSD-lib32” etc ...

◮ New packages are installed automatically on update ◮ Multitiple candidates for one package (-noman, -nocapsicum)

slide-67
SLIDE 67

Current work

◮ bsdinstall support

slide-68
SLIDE 68

Current work

◮ bsdinstall support ◮ release image support

slide-69
SLIDE 69

Current work

◮ bsdinstall support ◮ release image support ◮ kernel-select

slide-70
SLIDE 70

Current work

◮ bsdinstall support ◮ release image support ◮ kernel-select ◮ more packages split

slide-71
SLIDE 71

Future work

◮ Talk to re@ so we have official packages

slide-72
SLIDE 72

Future work

◮ Talk to re@ so we have official packages ◮ “freebsd-update”

slide-73
SLIDE 73

Future work

◮ Talk to re@ so we have official packages ◮ “freebsd-update” ◮ poudriere image support

slide-74
SLIDE 74

Are we there yet ?

slide-75
SLIDE 75

Are we there yet ?

◮ Not yet but close

slide-76
SLIDE 76

Are we there yet ?

◮ Not yet but close ◮ Wanna help ? ◮ Still a few bugs in bsd.*.mk ◮ Test installing a minimal FreeBSD based pkgbase and install

each package separatly to test if everything is working

◮ pkgbase@freebsd.org

slide-77
SLIDE 77

Thanks

◮ Baptiste Daroussin (bapt@FreeBSD.Org) ◮ Glen Barber (gjb@FreeBSD.Org)

slide-78
SLIDE 78

Questions ?

Emmanuel Vadot manu@freebsd.org Twitter: @manuvadot