~~~~~~~~

Title: Fun with FreeBSD Date: 2023-03-22 7:42 AM CST Category: Tech Tags: 100DaysToOffload, Computing, FOSS (Free and Open Source Software), Linux/Unix Tips, BSD, FreeBSD, Non-religious post

## Status: published

```<H2>Do *not* do the following :D<br>
Please scroll down to the **Update** section below, instead</H2>
```

I was watching this video[a] about FreeBSD last night, and the gentleman made mention of a blog which had extra information on FreeBSD. Looking at the blog, I found an excellent article[b] describing how to make the FreeBSD boot process less visually noisy.

=> https://yewtu.be/watch?v=BIttaeZF-zA [a]
=> https://vermaden.wordpress.com/2018/03/29/freebsd-desktop-part-1-simplified-boot/ [b]

 
The first step they gave is to add the lines:

```boot_mute=YES
autoboot_delay=2
```

to /boot/loader.conf.
The first line replaces the kernel boot messages with a graphic FreeBSD logo. It’s not as pretty, colorful or high-resolution as modern Plymouth boot images on Linux, but it definitely gets the job done. The second line reduces the automatic boot delay from 10 seconds to 2, which just speeds up the boot process by eliminating the need to manually hit “Enter” to start the boot right away.

```<del>The rest of the instructions given entail modifying a handful of init scripts to redirect the output of some verbose commands to </del>`/dev/null`.

<del>Now, anyone new to an OS would have some understandable trepidation modifying init scripts right away, but ultimately, a script is a script, and as long as you know what you're doing, there shouldn't be any serious danger that can't be fairly easily undone. However, I didn't like the idea of *permanently* altering the boot process, so I added my own failsafe:

I `touch`<del>ed a file called </del>`/etc/.quietboot`<del>, and then I added the following lines to the beginning of the init scripts I changed:</del>
```

```if [ -e /etc/.quietboot ]
then
    debugout() {
        cat >/dev/null
    }
else
    debugout() {
        cat
    }
fi
```

```<del>The code above checks for the presence of the </del>`/etc/.quietboot`<del> flag file I just created, and if found, it defines a function </del>`debugout()`<del> which simply runs </del>`cat >/dev/null`<del>, essentially serving as a pipe terminator to the null device.</del>    
<del>If the flag file is *not* found, the </del>`debugout()`<del> function will simply run cat, continuing the pipe to </del>`STDOUT`<del>, and not silencing any init messages.<del>    
<del>I then went to every line which the blog post recommended have a </del>`>/dev/null`<del> added at the end of (in order to eliminate unneeded boot init messages), and added </del>`| debugout`<del> instead.</del>    
<del>That way, if there's something wrong with the system and I need to verbosely see what the init scripts are doing,</del> I can just comment out the `autoboot_delay=2` line from `loader.conf`, <del>then delete the </del>`/etc/.quietboot`<del> flag file and reboot, and everything will be normal. No need to go hunting through init scripts to remove </del>`>/dev/null`<del> from several lines.</del>
```

##Update: Oops, or: “I coulda just read the manpage!” I found out that I didn’t have to modify the init scripts at all. Thanks to “evilham”[a] and vermaden himself[b], I learned that with two simple lines added to /etc/rc.conf, I could reduce all of the boot messages down to a mere 22 status lines, which easily fits in one screenful. I then undid all of the init script changes (so obviously skip all the steps above about modifying init scripts. The only changes needed for a pretty quite FreeBSD boot are add:

=> https://chaos.social/@evilham/110068882252044963 [a]
=> https://bsd.network/@vermaden/110068886930876007 [b]

```boot_mute=YES
autoboot_delay=2
```

to /boot/loader.conf, and add:

```rc_info="NO"
rc_startmsgs="NO"
```

to /etc/rc.conf.

That’s it! You may now safely disregard the rest of this blog post above, which I’m keeping intact for… posterity? Laughing at myself later? :D

#### #100DaysToOffload - Day 7