Skip to content

Commit

Permalink
doc: Add build instruction on AlpineLinux
Browse files Browse the repository at this point in the history
  • Loading branch information
seia-soto committed Dec 1, 2023
1 parent f700f9f commit d3ecba1
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions doc/installing.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,58 @@ sudo -E PATH=${PATH} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} $(go env GOPATH)/bin/inc
If `newuidmap/newgidmap` tools are present on your system and `/etc/subuid`, `etc/subgid` exist, they must be configured to allow the root user a contiguous range of at least 10M UID/GID.
```

### Other distros: AlpineLinux

The overall procedure follows the Ubuntu's one.
You can get development resources required to build Incus on your AlpineLinux via following command:

```sh
apk add acl-dev autoconf automake eudev-dev gettext-dev go intltool libcap-dev libtool libuv-dev linux-headers lz4-dev tcl-dev sqlite-dev lxc-dev make xz
```

To take advantage of all the necessary features of Incus, you must install additional packages.
You can reference the list of packages you need to use specific function from [LXD package definition in AlpineLinux aports repository](https://gitlab.alpinelinux.org/alpine/infra/aports/-/blob/master/community/lxd/APKBUILD).
Also you can find the package you need with the binary name from [AlpineLinux packages contents filter](https://pkgs.alpinelinux.org/contents).

```sh
# Install `depends`
apk add acl attr ca-certificates cgmanager dbus dnsmasq lxc iproute2 iptables netcat-openbsd rsync squashfs-tools shadow-uidmap tar xz

# Install `depends` for vms
apk add qemu-system-x86_64 qemu-chardev-spice qemu-hw-usb-redirect qemu-hw-display-virtio-vga qemu-img qemu-ui-spice-core ovmf sgdisk util-linux-misc virtiofsd
```

After preparing the source from release tarball or git repository, you need follow the below steps to avoid known issues during build time:

```sh
# cc1: error: /usr/local/include: No such file or directory [-Werror=missing-include-dirs]
mkdir -p /usr/local/include

# paste output `export` commands on console to set required environment variables
make deps

# gettext.cgo2.c:(.text+0x2b9): undefined reference to `libintl_gettext'
# - related issue: https://github.com/gosexy/gettext/issues/1
export CGO_LDFLAGS="$CGO_LDFLAGS -L/usr/lib -lintl"
export CGO_CPPFLAGS="-I/usr/include"

make
```

You can continue to `From source: Install` and `Machine setup` section to finalise setting up your Incus instance.
If you still encounter issues, the following details may help you:

#### `make`: gettext.cgo2.c:(.text+0x2b9): undefined reference to `libintl_gettext'

If you didn't installed `libintl` from package manager, the location of required library and header file can be different.
You can find the default location of `libintl.h` and `libintl.so` file from [AlpineLinux packages contents filter](https://pkgs.alpinelinux.org/contents?file=libintl*&path=&name=gettext-dev&branch=edge).
Also according to [GNU gettext FAQ: integrating undefined](https://www.gnu.org/software/gettext/FAQ.html#integrating_undefined), the `-lintl` flag should be located at the near end of the link command line.

```sh
export CGO_LDFLAGS="$CGO_LDFLAGS -L/directory/path/to/lib -lintl"
export CGO_CPPFLAGS="-I/directory/path/to/header"
```

(installing-manage-access)=
## Manage access to Incus

Expand Down

0 comments on commit d3ecba1

Please sign in to comment.