From nobody Fri Sep 26 10:32:54 2025 X-Original-To: dev-commits-doc-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cY6Nk4hwpz685rX for ; Fri, 26 Sep 2025 10:32:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cY6Nk2m57z3Jvw; Fri, 26 Sep 2025 10:32:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1758882774; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qmgzGISGItE9a7tML/GGEkq9/sUdnU+UA2JxLF1L/q0=; b=TIkVaNDUMAa8MDndw+zB9TZ1HIeuaLsI2LFuFFRvO+PEpkaav1jqshePx6bAsNaxqqGC9X ueffLbqWzP+6qJnpzyIMCuGjhO9wv9NdhnwYDuALVviAFNNu83lbxMAyra94qqHGCeFkL+ aBHPWx30RcBFMGXv8FuJWZsmZaP4IjRCIM8HfHXsJfE4ZzmGuKkSEmE5yx7N9TtoFazh5s M7XuH5PNI6yrQfVN7m79paNSnl9CLbUcGdLgk6tKDupwyk0k5ED9gdZRwzbL3Dyl9M9cuy HoDc7ec32FTz9rOEjKZBb5UjMF54Ph+RYdbPgDoX7lO9RjqzXd7MJ2qqjkWLAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1758882774; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qmgzGISGItE9a7tML/GGEkq9/sUdnU+UA2JxLF1L/q0=; b=szIbBWoJrwW2A4Ir/KmHFgESkb0jBHYUWKmNtk26UCBe+c9yi6lo2iKiBns/j8Dkvxp9ON 1bfVOrUGyPivf/baxK9RqjxbF2hGOUNRPH7gIJ0Jja1aSXOwZ8Ijqimrn4zpQuh8nvwmQn WYOaZm78+BlMcY7CQmHb4RNnsTsG6cmAKYs6bYOVFRchg+G1NXrBt4BToMgwpEepKtTJO4 a0UWeXlNNKlVdJVtFZOz/GLp0mQ/p0Lk9mV8rGcv9ipYDO2dL72Yebn+qtL/77b409rz9p C9NPLD2vTo8BfAV1XgWVx5JPyGAjAZpTdPKmlRuXVWvK6AmN6N7b1rSNJCnKmg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1758882774; a=rsa-sha256; cv=none; b=qAGIYuAd2fbDS/f3FiSNVj0SkjUy/VJN55ABKe4bYLPrpLTRoZjgnsPZ75K3d4j+yoi6Ml W0nULAHEMg3lV/Vz8g7R3kyL9fqkUEzy4hbnpsxUAEIdC3TgPmP+t8oWqsavwtLpwpCEp4 mbDsKGqitnmZTEFuE3YDWKeJ/YLJeYyrzvLQ70/Mq29HulUEGL8lJRvaLRdglIJ661mEf9 TmQTxktKhqUIlSxjBYQZJmnlF+1kneI5Nd3M+VDD5XtMgVJIhXVx1TYspJ5R5IY0J+hdeu u6DdHJjsSJzEpCkrDupCEX8TUWtK7luHvOjzo7h4nh8WWWi9eJhR4RSedZEjzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cY6Nk2LR0zkW8; Fri, 26 Sep 2025 10:32:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 58QAWsub052741; Fri, 26 Sep 2025 10:32:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58QAWsdP052738; Fri, 26 Sep 2025 10:32:54 GMT (envelope-from git) Date: Fri, 26 Sep 2025 10:32:54 GMT Message-Id: <202509261032.58QAWsdP052738@gitrepo.freebsd.org> To: doc-committers@FreeBSD.org, dev-commits-doc-all@FreeBSD.org From: Benedict Reuschling Subject: git: dbac0b5f52 - main - Use betarel-current variable in commands to use latest FreeBSD version List-Id: Commit messages for all branches of the doc repository List-Archive: https://lists.freebsd.org/archives/dev-commits-doc-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-doc-all@freebsd.org Sender: owner-dev-commits-doc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bcr X-Git-Repository: doc X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dbac0b5f520894ec78e93dc835d821b17856a0ba Auto-Submitted: auto-generated The branch main has been updated by bcr: URL: https://cgit.FreeBSD.org/doc/commit/?id=dbac0b5f520894ec78e93dc835d821b17856a0ba commit dbac0b5f520894ec78e93dc835d821b17856a0ba Author: Polarian AuthorDate: 2025-09-26 10:24:48 +0000 Commit: Benedict Reuschling CommitDate: 2025-09-26 10:32:13 +0000 Use betarel-current variable in commands to use latest FreeBSD version It is always tedious to change hardcoded version numbers in the documentation. Use the betarel-current variable in the jails chapter to always use the latest release version in the examples. Event: EuroBSDcon Devsummit 2025 Differential Revision: https://reviews.freebsd.org/D52729 --- .../content/en/books/handbook/jails/_index.adoc | 106 ++++++++++----------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/documentation/content/en/books/handbook/jails/_index.adoc b/documentation/content/en/books/handbook/jails/_index.adoc index fd652694cc..ecc10a1a79 100644 --- a/documentation/content/en/books/handbook/jails/_index.adoc +++ b/documentation/content/en/books/handbook/jails/_index.adoc @@ -361,19 +361,19 @@ The userland for the jail can be obtained from the official FreeBSD download ser Execute the following command to download the userland: -[source,shell] +[source,shell,subs=attributes] .... -# fetch https://download.freebsd.org/ftp/releases/amd64/amd64/14.2-RELEASE/base.txz -o /usr/local/jails/media/14.2-RELEASE-base.txz +# fetch https://download.freebsd.org/ftp/releases/amd64/amd64/{betarel-current}-RELEASE/base.txz -o /usr/local/jails/media/{betarel-current}-RELEASE-base.txz .... Once the download is complete, it will be necessary to extract the contents into the jail directory. Execute the following commands to extract the userland into the jail's directory: -[source,shell] +[source,shell,subs=attributes] .... # mkdir -p /usr/local/jails/containers/classic -# tar -xf /usr/local/jails/media/14.2-RELEASE-base.txz -C /usr/local/jails/containers/classic --unlink +# tar -xf /usr/local/jails/media/{betarel-current}-RELEASE-base.txz -C /usr/local/jails/containers/classic --unlink .... With the userland extracted in the jail directory, it will be necessary to copy the timezone and DNS server files: @@ -449,56 +449,56 @@ For this reason they are created in "read-only" mode so that jails are created w To create the dataset for the template, execute the following command: -[source,shell] +[source,shell,subs=attributes] .... -# zfs create -p zroot/jails/templates/14.2-RELEASE +# zfs create -p zroot/jails/templates/{betarel-current}-RELEASE .... Then execute the following command to download the userland: -[source,shell] +[source,shell,subs=attributes] .... -# fetch https://download.freebsd.org/ftp/releases/amd64/amd64/14.2-RELEASE/base.txz -o /usr/local/jails/media/14.2-RELEASE-base.txz +# fetch https://download.freebsd.org/ftp/releases/amd64/amd64/{betarel-current}-RELEASE/base.txz -o /usr/local/jails/media/{betarel-current}-RELEASE-base.txz .... Once the download is complete, it will be necessary to extract the contents in the template directory by executing the following command: -[source,shell] +[source,shell,subs=attributes] .... -# tar -xf /usr/local/jails/media/14.2-RELEASE-base.txz -C /usr/local/jails/templates/14.2-RELEASE --unlink +# tar -xf /usr/local/jails/media/{betarel-current}-RELEASE-base.txz -C /usr/local/jails/templates/{betarel-current}-RELEASE --unlink .... With the userland extracted in the templates directory, it will be necessary to copy the timezone and DNS server files to the template directory by executing the following command: -[source,shell] +[source,shell,subs=attributes] .... -# cp /etc/resolv.conf /usr/local/jails/templates/14.2-RELEASE/etc/resolv.conf -# cp /etc/localtime /usr/local/jails/templates/14.2-RELEASE/etc/localtime +# cp /etc/resolv.conf /usr/local/jails/templates/{betarel-current}-RELEASE/etc/resolv.conf +# cp /etc/localtime /usr/local/jails/templates/{betarel-current}-RELEASE/etc/localtime .... The next thing to do is update to the latest patch level by executing the following command: -[source,shell] +[source,shell,subs=attributes] .... -# freebsd-update -b /usr/local/jails/templates/14.2-RELEASE/ fetch install +# freebsd-update -b /usr/local/jails/templates/{betarel-current}-RELEASE/ fetch install .... Once the update is finished, the template is ready. To create an OpenZFS Snapshot from the template, execute the following command: -[source,shell] +[source,shell,subs=attributes] .... -# zfs snapshot zroot/jails/templates/14.2-RELEASE@base +# zfs snapshot zroot/jails/templates/{betarel-current}-RELEASE@base .... Once the OpenZFS Snapshot has been created, infinite jails can be created using the OpenZFS clone function. To create a Thin Jail named `thinjail`, execute the following command: -[source,shell] +[source,shell,subs=attributes] .... -# zfs clone zroot/jails/templates/14.2-RELEASE@base zroot/jails/containers/thinjail +# zfs clone zroot/jails/templates/{betarel-current}-RELEASE@base zroot/jails/containers/thinjail .... The last step is to configure the jail. @@ -546,45 +546,45 @@ A jail can be created with reduced duplication of system files by using the Thin The first step is to create the dataset to save the template, execute the following command if using OpenZFS: -[source,shell] +[source,shell,subs=attributes] .... -# zfs create -p zroot/jails/templates/14.2-RELEASE-base +# zfs create -p zroot/jails/templates/{betarel-current}-RELEASE-base .... Or this one if using UFS: -[source,shell] +[source,shell,subs=attributes] .... -# mkdir /usr/local/jails/templates/14.2-RELEASE-base +# mkdir /usr/local/jails/templates/{betarel-current}-RELEASE-base .... Then execute the following command to download the userland: -[source,shell] +[source,shell,subs=attributes] .... -# fetch https://download.freebsd.org/ftp/releases/amd64/amd64/14.2-RELEASE/base.txz -o /usr/local/jails/media/14.2-RELEASE-base.txz +# fetch https://download.freebsd.org/ftp/releases/amd64/amd64/{betarel-current}-RELEASE/base.txz -o /usr/local/jails/media/{betarel-current}-RELEASE-base.txz .... Once the download is complete, it will be necessary to extract the contents in the template directory by executing the following command: -[source,shell] +[source,shell,subs=attributes] .... -# tar -xf /usr/local/jails/media/14.2-RELEASE-base.txz -C /usr/local/jails/templates/14.2-RELEASE-base --unlink +# tar -xf /usr/local/jails/media/{betarel-current}-RELEASE-base.txz -C /usr/local/jails/templates/{betarel-current}-RELEASE-base --unlink .... Once the userland is extracted in the templates directory, it will be necessary to copy the timezone and DNS server files to the template directory by executing the following command: -[source,shell] +[source,shell,subs=attributes] .... -# cp /etc/resolv.conf /usr/local/jails/templates/14.2-RELEASE-base/etc/resolv.conf -# cp /etc/localtime /usr/local/jails/templates/14.2-RELEASE-base/etc/localtime +# cp /etc/resolv.conf /usr/local/jails/templates/{betarel-current}-RELEASE-base/etc/resolv.conf +# cp /etc/localtime /usr/local/jails/templates/{betarel-current}-RELEASE-base/etc/localtime .... With the files moved to the template, the next thing to do is update to the latest patch level by executing the following command: -[source,shell] +[source,shell,subs=attributes] .... -# freebsd-update -b /usr/local/jails/templates/14.2-RELEASE-base/ fetch install +# freebsd-update -b /usr/local/jails/templates/{betarel-current}-RELEASE-base/ fetch install .... In addition to the base template, it is also necessary to create a directory where the `skeleton` will be located. @@ -592,16 +592,16 @@ Some directories will be copied from the template to the `skeleton`. Execute the following command to create the dataset for the `skeleton` in case of using OpenZFS: -[source,shell] +[source,shell,subs=attributes] .... -# zfs create -p zroot/jails/templates/14.2-RELEASE-skeleton +# zfs create -p zroot/jails/templates/{betarel-current}-RELEASE-skeleton .... Or this one in case of using UFS: -[source,shell] +[source,shell,subs=attributes] .... -# mkdir /usr/local/jails/templates/14.2-RELEASE-skeleton +# mkdir /usr/local/jails/templates/{betarel-current}-RELEASE-skeleton .... Then create the `skeleton` directories. @@ -609,22 +609,22 @@ The `skeleton` directories will hold the local directories of the jails. Execute the following commands to create the directories: -[source,shell] +[source,shell,subs=attributes] .... -# mkdir -p /usr/local/jails/templates/14.2-RELEASE-skeleton/home -# mkdir -p /usr/local/jails/templates/14.2-RELEASE-skeleton/usr -# mv /usr/local/jails/templates/14.2-RELEASE-base/etc /usr/local/jails/templates/14.2-RELEASE-skeleton/etc -# mv /usr/local/jails/templates/14.2-RELEASE-base/usr/local /usr/local/jails/templates/14.2-RELEASE-skeleton/usr/local -# mv /usr/local/jails/templates/14.2-RELEASE-base/tmp /usr/local/jails/templates/14.2-RELEASE-skeleton/tmp -# mv /usr/local/jails/templates/14.2-RELEASE-base/var /usr/local/jails/templates/14.2-RELEASE-skeleton/var -# mv /usr/local/jails/templates/14.2-RELEASE-base/root /usr/local/jails/templates/14.2-RELEASE-skeleton/root +# mkdir -p /usr/local/jails/templates/{betarel-current}-RELEASE-skeleton/home +# mkdir -p /usr/local/jails/templates/{betarel-current}-RELEASE-skeleton/usr +# mv /usr/local/jails/templates/{betarel-current}-RELEASE-base/etc /usr/local/jails/templates/{betarel-current}-RELEASE-skeleton/etc +# mv /usr/local/jails/templates/{betarel-current}-RELEASE-base/usr/local /usr/local/jails/templates/{betarel-current}-RELEASE-skeleton/usr/local +# mv /usr/local/jails/templates/{betarel-current}-RELEASE-base/tmp /usr/local/jails/templates/{betarel-current}-RELEASE-skeleton/tmp +# mv /usr/local/jails/templates/{betarel-current}-RELEASE-base/var /usr/local/jails/templates/{betarel-current}-RELEASE-skeleton/var +# mv /usr/local/jails/templates/{betarel-current}-RELEASE-base/root /usr/local/jails/templates/{betarel-current}-RELEASE-skeleton/root .... The next step is to create the symlinks to the `skeleton` by executing the following commands: -[source,shell] +[source,shell,subs=attributes] .... -# cd /usr/local/jails/templates/14.2-RELEASE-base/ +# cd /usr/local/jails/templates/{betarel-current}-RELEASE-base/ # mkdir skeleton # ln -s skeleton/etc etc # ln -s skeleton/home home @@ -638,17 +638,17 @@ With the `skeleton` ready, it will be necessary to copy the data to the jail dir In case of using OpenZFS, OpenZFS snapshots can be used to easily create as many jails as necessary by executing the following commands: -[source,shell] +[source,shell,subs=attributes] .... -# zfs snapshot zroot/jails/templates/14.2-RELEASE-skeleton@base -# zfs clone zroot/jails/templates/14.2-RELEASE-skeleton@base zroot/jails/containers/thinjail +# zfs snapshot zroot/jails/templates/{betarel-current}-RELEASE-skeleton@base +# zfs clone zroot/jails/templates/{betarel-current}-RELEASE-skeleton@base zroot/jails/containers/thinjail .... In case of using UFS the man:cp[1] program can be used by executing the following command: -[source,shell] +[source,shell,subs=attributes] .... -# cp -R /usr/local/jails/templates/14.2-RELEASE-skeleton /usr/local/jails/containers/thinjail +# cp -R /usr/local/jails/templates/{betarel-current}-RELEASE-skeleton /usr/local/jails/containers/thinjail .... Then create the directory in which the base template and the skeleton will be mounted: @@ -688,9 +688,9 @@ thinjail { Then the create the [.filename]#/usr/local/jails/thinjail-nullfs-base.fstab# file as follows: -[.programlisting] +[.programlisting,subs=attributes] .... -/usr/local/jails/templates/14.2-RELEASE-base /usr/local/jails/thinjail-nullfs-base/ nullfs ro 0 0 +/usr/local/jails/templates/{betarel-current}-RELEASE-base /usr/local/jails/thinjail-nullfs-base/ nullfs ro 0 0 /usr/local/jails/containers/thinjail /usr/local/jails/thinjail-nullfs-base/skeleton nullfs rw 0 0 ....