mirror of
https://github.com/outbackdingo/incus-os.git
synced 2026-01-27 10:19:24 +00:00
60 lines
1.9 KiB
Markdown
60 lines
1.9 KiB
Markdown
% Include content from [../CONTRIBUTING.md](../CONTRIBUTING.md)
|
|
```{include} ../CONTRIBUTING.md
|
|
```
|
|
|
|
## Building locally
|
|
You can build IncusOS locally. Only users specifically interested in the
|
|
development and testing of new IncusOS features should need to do this.
|
|
Building your own images requires a current version of `mkosi`, and should work
|
|
on most Linux distributions, with Debian/Ubuntu being the most well-tested.
|
|
|
|
After cloning the repository from GitHub, simply run:
|
|
|
|
make
|
|
|
|
By default the build will produce a raw image in the `mkosi.output/` directory,
|
|
suitable for writing to a USB stick. It is also possible to build an ISO
|
|
image if you need to boot from a (virtual) CD-ROM device:
|
|
|
|
make build-iso
|
|
|
|
## Testing
|
|
To test a locally built raw image in an Incus virtual machine, run:
|
|
|
|
make test
|
|
|
|
After IncusOS has completed its installation and is running in the virtual machine, to load
|
|
applications run:
|
|
|
|
make test-applications
|
|
|
|
To test the update process, build a new image and update to it with:
|
|
|
|
make
|
|
make test-update
|
|
|
|
## Debugging
|
|
|
|
When IncusOS is run in an Incus virtual machine, it is possible to `exec` into the running
|
|
system to facilitate debugging of the system:
|
|
|
|
incus exec test-incus-os bash
|
|
|
|
You can also easily side-load a custom `incus-osd` binary into the virtual machine:
|
|
|
|
cd ./incus-osd/
|
|
go build ./cmd/incus-osd/
|
|
incus file push ./incus-osd test-incus-os/root/
|
|
|
|
Then `exec` into the virtual machine, stop the main `incus-osd` service and run the local copy:
|
|
|
|
incus exec test-incus-os bash
|
|
systemctl stop incus-osd
|
|
mount -o bind /root/incus-osd /usr/local/bin/incus-osd
|
|
systemctl start incus-osd
|
|
|
|
When debugging, it's a good idea to install the `debug` application which contains a variety of useful tools, including a basic text editor (`nano`).
|
|
|
|
incus exec test-incus-os bash
|
|
curl --unix-socket /run/incus-os/unix.socket socket/1.0/applications -X POST -d '{"name": "debug"}'
|