Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support OpenBSD - Document compilation instructions and code changes to support OpenBSD #2989

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 87 additions & 1 deletion docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,23 @@ For GUI notifications the following is also necessary:
sudo zypper install libnotify-devel
```

### Dependencies: OpenBSD

```text
pkg_add bash bash-completion gmake pkgconf autoconf automake newsyslog libinotify git sqlite3 dmd
```
> [!NOTE]
> If asked to chose package for autoconf, select `autoconf-2.72p0`
>
> If asked to chose package for automake, select `automake-1.16.5`

For GUI notifications the following is also necessary:
```text
pkg_add libnotify
```
> [!NOTE]
> Install the required OpenBSD packages as 'root' unless you have installed 'sudo'

## Compilation & Installation
### High Level Steps
1. Install the platform dependencies for your platform
Expand Down Expand Up @@ -212,15 +229,84 @@ sudo make install
```

### FreeBSD: Building the application using FreeBSD version of LDC
> [!NOTE]
> It is recommended to build and install the application as 'root' unless you have installed 'sudo'

```text
git clone https://github.com/abraunegg/onedrive.git
cd onedrive
./configure
gmake clean; gmake;
gmake install
```

### OpenBSD: Building the application using OpenBSD version of DMD
> [!NOTE]
> Install the application as 'root' unless you have installed 'sudo'
> It is recommended to build and install the application as 'root' unless you have installed 'sudo'

#### Configure 'ldconfig' for libinotify
The `libinotify` port installs into a subdirectory of `/usr/local/lib` so it is not picked up by the default `ld.so` "hints" or search paths.

Use `ldconfig` to modify the shared library search path. There are a number of ways to do this so check out `man ldconfig` for your prefered way to do it. An example is:
```
ldconfig -m /usr/local/lib/inotify
```

#### Configure 'login.conf' for non-root users for compilation
When compiling the application, you may run into an "our of memory" type error during compile. This is due to the extra security layers of OpenBSD and their "login class database" parameters.

Check out `man login.conf` for more details but generally you will be looking for a `datasize-cur` and `datasize-max` setting under whichever login class your build user belongs to; most likely `default:`.

The settings below were used to compile the application to create this documentation:
```
#
# The default values
# To alter the default authentication types change the line:
# :tc=auth-defaults:\
# to read something like: (enables passwd, "myauth", and activ)
# :auth=passwd,myauth,activ:\
# Any value changed in the daemon class should be reset in default
# class.
#
default:\
:path=/usr/bin /bin /usr/sbin /sbin /usr/X11R6/bin /usr/local/bin /usr/local/sbin:\
:umask=022:\
:datasize-max=infinity:\
:datasize-cur=8192M:\
:maxproc-max=256:\
:maxproc-cur=128:\
:openfiles-max=1024:\
:openfiles-cur=512:\
:stacksize-cur=4M:\
:localcipher=blowfish,a:\
:tc=auth-defaults:\
:tc=auth-ftp-defaults:
.....
#
# Staff have fewer restrictions and can login even when nologins are set.
#
staff:\
:datasize-cur=8192M:\
:datasize-max=infinity:\
:maxproc-max=512:\
:maxproc-cur=256:\
:ignorenologin:\
:requirehome@:\
:tc=default:
```
Ensure you run `cap_mkdb /etc/login.conf` to apply the new settings for users.

Confirm these changes with `ulimit -a` after logging out and logging back in with your non-root user.

#### Compiling the application on OpenBSD
The base installation of OpenBSD uses `ksh` instead of `bash` so when running the `configure` scripts from the repo, bash must be used.
```
git clone https://github.com/abraunegg/onedrive.git
cd onedrive
bash ./configure
gmake clean; gmake;
gmake install
```

### Build options
#### GUI Notification Support
Expand Down
Loading