update post (renamed and combined two posts) (OpenBSD,FreeBSD,DMRHost)

This commit updates a post and includes another one and deletes that
one then.
main
Dominic Reich 1 year ago
parent 3c6fec593c
commit c0ccacc1e7
Signed by: dominic
GPG Key ID: BC9D6AE1A3BE169A

@ -1,9 +1,9 @@
+++
# vim: ft=markdown
title = 'OpenBSD-current'
title = 'OpenBSD-current: built from source'
summary = 'Keeping up to date with OpenBSD-current. Some quick notes.'
date = '2023-08-11T19:47:56+0000'
lastmod = '2023-08-27T19:34:45+0000'
date = '2023-09-03T08:59:12+0200'
# lastmod = ''
categories = [ 'computerstuff' ]
tags = [ 'openbsd' ]
@ -18,6 +18,10 @@ All went good this time and I could compile everything except the
ports. I'm still looking to find a good solution to update all
the packages in one run.
{{< alert >}}
This post is about following OpenBSD-current and **building OpenBSD from source**.
{{< /alert >}}
I'm still studying the [ports(7)], [bulk(8)] and [dpb(1)] manpages, as well as
the [release(8)] and [cvs(1)] pages.

@ -1,20 +1,22 @@
+++
title = 'DMRHost on a RaspberryPi 4 with OpenBSD'
title = 'DMRHost on a RaspberryPi 4 with OpenBSD or FreeBSD'
summary = '''A rather quick demonstration of my recent test to install
DMRHost on a Raspberry Pi 4 which is running OpenBSD 7.3'''
aliases = [ '2023-08-26-dmrhost-on-a-raspberrypi4-with-openbsd' ]
date = '2023-08-26T19:07:53+0200'
#lastmod = ''
lastmod = ''
categories = [ 'amateur-radio' ]
tags = [ 'hotspot', 'raspberry-pi', 'mmdvm', 'dmr', 'openbsd' ]
+++
## Get the files
## OpenBSD
### Get the files
Download `install73.img` from <https://www.openbsd.org/arm64.html> and
write it to a USB stick.
## Installation of OpenBSD
### Installation of OpenBSD
Get yourself comfortable with this nice piece of documentation: [INSTALL.arm64][0]
@ -45,12 +47,12 @@ We booted without SD-Card because I had problems selecting the USB media for boo
You can select this from within Raspbian OS but I did not want to install this in the
first place.
## System configuration
### System configuration
Make sure to enable ssh. We will need that because we have to drop support for the
serial console to use the MMDVM hat.
## Disable the use of the serial console
### Disable the use of the serial console
Modify `/etc/ttys` (only the first lines are relevant)
@ -79,9 +81,9 @@ MMDVM hat.
Now you should be able to select `/dev/cua00` as the modem
in your `MMDVM.ini`.
## Setup DMRHost
### Setup DMRHost
### Installation
#### Installation
Get the files: <https://github.com/BrandMeister/DMRHost>.
@ -105,7 +107,7 @@ $ doas -u mmdvm make && doas make install
but as _root_ as it is installing the executable into `/usr/local/bin`.
Therefore we dropped the `-u mmdvm` on the last `doas` invocation!
### Configuration of DMRHost: `MMDVM.ini`
#### Configuration of DMRHost: `MMDVM.ini`
I use `/home/mmdvm/MMDVM.ini` because I'll put everything MMDVM-related
into `/home/mmdvm`.
@ -136,7 +138,7 @@ Protocol=uart
This is basically the same configuration as in the repository.
Have a look at the `[Log]` section.
### The rc script `/etc/rc.d/DMRHost`.
#### The rc script `/etc/rc.d/DMRHost`.
```bash
#!/bin/sh
@ -190,7 +192,7 @@ case "$1" in
esac
```
### First test / first start
#### First test / first start
Start DMRHost (not the service)
@ -201,7 +203,7 @@ $ doas -u mmdvm /usr/local/bin/DMRHost /home/mmdvm/MMDVM.ini
and see what it does. If it's logging into the master,
all is good and can be stopped with <kbd>CTRL</kbd>+<kbd>C</kbd>.
### Enable and start the service
#### Enable and start the service
```console
$ doas rcctl enable DMRHost
@ -210,7 +212,7 @@ $ doas rcctl start DMRHost
DMRHost runs.
## Some additional notes
### Some additional notes
I put myself (another user on the Raspberry Pi) into
the _users_ group and chmod the `MMDVM.ini` with with 664.
@ -219,3 +221,159 @@ That allows me to edit the file as my usual user and I do
**not** have to use `doas -u mmdvm` everytime I want to
modify something in that file.
## FreeBSD
{{< alert >}}
This section is probably not complete, I had several problems with the
Raspberry Pi's UART when I finally gave up on the long-term testing.
{{< /alert >}}
I'm using 14.0-CURRENT for this (which is moving to stable soon).
<https://download.freebsd.org/ftp/snapshots/arm64/aarch64/ISO-IMAGES/14.0/>
```console
$ doas dd if=FreeBSD-14.0-ALPHA3-arm64-aarch64-RPI-20230825-2af9390e54ed-265022.img of=/dev/rsd2c bs=1m
```
Boot into the system with the serial console. Setup a dedicated user for this and
disable the serial console after you successfully set up the network (don't forget
to also test ssh connection).
```console
$ doas pw useradd mmdvm -d /home/mmdvm -m -L daemon -G dialer
```
Do not use the UART for kernel messages.
Add this line to your `/boot/loader.conf` file.
```conf
hw.fdt.console="NO"
```
Reboot so the serial console can be used for the MMDVM_HS hat.
### Install DMRHost
You will need a few packages before we can continue. This list could
be incomplete because I try to remember them from brain memory...
```console
$ doas pkg install git gcc cmake
```
Goto `/home/mmdvm`, build and install DMRHost.
```console
$ doas -u mmdvm mkdir ~/git && cd /home/mmdvm/git
$ doas -u mmdvm git clone https://github.com/BrandMeister/DMRHost.git
$ cd DMRHost && doas -u mmdvm mkdir build && cd build
$ doas -u mmdvm (cmake -DCMAKE_BUILD_TYPE=Release .. && make)
$ doas make install
```
Create directories and the `MMDVM.ini` file.
```console
$ cd /home/mmdvm && doas -u mmdvm mkdir logs && chmod 0775 logs
$ doas -u mmdvm nvim MMDVM.ini
```
```ini
[...]
[Log]
# Logging levels, 0=No logging, 1=Debug, 2=Message, 3=Info, 4=Warning, 5=Error, 6=Fatal
SyslogLevel=0
DisplayLevel=0
FileLevel=2
FilePath=/home/mmdvm/logs
FileRoot=DMRHost
FileRotate=0
[...]
[Modem]
Port=/dev/cua00
Protocol=uart
[...]
```
I also add my user to the mmdvm group, so I can edit the MMDVM file.
(Well, set file permissions to 0664)
```console
$ doas pw usermod <user> -G mmdvm
```
### Test DMRHost
```console
$ doas -u mmdvm /usr/local/bin/DMRHost /home/mmdvm/MMDVM.ini
```
You may inspect the logfile beforehand: `tail -f /home/mmdvm/logs/DMRHost.log`.
The startup of DMRHost should end with something like these lines:
```log
M: 2023-08-25 11:03:05.000 DMRHost-20220617-DMRHost is running
M: 2023-08-25 11:03:15.000 DMR, Logged into the master successfully
```
### Setup an rc file
```sh
#!/bin/sh
# rc-script for DMRHost on OpenBSD 7.3
# runs on FreeBSD for now
# Dominic Reich <https://oe7drt.com>
DMRHOST="/usr/local/bin/DMRHost"
MMDVM_INI="/home/mmdvm/MMDVM.ini"
DMRHOST_PID="/home/mmdvm/DMRHost.pid"
DOAS="/usr/local/bin/doas -u mmdvm"
LOGDIR="/home/mmdvm/logs"
case "$1" in
"start")
if [ ! -d ${LOGDIR} ] ; then
mkdir ${LOGDIR}
chown mmdvm:users ${LOGDIR}
chmod 0775 ${LOGDIR}
fi
if ${DOAS} [ ! -r ${MMDVM_INI} ] ; then
echo "${MMDVM_INI} is not readable... aborting!"
exit 1
fi
echo -n "Starting DMRHost..."
${DOAS} ${DMRHOST} ${MMDVM_INI} &
echo $! | ${DOAS} tee ${DMRHOST_PID} > /dev/null
echo " done"
;;
"stop")
echo -n "Stopping DMRHost..."
if [ -f ${DMRHOST_PID} ] ; then
kill `cat ${DMRHOST_PID}`
rm -f ${DMRHOST_PID}
echo " done"
else
echo "not running?"
fi
;;
"restart")
$0 stop
sleep 2
$0 start
;;
*)
echo "$0 [start|stop|restart]"
;;
esac
```

@ -1,174 +0,0 @@
+++
title = 'DMRHost on a Raspberry Pi 4 with FreeBSD'
summary = '''multiline commentary
olay'''
date = '2023-08-26T21:01:16+02:00'
#lastmod = ''
categories = [ 'amateur-radio' ]
tags = []
# showBreadcrumbs = true
# showDate = false
# showReadingTime = false
# showWordCount = false
# showPagination = false
# feed_exclude = true
# site_exclude = true
draft = true
+++
## Setup FreeBSD
I'm using 14.0-CURRENT for this.
<https://download.freebsd.org/ftp/snapshots/arm64/aarch64/ISO-IMAGES/14.0/>
```console
$ doas dd if=FreeBSD-14.0-ALPHA3-arm64-aarch64-RPI-20230825-2af9390e54ed-265022.img of=/dev/rsd2c bs=1m
```
Boot into the system with the serial console. Setup a dedicated user for this and
disable the serial console after you successfully set up the network (don't forget
to also test ssh connection).
```console
$ doas pw useradd mmdvm -d /home/mmdvm -m -L daemon -G dialer
```
Do not use the UART for kernel messages.
Add this line to your `/boot/loader.conf` file.
```conf
hw.fdt.console="NO"
```
Reboot so the serial console can be used for the MMDVM_HS hat.
## Install DMRHost
You will need a few packages before we can continue. This list could
be incomplete because I try to remember them from brain memory...
```console
$ doas pkg install git gcc cmake
```
Goto `/home/mmdvm`, build and install DMRHost.
```console
$ doas -u mmdvm mkdir ~/git && cd /home/mmdvm/git
$ doas -u mmdvm git clone https://github.com/BrandMeister/DMRHost.git
$ cd DMRHost && doas -u mmdvm mkdir build && cd build
$ doas -u mmdvm (cmake -DCMAKE_BUILD_TYPE=Release .. && make)
$ doas make install
```
Create directories and the `MMDVM.ini` file.
```console
$ cd /home/mmdvm && doas -u mmdvm mkdir logs && chmod 0775 logs
$ doas -u mmdvm nvim MMDVM.ini
```
```ini
[...]
[Log]
# Logging levels, 0=No logging, 1=Debug, 2=Message, 3=Info, 4=Warning, 5=Error, 6=Fatal
SyslogLevel=0
DisplayLevel=0
FileLevel=2
FilePath=/home/mmdvm/logs
FileRoot=DMRHost
FileRotate=0
[...]
[Modem]
Port=/dev/cua00
Protocol=uart
[...]
```
I also add my user to the mmdvm group, so I can edit the MMDVM file.
(Well, set file permissions to 0664)
```console
$ doas pw usermod <user> -G mmdvm
```
## Test DMRHost
```console
$ doas -u mmdvm /usr/local/bin/DMRHost /home/mmdvm/MMDVM.ini
```
You may inspect the logfile beforehand: `tail -f /home/mmdvm/logs/DMRHost.log`.
The startup of DMRHost should end with something like these lines:
```log
M: 2023-08-25 11:03:05.000 DMRHost-20220617-DMRHost is running
M: 2023-08-25 11:03:15.000 DMR, Logged into the master successfully
```
## Setup an rc file
```sh
#!/bin/sh
# rc-script for DMRHost on OpenBSD 7.3
# runs on FreeBSD for now
# Dominic Reich <https://oe7drt.com>
DMRHOST="/usr/local/bin/DMRHost"
MMDVM_INI="/home/mmdvm/MMDVM.ini"
DMRHOST_PID="/home/mmdvm/DMRHost.pid"
DOAS="/usr/local/bin/doas -u mmdvm"
LOGDIR="/home/mmdvm/logs"
case "$1" in
"start")
if [ ! -d ${LOGDIR} ] ; then
mkdir ${LOGDIR}
chown mmdvm:users ${LOGDIR}
chmod 0775 ${LOGDIR}
fi
if ${DOAS} [ ! -r ${MMDVM_INI} ] ; then
echo "${MMDVM_INI} is not readable... aborting!"
exit 1
fi
echo -n "Starting DMRHost..."
${DOAS} ${DMRHOST} ${MMDVM_INI} &
echo $! | ${DOAS} tee ${DMRHOST_PID} > /dev/null
echo " done"
;;
"stop")
echo -n "Stopping DMRHost..."
if [ -f ${DMRHOST_PID} ] ; then
kill `cat ${DMRHOST_PID}`
rm -f ${DMRHOST_PID}
echo " done"
else
echo "not running?"
fi
;;
"restart")
$0 stop
sleep 2
$0 start
;;
*)
echo "$0 [start|stop|restart]"
;;
esac
```
Loading…
Cancel
Save