<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>2 | FreeBSD Foundation</title>
	<atom:link href="https://freebsdfoundation.org/difficulty-level/2/feed/" rel="self" type="application/rss+xml" />
	<link>https://freebsdfoundation.org</link>
	<description>A non-profit organization dedicated to supporting and building the FreeBSD Project</description>
	<lastBuildDate>Fri, 10 May 2024 14:17:17 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://freebsdfoundation.org/wp-content/uploads/2015/12/favicon.png</url>
	<title>2 | FreeBSD Foundation</title>
	<link>https://freebsdfoundation.org</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>An Introduction to Dynamic Tracing</title>
		<link>https://freebsdfoundation.org/resource/an-introduction-to-dynamic-tracing/</link>
		
		<dc:creator><![CDATA[Anne Dickison]]></dc:creator>
		<pubDate>Sun, 10 Dec 2023 15:16:31 +0000</pubDate>
				<guid isPermaLink="false">https://freebsdfoundation.org/?post_type=resource&#038;p=13494</guid>

					<description><![CDATA[<p>DTrace, or Dynamic Tracing, is a performance analysis and troubleshooting tool included by default with FreeBSD. DTrace can help locate performance bottlenecks in production systems and can be used to patch live running instructions. In addition to diagnosing performance problems, DTrace can help investigate and debug unexpected behavior in both the FreeBSD kernel and userland [&#8230;]</p>
<p>The post <a href="https://freebsdfoundation.org/resource/an-introduction-to-dynamic-tracing/">An Introduction to Dynamic Tracing</a> first appeared on <a href="https://freebsdfoundation.org">FreeBSD Foundation</a>.</p>]]></description>
										<content:encoded><![CDATA[<section class="block block-classic-editor">
<div class="sect1">
<p>DTrace, or Dynamic Tracing, is a performance analysis and troubleshooting tool included by default with FreeBSD. DTrace can help locate performance bottlenecks in production systems and can be used to patch live running instructions. In addition to diagnosing performance problems, DTrace can help investigate and debug unexpected behavior in both the FreeBSD kernel and userland programs.</p>
<div class="sectionbody">
<div class="paragraph">
<p>DTrace provides its own language (D Language) to help users author utilities that are customized to specific needs. While this introductory guide won&#8217;t cover writing scripts in D, more detailed information can be <a href="https://illumos.org/books/dtrace/preface.html#preface">found here.</a></p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="dtrace-enable">Enabling DTrace Support</h2>
</div>
<p>To start, all necessary modules will need to be loaded with:</p>
<p><code># kldload dtraceall</code></p>
<p>The DTrace Toolkit has several utilities written in <code>ksh</code>, so support for the Korn shell to fully utilize the system will be needed. </p>
<p><code># pkg install ksh93</code></p>
<div class="sect1">
<div class="sectionbody">
<div class="paragraph">
<p>The toolkit itself can be installed with:</p>
<p><code># pkg install dtrace-toolkit</code></p>
<p>This includes a variety of pre-made scripts for diagnosing system information. It&#8217;s important to note that not all of these scripts have been specifically ported to FreeBSD and may need manual configuration. Many of the toolkit scripts are written in the D Language, which is similar to C++.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="dtrace-using">Monitoring DTrace </h2>
<p>DTrace utilizes probes, which are instrumentation points for capturing event data. Each probe is associated with its own action. Whenever the condition for a probe is met, the associated action is executed. Possible actions include logging information and modifying context variables. </p>
<div class="sectionbody">
<div class="paragraph">
<p>To check if DTrace was successfully loaded, and to list all active probes, execute the following: </p>
</div>
<div class="listingblock">
<div class="content">
<p class="rouge highlight"><code data-lang="shell"><span class="c"># dtrace -l | more</span></code></p>
</div>
</div>
<div class="paragraph">
<p>This will list each probe as well as the ID, Provider, module, and function name.</p>
<p><code># dtrace -l | wc -l</code></p>
<p>This command will list the number of available probes, helpful for monitoring what probes can be enabled on each system.</p>
</div>
<div class="paragraph">
<p>For more information on probe identifiers, refer to <a href="https://man.freebsd.org/cgi/man.cgi?query=dtrace&amp;sektion=1&amp;format=html">dtrace(1)</a>.</p>
<h2 id="dtrace-using">Enabling Probes</h2>
</div>
</div>
</div>
<p>Probes can be enabled with the <code>dtrace</code> command, omitting the -l option from the previous section. For enabled probes, DTrace will perform the default action, indicating that the probe has been fired, but not collecting any further event data. </p>
<p>You can use the <code>dtrace:::BEGIN</code> probe to fire when DTrace starts:</p>
<p><code># dtrace -n dtrace:::BEGIN</code></p>
<p>Additionally, an action can be assigned to each probe. Actions enable DTrace to interact with the system outside of the DTrace framework. These actions range from recording data, stopping a current process, raising signals on a process, or stop tracing.</p>
<p><code># dtrace -n 'dtrace:::BEGIN { printf("Hello FreeBSD!\n"); }'</code></p>
<p>Use the<code> Ctrl+C key</code> combination to stop the process.</p>
<p>This modification on the previous command includes a specified action to display &#8220;Hello FreeBSD!&#8221; when DTrace starts.</p>
<p>An action can be assigned to each probe, allowing a massive amount of customization on what is monitored and the specific action DTrace executes when it is fired. Another possible use would be to set an action to the <code>syscall::open*:entry</code> to trace file opens as they happen.</p>
<h2 id="dtrace-using">Using DTrace Scripts</h2>
<div class="sect1">
<div class="sectionbody">
<div class="paragraph">
<p>Some pre-made DTrace scripts can be found in the DTrace toolkit. It&#8217;s a good idea to check if one already exists there before creating your own, though customization is still possible.</p>
</div>
<div class="paragraph">
<p>The <code><span class="filename">hotkernel</span></code> script is designed to identify which function is using the most kernel time. It will produce output similar to the following:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="shell"><span class="c"># cd /usr/local/share/dtrace-toolkit</span>
<span class="c"># ./hotkernel</span>
Sampling... Hit Ctrl-C to end.</code></pre>
<div class="copy-to-clipboard-wrapper">Upon termination, the script will display a list of kernel functions and timing information, sorting the output in increasing order of time:</div>
</div>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="shell">kernel<span class="sb">`</span>_thread_lock_flags                                   2   0.0%
0xc1097063                                                  2   0.0%
kernel<span class="sb">`</span>sched_userret                                        2   0.0%
kernel<span class="sb">`</span>kern_select                                          2   0.0%
kernel<span class="sb">`</span>generic_copyin                                       3   0.0%
kernel<span class="sb">`</span>_mtx_assert                                          3   0.0%
kernel<span class="sb">`</span>vm_fault                                             3   0.0%
kernel<span class="sb">`</span>sopoll_generic                                       3   0.0%
kernel<span class="sb">`</span>fixup_filename                                       4   0.0%
kernel<span class="sb">`</span>_isitmyx                                             4   0.0%
kernel<span class="sb">`</span>find_instance                                        4   0.0%
kernel<span class="sb">`</span>_mtx_unlock_flags                                    5   0.0%
kernel<span class="sb">`</span>syscall                                              5   0.0%
kernel<span class="sb">`</span>DELAY                                                5   0.0%
0xc108a253                                                  6   0.0%
kernel<span class="sb">`</span>witness_lock                                         7   0.0%
kernel<span class="sb">`</span>read_aux_data_no_wait                                7   0.0%
kernel<span class="sb">`</span>Xint0x80_syscall                                     7   0.0%
kernel<span class="sb">`</span>witness_checkorder                                   7   0.0%
kernel<span class="sb">`</span>sse2_pagezero                                        8   0.0%
kernel<span class="sb">`</span>strncmp                                              9   0.0%
kernel<span class="sb">`</span>spinlock_exit                                       10   0.0%
kernel<span class="sb">`</span>_mtx_lock_flags                                     11   0.0%
kernel<span class="sb">`</span>witness_unlock                                      15   0.0%
kernel<span class="sb">`</span>sched_idletd                                       137   0.3%
0xc10981a5                                              42139  99.3%</code></pre>
</div>
</div>
<div class="paragraph">
<p>This script will also work with kernel modules. To use this feature, run the script with <code>-m</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="shell"><span class="c"># ./hotkernel -m</span></code></pre>
</div>
</div>
<div class="paragraph">Other scripts can be run in a similar way, for a full list of pre-made DTrace scripts refer to the <a href="https://github.com/opendtrace/toolkit">dtrace-toolbox github repository</a>.</div>
</div>
<div> </div>
</div>
</section><p>The post <a href="https://freebsdfoundation.org/resource/an-introduction-to-dynamic-tracing/">An Introduction to Dynamic Tracing</a> first appeared on <a href="https://freebsdfoundation.org">FreeBSD Foundation</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Using FreeBSD as a Virtual Host &#8211; Quick Guide</title>
		<link>https://freebsdfoundation.org/resource/using-freebsd-as-a-virtual-host-quick-guide/</link>
		
		<dc:creator><![CDATA[Anne Dickison]]></dc:creator>
		<pubDate>Tue, 30 May 2023 18:34:09 +0000</pubDate>
				<guid isPermaLink="false">https://freebsdfoundation.org/?post_type=resource&#038;p=12280</guid>

					<description><![CDATA[<p>Installing VirtualBox™ Note: To run VirtualBox™, an Xorg session is needed. Refer to the handbook&#8217;s section on the X Window System to install and configure Xorg. VirtualBox™ is available as a FreeBSD package or port in emulators/virtualbox-ose. To quickly install the package:  # pkg install virtualbox-ose The kernel module vboxdrv will need to be loaded before [&#8230;]</p>
<p>The post <a href="https://freebsdfoundation.org/resource/using-freebsd-as-a-virtual-host-quick-guide/">Using FreeBSD as a Virtual Host – Quick Guide</a> first appeared on <a href="https://freebsdfoundation.org">FreeBSD Foundation</a>.</p>]]></description>
										<content:encoded><![CDATA[<section class="block block-classic-editor">
<div class="sect2">
<h2><img fetchpriority="high" decoding="async" class=" wp-image-12411 aligncenter" src="https://freebsdfoundation.org/wp-content/uploads/2023/05/Untitled-design-32-1024x256.png" alt="" width="1048" height="262" srcset="https://freebsdfoundation.org/wp-content/uploads/2023/05/Untitled-design-32-1024x256.png 1024w, https://freebsdfoundation.org/wp-content/uploads/2023/05/Untitled-design-32-300x75.png 300w, https://freebsdfoundation.org/wp-content/uploads/2023/05/Untitled-design-32-1536x384.png 1536w, https://freebsdfoundation.org/wp-content/uploads/2023/05/Untitled-design-32-2048x512.png 2048w, https://freebsdfoundation.org/wp-content/uploads/2023/05/Untitled-design-32.png 1920w" sizes="(max-width: 1048px) 100vw, 1048px" /></h2>
<h2 id="virtualization-virtualbox-install">Installing VirtualBox<img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2122.png" alt="™" class="wp-smiley" style="height: 1em; max-height: 1em;" /></h2>
</div>
<p><strong>Note: To run VirtualBox<img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2122.png" alt="™" class="wp-smiley" style="height: 1em; max-height: 1em;" />, an Xorg session is needed. Refer to the handbook&#8217;s section on <a href="https://docs.freebsd.org/en/books/handbook/x11/#x-install">the X Window System</a> to install and configure Xorg.</strong></p>
<div class="sect2">
<div class="paragraph">
<p>VirtualBox<img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2122.png" alt="™" class="wp-smiley" style="height: 1em; max-height: 1em;" /> is available as a FreeBSD package or port in <a class="package" href="https://cgit.freebsd.org/ports/tree/emulators/virtualbox-ose/">emulators/virtualbox-ose</a>. To quickly install the package: </p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="shell"><span class="c"># pkg install virtualbox-ose</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>The kernel module <code>vboxdrv</code> will need to be loaded before VirtualBox<img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2122.png" alt="™" class="wp-smiley" style="height: 1em; max-height: 1em;" /> is started for the first time: </p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="shell"><span class="c"># kldload vboxdrv</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>To ensure the module is always loaded after a reboot, add this line to <code><span class="filename">/boot/loader.conf</span>:</code></p>
</div>
<div class="literalblock programlisting">
<div class="content">
<pre>vboxdrv_load="YES"</pre>
</div>
</div>
<div class="paragraph">
<p>To use the kernel modules that allow bridged or host-only networking, add this line to <code><span class="filename">/etc/rc.conf</span></code> and reboot the computer:</p>
</div>
<div class="literalblock programlisting">
<div class="content">
<pre>vboxnet_enable="YES"</pre>
</div>
</div>
<div class="paragraph">
<p>The <code>vboxusers</code> group is created during installation of VirtualBox<img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2122.png" alt="™" class="wp-smiley" style="height: 1em; max-height: 1em;" />. All users that need access to VirtualBox<img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2122.png" alt="™" class="wp-smiley" style="height: 1em; max-height: 1em;" /> will have to be added as members of this group. <code>pw</code> can be used to add new members:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="shell"><span class="c"># pw groupmod vboxusers -m yourusername</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>The default permissions for <span class="filename">/dev/vboxnetctl</span> are restrictive and need to be changed for bridged networking. To permanently change these permissions, add these lines to <code><span class="filename">/etc/devfs.conf</span></code>:</p>
</div>
<div class="literalblock programlisting">
<div class="content">
<pre>own     vboxnetctl root:vboxusers
perm    vboxnetctl 0660</pre>
</div>
</div>
<div class="paragraph">
<p>To launch VirtualBox<img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2122.png" alt="™" class="wp-smiley" style="height: 1em; max-height: 1em;" />, type from an Xorg session:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="shell"># VirtualBox</code></pre>
</div>
<div class="copy-to-clipboard-wrapper"> </div>
</div>
</div>
<div class="sect2">
<h2 id="virtualization-virtualbox-usb-support">VirtualBox<img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2122.png" alt="™" class="wp-smiley" style="height: 1em; max-height: 1em;" /> USB Support</h2>
<div class="paragraph">
<p>Users will need to be members of the <code>operator</code> group For VirtualBox<img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2122.png" alt="™" class="wp-smiley" style="height: 1em; max-height: 1em;" /> to be aware of USB devices.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="shell"><span class="c"># pw groupmod operator -m yourusername</span></code></pre>
<div class="copy-to-clipboard-wrapper">Then, add the following to <span class="filename">/etc/devfs.rules</span>, or create this file if it does not exist yet:</div>
</div>
</div>
<div class="literalblock programlisting">
<div class="content">
<pre>[system=10]
add path 'usb/*' mode 0660 group operator</pre>
</div>
</div>
<div class="paragraph">
<p>To load these new rules, add the following to <span class="filename">/etc/rc.conf</span>:</p>
</div>
<div class="literalblock programlisting">
<div class="content">
<pre>devfs_system_ruleset="system"</pre>
</div>
</div>
<div class="paragraph">
<p>Then, restart devfs:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="shell"><span class="c"># service devfs restart</span></code></pre>
<div class="copy-to-clipboard-wrapper">Both the login session and VirtualBox<img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2122.png" alt="™" class="wp-smiley" style="height: 1em; max-height: 1em;" /> will need to be restarted for any changed to take effect.</div>
</div>
</div>
</div>
<div class="sect2">
<h2> </h2>
<h2 id="virtualization-virtualbox-host-dvd-cd-access">VirtualBox<img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2122.png" alt="™" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Host DVD/CD Access</h2>
<div class="paragraph">
<p>The HAL daemon needs to run for VirtualBox<img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2122.png" alt="™" class="wp-smiley" style="height: 1em; max-height: 1em;" /> DVD/CD functions to work, so enable it in <code><span class="filename">/etc/rc.conf</span></code> and start it if it is not already running:</p>
</div>
<div class="literalblock programlisting">
<div class="content">
<pre>hald_enable="YES"</pre>
</div>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="shell"><span class="c"># service hald start</span></code></pre>
<div class="copy-to-clipboard-wrapper">A variety of user permissions will need to be edited in order to access<code><span class="filename">/dev/xpt0</span></code>, <code><span class="filename">/dev/cdN</span></code>, and <code><span class="filename">/dev/passN</span></code>. This is usually achieved by making the user a member of <code>operator</code>. Permissions to these devices have to be corrected by adding these lines to <code><span class="filename">/etc/devfs.conf</span></code>:</div>
</div>
</div>
<div class="literalblock programlisting">
<div class="content">
<pre>perm cd* 0660
perm xpt0 0660
perm pass* 0660</pre>
</div>
</div>
<div class="listingblock">
<div class="content">
<p class="rouge highlight"><code data-lang="shell"><span class="c"># service devfs restart</span></code></p>
<p>This quick guide is intended to get VirtualBox<img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2122.png" alt="™" class="wp-smiley" style="height: 1em; max-height: 1em;" /> running on your FreeBSD device, however, the scope and scale of further configuration of your virtual machine would be unfit for a quick guide. The VirtualBox<img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2122.png" alt="™" class="wp-smiley" style="height: 1em; max-height: 1em;" /> handbook offers a massive amount of information on how to best use and set up your FreeBSD machine. While VirtualBox<img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2122.png" alt="™" class="wp-smiley" style="height: 1em; max-height: 1em;" /> can run on FreeBSD, it is not a supported host platform for the extension pack. Installation of the Pack will not extend the feature set</p>
</div>
</div>
</div>
</section><p>The post <a href="https://freebsdfoundation.org/resource/using-freebsd-as-a-virtual-host-quick-guide/">Using FreeBSD as a Virtual Host – Quick Guide</a> first appeared on <a href="https://freebsdfoundation.org">FreeBSD Foundation</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Video Playback on FreeBSD &#8211; Quick Guide</title>
		<link>https://freebsdfoundation.org/resource/video-playback-on-freebsd-quick-guide/</link>
		
		<dc:creator><![CDATA[Anne Dickison]]></dc:creator>
		<pubDate>Thu, 01 Sep 2022 20:26:36 +0000</pubDate>
				<guid isPermaLink="false">https://freebsdfoundation.org/?post_type=resource&#038;p=11665</guid>

					<description><![CDATA[<p>In this guide, we&#8217;ll use the xine video player to set up basic video playback on a fresh FreeBSD install. The xine multimedia player relies on the XWindow system and the XVideo extension to provide a graphical video playback interface. System Requirements: Xorg supports a wide variety of video cards, but not all are supported [&#8230;]</p>
<p>The post <a href="https://freebsdfoundation.org/resource/video-playback-on-freebsd-quick-guide/">Video Playback on FreeBSD – Quick Guide</a> first appeared on <a href="https://freebsdfoundation.org">FreeBSD Foundation</a>.</p>]]></description>
										<content:encoded><![CDATA[<section class="block block-classic-editor"><p></section><section class="block block-core-paragraph"></p>
<p>In this guide, we&#8217;ll use the xine video player to set up basic video playback on a fresh FreeBSD install. The xine multimedia player relies on the XWindow system and the XVideo extension to provide a graphical video playback interface.</p>
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter size-large is-resized"><img decoding="async" class="wp-image-11627" src="https://freebsdfoundation.org/wp-content/uploads/2022/08/Untitled-design-23-1024x576.png" alt="" width="840" height="472" srcset="https://freebsdfoundation.org/wp-content/uploads/2022/08/Untitled-design-23-1024x576.png 1024w, https://freebsdfoundation.org/wp-content/uploads/2022/08/Untitled-design-23-300x169.png 300w, https://freebsdfoundation.org/wp-content/uploads/2022/08/Untitled-design-23-1536x864.png 1536w, https://freebsdfoundation.org/wp-content/uploads/2022/08/Untitled-design-23.png 1920w" sizes="(max-width: 840px) 100vw, 840px" /></figure>
<p></section></div>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading">System Requirements:</h2>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Xorg supports a wide variety of video cards, but not all are supported or offer good video playback performance.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>It is a good idea to have a short MPEG test file for evaluating various players and options. Since some <code>DVD</code> applications look for <code>DVD</code> media in /dev/dvd by default, or have this device name hardcoded in them, it might be useful to make a symbolic link to the proper device:</p>
<p></section>
<section class="block block-core-code"></p>
<pre class="wp-block-code"><code># ln -sf /dev/cd0 /dev/dvd</code></pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Due to the nature of <a href="https://www.freebsd.org/cgi/man.cgi?query=devfs&amp;sektion=5&amp;format=html">devfs(5)</a>, manually created links will not persist after a system reboot. In order to recreate the symbolic link automatically when the system boots, add the following line to /etc/devfs.conf:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted">link cd0 dvd</pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>&nbsp;</p>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading" id="video-interface">Installing Xorg</h2>
<p></section>
<section class="block block-core-paragraph"></p>
<p>There are several possible ways to display video under Xorg and what works is largely hardware dependent. This guide will focus on the Xvideo extension which allows video to be directly displayed, even on low-end machines.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Start by installing the X Window System:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"># <code>pkg install -y xorg</code></pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Once the package has been fully installed, the X Window System can be started with:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"># <code>startx</code></pre>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading" id="video-interface-xvideo">XVideo Support</h2>
<p></section>
<section class="block block-core-paragraph"></p>
<p>To check whether the Xvideo extension is running, use <code>xvinfo</code>:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"><code>xvinfo</code></pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>If XVideo is supported, the result will look similar to the example below and may include screen and video card information.</p>
<p></section>
<section class="block block-core-code"></p>
<pre class="wp-block-code"><code>X-Video Extension version 2.2
  screen #0
  Adaptor #0: "Example Engine"
    number of ports: 1
    port base: 43
     
       .   .    .</code></pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>&nbsp;</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>XVideo is likely unsupported by the video card if the result instead look like:</p>
<p></section>
<section class="block block-core-code"></p>
<pre class="wp-block-code"><code>X-Video Extension version 2.2
screen #0
no adaptors present</code></pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The display may be unable to meet the demands of rendering video playback if XVideo is unsupported (though this is not always the case).</p>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading">The xine Video Player</h2>
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter size-full"><img decoding="async" width="618" height="235" class="wp-image-11650" src="https://freebsdfoundation.org/wp-content/uploads/2022/09/Screenshot-2022-09-01-154324.png" alt="" srcset="https://freebsdfoundation.org/wp-content/uploads/2022/09/Screenshot-2022-09-01-154324.png 618w, https://freebsdfoundation.org/wp-content/uploads/2022/09/Screenshot-2022-09-01-154324-300x114.png 300w" sizes="(max-width: 618px) 100vw, 618px" /></figure>
<p></section></div>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-paragraph"></p>
<p>xine is a free multimedia player. It plays back CDs, DVDs, BluRays and VCDs. It also decodes multimedia files like AVI, MOV, WMV, and MP3 from local disk drives, and displays multimedia streamed over the Internet. Get started by installing the package:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"><code># pkg install -y xine</code></pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>In practice, xine requires either a fast CPU or support for the XVideo extension. The xine video player performs best on XVideo interfaces. If in the previous step, the Xvideo extension was unsupported, issues may occur.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The xine player starts a graphical user interface (GUI) and the menus can be used to navigate to multimedia files.</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"><code># xine</code></pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Alternatively, xine may be directly invoked from the command line by specifying the name of the file to play:</p>
<p></section>
<section class="block block-core-code"></p>
<pre class="wp-block-code"><code># xine -g -p mymovie.avi</code></pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>You now have a simple way to play a variety of multimedia files on your FreeBSD system! To find out more about the xine player, refer to the <a href="https://sourceforge.net/projects/xine/" target="_blank" rel="noreferrer noopener">SourceForge page</a>.</p>
<p></section><section class="block block-classic-editor"></p></section><p>The post <a href="https://freebsdfoundation.org/resource/video-playback-on-freebsd-quick-guide/">Video Playback on FreeBSD – Quick Guide</a> first appeared on <a href="https://freebsdfoundation.org">FreeBSD Foundation</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Installing a Port on FreeBSD &#8211; Video Guide</title>
		<link>https://freebsdfoundation.org/resource/installing-a-port-on-freebsd-video-guide-2/</link>
		
		<dc:creator><![CDATA[Anne Dickison]]></dc:creator>
		<pubDate>Mon, 22 Aug 2022 16:53:35 +0000</pubDate>
				<guid isPermaLink="false">https://freebsdfoundation.org/?post_type=resource&#038;p=11539</guid>

					<description><![CDATA[<p>FreeBSD offers two primary methods of downloading applications and system tools: packages and ports. This video guide focuses on using the port collection to install irssi, a powerful and modular text-based Internet Relay Chat (IRC) client.</p>
<p>The post <a href="https://freebsdfoundation.org/resource/installing-a-port-on-freebsd-video-guide-2/">Installing a Port on FreeBSD – Video Guide</a> first appeared on <a href="https://freebsdfoundation.org">FreeBSD Foundation</a>.</p>]]></description>
										<content:encoded><![CDATA[<section class="block block-classic-editor">
<p><iframe title="YouTube video player" src="//www.youtube.com/embed/lywkQkTXMEY" width="1000" height="550" frameborder="0" allowfullscreen="allowfullscreen"></iframe></p>
</section><p>The post <a href="https://freebsdfoundation.org/resource/installing-a-port-on-freebsd-video-guide-2/">Installing a Port on FreeBSD – Video Guide</a> first appeared on <a href="https://freebsdfoundation.org">FreeBSD Foundation</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>InstallFest How-To Guide P2</title>
		<link>https://freebsdfoundation.org/resource/installfest-how-to-guide-p2/</link>
		
		<dc:creator><![CDATA[Anne Dickison]]></dc:creator>
		<pubDate>Mon, 15 Aug 2022 18:47:47 +0000</pubDate>
				<guid isPermaLink="false">https://freebsdfoundation.org/?post_type=resource&#038;p=11570</guid>

					<description><![CDATA[<p>The second part of our in depth guide to running your own FreeBSD Installfest, this section covers installing packages, setting up a desktop environment, and using poudriere and jails to further customize your system.</p>
<p>The post <a href="https://freebsdfoundation.org/resource/installfest-how-to-guide-p2/">InstallFest How-To Guide P2</a> first appeared on <a href="https://freebsdfoundation.org">FreeBSD Foundation</a>.</p>]]></description>
										<content:encoded><![CDATA[<section class="block block-classic-editor"><p></section><section class="block block-core-heading"></p>
<h3 class="has-text-align-center wp-block-heading"><strong>This Walkthrough is a Continuation of Part 1 of the InstallFest How-To Guide</strong></h3>
<p></section>
<section class="block block-core-paragraph"></p>
<p class="has-text-align-center"><a href="https://freebsdfoundation.org/freebsd-project/resources/installfest-how-to-guide/" target="_blank" rel="noreferrer noopener">Follow the link here for part 1</a></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong>Updated: August 14, 2020</strong></p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading"><strong>Step 2.1: Package Installation</strong></h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" class="wp-image-9495" src="https://freebsdfoundation.org/wp-content/uploads/2021/06/Firefox_Logo_2017-992x1024.png" alt="" width="144" height="148" /></figure>
<p></section></div>
<section class="block block-core-paragraph"></p>
<p>Packages can be downloaded in bulk by adding them to the same command line. Try this by installing the GNOME desktop environment, sudo, the vim editor, and Firefox in one line:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ pkg install -y gnome3 vim-console firefox</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The -y flag in the previous command assumes a pre-confirmation to the installation process, so installation will start instantly.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Gnome requires <code>/proc</code> to be mounted, in order to do this, run</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ vim /etc/fstab</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>This time we use the vim editor, Vi iMproved, and to begin typing you need to be in “insert mode” and must press ‘<code>i</code>‘ to enter insert mode and begin typing in text. Type in the following one-line configuration:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>proc      /proc      procfs      rw      0      0</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Exit vim by pressing “<code>Esc</code>” on the keyboard, then type <code>ZZ</code> or <code>:wq</code> followed by Enter/Return. At this point the virtual machine desktop can be started with the following command:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Change to regular user by holding down “<code>control</code>” and pressing “<code>d</code>” on the keyboard which will log out the current user.  Log in again, this time as the regular user account that was created and type the following commands.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ echo "exec /usr/local/bin/gnome-session" &gt; ~/.xinitrc</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ startx</code></em></p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading"><strong>Step 2.2: Desktop Configuration</strong></h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" class="wp-image-9496" src="https://freebsdfoundation.org/wp-content/uploads/2021/06/download-9.png" alt="" width="160" height="160" srcset="https://freebsdfoundation.org/wp-content/uploads/2021/06/download-9.png 225w, https://freebsdfoundation.org/wp-content/uploads/2021/06/download-9-150x150.png 150w" sizes="(max-width: 160px) 100vw, 160px" /></figure>
<p></section></div>
<section class="block block-core-paragraph"></p>
<p>Here is how to open a local copy of the handbook we installed in the Final Configuration:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Right click on: Desktop &gt; Applications &gt; Firefox Web Browser</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Open Firefox and navigate to the following URL: file:///usr/local/share/doc/freebsd/handbook/index.html</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>This is a local copy of the FreeBSD Handbook, and it will always be available as it doesn’t require an active internet connection. That’s all it takes to install FreeBSD. The next recommended step is to choose a firewall and configure it. Also recommend you pick up a copy of the book “BSD Hacks” to get more familiar with the tcsh shell as well as to acquire several new skills.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Navigate back to Applications and open the terminal.</p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading"><strong>Step 2.3: FreeBSD Update and Package</strong></h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<section class="block block-core-paragraph"></p>
<p>In the open terminal, run:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ sudo -i</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ env PAGER=cat freebsd-update fetch install</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>We’re using <code>env PAGER=cat</code> to modify the value of the <code>PAGER</code> variable which is used by the freebsd-update shell script. If you open up the shell script you will see the default value of <code>PAGER</code> is set to less. You can find the location of the freebsd-update shell script by typing which freebsd-update. By setting the value of <code>PAGER</code> to <code>cat</code>, freebsd-update will not stop to display the list of file to be updated, instead the cat command will only display the list of files and won’t stop to wait for you to read. If you only type freebsd-update fetch install, you’ll need to use the following to get through the prompts</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>‘<code>Page Down</code>‘ &amp; ‘<code>q</code>‘ should get you through the prompts. If the screen shows END press ‘<code>q</code>‘, use ‘<code>Page Down</code>‘ for the other screens. You can also use ‘q’ for every screen.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Now that FreeBSD itself is up to date, we should also update the packages.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ pkg update</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ pkg upgrade -y</code></em></p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading"><strong>Step 2.4: Setting up Jails</strong></h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" class="wp-image-9497" src="https://freebsdfoundation.org/wp-content/uploads/2021/06/download-10.png" alt="" width="144" height="152" /></figure>
<p></section></div>
<section class="block block-core-paragraph"></p>
<p>Set UTF-8 as the locale for this host:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ vim /etc/login.conf</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Change the line with :umask=022: to look like the following:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><code>:umask=022:\</code> <code>:charset=UTF-8:\</code> <code>:lang=en_US.UTF-8:</code></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Save and quit the editor then run the following:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ cap_mkdb /etc/login.conf</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ logout</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Log in as root and type the following to verify UTF-8 locale has been set</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ locale</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Install iocage</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ pkg install -y py37-iocage</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The following command assumes your <code>zpool</code> is named <code>zroot</code> adjust as necessary. Type <code>zpool</code> status to see the current name of your <code>zpool.</code></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ iocage activate zroot</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ iocage list</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>We should now see an empty table as the output of <code>iocage</code> list, we’ll do some additional housekeeping below to improve performance of <code>iocage</code>. There are many things you can do to optimize performance of various applications. One way to learn several new tips and tricks is to read the supurb collection of FreeBSD Mastery books available at <a href="https://mwl.io/">https://MWL.io</a> (In fact, the following performance optimization trick was in the book FreeBSD Mastery: Jails)</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ mount -t fdescfs null /dev/fd</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ vi /etc/fstab</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Add the following line to the file and exit when finished. ‘<code>i</code>‘ for insert mode, ‘<code>ESC</code>‘ then ‘<code>ZZ</code>‘ to save and quit the file. Press ‘<code>TAB</code>‘ between each of the fields for the fstab file rather than using spaces to separate fields.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>fdescfs /dev/fd fdescfs rw 0 0</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Download a Release branch of FreeBSD first</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ iocage fetch</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>We used [<code>Enter</code>] to fetch the default release <code>iocage</code> wants to provide. Verify the download with the following command</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ iocage list -r</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>View the help documentation</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ iocage --help</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Any sub-commands can also have the –help flag appended</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ iocage create --help</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Create a base jail</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ iocage create -T -n JAILNAME ip4_addr="10.0.2.16" -r 12.1-RELEASE</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>List current jails</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ iocage list</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Startup jail-one and jump into the console</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ iocage console JAILNAME</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The console command will start the jail if it isn’t already started. To manually start a jail use this:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ iocage start JAILNAME</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Similarly to stop a jail issue</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ iocage stop JAILNAME</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Verify networking is working</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ pkg</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Say yes to the pkg bootstrap prompt. Exit the jail console with <code>ctrl + d</code>.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>To delete a jail:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ iocage destroy JAILNAME</code></em></p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading"><strong>Step 2.5: Poudriere</strong></h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<section class="block block-core-paragraph"></p>
<p>The following commands will work on the virtual machine we’ve been using so far, but it will take a long time to compile all the packages.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong>We’re going to use the cloned virtual machine we created earlier to explore Poudriere.</strong></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Start up the cloned VM.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Execute the following commands as the root user:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ pkg install -y poudriere vim-console</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ mkdir /usr/ports/distfiles</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ mkdir /usr/local/poudriere</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ vim /usr/local/etc/poudriere.conf</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><code>poudriere.conf</code> content to modify</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><code>ZPOOL=zroot</code> <code>FREEBSD_HOST=https://download.freebsd.org</code></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Continue executing:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ poudriere jail -c -j amd64-12-1 -v 12.1-RELEASE</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ poudriere jail -l</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ poudriere ports -cp head</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ poudriere ports -l</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Get together a list of packages to build. I ran <code>pkg query -e '%a=0' %o</code> on my laptop and a large list appeared. <code>pkg query</code> on my VM was much shorter. To learn more about <code>pkg query</code> issue the command <code>pkg help query</code> to see help text for the query subcommand. Most commands support some form of help (-h, –help, or simply reading the man page with <code>man PROGRAM</code>) For this tutorial we will just build a shorter list of packages. The command to export the current packages installed on the system to a file called pkglist is:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ pkg query -e ‘%a=0’ %o | tee pkglist</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ editors/vim-console</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ ports-mgmt/pkg</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ ports-mgmt/poudriere</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong>Note</strong>: tee writes output to a file and also to stdout. Also the following two bits of information are optional for this tutorial and are included to show you how to customize packages.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Two ways to configure custom options for packages, manually and with the normal make config screen. FYI: Manually looks like this:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ vim /usr/local/etc/poudriere.d/amd64-12-1-make.conf</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ DEFAULT_VERSIONS += ssl=libressl</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>To customize a package one can use the normal package configuration screens, which will appear when issuing the following command</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ poudriere options -j amd64-12-1 -p head -f pkglist</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>For this tutorial we’ll just actually build the packages with the default options to get the hang of Poudriere by issuing the following:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ poudriere bulk -j amd64-12-1 -p head -f pkglist</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ cd /usr/local/poudriere</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>This directory contains logs related to Poudriere builds. There are even a few different website files generated at <code>/data/logs/bulk/.html/</code> with information about the builds. You can open the website in Firefox using the URL <code>file:///data/logs/bulk/.html/index.html</code> to check on the status of a current Poudriere build. You can also press <code>ctrl + t</code> on the command line where you issued the <code>poudriere bulk</code> command to issue a SIGINFO to Poudriere which is configured to print out the current status of the Poudriere build while the command is still processing. This trick works on many other commands as well to show you the status. For instance if you were using <code>scp</code> to download a large file and wanted to see how far along the download was SIGINFO would print out the status on the command line to show you. Another example is if you were decompressing a zip file and wanted to know the status of the extraction process.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Once Poudriere has finished, the packages that were built are available at</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ /data/packages/amd64-12-1-head</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Create a pkg repository</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ mkdir -p /usr/local/etc/pkg/repos</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Disable the main FreeBSD repo by creating a file to override the default settings found in the default FreeBSD repository <code>file /etc/pkg/FreeBSD.conf</code></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ vim /usr/local/etc/pkg/repos/FreeBSD.conf</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Type in the following configuration with enabled set to no</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>FreeBSD: {  <br />
        enabled: no  <br />
}</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Create a new configuration file for your local Poudriere package repository similar to the FreeBSD.conf file to hold the repository configuration</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ vim /usr/local/etc/pkg/repos/amd64-12-1.conf</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Add the following configuration</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>amd64-12-1: { <br />
          url: “file:///data/packages/amd64-12-1-head”,  <br />
          enabled: yes,  <br />
}</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>To reinstall all packages using the new repo</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ pkg upgrade -fy</code></em></p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading"><strong>Step 2.6: Updating Poudriere</strong></h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<section class="block block-core-paragraph"></p>
<p>NOTE: A good Systems Administration practice is to add comments to your configs to let the future you know what the config options do and why there were put there in the first place. That way when you revisit a config file after some time, you’ll have some context as to why those options were chosen.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ vim /usr/local/etc/poudriere.conf</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p># by default Poudriere builds all packages in the pkglist by default, these two lines tell Poudriere to look at each package individually</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><code>CHECK_CHANGED_OPTIONS=verbose</code> <code>CHECK_CHANGED_DEPS=yes</code></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ poudriere jail -j amd64-12-1 -u</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ poudriere ports -p head -u</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ poudriere bulk -j amd64-12-1 -p head -f pkglist</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>You can now install the updated packages:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ pkg update</code></em></p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading">Some Additional Useful Commands:</h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong>Avoiding Issues</strong></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Terminate current command:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ ^C (Ctrl-C)</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Clear to start of line:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ ^U (Ctrl-U)</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong>Finding Information:</strong></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Manual page for the “cmd” command, replace with any other command to access its manual page:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ man cmd</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong>Rebooting / Shutting Down</strong></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Power Down:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ sudo shutdown –p now</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Reboot:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ sudo shutdown –r now</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Log Out:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ exit</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ logout</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong>Directory Navigation</strong></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Display present work directory:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ pwd</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>List contents of current directory:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ ls</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong>Files</strong></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Create file if it does not exist:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ touch filename</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Delete file:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ rm filename</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Rename a file:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ mv oldname newname</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Search for a file: (full filename is not needed)</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ locate filename</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong>File editing</strong></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ vi filename</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ ee filename</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong>Change to your home directory</strong></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ cd</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ cd ~</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong>Change to parent directory</strong></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ cd ..</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong>Change to previous directory</strong></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ cd -</code></em></p>
<p></section>
<section class="block block-core-heading"></p>
<h3 class="wp-block-heading"> </h3>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h3 class="wp-block-heading">Additional Resources: </h3>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Website: <a href="http://www.freebsd.org" target="_blank" rel="noreferrer noopener">www.freebsd.org</a></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>FreeBSD Foundation: <a href="https://freebsdfoundation.org/" target="_blank" rel="noreferrer noopener">archive.freebsdfoundation.org</a></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>GitHub: <a href="http://github.com/freebsd" target="_blank" rel="noreferrer noopener">github.com/freebsd </a> </p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Mailing Lists: <a href="https://lists.freebsd.org/mailman/listinfo" target="_blank" rel="noreferrer noopener">https://lists.freebsd.org/mailman/listinfo</a></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Forums: <a href="https://forums.freebsd.org" target="_blank" rel="noreferrer noopener">https://forums.freebsd.org</a></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>FreeBSD Handbook:<a href="https://www.freebsd.org/doc/handbook/" target="_blank" rel="noreferrer noopener"> https://www.freebsd.org/doc/handbook/</a></p>
<p></section><section class="block block-classic-editor"></p></section><p>The post <a href="https://freebsdfoundation.org/resource/installfest-how-to-guide-p2/">InstallFest How-To Guide P2</a> first appeared on <a href="https://freebsdfoundation.org">FreeBSD Foundation</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>InstallFest How-To Guide</title>
		<link>https://freebsdfoundation.org/resource/installfest-how-to-guide/</link>
		
		<dc:creator><![CDATA[Anne Dickison]]></dc:creator>
		<pubDate>Mon, 15 Aug 2022 18:40:33 +0000</pubDate>
				<guid isPermaLink="false">https://freebsdfoundation.org/?post_type=resource&#038;p=11567</guid>

					<description><![CDATA[<p>The first part of our in depth guide to running your own FreeBSD Installfest, this section covers FreeBSD installation, system configuration, and GUI prep.</p>
<p>The post <a href="https://freebsdfoundation.org/resource/installfest-how-to-guide/">InstallFest How-To Guide</a> first appeared on <a href="https://freebsdfoundation.org">FreeBSD Foundation</a>.</p>]]></description>
										<content:encoded><![CDATA[<section class="block block-classic-editor"><p></section><section class="block block-core-paragraph"></p>
<p><strong>Updated: June 15, 2022</strong></p>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading"><strong>1.1 Identifying Your Computer:</strong></h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading">macOS:</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Start by opening up the terminal, found under Applications &gt; Utilities &gt; Terminal. Then use the code:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>sysctl -n machdep.cpu.brand_string</code></em></p>
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" class="wp-image-7748" src="https://freebsdfoundation.org/wp-content/uploads/2020/03/save3-1024x102-1.png" alt="" width="547" height="95" srcset="https://freebsdfoundation.org/wp-content/uploads/2020/03/save3-1024x102-1.png 583w, https://freebsdfoundation.org/wp-content/uploads/2020/03/save3-1024x102-1-300x52.png 300w" sizes="(max-width: 547px) 100vw, 547px" /></figure>
<p></section></div>
<section class="block block-core-paragraph"></p>
<p>This will return a string identifying the computer’s processor. Running a web search for this processor will take you to the manufacturers website, which should list the processor’s stats as well as whether it is 32-bit or 64-bit.</p>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading">Windows:</h4>
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" class="wp-image-5160" src="https://freebsdfoundation.org/wp-content/uploads/2016/06/windows_system_info-e1584820042943-1024x606.png" alt="" width="635" height="376" srcset="https://freebsdfoundation.org/wp-content/uploads/2016/06/windows_system_info-e1584820042943-1024x606.png 1024w, https://freebsdfoundation.org/wp-content/uploads/2016/06/windows_system_info-e1584820042943-300x178.png 300w, https://freebsdfoundation.org/wp-content/uploads/2016/06/windows_system_info-e1584820042943.png 1084w" sizes="(max-width: 635px) 100vw, 635px" /></figure>
<p></section></div>
<section class="block block-core-paragraph"></p>
<p>Navigate to “Control Panel → System and Security → System” and look for the highlighted information to determine whether your system is 32-bit or 64-bit.</p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading">1.<strong>2 Installing VirtualBox</strong></h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<section class="block block-core-paragraph"></p>
<p>Visit the <a href="https://www.virtualbox.org/wiki/Downloads" target="_blank" rel="noreferrer noopener">VirtualBox downloads website</a>, and in the highlighted area, select the <em>platform package binary</em> that applies to your operating system. VirtualBox is available on <strong>Windows, macOS, Linux, and Solaris</strong>.</p>
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" class="wp-image-5158" src="https://freebsdfoundation.org/wp-content/uploads/2016/06/virtual_box_download-e1584821388890.png" alt="" width="567" height="262" srcset="https://freebsdfoundation.org/wp-content/uploads/2016/06/virtual_box_download-e1584821388890.png 943w, https://freebsdfoundation.org/wp-content/uploads/2016/06/virtual_box_download-e1584821388890-300x139.png 300w" sizes="(max-width: 567px) 100vw, 567px" /></figure>
<p></section></div>
<section class="block block-core-paragraph"></p>
<p>Opening the downloaded file will start the installation walkthrough. Once it finishes, you’ll be able to launch the application.</p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading"><strong>1.3 Getting the latest FreeBSD release:</strong></h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading">   </h4>
<p></section>
<section class="block block-core-heading"></p>
<h3 class="wp-block-heading">Downloading FreeBSD</h3>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Visit the official <a href="https://www.freebsd.org/where.html" target="_blank" rel="noreferrer noopener">FreeBSD releases page</a>. The disk images are listed <em>in order of release date</em>, so the most recent release can be found at the top of the page as highlighted.</p>
<p></section>
<section class="block block-core-list"></p>
<ul class="wp-block-list">
	<li>For <strong>32-bit</strong> machines, click on <strong>i386</strong></li>
	<li>For <strong>64-bit</strong> machines, click on <strong>amd64</strong></li>
</ul>
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="349" class="wp-image-11385" src="https://freebsdfoundation.org/wp-content/uploads/2022/06/Screenshot-2022-06-15-112316-1024x349.png" alt="" srcset="https://freebsdfoundation.org/wp-content/uploads/2022/06/Screenshot-2022-06-15-112316-1024x349.png 1024w, https://freebsdfoundation.org/wp-content/uploads/2022/06/Screenshot-2022-06-15-112316-300x102.png 300w, https://freebsdfoundation.org/wp-content/uploads/2022/06/Screenshot-2022-06-15-112316.png 1067w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>
<p></section></div>
<section class="block block-core-paragraph"></p>
<p>After clicking the link, you will be redirected to a file directory containing multiple formats and versions of the FreeBSD installer.</p>
<p></section>
<section class="block block-core-heading"></p>
<h3 class="wp-block-heading">Identifying the Correct Disk Image</h3>
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="205" class="wp-image-11386" src="https://freebsdfoundation.org/wp-content/uploads/2022/06/Screenshot-2022-06-15-112332-1024x205.png" alt="" srcset="https://freebsdfoundation.org/wp-content/uploads/2022/06/Screenshot-2022-06-15-112332-1024x205.png 1024w, https://freebsdfoundation.org/wp-content/uploads/2022/06/Screenshot-2022-06-15-112332-300x60.png 300w, https://freebsdfoundation.org/wp-content/uploads/2022/06/Screenshot-2022-06-15-112332-1536x308.png 1536w, https://freebsdfoundation.org/wp-content/uploads/2022/06/Screenshot-2022-06-15-112332-2048x411.png 2048w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>
<p></section></div>
<section class="block block-core-paragraph"></p>
<p>For Virtual Machines, the format you are looking for is the file ending in <strong>-disk.iso</strong> as shown above. Click this file and it will start downloading the installer.</p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading">1.<strong>4 Configuring and Starting FreeBSD on VirtualBox:</strong></h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<section class="block block-core-paragraph"></p>
<p>Once the FreeBSD installer has been downloaded in the last step, run VirtualBox to start hard disk configuration. Select the “New” button on the top left of the window to open the configuration window. </p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Name your operating system as “FreeBSD”, then select FreeBSD from the dropdown menu as well as the version (32 or 64 bit).</p>
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" class="wp-image-6892" src="https://freebsdfoundation.org/wp-content/uploads/2019/03/Screen-Shot-2019-02-28-at-6.12.28-PM-e1584821693321-1024x608.png" alt="" width="631" height="374" srcset="https://freebsdfoundation.org/wp-content/uploads/2019/03/Screen-Shot-2019-02-28-at-6.12.28-PM-e1584821693321-1024x608.png 1024w, https://freebsdfoundation.org/wp-content/uploads/2019/03/Screen-Shot-2019-02-28-at-6.12.28-PM-e1584821693321-300x178.png 300w, https://freebsdfoundation.org/wp-content/uploads/2019/03/Screen-Shot-2019-02-28-at-6.12.28-PM-e1584821693321.png 1323w" sizes="(max-width: 631px) 100vw, 631px" /></figure>
<p></section></div>
<section class="block block-core-paragraph"></p>
<p>Choose the defaults options for disc setup until you reach the memory allocation section</p>
<p></section>
<section class="block block-core-list"></p>
<ul class="wp-block-list">
	<li>Pick 2-4GB memory (as long as the slider does not move into the red)</li>
	<li>Hardware drive Option – Recommend 100GB at least 20GB</li>
	<li>Give the VM some extra processors if your machine can handle it (stay in the green)</li>
</ul>
<p></section>
<section class="block block-core-paragraph"></p>
<p>After the hard disk has been configured, boot up the operating system with the “Start” button. VirtualBox will start up a virtual machine and ask for a <em>virtual optical disk file</em>. This will be the <strong>.iso</strong> file that you downloaded through the FreeBSD website. Navigate to this file by clicking the small file symbol next to the drop-down menu. Once selected, the booting process will continue and the FreeBSD installer will start.</p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading">1.<strong>5 Installing FreeBSD:</strong></h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" class="wp-image-5218" src="https://freebsdfoundation.org/wp-content/uploads/2017/05/freebsd_bootscreen-e1585249387619.png" alt="" width="679" height="378" srcset="https://freebsdfoundation.org/wp-content/uploads/2017/05/freebsd_bootscreen-e1585249387619.png 722w, https://freebsdfoundation.org/wp-content/uploads/2017/05/freebsd_bootscreen-e1585249387619-300x167.png 300w" sizes="(max-width: 679px) 100vw, 679px" /></figure>
<p></section></div>
<section class="block block-core-paragraph"></p>
<p>The FreeBSD booting system will automatically start once VirtualBox starts the virtual machine. While this how-to will provide a detailed installation guide, the <a href="https://www.freebsd.org/doc/handbook/using-bsdinstall.html">FreeBSD handbook’s installation guide</a> can also be used. <em>When in doubt, use the default options provided</em>, as they can be reconfigured later if necessary.</p>
<p></section>
<section class="block block-core-list"></p>
<ol class="wp-block-list">
	<li>After the first boot, users will be directed to the welcome menu. <strong>Arrow </strong>keys can be used to navigate through the options while the <strong>Enter</strong> key will be used to save the selection and move onto the next menu. To begin installation, select the first [ Install ] option.</li>
	<li>This will enter bdsinstall, a program that allows users to install FreeBSD while offering multiple options for customization. For now, default options will be all that’s needed. The options are a great tool for more advanced users wanting a more personalized experience.</li>
	<li>First, the installer will display a menu for keymap selection. Highlight the option to continue with the default keymap and press <strong>Enter</strong> to use the default keyboard layout.</li>
	<li>The installer will then allow the user to set a hostname for the system. Type in a hostname that is unique for your network. Hit <strong>Enter</strong> again to save the new name.</li>
	<li>After a hostname is selected and saved, the installer will prompt the user to select components to install. Stick with the default options and hit <strong>Enter</strong> to continue.</li>
	<li>The installer will guide the user through the process of allocating disk space. This will allow FreeBSD to set up a partition scheme.

<ul>
	<li>Choose the Auto (UFS) Guided Disk Setup.</li>
	<li>Confirm your selection.</li>
	<li>Use the Entire disk (ada0), this will make sure that all allocation disk space will be utilized.</li>
	<li>Select GPT Partitions when prompted for a partition scheme. To navigate, use the <strong>arrow keys</strong> and <strong>Space </strong>to select the GPT option.</li>
</ul>
</li>
	<li>When prompted, complete the setup process and create the disk partition by selecting [ Finish ] and [ Commit ]. Once these changes have been saved and committed, bsdinstall will start the FreeBSD installation process. This may take a few minutes.</li>
</ol>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading">1.<strong>6 Post- Installation Setup</strong></h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<section class="block block-core-paragraph"></p>
<p>While the FreeBSD installation process has been completed, there a few more configuration options that need to be set before booting into the newly installed system.</p>
<p></section>
<section class="block block-core-list"></p>
<ol class="wp-block-list">
	<li>First, the <em>root </em>password must be set. The <em>root</em> account is a superuser that has access to all files and commands. Characters that are typed during this section will not be displayed on the screen. Type the new root password and then a second time when prompted.</li>
	<li>Next, FreeBSD will need to configure the network interfaces found on the computer. Select <strong>Enter</strong> to continue. The default options should be used.

<ul>
	<li>Select [ Yes ] to configure IPv4</li>
	<li>Select [ Yes ] to use DHCP to configure</li>
	<li>Select [ Yes ] to configure IPv6</li>
	<li>Select [ Yes ] to try SLAAC</li>
	<li>At this point you will be directed to a menu with Resolver Configuration values, hit <strong>Enter</strong> to continue to the next step.</li>
</ul>
</li>
	<li>The next menu is a large list of regions for time zone configuration. Use the arrow keys to navigate to the correct region and hit <strong>Enter</strong>. Next, navigate to the correct country or region. Finally, identify and choose the correct time zone. Select [ Yes] to confirm.</li>
	<li>A menu to set the correct date will be next, while you can navigate through the menu to set date, choose [ Skip ] if the displayed date is already correct. [ Skip ] the next menu as the time zone was set up in the previous configuration menu.</li>
	<li>The next two menus will be to configure what system services will be started when the system boots. All services are optional and for now select [ OK ] in both menus to continue with the default configuration.</li>
	<li>The next step will be to add a user besides <em>root</em>. Because <em>root </em>has no limits and protection, it is recommended to log in to the system using a user account to limit the damage if a mistake is made (even a typo could be catastrophic).</li>
	<li>When prompted to create a user account select [ Yes ]. Bsdinstall will follow with a series of prompts to customize the account. Below is a quick summary of the information to input. For clarity, text in bold notates when the user should input text and not just use the default option:

<ul>
	<li>Username – username used to log in. <strong>Username is case sensitive and should not contain spaces</strong></li>
	<li>Full name – <strong>The user’s full name</strong></li>
	<li>Uid – user ID (leave this blank)</li>
	<li>Login group – The user’s group (leave blank)</li>
	<li>Invite user into other groups? – Additional groups for the user. <strong>Type: <em>wheel operator video  </em></strong><strong>here, which will assign the user to the wheel (admin), operator, and video groups.</strong></li>
	<li>Login Class – (leave blank)</li>
	<li>Shell – (leave blank)</li>
	<li>Home directory – The user’s home directory (leave blank)</li>
	<li>Home directory permissions – Permissions on the user’s home directory (leave blank)</li>
	<li>Use password-based authentication? – Prompts user to input password at logic (leave blank)</li>
	<li>Use an empty password? – Option to use a blank password, though this is insecure (leave blank)</li>
	<li>Use a random password? – Option for a randomized password (leave blank)</li>
	<li>Enter password – The password for this user. <strong>Characters typed will not show on screen.</strong></li>
	<li>Enter password again – <strong>The password must be typed again for verification.</strong></li>
	<li>Lock out the account after creation? – Option to lock out use (leave blank)</li>
	<li>User will be prompted to review the summary. If a mistake was made enter <em>no</em> and try again. If everything is correct, enter <em>yes</em> to finalize and create the new user. The menu will then ask if the user wants to create further user accounts, for now enter <em>no.</em></li>
</ul>
</li>
	<li>Final configuration: Use the arrow keys to navigate to <em>Handbook </em>and press <strong>Enter</strong> to install the FreeBSD Handbook. Select [ Ok ] to begin installation.</li>
	<li>Navigate to <em>Exit </em>and hit <strong>Enter</strong> to finalize changes. Select [ No ] when asked if further manual configuration is required and [ Reboot ] to complete the FreeBSD installation process.</li>
</ol>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading"><strong>1.7 Saving Your Configuration:</strong></h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<section class="block block-core-paragraph"></p>
<p>Once FreeBSD has been properly configured, a window will appear asking to reboot. Select “yes” and wait until the FreeBSD booting page appears again. Once this happens, manually close the virtual machine window and select “Power off the machine”.</p>
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" class="wp-image-4091" src="https://freebsdfoundation.org/wp-content/uploads/2016/06/ScreenShot2016-06-14at1.23.48PM-e1584822254802-1024x384.png" alt="" width="573" height="214" srcset="https://freebsdfoundation.org/wp-content/uploads/2016/06/ScreenShot2016-06-14at1.23.48PM-e1584822254802-1024x384.png 1024w, https://freebsdfoundation.org/wp-content/uploads/2016/06/ScreenShot2016-06-14at1.23.48PM-e1584822254802-300x113.png 300w, https://freebsdfoundation.org/wp-content/uploads/2016/06/ScreenShot2016-06-14at1.23.48PM-e1584822254802.png 1280w" sizes="(max-width: 573px) 100vw, 573px" /></figure>
<p></section></div>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading">1.<strong>8 Removing the Installation Disk:</strong></h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<section class="block block-core-paragraph"></p>
<p>On the main VirtualBox application, click the the section (on the lower right side of the window) that says “Storage”. A new window should appear showing the storage options.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Under the main “Controller: IDE” there will be two options. One will be the hard disk that VirtualBox created for the system (it will have a square blue hard drive icon) and the other is the original FreeBSD download (with a light blue disk icon). Right click the <em>sub-storage</em> with the disk icon and select “Remove” from the drop-down menu.</p>
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" class="wp-image-4092" src="https://freebsdfoundation.org/wp-content/uploads/2016/06/ScreenShot2016-06-09at10.52.13AM-e1584822334646-1024x299.png" alt="" width="732" height="214" /></figure>
<p></section></div>
<section class="block block-core-paragraph"></p>
<p>Once it is removed, the window should resemble the one pictured above.</p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading">1.<strong>9 Cloning a VirtualBox VM</strong></h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<section class="block block-core-paragraph"></p>
<p>Use the Snapshots menu in VirtualBox to Clone the VM. Check the box “Reinitialize the MAC address of all network cards”. We could choose either a Full clone or a Linked clone. We’ll use the Full clone option. Later on in the installfest we’ll use this cloned VM.</p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading">1.<strong>10 Final Configurations:</strong></h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<section class="block block-core-paragraph"></p>
<p>Click “Start” with the original VM selected, and the FreeBSD virtual machine should now boot in its configured form. In order to download packages you need to be logged into, or emulate the root user. After logging into the previously created user, enter the following command in the terminal:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ su</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Install the VirtualBox guest addition packages, and configure the startup service configuration:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ pkg install emulators/virtualbox-ose-additions</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ sysrc vboxguest_enable=YES</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ sysrc vboxservice_enable=YES</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>sysrc is a pre-packaged command that allows rc.conf (system configuration to be read on boot) to be edited from the command line, without using a text editor.</p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading">1.11 GUI (Desktop) Prep</h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter"><img decoding="async" src="https://upload.wikimedia.org/wikipedia/commons/7/77/Xwin.png" alt="" /></figure>
<p></section></div>
<section class="block block-core-paragraph"></p>
<p>Before installing a desktop environment, a graphical user interface (GUI) is needed. The X Window System is an open source GUI that supports FreeBSD and offers a ton of customization and user tools.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>To install the Xorg binary package and configure the X Window System:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ pkg install -y xorg</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ ee /boot/loader.conf</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><code>ee(1)</code> is the first text editor we will be using, the following line can be added simply by typing it:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>kern.vty=vt</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Escape and then hit Enter twice to save changes and exit the <code>ee(1)</code> editor:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ ee /usr/local/etc/X11/xorg.conf.d/driver-vboxvideo.conf</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Use the same method above and add the following content to the new file:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>Section “Device”</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>          Identifier "Card0"</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>          Driver "vboxvideo"</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>EndSection</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Enter the following commands:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ sysrc dbus_enable=YES </code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ sysrc hald_enable=YES</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ dbus-uuidgen &gt; /etc/machine-id </code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ pkg install -y sudo </code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ visudo</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>(we will use another text editor, the vi editor, to edit sudo )</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Within the sudo config type <code>/wheel</code> press <code>Enter</code> and uncomment the line below to allow all members of the wheel group to use sudo (in vi you can type the following to accomplish this task: <code>j0xxZZ</code>) ( pressing j moves down, 0 moves to the beginning of a line, x deletes one character, ZZ is saves and quits)</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ reboot</code></em></p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="has-text-align-center wp-block-heading">The Guide Continues in Part II!</h2>
<p></section>
<section class="block block-core-paragraph"></p>
<p class="has-text-align-center"><a href="https://freebsdfoundation.org/freebsd-project/resources/installfest-how-to-guide-p2/" target="_blank" rel="noreferrer noopener">Follow the link here</a></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p class="has-text-align-center">The next part will include installing a desktop environment, updating FreeBSD, setting up a FreeBSD jail, as well as using Ansible and Poudriere.</p>
<p></section><section class="block block-classic-editor"></p></section><p>The post <a href="https://freebsdfoundation.org/resource/installfest-how-to-guide/">InstallFest How-To Guide</a> first appeared on <a href="https://freebsdfoundation.org">FreeBSD Foundation</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Networking Basics: WiFi and Bluetooth</title>
		<link>https://freebsdfoundation.org/resource/networking-basics-wifi-and-bluetooth/</link>
		
		<dc:creator><![CDATA[Anne Dickison]]></dc:creator>
		<pubDate>Mon, 15 Aug 2022 18:33:01 +0000</pubDate>
				<guid isPermaLink="false">https://freebsdfoundation.org/?post_type=resource&#038;p=11565</guid>

					<description><![CDATA[<p>Our latest how-to guide is all about networks, covering the basics of Wi-Fi and Bluetooth. Learn how to set up and configure Wi-Fi and Bluetooth on FreeBSD devices, even when the network is hidden. Further setup for USB tethering and using your FreeBSD device as an access point is also covered. This is intended to be an introductory level guide, with only limited required experience of the FreeBSD operating system.</p>
<p>The post <a href="https://freebsdfoundation.org/resource/networking-basics-wifi-and-bluetooth/">Networking Basics: WiFi and Bluetooth</a> first appeared on <a href="https://freebsdfoundation.org">FreeBSD Foundation</a>.</p>]]></description>
										<content:encoded><![CDATA[<section class="block block-classic-editor"><p></section><section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="512" class="wp-image-11216" src="https://freebsdfoundation.org/wp-content/uploads/2022/04/Untitled-design-8-1024x512.png" alt="" srcset="https://freebsdfoundation.org/wp-content/uploads/2022/04/Untitled-design-8-1024x512.png 1024w, https://freebsdfoundation.org/wp-content/uploads/2022/04/Untitled-design-8-300x150.png 300w, https://freebsdfoundation.org/wp-content/uploads/2022/04/Untitled-design-8-1536x768.png 1536w, https://freebsdfoundation.org/wp-content/uploads/2022/04/Untitled-design-8-2048x1024.png 2048w, https://freebsdfoundation.org/wp-content/uploads/2022/04/Untitled-design-8.png 1920w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>
<p></section></div>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading" id="_kernel_configuration">Wireless Configuration/Set-up</h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<section class="block block-core-paragraph"></p>
<p>A wireless networking card is required to use a wireless network, FreeBSD will also need to be configured to the correct wireless network support. The correct module will need to be modified, depending on the type of networking card. The most commonly used wireless devices are those that use parts made by Atheros. These devices are supported by <a href="https://www.freebsd.org/cgi/man.cgi?query=ath&amp;sektion=4&amp;format=html" target="_blank" rel="noreferrer noopener">ath(4)</a> and require the following line to be added to <code>/boot/loader.conf</code>:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"><code>if_ath_load="YES"</code></pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>If unsure about the device, you can identify many common wireless adaptors through the use of the  <a href="https://www.freebsd.org/cgi/man.cgi?query=sysctl&amp;sektion=8&amp;format=html" target="_blank" rel="noreferrer noopener">sysctl(8)</a> <code>net.wlan.devices</code> variable:</p>
<p></section>
<section class="block block-core-code"></p>
<pre class="wp-block-code"><code>% sysctl net.wlan.devices</code></pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>To load support for a different type of wireless device, specify the module for that device. This example is for devices based on the Intersil Prism parts (<a href="https://www.freebsd.org/cgi/man.cgi?query=wi&amp;sektion=4&amp;format=html" target="_blank" rel="noreferrer noopener">wi(4)</a>) driver:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"><code>if_wi_load="YES"</code></pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong>Note:</strong><em> A list of available wireless drivers and supported adapters can be found in the FreeBSD Hardware Notes, available on the <a href="https://www.freebsd.org/releases/" target="_blank" rel="noreferrer noopener">Release Information</a> page of the FreeBSD website. </em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>In addition, the modules that implement cryptographic support for the security protocols to use must be loaded. These are intended to be dynamically loaded on demand by the <a href="https://www.freebsd.org/cgi/man.cgi?query=wlan&amp;sektion=4&amp;format=html" target="_blank" rel="noreferrer noopener">wlan(4)</a> module. To load these modules at boot time, add the following lines to /boot/loader.conf:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted">wlan_wep_load="YES"
wlan_ccmp_load="YES"
wlan_tkip_load="YES"</pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Information about the wireless device should appear in the boot messages, like this:</p>
<p></section>
<section class="block block-core-code"></p>
<pre class="wp-block-code"><code>ath0: &lt;Atheros 5212&gt; mem 0x88000000-0x8800ffff irq 11 at device 0.0 on cardbus1
ath0: [ITHREAD]
ath0: AR2413 mac 7.9 RF2413 phy 4.5</code></pre>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading">Connecting to a Network:</h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<section class="block block-core-heading"></p>
<h3 class="wp-block-heading">Open Networks</h3>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Directly connecting to an unsecure network, while not recommended, is extremely common. It&#8217;s also a very simple process on FreeBSD. In this example I&#8217;ll beconnecting to the John F Kennedy International Airport&#8217;s free WiFi.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Start by finding the name of the network:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted">ifconfig wlan0 up scan</pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>This will look for available networks and return a list, In this case, we want to connect to the JFK free wifi so we&#8217;ll use:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted">ifconfig wlan0 ssid _Free JFK WiFi</pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Hopefully you will see that it&#8217;s joined, and running ifconfig ath0 will show that it&#8217;s associated. You can then get an address with:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted">dhclient wlan0</pre>
<p></section>
<section class="block block-core-heading"></p>
<h3 class="wp-block-heading"><strong>WPA/WPA2/Personal</strong></h3>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Most home/private networks will rely on these security protocols. Connecting a computer to an existing WPA/WPA2/Personal wireless network is a very common situation.</p>
<p></section>
<section class="block block-core-list"></p>
<ul class="wp-block-list">
	<li>Obtain the SSID (Service Set Identifier) and PSK (Pre-Shared Key) from the network administrator, these may also be listed on the router.</li>
	<li>Add an entry for this network to <code>/etc/wpa_supplicant.conf</code>. If the file does not exist, create it. Replace <em>myssid</em> and <em>mypsk</em> with the SSID and PSK provided by the network administrator.</li>
</ul>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted">network={ 
        ssid="myssid" 
        psk="mypsk" 
}
</pre>
<p></section>
<section class="block block-core-list"></p>
<ul class="wp-block-list">
	<li><strong>Note</strong>: If the wireless network is <em>hidden</em>, add an additional line to indicate that the network is not publicly visible.</li>
</ul>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted">network={
        scan_ssid=1
        ssid="mywpa"
        psk="1234"
}</pre>
<p></section>
<section class="block block-core-list"></p>
<ul class="wp-block-list">
	<li>Add entries to <code>/etc/rc.conf</code> to configure the network on startup. Make sure to use the correct wireless adapter as identified earlier (this example will use the Atheros <code>ath0</code> wireless adapter).</li>
</ul>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted">wlans_ath0="wlan0" 
ifconfig_wlan0="WPA SYNCDHCP"</pre>
<p></section>
<section class="block block-core-list"></p>
<ul class="wp-block-list">
	<li>Restart the computer, or restart the network service to connect to the network:</li>
</ul>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"># service netif restart</pre>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading">FreeBSD as an Access Point:</h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<section class="block block-core-paragraph"></p>
<p>FreeBSD can act as an Access Point (AP) in order to act as a gateway or to eliminate the need to purchase AP hardware. Before an Access Point can be set up, the kernel must be configured with the appropriate networking support for the wireless card as well as the security protocols being used. This mode is only supported by native FreeBSD wireless drivers.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>After setting up wireless networking, you can check if the device supports host-based access point mode:</p>
<p></section>
<section class="block block-core-code"></p>
<pre class="wp-block-code"><code># ifconfig wlan0 create wlandev ath0
# ifconfig wlan0 list caps
drivercaps=6f85edc1&lt;STA,FF,TURBOP,IBSS,<strong><span class="has-inline-color has-luminous-vivid-orange-color">HOSTAP</span></strong>,AHDEMO,TXPMGT,SHSLOT,SHPREAMBLE,MONITOR,MBSS,WPA1,WPA2,BURST,WME,WDS,BGSCAN,TXFRAG&gt;
cryptocaps=1f&lt;WEP,TKIP,AES,AES_CCM,TKIPMIC&gt;</code></pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>This output displays the card’s capabilities. The <strong><span class="has-inline-color has-luminous-vivid-orange-color"><code>HOSTAP</code> </span></strong>word confirms that this wireless card can act as an AP.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The wireless device can only be put into hostap mode during the creation of the network pseudo-device, so a previously created device must be destroyed first:</p>
<p></section>
<section class="block block-core-code"></p>
<pre class="wp-block-code"><code># ifconfig wlan0 destroy</code></pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>then regenerated with the correct option before setting the other parameters:</p>
<p></section>
<section class="block block-core-code"></p>
<pre class="wp-block-code"><code># ifconfig wlan0 create wlandev ath0 wlanmode hostap
# ifconfig wlan0 inet 192.168.0.1 netmask 255.255.255.0 ssid freebsdap mode 11g channel 1</code></pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Use <a href="https://www.freebsd.org/cgi/man.cgi?query=ifconfig&amp;sektion=8&amp;format=html" target="_blank" rel="noreferrer noopener">ifconfig(8)</a> again to see the status of the wlan0 interface:</p>
<p></section>
<section class="block block-core-code"></p>
<pre class="wp-block-code"><code># ifconfig wlan0
  wlan0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; metric 0 mtu 1500
	  ether 00:11:95:c3:0d:ac
	  inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255
	  media: IEEE 802.11 Wireless Ethernet autoselect mode 11g &lt;<span class="has-inline-color has-luminous-vivid-orange-color"><strong>hostap</strong></span>&gt;
	  status: running
	  ssid freebsdap channel 1 (2412 Mhz 11g) bssid 00:11:95:c3:0d:ac
	  country US ecm authmode OPEN privacy OFF txpower 21.5 scanvalid 60
	  protmode CTS wme burst dtimperiod 1 -dfs</code></pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The <strong><span class="has-inline-color has-luminous-vivid-orange-color"><code>hostap</code> </span></strong>parameter indicates the interface is running in the host-based access point mode.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The interface configuration can be done automatically at boot time by adding the following lines to <code>/etc/rc.conf</code>:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted">wlans_ath0="wlan0"
create_args_wlan0="wlanmode hostap"
ifconfig_wlan0="inet 192.168.0.1 netmask 255.255.255.0 ssid freebsdap mode 11g channel 1"</pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p id="block-f5bdf692-e2f3-4f0a-b7b1-71df80dba746">Once the AP is configured, initiate a scan from another wireless machine to find the AP.</p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading">USB Tethering</h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<section class="block block-core-paragraph"></p>
<p>Many cellphones can share data connection over USB, FreeBSD provides support through a variety of protocols:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Before attaching a device, load the appropriate driver into the kernel:</p>
<p></section>
<section class="block block-core-code"></p>
<pre class="wp-block-code"><code># kldload if_urndis                     # driver generally used by Android&#x2122; device
# kldload if_ipheth                     # driver used by Apple® devices
# kldload if_cdce                       # driver often used in older devices</code></pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Once the device is attached <code>ue</code><em>0</em> will be available for use like a normal network device. Be sure that the &#8220;USB tethering&#8221; option is enabled on the mobile device.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>To make this change permanent and load the driver as a module at boot time, place the appropriate line of the following in /boot/loader.conf:</p>
<p></section>
<section class="block block-core-code"></p>
<pre class="wp-block-code"><code>if_urndis_load="YES"
if_cdce_load="YES"
if_ipheth_load="YES"</code></pre>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="512" class="wp-image-11217" src="https://freebsdfoundation.org/wp-content/uploads/2022/04/Untitled-design-9-1024x512.png" alt="" srcset="https://freebsdfoundation.org/wp-content/uploads/2022/04/Untitled-design-9-1024x512.png 1024w, https://freebsdfoundation.org/wp-content/uploads/2022/04/Untitled-design-9-300x150.png 300w, https://freebsdfoundation.org/wp-content/uploads/2022/04/Untitled-design-9-1536x768.png 1536w, https://freebsdfoundation.org/wp-content/uploads/2022/04/Untitled-design-9-2048x1024.png 2048w, https://freebsdfoundation.org/wp-content/uploads/2022/04/Untitled-design-9.png 1920w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>
<p></section></div>
<section class="block block-core-heading"></p>
<h1 class="wp-block-heading">Bluetooth:</h1>
<p></section>
<section class="block block-core-paragraph"></p>
<p>&nbsp;</p>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading" id="_loading_bluetooth_support">Loading Bluetooth Support</h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<section class="block block-core-paragraph"></p>
<p>Before attaching a Bluetooth device, determine which Bluetooth driver it uses. A broad variety of Bluetooth USB dongles are supported by <a href="https://www.freebsd.org/cgi/man.cgi?query=ng_ubt&amp;sektion=4&amp;format=html">ng_ubt(4)</a>. Broadcom BCM2033 based Bluetooth devices are supported by the <a href="https://www.freebsd.org/cgi/man.cgi?query=ubtbcmfw&amp;sektion=4&amp;format=html">ubtbcmfw(4)</a> and <a href="https://www.freebsd.org/cgi/man.cgi?query=ng_ubt&amp;sektion=4&amp;format=html">ng_ubt(4)</a> drivers. The 3Com Bluetooth PC Card 3CRWB60-A is supported by the <a href="https://www.freebsd.org/cgi/man.cgi?query=ng_bt3c&amp;sektion=4&amp;format=html">ng_bt3c(4)</a> driver. Serial and UART based Bluetooth devices are supported by <a href="https://www.freebsd.org/cgi/man.cgi?query=sio&amp;sektion=4&amp;format=html">sio(4)</a>, <a href="https://www.freebsd.org/cgi/man.cgi?query=ng_h4&amp;sektion=4&amp;format=html">ng_h4(4)</a>, and <a href="https://www.freebsd.org/cgi/man.cgi?query=hcseriald&amp;sektion=8&amp;format=html">hcseriald(8)</a>. For example, if the device uses the <a href="https://www.freebsd.org/cgi/man.cgi?query=ng_ubt&amp;sektion=4&amp;format=html">ng_ubt(4)</a> driver:</p>
<p></section>
<section class="block block-core-code"></p>
<pre class="wp-block-code"><code># kldload ng_ubt</code></pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>If the Bluetooth device will be attached to the system during system startup, the system can be configured to load the module at boot time by adding the driver to <code>/boot/loader.conf</code>:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted">ng_ubt_load="YES"</pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Once the driver is loaded, plug in the USB dongle. If the driver load was successful, output similar to the following should appear on the console and in <code>/var/log/messages</code>:</p>
<p></section>
<section class="block block-core-code"></p>
<pre class="wp-block-code"><code>ubt0: vendor 0x0a12 product 0x0001, rev 1.10/5.25, addr 2
ubt0: Interface 0 endpoints: interrupt=0x81, bulk-in=0x82, bulk-out=0x2
ubt0: Interface 1 (alt.config 5) endpoints: isoc-in=0x83, isoc-out=0x3,
      wMaxPacketSize=49, nframes=6, buffer size=294</code></pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>To start and stop Bluetooth, use the driver&#8217;s startup script.</p>
<p></section>
<section class="block block-core-code"></p>
<pre class="wp-block-code"><code># service bluetooth start ubt0</code></pre>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading" id="_finding_other_bluetooth_devices">Finding Other Bluetooth Devices</h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<section class="block block-core-paragraph"></p>
<p>FreeBSD uses <a href="https://www.freebsd.org/cgi/man.cgi?query=hccontrol&amp;sektion=8&amp;format=html" target="_blank" rel="noreferrer noopener">hccontrol(8)</a> to find and identify Bluetooth devices within RF proximity.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>One of the most common tasks is discovery of Bluetooth devices within RF proximity. This operation is called <em>inquiry</em>. Inquiry and other HCI related operations are done using <a href="https://www.freebsd.org/cgi/man.cgi?query=hccontrol&amp;sektion=8&amp;format=html">hccontrol(8)</a>. To display a list of devices that are in range use:</p>
<p></section>
<section class="block block-core-code"></p>
<pre class="wp-block-code"><code>% hccontrol -n ubt0hci inquiry
Inquiry result, num_responses=1
Inquiry result #0
       <span class="has-inline-color has-luminous-vivid-orange-color"><strong>BD_ADDR</strong></span>: 00:80:37:29:19:a4
       Page Scan Rep. Mode: 0x1
       Page Scan Period Mode: 00
       Page Scan Mode: 00
       Class: 52:02:04
       Clock offset: 0x78ef
Inquiry complete. Status: No error [00]</code></pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong>Note</strong>: only devices that are set to discoverable mode will be li<em>sted.</em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The <span class="has-inline-color has-luminous-vivid-orange-color"><strong><code>BD_ADDR</code> </strong></span>is the unique address of a Bluetooth device, similar to the MAC address of a network card. This address is needed for further communication with a device. To to obtain the human readable name that was assigned to the remote device:</p>
<p></section>
<section class="block block-core-code"></p>
<pre class="wp-block-code"><code>% hccontrol -n ubt0hci remote_name_request 00:80:37:29:19:a4
BD_ADDR: 00:80:37:29:19:a4
Name: Pav's T39</code></pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The Bluetooth system provides a point-to-point connection between two Bluetooth units, or a point-to-multipoint connection which is shared among several Bluetooth devices. The following example shows how to create a connection to a remote device:</p>
<p></section>
<section class="block block-core-code"></p>
<pre class="wp-block-code"><code>% hccontrol -n ubt0hci create_connection BT_ADDR</code></pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p><code>create_connection</code> accepts <code>BT_ADDR</code> as well as host aliases in /etc/bluetooth/hosts.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The following example shows how to obtain the list of active baseband connections for the local device:</p>
<p></section>
<section class="block block-core-code"></p>
<pre class="wp-block-code"><code>% hccontrol -n ubt0hci read_connection_list
Remote BD_ADDR    Handle Type Mode Role Encrypt Pending Queue State
00:80:37:29:19:a4     41  ACL    0 MAST    NONE       0     0 OPEN</code></pre>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading" id="_device_pairing">Bluetooth Device Pairing</h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<section class="block block-core-paragraph"></p>
<p>While a Bluetooth device can choose to require authentication, communication is normally not authenticated, so any Bluetooth device can talk to any other device. If the device requires authentication, the <em>PIN</em> code must be entered on both devices, the devices will then generate a <em>link key</em>. After that, the link key can be stored either in the devices or in a persistent storage. This procedure is called <em>pairing</em>.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The <a href="https://www.freebsd.org/cgi/man.cgi?query=hcsecd&amp;sektion=8&amp;format=html">hcsecd(8)</a> daemon is responsible for handling Bluetooth authentication requests. The default configuration file is <code>/etc/bluetooth/hcsecd.conf</code>. An example section for a cellular phone with the PIN code set to <code>1234</code> is shown below:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted">device {
        bdaddr  00:80:37:29:19:a4;
        name    "iPhone";
        key     nokey;
        pin     "1234";
      }</pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The only limitation on PIN codes is length. Some devices, such as Bluetooth headsets, may have a fixed PIN code built in. The <code>-d</code> switch forces <a href="https://www.freebsd.org/cgi/man.cgi?query=hcsecd&amp;sektion=8&amp;format=html">hcsecd(8)</a> to stay in the foreground, so it is easy to see what is happening. Set the remote device to receive pairing and initiate the Bluetooth connection to the remote device. The remote device should indicate that pairing was accepted and request the PIN code. Enter the same PIN code listed in<code> hcsecd.conf</code>. Now the computer and the remote device are paired.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The following line can be added to /etc/rc.conf to configure <a href="https://www.freebsd.org/cgi/man.cgi?query=hcsecd&amp;sektion=8&amp;format=html">hcsecd(8)</a> to start automatically on system start:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted">hcsecd_enable="YES"</pre>
<p></section><section class="block block-classic-editor"></p></section><p>The post <a href="https://freebsdfoundation.org/resource/networking-basics-wifi-and-bluetooth/">Networking Basics: WiFi and Bluetooth</a> first appeared on <a href="https://freebsdfoundation.org">FreeBSD Foundation</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Updating FreeBSD From Git</title>
		<link>https://freebsdfoundation.org/resource/updating-freebsd-from-git/</link>
		
		<dc:creator><![CDATA[Anne Dickison]]></dc:creator>
		<pubDate>Mon, 15 Aug 2022 18:27:46 +0000</pubDate>
				<guid isPermaLink="false">https://freebsdfoundation.org/?post_type=resource&#038;p=11561</guid>

					<description><![CDATA[<p>With FreeBSD's ongoing migration to git from subversion, the system for updating FreeBSD from source has adapted. This guide will cover getting sources from git, updating them, and how to bisect those sources. It is meant as an introduction to the new mechanics for general users.</p>
<p>The post <a href="https://freebsdfoundation.org/resource/updating-freebsd-from-git/">Updating FreeBSD From Git</a> first appeared on <a href="https://freebsdfoundation.org">FreeBSD Foundation</a>.</p>]]></description>
										<content:encoded><![CDATA[<section class="block block-classic-editor"><p></section><section class="block block-core-paragraph"></p>
<p><strong>Updated: June 15, 2022</strong></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>With FreeBSD&#8217;s ongoing migration to git from subversion, the system for updating FreeBSD from source has adapted. This guide will cover getting sources from git, updating them, and how to bisect those sources. It is meant as an introduction to the new mechanics for general users.</p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h3 id="Keeping-Current-With-FreeBSD-src-tree" class="has-text-align-left wp-block-heading">1. Keeping Current With FreeBSD src tree</h3>
<p></section>
<section class="block block-core-paragraph"></p>
<p>To begin, the source tree must be downloaded. This can be done quite simply. First step: cloning a tree. This downloads the entire tree. There are two ways to download. By default, git will do a deep clone, which matches what most people want. However, there are times that you may wish to do a shallow clone.</p>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading" id="Branch-names">1.1 Branch names</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The branch names in the new git repository are similar to the subversion names. For the stable branches, they are <code><strong>stable/X</strong></code> where <strong><code>X</code></strong> is the major release number (like 12 or 13). The development branch for -CURRENT in the new repository is <code><strong>main</strong></code>.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong>Note:</strong> The main branch is the default branch if you omit the <strong><code>-b branch</code></strong> options below.</p>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading" id="Repositories">1.2 Repositories</h4>
<p></section>
<section class="block block-core-list"></p>
<ul class="wp-block-list">
	<li>The official geographically distributed mirror for the general public is git.FreeBSD.org, The access URL is: <a href="https://git.freebsd.org/src.git" target="_blank" rel="noreferrer noopener">https://git.freebsd.org/src.git</a></li>
	<li>The repository is also accessible by SSH: ssh://anongit@git.freebsd.org/src.git</li>
	<li>There are several officially maintained external mirrors. The list is available at <a href="https://docs.freebsd.org/en/books/handbook/mirrors/#external-mirrors" target="_blank" rel="noreferrer noopener">https://docs.freebsd.org/en/books/handbook/mirrors/#external-mirrors</a></li>
	<li>For using web browser to view the content, there is a cgit web interface at <a href="https://cgit.freebsd.org/src" target="_blank" rel="noreferrer noopener">https://cgit.freebsd.org/src</a></li>
</ul>
<p></section>
<section class="block block-core-list"></p>
<ul class="wp-block-list">
	<li>There is an old experimental github repository at <a href="https://github.com/freebsd/freebsd-legacy/" target="_blank" rel="noreferrer noopener">https://github.com/freebsd/freebsd-legacy/</a> (was https://github.com/freebsd/freebsd) similar to the new Git repository. However, there are a large number of mistakes in the github repository that required us to regenerate the export when we migrated to having a git repository be the source of truth for the project.</li>
</ul>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The hashes are different between them. For migrating from the old repository to the new one, please refer to <a href="https://github.com/freebsd/freebsd-legacy/commit/de1aa3dab23c06fec962a14da3e7b4755c5880cf" target="_blank" rel="noreferrer noopener">https://github.com/freebsd/freebsd-legacy/commit/de1aa3dab23c06fec962a14da3e7b4755c5880cf</a></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Use the repository of choice in place of <strong><code>$URL</code></strong> in the following commands.</p>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading">1.2.1 Install git From Ports/Pkg</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Before cloning the tree, <strong><code>git</code></strong> will need to be installed. The simplest way of doing so is through packages.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><code><strong># pkg install git</strong></code></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>There are also <code><strong>git-lite</strong></code> and <code><strong>git-tiny</strong></code>, two packages with only essential dependencies available. They are sufficient for the commands in this article.</p>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading" id="Deep-Clone">1.2.2 Deep Clone</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>A deep clone pulls in the entire tree, as well as all the history and branches. It’s the easiest to do. It also allows you to use git’s worktree feature to have all your active branches checked out into separate directories but with only one copy of the repository.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong><code>% git clone $URL -b branch [dir]</code></strong></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>is how you make a deep clone. <code><strong>branch</strong></code> should be one of the branches listed in the <strong>section 1.1</strong>, if omitted, it will be the depository’s default: main. Dir is an optional directory to place it in (the default will be the name of the repository you are clone (src). For example:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong><code>% git clone https://git.freebsd.org/src.git  </code></strong></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>You’ll want a deep clone if you are interested in the history, plan on making local changes, or plan on working on more than one branch. It’s the easiest to keep up to date as well. If you are interested in the history, but are working with only one branch and are short on space, you can also use <br />
<strong><code>--single-branch</code></strong> to only download the one branch (though some merge commits will not reference the merged-from branch which may be important for some users who are interested in detailed versions of history).</p>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading" id="Shallow-Clone">1.2.3 Shallow Clone</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>A shallow clone copies just the most current code, but none or little of the history. This can be useful when you need to build a specific revision of FreeBSD, or when you are just starting out and plan to track the tree more fully. You can also use it to limit history to only so many revisions.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong><code>% git clone -b branch --depth 1 $URL [dir]</code></strong></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>An example using the default branch:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong><code>% git clone --depth 1 https://git.freebsd.org/src.git</code></strong></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>This clones the repository, but only has the most recent revision in the repository. The rest of the history is not downloaded. Should you change your mind later, you can do <code><strong>git fetch --unshallow</strong></code> to get the complete history.</p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h3 class="wp-block-heading">2. Building and Updating from Source</h3>
<p></section>
<section class="block block-core-paragraph"></p>
<p>After cloning the FreeBSD repository, the next step is to build from source. The process of building remains relatively unchanged, using <code><strong>make</strong></code> and <strong><code>install</code></strong>. Git and offer <code><strong>git pull </strong></code>and <code><strong>git checkout</strong></code> for updating and selecting specific branches or revisions.</p>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading" id="Building">2.1 Building From Source</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Building can be done as described in the handbook [3], eg:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong><code>% cd src <br />
% make buildworld <br />
% make buildkernel <br />
% make installkernel <br />
% make installworld</code></strong></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>&nbsp;</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Note that you can specify <strong><code>-j</code></strong> to make to speed up with parallelism.</p>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading" id="Updating">2.2 Updating From Source</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The following command will update both types of trees. This will pull all revisions since the last update.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong><code>% git pull --ff-only </code></strong></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>This will update the tree. In git, a fast forward merge is one that only needs to set a new branch pointer and doesn’t need to re-create the commits. By always doing a fast forward merge/pull, you’ll ensure that you have an identical copy of the FreeBSD tree. This will be important if you want to maintain local patches.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>See below for how to manage local changes. The simplest is to use:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong><code>% git pull --autostash </code></strong></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>but more sophisticated options are available.</p>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading" id="Selecting-a-Specific-Version">2.3 Selecting a Specific Revision</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>In git, the <code><strong>git checkout</strong></code> command can be used to checkout a specific revision as well as branches. Git’s revisions are the long hashes rather than a sequential number.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>When you checkout a specific revision, just specify the hash you want on the command line (the git log command can help you decide which hash you might want):</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong><code>% git checkout 08b8197a74</code></strong></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>However, as with many things git, it’s not so simple. You’ll be greeted with a message similar to the following:</p>
<p></section>
<section class="block block-core-code"></p>
<pre class="wp-block-code"><code>Note: checking out '08b8197a742a96964d2924391bf9fdfeb788865d'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b &lt;new-branch-name&gt;

HEAD is now at 08b8197a742a hook gpiokeys.4 to the build
</code></pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>where the last line is generated from the hash you are checking out and the first line of the commit message from that revision. Hashes can also be abbreviated. That’s why you’ll see them have different lengths in different commands or their outputs. These super long hashes are often unique after some characters, depends on the size of the repository so git lets you abbreviate and is somewhat inconsistent about how it presents them to users. <strong><code>git rev-parse --short &lt;full-hash&gt; </code></strong>will show the short hash which has the enough length to distinguish in the repository. The current length of FreeBSD src repository is 12.</p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h3 class="wp-block-heading" id="Bisecting">3. Bisecting/Other Considerations</h3>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading">3.1 Bisecting With git bisect</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Sometimes, things go wrong. The last revision worked, but the one you just updated to does not. A developer may ask to bisect the problem to track down which commit caused the regression.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>If you’ve read the last section, you may be thinking to yourself “How the heck do I bisect with crazy revision numbers like that?” then this section is for you. It’s also for you if you didn’t think that, but also want to bisect.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Fortunately, git offers the <code><strong>git bisect</strong></code> command. Here’s a brief outline in how to use it. For more information, I’d suggest <a href="https://git-scm.com/docs/git-bisect" target="_blank" rel="noreferrer noopener">https://git-scm.com/docs/git-bisect</a> for more details. The man page is good at describing what can go wrong, what to do when revisions won’t build, when you want to use terms other than good and bad, etc, none of which will be covered here.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><code><strong>git bisect start</strong></code> will start the bisection process. Next, you need to tell a range to go through. <code><strong>git bisect good XXXXXX</strong></code> will tell it the working revision and <strong><code>git bisect bad XXXXX</code></strong> will tell it the bad revision. The bad revision will almost always be <code><strong>HEAD</strong></code> (a special tag for what you have checked out). The good revision will be the last one you checked out.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>A quick aside: if you want to know the last revision you checked out, you should use <code><strong>git reflog</strong></code>:</p>
<p></section>
<section class="block block-core-code"></p>
<pre class="wp-block-code"><code>5ef0bd68b515 (HEAD -&gt; master, origin/master, origin/HEAD) HEAD@{0}: pull --ff-only: Fast-forward
a8163e165c5b (upstream/master) HEAD@{1}: checkout: moving from b6fb97efb682994f59b21fe4efb3fcfc0e5b9eeb to master
...
</code></pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>shows me moving the working tree to the master branch (a816…) and then updating from upstream (to 5ef0…). In this case, <code><strong>bad</strong></code> would be <code><strong>HEAD</strong></code> (or 5rf0bd68) and <code><strong>good</strong></code> would be a8163e165. As you can see from the output, HEAD@{1} also often works, but isn’t foolproof if you’ve done other things to your git tree after updating, but before you discover the need to bisect.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Back to git bisect. Set the <code><strong>good</strong></code> revision first, then set the <strong><code>bad</code></strong> (though the order doesn’t matter). When you set the bad revision, it will give you some statistics on the process:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><code><strong>% git bisect start<br />
% git bisect good a8163e165c5b<br />
% git bisect bad HEAD</strong></code></p>
<p></section>
<section class="block block-core-code"></p>
<pre class="wp-block-code"><code>Bisecting: 1722 revisions left to test after this (roughly 11 steps)
[c427b3158fd8225f6afc09e7e6f62326f9e4de7e] Fixup r361997 by balancing parens.</code></pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>You’d then build/install that revision. If it’s good you’d type <strong><code>git bisect good </code></strong>otherwise <code><strong>git bisect bad</strong></code>. You’ll get a similar message to the above each step. When you are done, report the bad revision to the developer (or fix the bug yourself and send a patch). <code><strong>git bisect reset</strong></code> will end the process and return you back to where you started (usually tip of main). Again, the git-bisect manual (linked above) is a good resource for when things go wrong or for unusual cases.</p>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading" id="Ports-Considerations">3.2 Documents and Ports Considerations</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The doc tree is the first repository converted to git. There is only one development branch in the repository, main, which contains the source of <a href="https://www.freebsd.org" target="_blank" rel="noreferrer noopener">https://www.freebsd.org</a> and <a href="https://docs.freebsd.org" target="_blank" rel="noreferrer noopener">https://docs.freebsd.org</a>.</p>
<p></section>
<section class="block block-core-list"></p>
<ul class="wp-block-list">
	<li>The repository URL is at <a href="https://git.freebsd.org/doc.git" target="_blank" rel="noreferrer noopener">https://git.freebsd.org/doc.git</a></li>
	<li>The repository is also accessible with SSH: <strong>ssh://anongit@git.freebsd.org/doc.git</strong></li>
	<li>And cgit web repository browser is at: <a href="https://cgit.freebsd.org/doc/" target="_blank" rel="noreferrer noopener">https://cgit.freebsd.org/doc/</a></li>
</ul>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The ports tree operates a similar way. The branch names are different and the repos are in different locations.</p>
<p></section>
<section class="block block-core-list"></p>
<ul class="wp-block-list">
	<li>The repository URL is at <a href="https://git.freebsd.org/ports.git" target="_blank" rel="noreferrer noopener">https://git.freebsd.org/ports.git</a></li>
	<li>The repository is also accessible with SSH: <strong>ssh://anongit@git.freebsd.org/ports.git</strong></li>
	<li>And cgit web repository browser is at: <a href="https://cgit.freebsd.org/ports/" target="_blank" rel="noreferrer noopener">https://cgit.freebsd.org/ports/</a></li>
</ul>
<p></section>
<section class="block block-core-paragraph"></p>
<p>As with ports, the latest development branch is <code><strong>main</strong></code>. The quarterly branches are named the same as in FreeBSD’s svn repo. They are used by the latest and quarterly branches of the pkg.</p>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading" id="Coping-with-Local-Changes">3.3 Coping with Local Changes</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Here’s a small collection of topics that are more advanced for the user tracking FreeBSD. If you have no local changes, you can stop reading now (it’s the last section and OK to skip).</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>One item that’s important for all of them: all changes are local until pushed. Unlike svn, git uses a distributed model. For users, for most things, there’s very little difference. However, if you have local changes, you can use the same tool to manage them as you use to pull in changes from FreeBSD. All changes that you’ve not pushed are local and can easily be modified (git rebase, discussed below does this).</p>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading" id="Keeping-local-changes">3.4 Keeping local changes</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The simplest way to keep local changes (especially trivial ones) is to use <code><strong>git stash</strong></code>. In its simplest form, you use <code><strong>git stash</strong></code> to record the changes (which pushes them onto the stash stack). Most people use this to save changes before updating the tree as described above. They then use <code><strong>git stash apply</strong></code> to re-apply them to the tree. The stash is a stack of changes that can be examined with <code><strong>git stash list</strong></code>. The git-stash man page (<a href="https://git-scm.com/docs/git-stash" target="_blank" rel="noreferrer noopener">https://git-scm.com/docs/git-stash</a>) has all the details.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>This method is suitable when you have tiny tweaks to the tree. When you have anything non trivial, you’ll likely be better off keeping a local branch and rebasing. It is also integrated with the <code><strong>git pull</strong></code> command: just add <br />
<strong>&#8211;</strong><code><strong>–autostash</strong></code> to the command line.</p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h3 class="wp-block-heading">4. FreeBSD Branches</h3>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading" id="Keeping-a-local-branch">4.1 Keeping a local branch</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>It’s much easier to keep a local branch with git than subversion. In subversion you need to merge the commit, and resolve the conflicts. This is manageable, but can lead to a convoluted history that’s hard to upstream should that ever be necessary, or hard to replicate if you need to do so. Git also allows one to merge, along with the same problems. That’s one way to manage the branch, but it’s the least flexible.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Git has a concept of ‘rebasing’ which you can use to avoid these issues. The <code><strong>git rebase</strong></code> command will basically replay all the commits relative to the parent branch at a newer location on that parent branch. This section will briefly cover how to do this, but will not cover all scenarios.</p>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading" id="Create-a-branch">4.2 Create a branch</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Let’s say you want to make a hack to FreeBSD’s <code><strong>ls(1)</strong></code> command to never, ever do color. There’s many reasons to do this, but this example will use that as a baseline. The FreeBSD <code><strong>ls(1)</strong></code> command changes from time to time, and you’ll need to cope with those changes. Fortunately, with git rebase it usually is automatic.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong><code>% cd src<br />
% git checkout main<br />
% git checkout -b no-color-ls<br />
% cd bin/ls<br />
% vi ls.c # hack the changes in<br />
% git diff # check the changes</code></strong></p>
<p></section>
<section class="block block-core-code"></p>
<pre class="wp-block-code"><code>diff --git a/bin/ls/ls.c b/bin/ls/ls.c
index 7378268867ef..cfc3f4342531 100644
--- a/bin/ls/ls.c
+++ b/bin/ls/ls.c
@@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$");
 #include &lt;stdlib.h&gt;
 #include &lt;string.h&gt;
 #include &lt;unistd.h&gt;
+#undef COLORLS
 #ifdef COLORLS
 #include &lt;termcap.h&gt;
 #include &lt;signal.h&gt;</code></pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong><code>% # these look good, make the commit...<br />
% git commit ls.c</code></strong></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The commit will pop you into an editor to describe what you’ve done. Once you enter that, you have your own <strong>local</strong> branch in the git repo. Build and install it like you normally would, following the directions in the handbook. git differs from other revision control systems in that you have to tell it explicitly which files to use. Here it&#8217;s done on the commit command line, but you can also do it with <code><strong>git add</strong></code> which many of the more in depth tutorials cover.</p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h3 class="wp-block-heading">5. Updating to New FreeBSD Releases</h3>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading" id="Time-to-update">5.1 Updating to a New FreeBSD Revision</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>When it’s time to bring in a new revision, it’s almost the same as w/o the branches. You would update like you would above, but there’s one extra command before you update, and one after. The following assumes you are starting with an unmodified tree. It’s important to start rebasing operations with a clean tree (git usually requires this).</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong><code>% git checkout main <br />
% git pull<br />
% git rebase -i main no-color-ls </code></strong></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>This will bring up an editor that lists all the commits in it. For this example, don’t change it at all. This is typically what you are doing while updating the baseline (though you also use the <code><strong>git rebase</strong></code> command to curate the commits you have in the branch).</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Once you’re done with the above, you’ve moved the commits to ls.c forward from the old revision of FreeBSD to the newer one.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Sometimes there’s merge conflicts. That’s OK. Don’t panic. You’d handle them the same as you would any other merge conflicts. To keep it simple, I’ll just describe a common issue you might see. A pointer to a more complete treatment can be found at the end of this section.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Let’s say this includes changes upstream in a radical shift to terminfo as well as a name change for the option. When you updated, you might see something like this:</p>
<p></section>
<section class="block block-core-code"></p>
<pre class="wp-block-code"><code>Auto-merging bin/ls/ls.c
CONFLICT (content): Merge conflict in bin/ls/ls.c
error: could not apply 646e0f9cda11... no color ls
Resolve all conflicts manually, mark them as resolved with
"git add/rm &lt;conflicted_files&gt;", then run "git rebase --continue".
You can instead skip this commit: run "git rebase --skip".
To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply 646e0f9cda11... no color ls</code></pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>which looks scary. If you bring up an editor, you’ll see it’s a typical 3-way merge conflict resolution that you may be familiar with from other source code systems (the rest of ls.c has been omitted):</p>
<p></section>
<section class="block block-core-code"></p>
<pre class="wp-block-code"><code>&lt;&lt;&lt;&lt;&lt;&lt;&lt; HEAD
#ifdef COLORLS_NEW
#include &lt;terminfo.h&gt;
=======
#undef COLORLS
#ifdef COLORLS
#include &lt;termcap.h&gt;
&gt;&gt;&gt;&gt;&gt;&gt;&gt; 646e0f9cda11... no color ls</code></pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The new code is first, and your code is second. The right fix here is to just add a <code><strong>#undef COLORLS_NEW</strong></code> before <code><strong>#ifdef</strong></code> and then delete the old changes:</p>
<p></section>
<section class="block block-core-code"></p>
<pre class="wp-block-code"><code>#undef COLORLS_NEW
#ifdef COLORLS_NEW
#include &lt;terminfo.h&gt;</code></pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>save the file. The rebase was interrupted, so you have to complete it:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong><code>% git add ls.c <br />
% git rebase --cont</code></strong></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>which tells git that <strong><code>ls.c</code></strong> has changed and to continue the rebase operation. Since there was a conflict, you’ll get kicked into the editor to maybe update the commit message.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>If you get stuck during the rebase, don’t panic. git rebase &#8211;abort will take you back to a clean slate. It’s important, though, to start with an unmodified tree.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>For more on this topic, <a href="https://www.freecodecamp.org/news/the-ultimate-guide-to-git-merge-and-git-rebase/" target="_blank" rel="noreferrer noopener">https://www.freecodecamp.org/news/the-ultimate-guide-to-git-merge-and-git-rebase/</a> provides a rather extensive treatment. It goes into a lot of cases I didn’t cover here for simplicity that are useful to know since they come up from time to time.</p>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading" id="Updating-to-a-New-FreeBSD-Branch">5.2 Updating to a New FreeBSD Branch</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Let’s say you want to main the jump from FreeBSD stable/12 to FreeBSD current. That’s easy to do as well, if you have a deep clone.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong><code>% git checkout main <br />
% # build and install here...</code></strong></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>and you are done. If you have a local branch, though, there’s one or two caveats. First, rebase will rewrite history, so you’ll likely want to do something to save it. Second, jumping branches tends to encounter more conflicts. If we pretend the example above was relative to stable/12, then to move to main, I’d suggest the following:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong><code>% git checkout no-color-ls <br />
% git checkout -b no-color-ls-stable-12   # create another name for this branch <br />
% git rebase -i stable/12 no-color-ls --onto main </code></strong></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>What the above does is checkout no-color-ls. Then create a new name for it (no-color-ls-stable-12) in case you need to get back to it. Then you rebase onto the main branch. This will find all the commits to the current no-color-ls branch (back to where it meets up with the stable/12 branch) and then it will replay them onto the main branch creating a new no-color-ls branch there (which is why I had you create a placeholder name).</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>&nbsp;</p>
<p></section>
<section class="block block-core-heading"></p>
<h1 class="wp-block-heading">References:</h1>
<p></section>
<section class="block block-core-paragraph"></p>
<p>[1] Using Git, FreeBSD Handbook, <a href="https://docs.freebsd.org/en/books/handbook/mirrors/#git">https://docs.freebsd.org/en/books/handbook/mirrors/#git</a></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>[2] Git, FreeBSD wiki, <a href="https://wiki.freebsd.org/Git">https://wiki.freebsd.org/Git</a></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>[3] Updating FreeBSD from Source, FreeBSD Handbook, <a href="https://docs.freebsd.org/en/books/handbook/cutting-edge/#makeworld">https://docs.freebsd.org/en/books/handbook/cutting-edge/#makeworld</a></p>
<p></section><section class="block block-classic-editor"></p></section><p>The post <a href="https://freebsdfoundation.org/resource/updating-freebsd-from-git/">Updating FreeBSD From Git</a> first appeared on <a href="https://freebsdfoundation.org">FreeBSD Foundation</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Contributing to FreeBSD as a Programmer</title>
		<link>https://freebsdfoundation.org/resource/contributing-to-freebsd-as-a-programmer/</link>
		
		<dc:creator><![CDATA[Anne Dickison]]></dc:creator>
		<pubDate>Mon, 15 Aug 2022 18:26:25 +0000</pubDate>
				<guid isPermaLink="false">https://freebsdfoundation.org/?post_type=resource&#038;p=11559</guid>

					<description><![CDATA[<p>FreeBSD relies on the continued contributions of its user base to survive. Becoming involved is simple and there are a wide variety of tasks that users can contribute to. This guide will focus on how programmers can contribute to the project.</p>
<p>The post <a href="https://freebsdfoundation.org/resource/contributing-to-freebsd-as-a-programmer/">Contributing to FreeBSD as a Programmer</a> first appeared on <a href="https://freebsdfoundation.org">FreeBSD Foundation</a>.</p>]]></description>
										<content:encoded><![CDATA[<section class="block block-classic-editor"><p></section><section class="block block-core-paragraph"></p>
<p><strong>Updated: June 15, 202</strong>2</p>
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="507" height="304" class="wp-image-7899" src="https://freebsdfoundation.org/wp-content/uploads/2020/03/event-slider-freebsd-logo-cropped.jpg" alt="" srcset="https://freebsdfoundation.org/wp-content/uploads/2020/03/event-slider-freebsd-logo-cropped.jpg 507w, https://freebsdfoundation.org/wp-content/uploads/2020/03/event-slider-freebsd-logo-cropped-300x180.jpg 300w" sizes="(max-width: 507px) 100vw, 507px" /></figure>
<p></section></div>
<section class="block block-core-paragraph"></p>
<p>FreeBSD relies on the continued contributions of its user base to survive. Becoming involved is simple and there are a wide variety of tasks that users can contribute to.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>A large and growing number of international contributors, of various ages and areas of technical expertise, develop FreeBSD. There is always more work to be done than there are people available to do it, and more help is always appreciated.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The FreeBSD project is responsible for the entire FreeBSD operating system environment, meaning a wide range of <code>TODO</code> tasks exist. To help contributing to the FreeBSD documentation, check out <a href="https://freebsdfoundation.org/contributing-freebsd-documentation/" target="_blank" rel="noreferrer noopener">this guide</a> on submitting and updating documentation.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>This guide will focus on how programmers can contribute to the project. Please read through the following selection of tasks that may be needed.</p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="has-text-align-center wp-block-heading">Where to Find Open Tasks</h2>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading">1.1 Ongoing Programmer Tasks</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Most of the tasks listed here require a considerable investment of time, an in-depth knowledge of the FreeBSD kernel, or both. However, there are also many useful tasks which are suitable for “weekend hackers”.</p>
<p></section>
<section class="block block-core-list"></p>
<ol class="wp-block-list" type="1">
	<li>Read the <a href="http://lists.freebsd.org/mailman/listinfo/freebsd-bugs" target="_blank" rel="noreferrer noopener">FreeBSD problem reports mailing list</a>. There may be a problem you can comment constructively on, or with patches you can test. You could even try to fix one of the problems yourself.</li>
	<li>If you know of any bug fixes which have been successfully applied to -CURRENT but have not been merged into -STABLE after a decent interval (normally a couple of weeks), send the committer a polite reminder.</li>
	<li>Move contributed software to <code>src/contrib</code> in the source tree.</li>
	<li>Make sure code in <code>src/contrib</code> is up to date.</li>
	<li>Build the source tree with extra warnings enabled and clean up the warnings. A list of build warnings can also be found from our <a href="https://ci.freebsd.org/" target="_blank" rel="noreferrer noopener">CI</a> by selecting a build and checking &#8220;LLVM/Clang Warnings&#8221;.</li>
	<li>Fix warnings for ports which do deprecated things like using <code>gets()</code> or including <code>malloc.h</code>.</li>
	<li>If you have contributed any ports where you had to make FreeBSD-specific changes, send your patches back to the original authors (this will make your life easier when they bring out the next version).</li>
	<li>Get copies of formal standards like POSIX®. Compare FreeBSD&#8217;s behavior to that required by the standard. If the behavior differs, particularly in subtle or obscure corners of the specification, send in a PR about it. If you are able to, figure out how to fix it and include a patch in the PR.</li>
</ol>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading">1.2 Working Through the PR Database</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>FreeBSD users can submit requests for enhancement and bug reports through to <a href="http://bugs.freebsd.org/search/" target="_blank" rel="noreferrer noopener">FreeBSD PR (problem report) </a>database. The database contains many active programmer and non-programmer tasks, though not all tasks are required to be logged there. Look through the open problem reports, and see if anything there takes your interest. There is a wide range of tasks that may range from simple code reviews to much more complex requests that may not readily contain a fix.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Start with open problem reports that have not been assigned to anyone else. If there is an active PR that is assigned to someone else, but looks like something you would like to work on, email the person assigned to the task and ask if you can assist or take over the PR. They may already have a patch that they need to test, or benefit from your suggestions.</p>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading">1.3 Ongoing Ports Tasks</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The Ports Collection contains a massive amount of content and as such, is always a perpetual work in progress. People are constantly needed to keep the collection up to date, and filled with high quality third party software.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Anyone can get involved, and there are lots of different ways to contribute. Contributing to ports is an excellent way to help “give back” something to the project. Whether you are looking for an ongoing role or a fun challenge for a rainy day, the project would love to have your help!</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>There are a number of easy ways you can contribute to keeping the ports tree up to date and in good working order:</p>
<p></section>
<section class="block block-core-list"></p>
<ul class="wp-block-list">
	<li>Create a new port for a cool or useful software.</li>
	<li>Adopt an unmaintained port and become the maintainer.

<ul>
	<li>If you have created or adopted a port, be aware of what you need to do as a maintainer. Consider reading through <a href="https://docs.freebsd.org/en/articles/contributing/ports-contributing.html#maintain-port" target="_blank" rel="noreferrer noopener">the maintainer responsibilities.</a></li>
</ul>
</li>
	<li>When you are looking for a quick challenge you could fix a bug or a broken port.</li>
</ul>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading">1.4 Pick One of the Items From the Ideas Page</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p><a href="https://wiki.freebsd.org/IdeasPage" target="_blank" rel="noreferrer noopener">The FreeBSD ideas page</a> is regularly updated with items for programmers. Anyone looking to contribute to the FreeBSD Project can check it for tasks that they can assist with.</p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="402" class="wp-image-7893" src="https://freebsdfoundation.org/wp-content/uploads/2020/05/free-bsd-header-1024x402.jpg" alt="" srcset="https://freebsdfoundation.org/wp-content/uploads/2020/05/free-bsd-header-1024x402.jpg 1024w, https://freebsdfoundation.org/wp-content/uploads/2020/05/free-bsd-header-300x118.jpg 300w, https://freebsdfoundation.org/wp-content/uploads/2020/05/free-bsd-header-1536x603.jpg 1536w, https://freebsdfoundation.org/wp-content/uploads/2020/05/free-bsd-header-2048x804.jpg 2048w, https://freebsdfoundation.org/wp-content/uploads/2020/05/free-bsd-header-scaled.jpg 1920w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>
<p></section></div>
<section class="block block-core-heading"></p>
<h2 class="has-text-align-center wp-block-heading">Ways to Contribute to The System</h2>
<p></section>
<section class="block block-core-paragraph"></p>
<p>After identifying a task to work on, there are a few ways to assist with the operating system itself.</p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading">2.1 Submitting Bug Reports and General Commentary</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>&nbsp;</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>If you are submitting a specific change, you can submit the patch by using the <a href="https://bugs.freebsd.org/submit/" target="_blank" rel="noreferrer noopener">bug submission form</a>. <a href="https://freebsdfoundation.org/freebsd-project/resources/how-to-submit-a-bug-report" target="_blank" rel="noreferrer noopener">This how to guide</a> provides a step-by-step walkthrough for submitting a bug report.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>If the patch is suitable to be applied to the source tree put [PATCH] in the synopsis of the report. When including patches, <em><strong>do not</strong></em> use cut-and-paste because cut-and-paste turns tabs into spaces and makes them unusable. When patches are a lot larger than 20KB, consider compressing them prior to uploading them.</p>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading">2.2 Submitting Changes to Existing Source Code</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>An addition or change to the existing source code is a somewhat trickier affair and depends a lot on how far out of date you are with the current state of FreeBSD development. There is a special on-going release of FreeBSD known as “FreeBSD-CURRENT” which is made available in a variety of ways for the convenience of developers working actively on the system. See <a href="https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/current-stable.html" target="_blank" rel="noreferrer noopener">The FreeBSD Handbook</a> for more information about getting and using FreeBSD-CURRENT.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Working from older sources, unfortunately, means that your changes may sometimes be too obsolete or too divergent for easy re-integration into FreeBSD. Chances of this can be minimized somewhat by subscribing to the <a href="http://lists.freebsd.org/mailman/listinfo/freebsd-announce" target="_blank" rel="noreferrer noopener">FreeBSD announcements mailing list</a> and the <a href="http://lists.freebsd.org/mailman/listinfo/freebsd-current" target="_blank" rel="noreferrer noopener">FreeBSD-CURRENT mailing list</a> lists, where discussions on the current state of the system take place.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Assuming that you can manage to secure fairly up-to-date sources to base your changes on, the next step is to produce a set of diffs to send to the FreeBSD maintainers. This is done with the <a href="https://www.freebsd.org/cgi/man.cgi?query=diff&amp;sektion=1&amp;manpath=freebsd-release-ports" target="_blank" rel="noreferrer noopener">diff(1)</a> command.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The preferred <a href="https://www.freebsd.org/cgi/man.cgi?query=diff&amp;sektion=1&amp;manpath=freebsd-release-ports" target="_blank" rel="noreferrer noopener">diff(1)</a> format for submitting patches is the unified output format generated by <code>diff -u</code>.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><strong><code>%</code> <code>diff -u oldfile newfile</code></strong></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>or</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><strong><code>% diff -u -r -N olddir newdir</code></strong></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>will generate a set of unified diffs for the given source file or directory hierarchy.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Once you have a set of diffs (which you may test with the <a href="https://www.freebsd.org/cgi/man.cgi?query=patch&amp;sektion=1&amp;manpath=freebsd-release-ports" target="_blank" rel="noreferrer noopener">patch(1)</a> command), you should submit them for inclusion with FreeBSD as a bug report. Because we are busy, we may not be able to address it immediately, but it will remain in the PR database until we do. Indicate your submission by including <code>[PATCH]</code> in the synopsis of the report.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>If your change is of a potentially sensitive nature, such as if you are unsure of copyright issues governing its further distribution then you should send it to Core Team <code>&lt;<a href="mailto:core@FreeBSD.org" target="_blank" rel="noreferrer noopener">core@FreeBSD.org</a>&gt;</code> directly rather than submitting as a bug report. The Core Team <code>&lt;<a href="mailto:core@FreeBSD.org" target="_blank" rel="noreferrer noopener">core@FreeBSD.org</a>&gt;</code> reaches a much smaller group of people who do much of the day-to-day work on FreeBSD. Note that this group is also <em>very busy</em> and so you should only send mail to them where it is truly necessary.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong>NOTE:</strong> Please refer to <a href="https://www.freebsd.org/cgi/man.cgi?query=intro&amp;sektion=9&amp;manpath=freebsd-release-ports" target="_blank" rel="noreferrer noopener">intro(9)</a> and <a href="https://www.freebsd.org/cgi/man.cgi?query=style&amp;sektion=9&amp;manpath=freebsd-release-ports" target="_blank" rel="noreferrer noopener">style(9)</a> for some information on coding style. We would appreciate it if you were at least aware of this information before submitting code.</p>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading">2.3 New Code or Major Value-Added Packages</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>In the case of a significant contribution, or the addition of an important new feature to FreeBSD, it becomes almost always necessary to either send changes as tar files or a publicly accessible git branch or repository. Running these large changes through <a href="https://reviews.freebsd.org/" target="_blank" rel="noreferrer noopener">Phabricator</a> is also recommended.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>When working with large amounts of code, the touchy subject of copyrights also invariably comes up. FreeBSD prefers free software licenses such as BSD or ISC. Copyleft licenses such as GPLv2 are sometimes permitted. The complete listing can be found on the <a href="https://www.freebsd.org/internal/software-license.html" target="_blank" rel="noreferrer noopener">core team licensing policy</a> page.</p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="480" height="128" class="wp-image-5184" src="https://freebsdfoundation.org/wp-content/uploads/2017/05/freebsd_ports-e1585249630722.png" alt="" srcset="https://freebsdfoundation.org/wp-content/uploads/2017/05/freebsd_ports-e1585249630722.png 480w, https://freebsdfoundation.org/wp-content/uploads/2017/05/freebsd_ports-e1585249630722-300x80.png 300w" sizes="(max-width: 480px) 100vw, 480px" /></figure>
<p></section></div>
<section class="block block-core-heading"></p>
<h2 class="has-text-align-center wp-block-heading">Contributing to Ports</h2>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Creating a port is a once-off task. Ensuring that a port is up to date and continues to build and run requires an ongoing maintenance effort. Maintainers are the people who dedicate some of their time to meeting these goals.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The foremost reason ports need maintenance is to bring the latest and greatest in third party software to the FreeBSD community. An additional challenge is to keep individual ports working within the Ports Collection framework as it evolves.</p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading">3.1 Adopting Unmaintained Ports</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Taking over unmaintained ports is a great way to get involved. Unmaintained ports are only updated and fixed when somebody volunteers to work on them. There are a large number of unmaintained ports. A good idea is to start by adopting a port that you use regularly.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Unmaintained ports have their <code><strong>MAINTAINER</strong></code> set to <code><strong>ports@FreeBSD.org</strong></code>. A list of unmaintained ports and their current errors and problem reports can be seen at the <a href="http://portsmon.freebsd.org/" target="_blank" rel="noreferrer noopener">FreeBSD Ports Monitoring System</a>.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Some ports affect a large number of others due to dependencies. Generally, we want people to have some experience before they maintain these ports.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>&nbsp;</p>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading">3.2 Finding and Fixing a Broken Port</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>There are two really good places to find a port that needs some attention.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>You can use the <a href="https://bugs.freebsd.org/search">web interface</a> to the Problem Report database to search through and view unresolved PRs. The majority of ports PRs are updates, but with a little searching and skimming over synopses you should be able to find something interesting to work on (the <code><strong>sw-bug</strong></code> class is a good place to start).</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The other place is the <a href="http://portsmon.freebsd.org/">FreeBSD Ports Monitoring System</a>. In particular look for unmaintained ports with build errors and ports that are marked <code>BROKEN</code>. It is OK to send changes for a maintained port as well, but remember to ask the maintainer in case they are already working on the problem.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Once you have found a bug or problem, collect information, investigate and fix! If there is an existing PR, follow up to that. Otherwise create a new PR. Your changes will be reviewed and, if everything checks out, committed.</p>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading">3.3 How to Adopt the Port</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>First, make sure you understand your responsibilities as a maintainer. Also read the <a href="https://download.freebsd.org/ftp/doc/en/books/porters-handbook/book.pdf">Porter&#8217;s Handbook</a>. <em>Please do not commit yourself to more than you feel you can comfortably handle.</em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>You may request maintainership of any unmaintained port as soon as you wish. Simply set <code><strong>MAINTAINER</strong></code> to your own email address and send a problem report (PR) with the change. If the port has build errors or needs updating, you may wish to include any other changes in the same PR. This will help because many committers are less willing to assign maintainership to someone who does not have a known track record with FreeBSD. Submitting PRs that fix build errors or update ports are the best ways to establish one.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>File your PR with category <code><strong>ports</strong></code> and class <code><strong>change-request</strong></code>. A committer will examine your PR, commit the changes, and close the PR.</p>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading">3.4 Keep Your Ports up to Date</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>This section outlines the process to follow to keep your ports up to date.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>This is an overview. More information about upgrading a port is available in the <a href="https://download.freebsd.org/ftp/doc/en/books/porters-handbook/book.pdf" target="_blank" rel="noreferrer noopener">Porter&#8217;s Handbook</a>.</p>
<p></section>
<section class="block block-core-list"></p>
<ol class="wp-block-list" type="1">
	<li><strong>Watch for updates</strong>: Monitor the upstream vendor for new versions, updates and security fixes for the software. Announcement mailing lists or news web pages are useful for doing this. Sometimes users will contact you and ask when your port will be updated. If you are busy with other things, or for any reason just cannot update it at the moment, ask if they will help you by submitting an update. You may also receive automated email from the <code><strong>FreeBSD Ports Version Check</strong></code> informing you that a newer version of your port&#8217;s distfile is available. More information about that system (including how to stop future emails) will be provided in the message.</li>
	<li><strong>Incorporate changes</strong>: When they become available, incorporate the changes into the port. You need to be able to generate a patch between the original port and your updated port.</li>
	<li><strong>Review and test</strong>: Thoroughly review and test your changes:

<ul>
	<li>Build, install and test your port on as many platforms and architectures as you can. It is common for a port to work on one branch or platform and fail on another.</li>
	<li>Make sure your port&#8217;s dependencies are complete. The recommended way of doing this is by installing your own ports tinderbox.</li>
	<li>Check that the packing list is up to date. This involves adding in any new files and directories and removing unused entries.</li>
	<li>Verify your port using <a href="https://www.freebsd.org/cgi/man.cgi?query=portlint&amp;sektion=1&amp;manpath=freebsd-release-ports" target="_blank" rel="noreferrer noopener">portlint(1)</a> as a guide.</li>
	<li>Consider whether changes to your port might cause any other ports to break. If this is the case, coordinate the changes with the maintainers of those ports. This is especially important if your update changes the shared library version; in this case, at the very least, the dependent ports will need to get a <code><strong>PORTREVISION</strong></code> bump so that they will automatically be upgraded by automated tools such as portmaster or <a href="https://www.freebsd.org/cgi/man.cgi?query=portupgrade&amp;sektion=1&amp;manpath=freebsd-release-ports" target="_blank" rel="noreferrer noopener">portupgrade(1)</a>.</li>
</ul>
</li>
	<li><strong>Submit changes</strong>: Send your update by submitting a PR with an explanation of the changes and a patch containing the differences between the original port and the updated one. <strong>Note:</strong> Please do not submit a <a href="https://www.freebsd.org/cgi/man.cgi?query=shar&amp;sektion=1&amp;manpath=freebsd-release-ports" target="_blank" rel="noreferrer noopener">shar(1)</a> archive of the entire port; instead, use <a href="https://www.freebsd.org/cgi/man.cgi?query=diff&amp;sektion=1&amp;manpath=freebsd-release-ports" target="_blank" rel="noreferrer noopener">diff(1)</a> <code><strong>-ruN</strong></code>. In this way, committers can much more easily see exactly what changes are being made.</li>
	<li><strong>Wait</strong>: At some stage a committer will deal with your PR. It may take minutes, or it may take weeks — so please be patient. If you don&#8217;t receive feedback, it may simply that the committer had none, or that it was missed.</li>
	<li><strong>Give feedback</strong>: If a committer finds a problem with your changes, they will most likely refer it back to you. A prompt response will help get your PR committed faster, and is better for maintaining a thread of conversation when trying to resolve any problems.</li>
	<li><strong>And Finally</strong>: Your changes will be committed and your port will have been updated. The PR will then be closed by the committer.</li>
</ol>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading">3.5 Ensure Your Ports Continue to Build Correctly</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>FreeBSD only guarantees that the Ports Collection works on the <code><strong>-STABLE</strong></code> branches. In theory, you should be able to get by with running the latest release of each stable branch but if you can run the branch, that is even better.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Since the majority of FreeBSD installations run on PC-compatible machines (what is termed the <code><strong>i386</strong></code> architecture), we expect you to keep the port working on that architecture. We prefer that ports also work on the <strong><code>amd64</code> </strong>architecture running native. It is completely fair to ask for help if you do not have one of these machines.</p>
<p></section>
<section class="block block-core-heading"></p>
<h5 class="wp-block-heading"><strong>Note</strong>: </h5>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The usual failure modes for non<strong>&#8211;<code>x86</code></strong> machines are that the original programmers assumed that, for instance, pointers are <strong><code>int</code>s</strong>, or that a relatively lax older <strong>gcc</strong> compiler was being used. More and more, application authors are reworking their code to remove these assumptions — but if the author is not actively maintaining their code, you may need to do this yourself.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>These are the tasks you need to perform to ensure your port is able to be built:</p>
<p></section>
<section class="block block-core-list"></p>
<ol class="wp-block-list" type="1">
	<li><strong>Watch for build failures</strong>: Check your mail for mail from <code><strong>pkg-fallout@FreeBSD.org</strong></code> and the <a href="http://portscout.freebsd.org/">distfiles scanner</a> to see if any of the port which are failing to build are out of date.</li>
	<li><strong>Collect information</strong>: Once you are aware of a problem, collect information to help you fix it. Build errors reported by <code><strong>pkg-fallout</strong></code> are accompanied by logs which will show you where the build failed. If the failure was reported to you by a user, ask them to send you information which may help in diagnosing the problem, such as:

<ul>
	<li>Build logs</li>
	<li>The commands and options used to build the port (including options set in <code><strong>/etc/make.conf</strong></code>)</li>
	<li>A list of packages installed on their system as shown by <a href="https://www.freebsd.org/cgi/man.cgi?query=pkg-info&amp;sektion=8&amp;manpath=freebsd-release-ports">pkg-info(8)</a></li>
	<li>The version of FreeBSD they are running as shown by <a href="https://www.freebsd.org/cgi/man.cgi?query=uname&amp;sektion=1&amp;manpath=freebsd-release-ports">uname(1)</a><code><strong> -a</strong></code></li>
	<li>When their ports collection was last updated</li>
	<li>When their ports tree and <code><strong>INDEX</strong></code> was last updated</li>
</ul>
</li>
	<li><strong>Investigate and find a solution</strong>: Unfortunately there is no straightforward process to follow to do this. If you are stuck, ask for help! The <a href="http://lists.freebsd.org/mailman/listinfo/freebsd-ports">FreeBSD ports mailing list</a> is a good place to start, and the upstream developers are often very helpful.</li>
	<li><strong>Submit changes</strong>: Just as with updating a port, you should now incorporate changes, review and test, submit your changes in a PR, and provide feedback if required.</li>
	<li><strong>Send patches to upstream authors</strong>: In some cases, you will have to make patches to the port to make it run on FreeBSD. Some (but not all) upstream authors will accept such patches back into their code for the next release. If so, this may even help their users on other BSD-based systems as well and perhaps save duplicated effort. Please consider sending any applicable patches to the authors as a courtesy.</li>
</ol>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading">3.6 Investigate Bug Reports and PRs Related to Your Port</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>FreeBSD-specific bugs are generally caused by assumptions about the build and runtime environments that do not apply to FreeBSD. You are less likely to encounter a problem of this type, but it can be more subtle and difficult to diagnose.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>These are the tasks you need to perform to ensure your port continues to work as intended:</p>
<p></section>
<section class="block block-core-list"></p>
<ol class="wp-block-list" type="1">
	<li><strong>Respond to bug reports: </strong>Bugs may be reported to you through email via the <a href="https://bugs.freebsd.org/search/" target="_blank" rel="noreferrer noopener">Problem Report database</a>. Bugs may also be reported directly to you by users. You should respond to PRs and other reports within 14 days, but please try not to take that long. Try to respond as soon as possible, even if it is just to say you need some more time before you can work on the PR. If you have not responded after 14 days, any committer may commit from a PR that you have not responded to via a <code>maintainer-timeout</code>.</li>
	<li><strong>Collect information</strong>: If the person reporting the bug has not also provided a fix, you need to collect the information that will allow you to generate one. If the bug is reproducible, you can collect most of the required information yourself. If not, ask the person who reported the bug to collect the information for you, such as:

<ul>
	<li>A detailed description of their actions, expected program behavior and actual behavior</li>
	<li>Copies of input data used to trigger the bug</li>
	<li>Information about their build and execution environment — for example, a list of installed packages and the output of <a href="https://www.freebsd.org/cgi/man.cgi?query=env&amp;sektion=1&amp;manpath=freebsd-release-ports">env(1)</a></li>
	<li>Core dumps</li>
	<li>Stack traces</li>
</ul>
</li>
	<li><strong>Eliminate incorrect reports</strong>: Some bug reports may be incorrect. For example, the user may have simply misused the program; or their installed packages may be out of date and require updating. Sometimes a reported bug is not specific to FreeBSD. In this case report the bug to the upstream developers. If the bug is within your capabilities to fix, you can also patch the port so that the fix is applied before the next upstream release.</li>
	<li><strong>Find a solution</strong>: As with build errors, you will need to sort out a fix to the problem. Again, remember to ask if you are stuck!</li>
	<li><strong>Submit or approve changes</strong>: Just as with updating a port, you should now incorporate changes, review and test, and submit your changes in a PR (or send a follow-up if a PR already exists for the problem). If another user has submitted changes in the PR, you can also send a follow-up saying whether or not you approve the changes.</li>
</ol>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading">3.7 Providing Support</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Part of being a maintainer is providing support — not for the software in general — but for the port and any FreeBSD-specific quirks and problems. Users may contact you with questions, suggestions, problems and patches. Most of the time their correspondence will be specific to FreeBSD.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Occasionally you may have to point users seeking general support to the appropriate resources. Less frequently you will encounter a person asking why the <code>RPM</code>s are not up to date or how can they get the software to run under Foo Linux. Take the opportunity to tell them that your port is up to date, and suggest that they try FreeBSD.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Sometimes users and developers will spend time assisting you and your port. They may:</p>
<p></section>
<section class="block block-core-list"></p>
<ul class="wp-block-list">
	<li>Submit a PR or send you patches to update your port</li>
	<li>Investigate and perhaps provide a fix to a PR</li>
	<li>Otherwise submit changes to your port</li>
</ul>
<p></section>
<section class="block block-core-paragraph"></p>
<p>In these cases, your main obligation is to respond in a timely manner. Again, the timeout for non-responsive maintainers is 14 days. After this period changes may be committed unapproved. They have taken the trouble to do this for you; so please try to at least respond promptly. Then review, approve, modify or discuss their changes with them as soon as possible.</p>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading">3.8 Resources for Ports Maintainers and Contributors</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The <a href="https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook" target="_blank" rel="noreferrer noopener">Porter&#8217;s Handbook</a> is your hitchhiker&#8217;s guide to the ports system. Keep it handy!</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The <a href="https://bugs.freebsd.org/bugzilla/query.cgi" target="_blank" rel="noreferrer noopener">Problem Report database</a>.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The <a href="http://portsmon.freebsd.org/" target="_blank" rel="noreferrer noopener">FreeBSD Ports Monitoring System</a> can show you cross-referenced information about ports such as build errors and problem reports. If you are a maintainer you can use it to check on the build status of your ports. As a contributor you can use it to find broken and unmaintained ports that need to be fixed.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The <a href="http://portscout.freebsd.org/" target="_blank" rel="noreferrer noopener">FreeBSD Ports distfile scanner</a> can show you ports for which the distfiles are not fetchable. You can check on your own ports or use it to find ports that need their <code><strong>MASTER_SITES</strong></code> updated.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><a href="https://www.freebsd.org/cgi/url.cgi?ports/ports-mgmt/poudriere/pkg-descr" target="_blank" rel="noreferrer noopener">ports-mgmt/poudriere</a> is the most thorough way to test a port through the entire cycle of installation, packaging, and deinstallation. Documentation is located at the <a href="https://github.com/freebsd/poudriere" target="_blank" rel="noreferrer noopener">poudriere github repository</a></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><a href="https://www.freebsd.org/cgi/man.cgi?query=portlint&amp;sektion=1&amp;manpath=freebsd-release-ports" target="_blank" rel="noreferrer noopener">portlint(1)</a> is an application which can be used to verify that your port conforms to many important stylistic and functional guidelines. portlint is a simple heuristic application, so you should use it <em>only as a guide</em>. If portlint suggests changes which seem unreasonable, consult the <a href="https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook" target="_blank" rel="noreferrer noopener">Porter&#8217;s Handbook</a> or ask for advice.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The <a href="http://lists.freebsd.org/mailman/listinfo/freebsd-ports" target="_blank" rel="noreferrer noopener">FreeBSD ports mailing list</a> is for general ports-related discussion. It is a good place to ask for help. You can <a href="https://lists.freebsd.org/mailman/listinfo" target="_blank" rel="noreferrer noopener">subscribe, or read and search the list archives</a>. Reading the archives of the <a href="http://lists.freebsd.org/mailman/listinfo/freebsd-ports-bugs" target="_blank" rel="noreferrer noopener">FreeBSD ports bugs mailing list</a> and the <a href="http://lists.freebsd.org/mailman/listinfo/svn-ports-head" target="_blank" rel="noreferrer noopener">SVN commit messages for the ports tree for head/</a> may also be of interest.</p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="has-text-align-center wp-block-heading">Other Ways to Contribute</h2>
<p></section>
<section class="block block-core-paragraph"></p>
<p>If you are looking for something interesting to get started, the FreeBSD Project has several Wiki pages containing areas within which new contributors can get ideas on how to get started.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The <a href="https://wiki.freebsd.org/JuniorJobs" target="_blank" rel="noreferrer noopener">Junior Jobs</a> page lists current projects that may interest people new to FreeBSD, these can be great way to acquaint oneself with the project.</p>
<p></section><section class="block block-classic-editor"></p></section><p>The post <a href="https://freebsdfoundation.org/resource/contributing-to-freebsd-as-a-programmer/">Contributing to FreeBSD as a Programmer</a> first appeared on <a href="https://freebsdfoundation.org">FreeBSD Foundation</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Contributing FreeBSD Documentation</title>
		<link>https://freebsdfoundation.org/resource/contributing-freebsd-documentation/</link>
		
		<dc:creator><![CDATA[Anne Dickison]]></dc:creator>
		<pubDate>Mon, 15 Aug 2022 18:19:41 +0000</pubDate>
				<guid isPermaLink="false">https://freebsdfoundation.org/?post_type=resource&#038;p=11555</guid>

					<description><![CDATA[<p>Quality documentation is crucial to the success of FreeBSD, submitting documentation is one of the easiest ways to contribute to the project and anyone is welcome to submit! Willingness to contribute is the only membership requirement.</p>
<p>The post <a href="https://freebsdfoundation.org/resource/contributing-freebsd-documentation/">Contributing FreeBSD Documentation</a> first appeared on <a href="https://freebsdfoundation.org">FreeBSD Foundation</a>.</p>]]></description>
										<content:encoded><![CDATA[<section class="block block-classic-editor"><p></section><section class="block block-core-paragraph"></p>
<p><strong>Updated: February 5, 2022</strong></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Quality documentation is crucial to the success of FreeBSD, submitting documentation is one of the easiest ways to contribute to the project and anyone is welcome to submit! Willingness to contribute is the only membership requirement.</p>
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="274" height="163" class="wp-image-9449" src="https://freebsdfoundation.org/wp-content/uploads/2021/05/doc.jpg" alt="" /></figure>
<p></section></div>
<section class="block block-core-heading"></p>
<h2 class="has-text-align-center wp-block-heading">Documentation Quick-Guide</h2>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The first step to contribute is to subscribe to the <a href="https://lists.freebsd.org/mailman/listinfo/freebsd-doc" target="_blank" rel="noreferrer noopener">FreeBSD documentation project mailing list.</a> This is a fantastic resource for any questions or problems involving the documentation.</p>
<p></section>
<section class="block block-core-list"></p>
<ol class="wp-block-list" type="1">
	<li>Install a few packages. The <a href="https://www.freebsd.org/cgi/url.cgi?ports/textproc/docproj/pkg-descr">textproc/docproj</a> meta-package installs all of the software needed to edit and build FreeBSD documentation, git is needed to obtain a working copy of the documentation and generate patches with, and python is helpful for work with the FreeBSD documentation<br />
<code><em># pkg install docproj git</em></code></li>
	<li>Install a local working copy of the documentation from the FreeBSD repository in <code>~/doc</code> (see <a title="The Working Copy" href="https://docs.freebsd.org/en/books/fdp-primer/working-copy/" target="_blank" rel="noreferrer noopener">Chapter 3, <em>The Working Copy</em></a>).<br />
<code><em>% git clone https://git.freebsd.org/doc</em></code>.<code><em>git ~/doc</em></code></li>
	<li>Configure the text editor:

<ul>
	<li>Word wrap set to 70 characters.</li>
	<li>Tab stops set to 2.</li>
	<li>Replace each group of 8 leading spaces with a single tab. Specific editor configurations are listed in <a href="https://docs.freebsd.org/en/books/fdp-primer/editor-config/">Chapter 15, <em>Editor Configuration</em></a>.</li>
</ul>
</li>
	<li>Update the local working copy:<br />
<code><em>% git pull --ff-only</em></code></li>
	<li>Edit the documentation files that require changes. If a file needs major changes, consult the mailing list for input. References to AsciiDoctor can be found in <a href="https://docs.freebsd.org/en/books/fdp-primer/asciidoctor-primer/" target="_blank" rel="noreferrer noopener">Chapter 6. AsciiDoctor Primer</a> and in the <a href="https://docs.asciidoctor.org/asciidoc/latest/" target="_blank" rel="noreferrer noopener">AsciiDoc Language Documentation Portal</a>.</li>
	<li><em>Always</em> build-test changes before submitting them. Running <strong><code>make</code></strong> in the top-level directory of the documentation being edited will generate that documentation in split HTML format.<br />
<em><code>% make</code></em></li>
	<li>When changes are complete and tested, generate a “diff file”:<br />
<em><code>% cd ~/doc <br />
% git diff</code></em> &gt; <em><code>bsdinstall.diff.txt</code></em><br />
Give the diff file a descriptive name.</li>
	<li>Submit the diff file using the web-based <a href="https://bugs.freebsd.org/bugzilla/enter_bug.cgi?product=Documentation">Problem Report</a> system. If using the web form, enter a Summary of <code>[Patch]</code><em> </em><strong>short description of problem</strong>. Select the Component <strong>Documentation</strong>. In the <strong>Description</strong> field, enter a short description of the changes and any important details about them. Use the <code>[ Add an attachment ]</code> button to attach the diff file. Finally, use the <code>[ Submit Bug ]</code> button to submit your diff to the problem report system.</li>
</ol>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="has-text-align-center wp-block-heading">Optional Tools</h4>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-list"></p>
<ul class="wp-block-list">
	<li>These applications are not required, but can make working on the documentation easier or add capabilities. Both editors include a special mode for editing documents with commands to reduce errors and typing.

<ul>
	<li>Vim (<a href="https://www.freebsd.org/cgi/url.cgi?ports/editors/vim/pkg-descr">editors/vim</a>),</li>
	<li>Emacs (<a href="https://www.freebsd.org/cgi/url.cgi?ports/editors/emacs/pkg-descr">editors/emacs</a>)</li>
</ul>
</li>
</ul>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading">1. Editing and Maintaining a Working Copy</h2>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The <em>working copy</em> is a copy of the FreeBSD repository documentation tree downloaded onto the local computer. Changes are made to the local working copy, tested, and then submitted as patches to be committed to the main repository. A full copy of the documentation tree can occupy 700 megabytes of disk space. Allow for a full gigabyte of space to have room for temporary files and test versions of various output formats.</p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="has-text-align-center wp-block-heading">Manual Pages</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>FreeBSD documentation for commands and configuration files can be found within the manual page collection. These consist of two repositories: <em><code>doc</code></em> for books and articles, and <em><code>src </code></em>for operating system and manual pages. These repositories can contain multiple versions of documentation and source code.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>In order to edit manual pages, <code><em>src </em></code>will need to be checked out separately.</p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="has-text-align-center wp-block-heading">Choosing a Directory</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>FreeBSD documentation is traditionally stored in <code><em>/usr/doc/</em></code>, and system source code with manual pages in <code><em>/usr/src/</em></code>. These directory trees are relocatable, and users may want to put the working copies in other locations to avoid interfering with existing information in the main directories. The examples that follow use <em><code>~/doc</code> </em>and<em> <code>~/src</code></em>, both subdirectories of the user&#8217;s home directory.</p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="has-text-align-center wp-block-heading">Check Out a Copy</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>A download of a working copy from the repository is called a clone, this can be done with <code>git clone</code>. For example, to checkout the latest version (<em><code>head</code></em>) of the documentation tree.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>% git clone https://git.freebsd.org/doc.git ~./doc</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>And to checkout the source code for manual pages:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>% git clone https://git.freebsd.org/src.git ~./src</code></em></p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="has-text-align-center wp-block-heading">Updating the Working Copy</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The FreeBSD repository is frequently updated, even a short time after the initial checkout, changes may have already been made creating differences between the local working copy and the main FreeBSD repository. To update the local version, use <em><code>git pull</code></em> on the directory containing the local working copy. Getting into the habit of doing this often before editing document files will be helpful.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><code><em>% cd ~/doc</em></code><br />
<code><em>% git pull --ff-only</em></code></p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="has-text-align-center wp-block-heading">Reverting Changes</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Sometimes it turns out that changes were unnecessary, or the writer wants to start over. <em><code>git restore </code></em>can &#8220;reset&#8221; files to their unchanged form</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>% git restore filename</code></em></p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="has-text-align-center wp-block-heading">Making a Diff</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>After edits to a file or group of files are completed, the differences between the local working copy and the version on the FreeBSD repository must be collected into a single file for submission. These <em>diff</em> files are produced by redirecting the output of <code>git diff</code> into a file:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>%</code> <code>cd ~/doc</code> </em><br />
<em><code>%</code> <code>git diff</code> &gt; filename</em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Give the file a meaningful name that identifies the contents. Thhttps://www.freebsd.org/doc/en_US.ISO8859-1/books/fdp-primer/working-copy.htmlis will be important for identifying what type of change was made, and to what part of the tree.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>If the diff file is to be submitted with the web “<a href="https://bugs.freebsd.org/bugzilla/enter_bug.cgi">Submit a FreeBSD problem report</a>” interface, add a <code>.txt</code> extension to give the earnest and simple-minded web form a clue that the contents are plain text.</p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading">2. Documentation Build Process</h2>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="has-text-align-center wp-block-heading">Rendering AsciiDoc into Output</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Different types of output can be produced from a single AsciiDoc source file.</p>
<p></section>
<section class="block block-core-table"></p>
<figure class="wp-block-table is-style-stripes">
<table>
<thead>
<tr>
<th><strong>FORMATS  </strong></th>
<th>File Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>html</code></td>
<td>HTML</td>
<td>An <code>article </code>or <code>book </code>chapter.</td>
</tr>
<tr>
<td><code>pdf</code></td>
<td>PDF</td>
<td>Portable Document Format.</td>
</tr>
<tr>
<td><code>epub</code></td>
<td>EPUB</td>
<td>Electronic Publication file format.</td>
</tr>
</tbody>
</table>
</figure>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="has-text-align-center wp-block-heading">FreeBSD Documentation Build Toolset</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>These are the tools used to build and install the FDP documentation.</p>
<p></section>
<section class="block block-core-list"></p>
<ul class="wp-block-list">
	<li>The primary build tool is <a href="https://www.freebsd.org/cgi/man.cgi?query=make&amp;sektion=1&amp;manpath=freebsd-release-ports">make(1)</a>, specifically Berkeley Make.</li>
	<li>Hugo</li>
	<li>AsciiDoctor</li>
	<li>Git</li>
</ul>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="has-text-align-center wp-block-heading">Understanding Makefiles in the Documentation Tree</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>There are three main types of <code>Makefile</code>s in the FreeBSD Documentation Project tree.</p>
<p></section>
<section class="block block-core-list"></p>
<ul class="wp-block-list">
	<li>The Makefile in the documentation directory will build only the documentation.</li>
	<li>The Makefile in the website directory will build only the website.</li>
	<li>The Makefile at the top of the tree will build both the documentation and the website.</li>
</ul>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="has-text-align-center wp-block-heading">Documentation Makefile</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>These <code>Makefiles </code>usually take this form: (Some contents have been removed for simplicity sake):</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"><strong>MAINTAINER</strong>=carlavilla@FreeBSD.org 

<strong>ALL_LANGUAGES</strong>=	bn-bd da de el en es fr hu it ja ko mn nl pl pt-br ru tr zh-cn zh-tw

<strong>LOCALBASE</strong>?=	/usr/local

<strong>RUBY_CMD</strong> =	${LOCALBASE}/bin/ruby
<strong>HUGO_CMD</strong> =	${LOCALBASE}/bin/hugo
<strong>HUGO_ARGS</strong>?=	--verbose --minify
<strong>HUGO_OFFLINE_ARGS</strong>?= 	--environment offline --verbose --minify
<strong>ASCIIDOCTOR_CMD</strong>=	${LOCALBASE}/bin/asciidoctor
<strong>ASCIIDOCTORPDF_CMD</strong>=	${LOCALBASE}/bin/asciidoctor-pdf

<strong>                                                         .    .    .
</strong>
<strong>.ORDER</strong>: all run

<strong>.ORDER</strong>: requirements
<strong>.ORDER</strong>: starting-message
<strong>.ORDER</strong>: starting-message build
<strong>.ORDER</strong>: build

<strong>all</strong>: requirements starting-message generate-pgpkeys-txt build
<strong>run</strong>: requirements starting-message generate-pgpkeys-txt run-local

<strong>starting-message</strong>: .PHONY
	@echo ---------------------------------------------------------------
	@echo                   Building the documentation
	@echo  included languages: ${LANGUAGES}
	@echo  excluded languages: ${SKIP_LANGS}
	@echo ---------------------------------------------------------------

<strong>run-local</strong>: .PHONY
	HUGO_DISABLELANGUAGES="${SKIP_LANGS}" ${HUGO_CMD} server \
		${HUGO_ARGS} -D $(BIND:D--bind=$(BIND)) --baseURL="http://$(.HOST):1313"

<strong>build</strong>: .PHONY
	HUGO_DISABLELANGUAGES="${SKIP_LANGS}" ${HUGO_CMD} ${HUGO_ARGS}


</pre>
<p></section>
<section class="block block-core-table"></p>
<figure class="wp-block-table is-style-regular">
<table>
<tbody>
<tr>
<td>&nbsp;</td>
<td>The <strong><code>MAINTAINER</code> </strong>flag specifies who is the maintainer of this Makefile.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><strong><code>RUBY_CMD</code> </strong>flag specifies the location of the Ruby binary.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><strong><code>HUGO_CMD</code> </strong>flag specifies the location of the Hugo binary.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><strong><code>ASCIIDOCTOR_CMD</code> </strong>flag specifies the location of the AsciiDoctor binary.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><strong><code>ALL_LANGUAGES</code> </strong>flag specifies in which languages the documentation has to be generated.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><code>.</code><strong><code>ORDER</code> </strong>directives are used to ensure multiple make jobs may run without problem.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><strong><code>all</code> </strong>target builds the documentation and puts the result in ~/doc/documentation/public.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><strong><code>starting-message</code> </strong>shows a message in the CLI to show the user that the process is running.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><code><strong>run-local</strong></code> runs hugo webserver on port 1313, or a random free port if that is already in use.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><code><strong>build</strong></code> builds the documentation and puts the result in the <code>~/doc/documentation/public.</code></td>
</tr>
</tbody>
</table>
</figure>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="has-text-align-center wp-block-heading">Website Makefile</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>These <code>Makefiles</code> share a similar format to documentation <code>Makefiles</code>, however, no <strong>languages</strong> tag is used.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Here is an example of the second half of a website <code>Makefile</code>:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"><strong>.ORDER</strong>: all run

<strong>.ORDER</strong>: starting-message generate-releases
<strong>.ORDER</strong>: starting-message build
<strong>.ORDER</strong>: generate-releases build

<strong>all</strong>: starting-message generate-releases run 

<strong>starting-message</strong>: .PHONY 
	@echo ---------------------------------------------------------------
	@echo                   Building the website
	@echo ---------------------------------------------------------------

<strong>generate-releases</strong>: data/releases.toml

<strong>data/releases.toml</strong>:
	${RUBY_CMD} ./tools/releases-toml.rb

<strong>run-local</strong>: .PHONY
	HUGO_DISABLELANGUAGES="${SKIP_LANGS}" ${HUGO_CMD} server \
	    ${HUGO_ARGS} -D $(BIND:D--bind=$(BIND)) --baseURL="http://$(.HOST):1313"

<strong>build</strong>: .PHONY 
	${HUGO_CMD}
</pre>
<p></section>
<section class="block block-core-table"></p>
<figure class="wp-block-table">
<table>
<tbody>
<tr>
<td><strong><code>all</code> </strong>target builds the website and puts the result in <code>~/doc/website/public.</code></td>
</tr>
<tr>
<td><code><strong>generate-releases</strong></code> calls the script used to convert from AsciiDoc variables to TOML variables. With this conversion, the releases variables can be used in AsciiDoc and in the Hugo custom templates.</td>
</tr>
<tr>
<td><strong><code>build</code> </strong>builds the website and puts the result in the <code>~/doc/website/public.</code></td>
</tr>
</tbody>
</table>
</figure>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading">3. AsciiDoctor Primer</h2>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Most FDP documentation is written with AsciiDoc. This chapter explains what that means, how to read and understand the documentation source, and the techniques used. To get a complete reference of the AsciiDoctor capabilities please consult the <a href="https://docs.asciidoctor.org/home/">Asciidoctor documentation</a>. Some of the examples have been taken from the <a href="https://docs.asciidoctor.org/asciidoc/latest/syntax-quick-reference">AsciiDoc Syntax Quick Reference</a>.<br />
<br />
</p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h4 id="asciidoctor-headings" class="has-text-align-center wp-block-heading">Headings</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>AsciiDoctor supports six headings levels. If the document type is <code>article</code> only one level 0 (<code>=</code>) can be used. If the document type is <code>book</code> then there can be multiple level 0 (<code>=</code>) headings.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>This is an example of headings in an <code>article</code>.</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"> = Document Title (Level 0)

 == Level 1 Section Title

 === Level 2 Section Title

 ==== Level 3 Section Title

 ===== Level 4 Section Title

 ====== Level 5 Section Title

 == Another Level 1 Section Title</pre>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h4 id="asciidoctor-paragraphs" class="has-text-align-center wp-block-heading">Paragraphs</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Paragraphs don’t require special markup in AsciiDoc. A paragraph is defined by one or more consecutive lines of text. To create a new paragraph leave one blank line.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>For example, this is a heading with two paragraphs.</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"> = This is the heading

 This is the first paragraph.
 This is also the first paragraph.

 And this is the second paragraph.</pre>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h4 id="asciidoctor-lists" class="has-text-align-center wp-block-heading">Lists</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>AsciiDoctor supports a few types of lists, the most common are <code>ordered</code> and <code>unordered</code>. To get more information about lists, see <a href="https://docs.asciidoctor.org/asciidoc/latest/syntax-quick-reference/#lists">AsciiDoc Syntax Quick Reference</a>.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p class="has-text-align-left"><strong>To create an ordered list use the <code>.</code> character.</strong></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>For example, this is an ordered list.</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted">. First item
. Second item
.. Subsecond item
. Third item</pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>And this would be rendered as.</p>
<p></section>
<section class="block block-core-list"></p>
<ol class="wp-block-list">
	<li>First item</li>
	<li>Second item

<ol type="a">
	<li>Subsecond item</li>
</ol>
</li>
	<li>Third item</li>
</ol>
<p></section>
<section class="block block-core-paragraph"></p>
<p class="has-text-align-left"><strong>To create an unordered list use the <code>*</code> character.</strong></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>For example, this is an unordered list.</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted">* First item
* Second item
** Subsecond item
* Third item</pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>And this would be rendered as.</p>
<p></section>
<section class="block block-core-list"></p>
<ul class="wp-block-list">
	<li>First item</li>
	<li>Second item

<ul>
	<li>Subsecond item</li>
</ul>
</li>
	<li>Third item</li>
</ul>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h4 id="asciidoctor-links" class="has-text-align-center wp-block-heading">Links</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>To point to another website the <code>link</code> macro should be used.</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted">link:https://www.FreeBSD.org[FreeBSD]</pre>
<p></section>
<section class="block block-core-table"></p>
<figure class="wp-block-table">
<table>
<tbody>
<tr>
<td>&nbsp;</td>
<td>As the AsciiDoctor documentation describes, the <code>link</code> macro is not required when the target starts with a URL scheme like <code>https</code>. However, it is a good practice to do this anyway to ensure that AsciiDoctor renders the link correctly, especially in non-latin languages like Japanese.</td>
</tr>
</tbody>
</table>
</figure>
<p></section>
<section class="block block-core-paragraph"></p>
<p>To point to another book or article the AsciiDoctor variables should be used. For example, if we are in the <code>cups</code> article and we want to point to <code>ipsec-must</code> these steps should be used.</p>
<p></section>
<section class="block block-core-list"></p>
<ol class="wp-block-list">
	<li>Include the <code><em>urls.adoc</em></code> file from <code>~/doc/shared</code> folder.<br />
<code><em>include::shared/{lang}/urls.adoc[]</em></code></li>
	<li>Then create a link using the AsciiDoctor variable to the <code>ipsec-must</code> article.<br />
<em><code>extref:{ipsec-must}[IPSec-Must article]</code></em></li>
</ol>
<p></section>
<section class="block block-core-paragraph"></p>
<p>&nbsp;</p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-paragraph"></p>
<p class="has-text-align-center">We hope this guide has served as a brief introduction to the process of submitting documentation, programmers should also check out our guide on <a href="https://freebsdfoundation.org/contributing-to-freebsd-as-a-programmer/" target="_blank" rel="noreferrer noopener">Contributing to FreeBSD as a Programmer</a>.</p>
<p></section><section class="block block-classic-editor"></p></section><p>The post <a href="https://freebsdfoundation.org/resource/contributing-freebsd-documentation/">Contributing FreeBSD Documentation</a> first appeared on <a href="https://freebsdfoundation.org">FreeBSD Foundation</a>.</p>]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
