User Tools

Site Tools


documentation:technical_docs:poudriere

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
documentation:technical_docs:poudriere [2023/10/10 19:15] – [Generating firmware image] olivierdocumentation:technical_docs:poudriere [2024/11/18 19:11] (current) – [Build packages] olivier
Line 43: Line 43:
  
 Using poudriere from a ZFS is not mandatory but strongly advised. Using poudriere from a ZFS is not mandatory but strongly advised.
-  - Install poudriere and configure it: <code>pkg install poudriere-devel +  - Install poudriere and configure it: <code>sudo pkg install poudriere-devel 
-echo "ZPOOL="`zpool list -H | cut -f1` >> /usr/local/etc/poudriere.conf</code> +echo "ZPOOL="`zpool list -H | cut -f1` | sudo tee -a /usr/local/etc/poudriere.conf</code> 
-  - Create a poudriere jail WITH a GENERIC kernel (by default kernel is not build & installed), here named "router":  <code>poudriere jail -c -j router -v 13.2-RELEASE -K GENERIC</code> +  - Create a poudriere jail WITH a GENERIC kernel (by default kernel is not build & installed), here named "router":  <code>sudo poudriere jail -c -j router -v 14.2-RELEASE -K GENERIC</code> 
-  - Create a port-tree using "poudriere ports":<code>poudriere ports -c -p router-ports</code>+  - Create a port-tree using "poudriere ports":<code>sudo poudriere ports -c -p router_ports</code>
   - Generate list of ports to be build & added into the firmware image:<code>   - Generate list of ports to be build & added into the firmware image:<code>
 cat > ~/router-pkglist <<EOF cat > ~/router-pkglist <<EOF
 sysutils/tmux sysutils/tmux
-net/frr9+net/frr10
 net/bird2 net/bird2
 net/mpd5 net/mpd5
 EOF</code> EOF</code>
-  - Build the ports (ie: generate binary packages) from the corresponding jail using "poudriere bulk":<code>poudriere bulk -j router -p router-ports -f ~/router-pkglist</code>+  - Build the ports (ie: generate binary packages) from the corresponding jail using "poudriere bulk":<code>sudo poudriere bulk -j router -p router_ports -f ~/router-pkglist</code>
   - Generate your disk image (4Gb total, because 2 systems partitions of 2Gb) using "poudriere image": <code>   - Generate your disk image (4Gb total, because 2 systems partitions of 2Gb) using "poudriere image": <code>
-poudriere image -t firmware -j router -s 4g -p router-ports -h router -n router -f ~/router-pkglist+sudo poudriere image -t firmware -j router -s 4g -p router_ports -h router -n router -f ~/router-pkglist
 (...) (...)
 [00:00:15] Creating ESP image [00:00:15] Creating ESP image
Line 151: Line 151:
 | Build a specific kernel file  | Just had to install custom kernel int the custom source tree | Customized kernel | | Build a specific kernel file  | Just had to install custom kernel int the custom source tree | Customized kernel |
 | Build only list of kernel modules | Declaring MODULES_OVERRIDE in -src.conf | Customized module list | | Build only list of kernel modules | Declaring MODULES_OVERRIDE in -src.conf | Customized module list |
-| Advanced scripting for building non-ports softwares | FIXME Not available, no idea of how to cleanly add this feature | Need to build some of /usr/src/tools |+| Advanced scripting for building non-ports softwares | Solution should be to create a port | Need to build some of /usr/src/tools |
 | Advanced tuning of final image | -A post-script and -B pre-script | Generating a mtree (for host-IDS), creating specific users | | Advanced tuning of final image | -A post-script and -B pre-script | Generating a mtree (for host-IDS), creating specific users |
 | Building ports using own (outdated) embedded script | NATIVE role of poudriere | Adding ports to image | | Building ports using own (outdated) embedded script | NATIVE role of poudriere | Adding ports to image |
 | System upgrade by changing MBR active mode on system partition | System upgrade by setting "bootonce" attribute on system partition (and need to be removed from older?) | Upgrading system partition (new/old)| | System upgrade by changing MBR active mode on system partition | System upgrade by setting "bootonce" attribute on system partition (and need to be removed from older?) | Upgrading system partition (new/old)|
 +
 +===== poudriere-image patches =====
 +
 +List of mandatory patches for poudriere in Pull-request review:
 +  * [[https://github.com/freebsd/poudriere/issues/1181|Overlay permission bug on the final image]]
 +
 +Merged patches:
 +  * [[https://github.com/freebsd/poudriere/pull/1141|Optimize disk space for space]]
 +  * [[https://github.com/freebsd/poudriere/pull/1139|Need to replace loader.efi by gptboot.efi to use GPT attribute bootonce and bootme]]
 +  * [[https://github.com/freebsd/poudriere/pull/1140|Need to generate the upgrade image too]]
 +  * [[https://github.com/freebsd/poudriere/commit/2fa915c41d2786aad80b8e59ba07a4f0161df794|Fix default permissions to cfg and data partitions]]
 +  * [[https://github.com/freebsd/poudriere/commit/6b07d209c579ddf01a4fab947c4efd9683e6778a|Add bytes to bibytes conversion regarding image size]]
 +  * [[https://github.com/freebsd/poudriere/commit/48d15c2a0aff88816ad255d5beefc9ca0c04727b|Generate /etc/os-release]]
 +  * [[https://github.com/freebsd/poudriere/commit/32086a1c130380832c872b5d8eb31553e78e9242|Fix excludelist path]]
 ====== Customized poudriere image for BSDRP ====== ====== Customized poudriere image for BSDRP ======
  
Line 174: Line 188:
 Then need other configuration files: Then need other configuration files:
   * BSDRP-pkglist : List of packages to be build and included in the final image   * BSDRP-pkglist : List of packages to be build and included in the final image
-  * A kernel configuration file: I'm using the BSDRP amd64 configuration+  * A kernel configuration file: I'm using the [[https://github.com/ocochard/BSDRP/blob/master/BSDRP/kernels/amd64|BSDRP amd64 configuration]]
   * excluded.files: A list of file we want to be exculed during the installworld   * excluded.files: A list of file we want to be exculed during the installworld
-  * overlaydir/usr/local/etc/pkg.conf: with a FILES_IGNORE_GLOB list that will exclude files from being extracted during packages installation+  * [[https://github.com/ocochard/BSDRP/blob/master/BSDRP/Files/usr/local/etc/pkg.conf|overlaydir/usr/local/etc/pkg.conf]]: with a FILES_IGNORE_GLOB list that will exclude files from being extracted during packages installation
 ==== poudriere.d/BSDRPj-src.conf ==== ==== poudriere.d/BSDRPj-src.conf ====
  
Line 212: Line 226:
 The [[https://github.com/ocochard/BSDRP/blob/master/poudriere.etc/poudriere.d/excluded.files|excluded.files ]] is on github. The [[https://github.com/ocochard/BSDRP/blob/master/poudriere.etc/poudriere.d/excluded.files|excluded.files ]] is on github.
  
 +==== Packages excluded files ====
  
 +When customizing ports options, some could not be disabled but we could configure pkg to not install some files from packages while extracting them.
 +
 +The [[https://github.com/ocochard/BSDRP/blob/master/BSDRP/Files/usr/local/etc/pkg.conf|customized pkg.conf]] is on github.
  
 ===== Building the jail ===== ===== Building the jail =====
Line 219: Line 237:
 The simplest solution is to re-use already existing BSDRP patched source tree: specific kernel configuration files can be installed into these source tree and use after. The simplest solution is to re-use already existing BSDRP patched source tree: specific kernel configuration files can be installed into these source tree and use after.
  
-Start by only patching BSDRP sources (sources and ports) using the [[https://github.com/ocochard/BSDRP/blob/master/make.sh|BSDRP make.sh]] script:+Start by only patching BSDRP sources (sources and ports) using the [[https://github.com/ocochard/BSDRP/blob/master/Makefile|BSDRP makefile]]:
 <code> <code>
-./make.sh -+make patch-sources
-Update ONLY done+
 </code> </code>
  
-There is now 2 sources ready patched: +There are now 2 sources ready patched: 
-  * /usr/local/BSDRP/BSDRP/FreeBSD/src (including BSDRP specific kernel configuration file) +  * obj/FreeBSD (including BSDRP specific kernel configuration file) 
-  * /usr/local/BSDRP/BSDRP/FreeBSD/ports +  * obj/ports
  
 <code> <code>
-poudriere jail -c -j BSDRPj -b -m src=/usr/local/BSDRP/BSDRP/FreeBSD/src -K amd64+poudriere jail -e poudriere.etc -c -j BSDRPj -b -m src=obj/FreeBSD -K amd64
 </code> </code>
 Command line details: Command line details:
Line 237: Line 253:
   * -c: create a jail   * -c: create a jail
   * -j: SHORT name for the jail (I can't use BSDRP-amd64-10.3R here because later it will generate a long directory name and long name aren't well supported)   * -j: SHORT name for the jail (I can't use BSDRP-amd64-10.3R here because later it will generate a long directory name and long name aren't well supported)
 +  * -e: Load all configurations files from ./poudriere.etc
   * -m src=: Path to the patched source branch we want to use   * -m src=: Path to the patched source branch we want to use
   * -K: The kernel configuration file (was copied here during patching BSDRP code tree)   * -K: The kernel configuration file (was copied here during patching BSDRP code tree)
Line 245: Line 262:
  
 <code> <code>
-poudriere ports -c -p BSDRPp -m null -M /usr/local/BSDRP/BSDRP/FreeBSD/ports+poudriere ports -e poudriere.etc -c -p BSDRPp -m null -M obj/ports
 </code> </code>
  
Line 252: Line 269:
 poudriere native role, we just give the jail name and port-tree name to use then the list of packages. poudriere native role, we just give the jail name and port-tree name to use then the list of packages.
 <code> <code>
-poudriere bulk -j BSDRPj -p BSDRPp -f /usr/local/etc/poudriere.d/BSDRP-pkglist+poudriere bulk -e poudriere.etc -j BSDRPj -p BSDRPp -f /usr/local/etc/poudriere.d/BSDRP-pkglist.common
 </code> </code>
  
documentation/technical_docs/poudriere.1696958108.txt.gz · Last modified: 2023/10/10 19:15 by olivier

Except where otherwise noted, content on this wiki is licensed under the following license: BSD 2-Clause
Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki