Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
pkgbase [2020/07/29 19:35] – Add note about replacing /etc/master.passwd EdMastepkgbase [2023/10/18 20:32] (current) – Agreed with Mina Galić that the overview section is good enough to be treated as up-to-date. Draw a line there, with a hint that what's below is outdated. GrahamPerrin
Line 1: Line 1:
 **Packaging %%FreeBSD%% base** **Packaging %%FreeBSD%% base**
 +
 +===== About PkgBase =====
 +
 +PkgBase is the %%FreeBSD%% base operating system (OS), //packaged//.
 +
 +Use of [[https://man.freebsd.org/cgi/man.cgi?query=pkg&sektion=8&manpath=freebsd-ports|pkg(8)]] is the norm for installation of, and updates to, [[https://www.freshports.org/|ported software]] that runs on the OS.
 +
 +Where it becomes possible to also use pkg for the OS:
 +
 +  * it's no longer necessary to use [[https://man.freebsd.org/cgi/man.cgi?query=freebsd-update&sektion=8&manpath=freebsd-release|freebsd-update(8)]] or [[https://docs.freebsd.org/en/books/handbook/book/#makeworld|build and install from source]].
  
 ===== Status ===== ===== Status =====
  
-Packaged base (PkgBase) work is happening in HEAD.+Packages will be provided from %%FreeBSD%% 14.0 onwards:
  
-A [[https://lists.freebsd.org/pipermail/freebsd-pkgbase/2016-March/000032.html|call for testing was made in March 2016]]. Major blockers and critical issues appear to be resolved. Please note, as with any development branch, this is not yet intended for production environments. Use of virtual machines or dedicated testing machines is strongly encouraged.+  * as a technology preview of sorts, for experimentation and use by projects such as [[https://mastodon.world/@dfr|Doug Rabson]]'s [[https://github.com/dfr/freebsd-images#readme|FreeBSD container images]] 
 +  * not yet for things such as [[https://man.freebsd.org/cgi/man.cgi?query=bsdinstall&sektion=8&manpath=freebsd-release|bsdinstall(8)]] 
 +  * not yet intended for production environments.
  
-PkgBase comprises around 300 packages with the default build (empty src.conf(5) and make.conf(5%%))%% for amd64. The number depends on several factors, but for most cases a runtime binary is split into several components.  In particular, most shared libraries are individually packaged, in addition to debugging symbols, and 32-bit packaged separately.+In addition, to aid exploration and adoption, an unofficial repository [[https://pkg.freebsd.evilham.com/images]] is provided by [[https://evilham.com/|Evilham (Andrés)]].
  
-===== Outstanding =====+In Bugzilla:
  
-  * There is currently no method to notify users when new base packages are created (packages that did not previously exist), and they are not installed during a ''%%pkg upgrade%%''. This is particularly problematic if files are moved from an existing package to a new dedicated package, which will result in them being deleted during the next ''%%pkg upgrade%%''. This was noticed after [[https://svnweb.freebsd.org/base?view=revision&revision=299840|r299840]], which moves ''%%/etc/rc.d/[zfs|zvol]%%'' from the existing %%FreeBSD%%-runtime package to a new %%FreeBSD%%-zfs package, and resulted in them being deleted during the next ''%%pkg upgrade%%''.+  * [[https://bugs.freebsd.org/bugzilla/buglist.cgi?bug_status=__open__&keywords=pkgbase%2C+&keywords_type=allwords&list_id=644525&order=Bug+Number&query_format=advanced|all open reports with the pkgbase keyword]].
  
-  * [[https://svnweb.freebsd.org/base/head/Makefile.inc1?r1=337960&r2=337991|r337991]] fixes an issue where a user has defined DISTDIR in make.conf; the error will be that awk can't find [....]/METALOG during make packages.  11.2-RELEASE needs this patch (or wrap the DISTDIR definition with ''%%.if ! ${.CURDIR:M/usr/src*%%''})+Use of a virtual machine, or a dedicated test machine, is encouraged.
  
-Please follow up on the freebsd-pkgbase@ mailing list with problems (and successes).+===== Overview ===== 
 + 
 +PkgBase comprises a few hundred packages with the default build (empty [[https://man.freebsd.org/cgi/man.cgi?query=src.conf&sektion=5&manpath=freebsd-release|src.conf(5)]] and [[https://man.freebsd.org/cgi/man.cgi?query=make.conf&sektion=5&manpath=freebsd-release|make.conf(5)]]) for amd64. The number of packages depends on several factors. 
 + 
 +In most cases, a runtime binary is split into multiple components. Debugging symbols and most shared libraries are packaged individually. 32-bit is bit packaged separately. 
 + 
 +---- 
 + 
 +//Content below this line is outdated, will be updated …//
  
 ===== Initial setup ===== ===== Initial setup =====
Line 74: Line 94:
  
 **Caution:** There is currently no built-in mechanism for bootstrapping pkg info from the existing system, and files (such as ///etc/master.passwd//) will be replaced with default copies from the newly installed packages. Existing files will be renamed with a ''%%.pkgsave%%'' extension. **Caution:** There is currently no built-in mechanism for bootstrapping pkg info from the existing system, and files (such as ///etc/master.passwd//) will be replaced with default copies from the newly installed packages. Existing files will be renamed with a ''%%.pkgsave%%'' extension.
 +
 +Files that may be of particular interest include:
 +  * /etc/aliases
 +  * /etc/fstab
 +  * /etc/group
 +  * /etc/hosts
 +  * /etc/mail.rc
 +  * /etc/master.passwd
 +  * /etc/ssh/ssh_config
 +  * /etc/ssh/sshd_config
 +  * /etc/sysctl.conf
 +  * /etc/syslog.conf
 +  * /etc/ttys
 +  * /root/.cshrc
 +  * /root/.k5login
 +  * /root/.login
 +  * /root/.profile
 +  * /root/.shrc
 +
 +**WARNINGS:**
 +
 +=== Fixing missing user ===
 +
 +After upgrading, if you have the following message from ''%%su%%''
 +
 +<code>
 +su: who are you?
 +</code>
 +
 +It means that you have replaced your ''%%master.passwd%%'' file during the upgrade, in order to restore your user and rebuild the passwd database, you can do the commands below, then login again:
 +
 +<code>
 +# cp /etc/master.passwd.pkgsave /etc/master.passwd
 +# /usr/sbin/pwd_mkdb -p /etc/master.passwd
 +</code>
  
 ==== Kernel packages ==== ==== Kernel packages ====
Line 94: Line 149:
   * %%FreeBSD%%-kernel-mykernel2-debug   * %%FreeBSD%%-kernel-mykernel2-debug
  
-==== Upgrading ====+===== Upgrades =====
  
 After the first time the source tree was built and installed with PkgBase, an upgrade involves the following steps: After the first time the source tree was built and installed with PkgBase, an upgrade involves the following steps:
Line 105: Line 160:
 # make [make flags] buildworld # make [make flags] buildworld
 # make [make flags] buildkernel # make [make flags] buildkernel
-# make packages+# make update-packages
 </code> </code>
  
 +Note that for make update-packages working correctly you need WITH_REPRODUCIBLE_BUILD=yes in /etc/src.conf as it compares the internal package data.
   - Upgrade the base packages:   - Upgrade the base packages:
  
Line 150: Line 206:
 </code> </code>
  
-===== Project goals and additional unresolved issues =====+===== Outstanding ===== 
 + 
 +  * No method to notify users when new base packages are created (packages that did not previously exist), and they are not installed during a ''%%pkg upgrade%%''. This is particularly problematic if files are moved from an existing package to a new dedicated package, which will result in them being deleted during the next ''%%pkg upgrade%%''. This was noticed after [[https://svnweb.freebsd.org/base?view=revision&revision=299840|r299840]], which moves ''%%/etc/rc.d/[zfs|zvol]%%'' from the existing %%FreeBSD%%-runtime package to a new %%FreeBSD%%-zfs package, and resulted in them being deleted during the next ''%%pkg upgrade%%''. 
 + 
 +  * [[https://svnweb.freebsd.org/base/head/Makefile.inc1?r1=337960&r2=337991|r337991]] fixes an issue where a user has defined DISTDIR in make.conf; the error will be that awk can't find [....]/METALOG during make packages.  11.2-RELEASE needs this patch (or wrap the DISTDIR definition with ''%%.if ! ${.CURDIR:M/usr/src*%%''}) 
 + 
 +  * certutil rehash needs to be manually run after upgrades 
 + 
 +Please follow up on the freebsd-pkgbase@ mailing list with problems (and successes). 
 + 
 +==== Goals, and additional unresolved issues ====
  
 The following items need to be addressed before PkgBase can be considered for production use: The following items need to be addressed before PkgBase can be considered for production use:
Line 178: Line 244:
     * IDEA: Ship the plist and ucl files from the build, since that is what pkg register would need.     * IDEA: Ship the plist and ucl files from the build, since that is what pkg register would need.
   * Metapkgs: The current is to implement a pkg feature called groups. See: [[https://github.com/freebsd/pkg/issues/1697|pkg#1697]]   * Metapkgs: The current is to implement a pkg feature called groups. See: [[https://github.com/freebsd/pkg/issues/1697|pkg#1697]]
 +
 +===== Retrospective =====
 +
 +A [[https://lists.freebsd.org/pipermail/freebsd-pkgbase/2016-March/000032.html|call for testing was made in March 2016]].
 +
 +Major blockers and critical issues appeared to be resolved.
  
 ==== Glen Barber's notes from the packaging session at the 2017-08 BSDCam devsummit ==== ==== Glen Barber's notes from the packaging session at the 2017-08 BSDCam devsummit ====
  
 //Userland packages sets// – can someone clarify what exactly this means? //Userland packages sets// – can someone clarify what exactly this means?
- 
-ETA? 
  
 TODO: TODO:
  • pkgbase.1596051317.txt.gz
  • Last modified: 2020/07/29 19:35
  • by EdMaste