Skip to content

Commit

Permalink
add userspace info draft
Browse files Browse the repository at this point in the history
  • Loading branch information
bstiq committed Aug 2, 2024
1 parent cfc760a commit 300e62a
Showing 1 changed file with 85 additions and 7 deletions.
92 changes: 85 additions & 7 deletions fw/compile-firmware.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ parent: Firmware
1. TOC
{:toc}


# Introduction

The [BastardKB QMK repository](https://github.com/bastardkb/bastardkb-qmk) contains the firmware code and releases for the Bastard Keyboards Charybdis boards.
Expand All @@ -21,17 +20,70 @@ This page details how to compile your own firmware. Building from source is usef

If that seems too complicated, you can also use one of the default releases, or VIA.

# Requirements
# Pre-requisites

## Working QMK environment

Make sure you have a functional QMK environment. See [QMK Docs](https://docs.qmk.fm/#/newbs) for details. At this point, **you don't need** to run `qmk setup`.

1. Follow the [QMK docs](https://docs.qmk.fm/#/getting_started_build_tools) to setup your environment
2. Clone the [BastardKB QMK repository](https://github.com/bastardkb/bastardkb-qmk)
## BastardKb QMK fork

# Building your firmware
We maintain our own QMK fork. It serves as the primary source of truth, and contains the latest changes and innovation.
While we regularly push to the main QMK repository, the BKB QMK fork is the one that's most up to date.

To build a firmware, use the `bkb-master` branch:
Clone the BKB QMK repository, using either github desktop or the command line, and switch to the `bkb-master` branch:

```shell
git clone https://github.com/bastardkb/bastardkb-qmk
git checkout origin/bkb-master
```

Now that you've cloned the repository, `cd` into it and set it as the default local QMK repository. You also need to do this if you had a previous, separate QMK installation.

```shell
cd bastardkb-qmk
qmk config user.qmk_home="$(realpath .)"

Check warning on line 45 in fw/compile-firmware.md

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (realpath)
```

{: .note }
If you have multiple QMK installations, you will need to manually set the qmk home path again to use the other ones.

## BastardKb userspace

Check warning on line 51 in fw/compile-firmware.md

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (userspace)

While the QMK repository contains the logic behind the keyboards, the keymaps are in the userspace repository.

Check warning on line 53 in fw/compile-firmware.md

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (userspace)

In a separate folder, clone the BKB QMK repository, using either github desktop or the command line:


```shell
git clone https://github.com/bastardkb/qmk_userspace
```

Next, `cd` into the repository and enable userspace:

Check warning on line 62 in fw/compile-firmware.md

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (userspace)

```shell
cd qmk_userspace

Check warning on line 65 in fw/compile-firmware.md

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (userspace)
qmk config user.overlay_dir="$(realpath .)"

Check warning on line 66 in fw/compile-firmware.md

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (realpath)
```

## Github actions

// TODO screenshot enable actions workflows

// TODO mroe details, screenshots

Check warning on line 73 in fw/compile-firmware.md

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (mroe)
actions tab -- "I understand my workflows, go ahead and enable them"

1. In the GitHub Actions tab, enable workflows
2. Push your changes above to your forked GitHub repository
3. Look at the GitHub Actions for a new actions run
4. Wait for the actions run to complete
5. Inspect the Releases tab on your repository for the latest firmware build

# Compiling with console

Once in the QMK Userspace repository, compiling a keymap works the same as normal:

Check warning on line 84 in fw/compile-firmware.md

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (Userspace)

```shell
qmk compile -c -kb bastardkb/{keyboard} -km {keymap}
```

Expand All @@ -58,12 +110,38 @@ To build *any* keymap with Via support, simply add the following argument to the
qmk compile -c -kb {keyboard} -km default -e VIA_ENABLE=yes
```

# Compiling with Github Actions

If you clone the BastardKB Userspace repository, it is alredy configured to work with the BastardKB QMK fork.

If you created your own keymap, you will need to add it to the list of keympaps to be compiled in `qmk.json`, for example:

```shell
{
"userspace_version": "1.0",
"build_targets": [
["bastardkb/charybdis/4x6", "my-keymap"]
]
}
```

We also recommend deleting the other keymaps if you don't use them, as it'll make the action run faster.

# Creating your own keymap

// TODO

# Contributing your own keymap

// TODO

# Flashing your keyboard

Once you compiled your `uf2` image, you can flash your keyboard.

For how to flash your keyboard, take a look at the [how to flash your keyboard page][flashing].


---

[flashing]: {{site.baseurl}}/fw/flashing.html
[flashing]: {{site.baseurl}}/fw/flashing.html

0 comments on commit 300e62a

Please sign in to comment.