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

feat(docs): Replace mdbook with mkdocs workflow #1548

Merged
merged 145 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
145 commits
Select commit Hold shift + click to select a range
ebce41a
feat: add mdbook docs
Zeglius Jul 31, 2024
f6c7356
chore: add several articles to docs
Zeglius Jul 31, 2024
f1d000b
docs: add documentation at surface level
Zeglius Jul 31, 2024
e3be3c6
docs: Add missing chapter emojis
Zeglius Aug 1, 2024
94c47fa
docs: Realocate 'Gaming' section under 'General'
Zeglius Aug 1, 2024
07a18e9
docs: Add 'Introduction' section
Zeglius Aug 1, 2024
8b50d6e
docs: Add unstable documentation warning
Zeglius Aug 1, 2024
46aa4f4
docs: Add missing github url
Zeglius Aug 1, 2024
8cbce1f
docs: Add discourse scrapper utility
Zeglius Aug 2, 2024
c3538ea
docs: minor discourse scrapper docs changes
Zeglius Aug 2, 2024
c17c783
docs: Add youtube embeding preprocessor
Zeglius Aug 3, 2024
1ce22b4
minor reformat for youtube-embed
Zeglius Aug 3, 2024
ec27cc9
docs: Add mdbook preprocessor template
Zeglius Aug 3, 2024
68d5eed
docs: add format-author preprocessor
Zeglius Aug 4, 2024
433dd2d
docs: add git lib to mdbook toolset
Zeglius Aug 4, 2024
74130ee
docs: Always fetch the highest quality image by fetch_discourse_md
Zeglius Aug 4, 2024
63c6164
docs: fix youtube-embed ignoring new line requirement
Zeglius Aug 4, 2024
b887ebe
docs: Add documentation transcription guide
Zeglius Aug 4, 2024
4eae894
docs: Missing url in transcription guide
Zeglius Aug 4, 2024
cd989d0
Merge remote-tracking branch 'upstream/main' into feat/mdbook
Zeglius Aug 5, 2024
ec24162
docs: Remove YAML header from doc guide
Zeglius Aug 5, 2024
ad6587a
docs: Minor tweaks to transcription guide
Zeglius Aug 5, 2024
48a57c1
docs: Add utilities preprocessor module
Zeglius Aug 6, 2024
53ee1e7
docs: tweak debug function
Zeglius Aug 6, 2024
a6bf1f3
docs: Add 'replace-urls' preprocessor
Zeglius Aug 6, 2024
d42769a
chore: Move mappings parameter in replace-urls preprocessor
Zeglius Aug 6, 2024
04f97c1
docs: add ignore field to replace-urls
Zeglius Aug 6, 2024
32e3096
docs: add Mdbook python types
Zeglius Aug 7, 2024
c27ac01
docs: Add ignore field to replace-urls
Zeglius Aug 7, 2024
3644edf
chore(ci): add deploy_docs
Zeglius Aug 9, 2024
3a58a7c
chore(ci): Add dynamic edit url template to deploy_docs
Zeglius Aug 9, 2024
eee1d96
chore(ci): Add html.site-url to deploy_docs
Zeglius Aug 9, 2024
6a781c6
chore(readme): Use relative paths for repo_content
Zeglius Aug 9, 2024
5b08f1c
chore(ci): Add README to included paths for deploy_docs
Zeglius Aug 9, 2024
396b972
chore(ci): Disable deploy_docs
Zeglius Aug 9, 2024
2ed0929
chore(ci): Use main in deploy_docs.on.push.branches
Zeglius Aug 9, 2024
0000de0
docs: Rephrase unstable docs warning
Zeglius Aug 9, 2024
3f21af7
chore(ci): Exclude docs from triggering build workflow
Zeglius Aug 9, 2024
761be1f
chore(ci): Enable deploy_docs
Zeglius Aug 9, 2024
f23182a
fix(docs): Remove unnecessary imports in preprocessors
Zeglius Aug 9, 2024
8b8f414
docs: Move unstable docs warning to index.hbs
Zeglius Aug 9, 2024
3eeb9a3
docs: Add page metadata inclusion with fetch_discourse_md.py
Zeglius Aug 10, 2024
e059865
docs: Move fetch_discourse_md.py to docs/utils
Zeglius Aug 10, 2024
8400049
docs: Add 'fetched_at' metadata field in fetch_discourse_md.py
Zeglius Aug 10, 2024
68eec7e
docs: Update fetch_discourse_md.py to format metadata in json
Zeglius Aug 10, 2024
68c5dc2
Revert "chore(readme): Use relative paths for repo_content"
Zeglius Aug 12, 2024
207a71e
docs: Replace include with an url to repo README
Zeglius Aug 12, 2024
3063d20
ci(docs): Add multilanguage doc build support
Zeglius Aug 12, 2024
adca5af
docs: add Justfile utility
Zeglius Aug 12, 2024
682d3eb
docs: update Justfile utility
Zeglius Aug 12, 2024
4342e9b
ci(docs): Add stricter workflow trigger to deploy_docs
Zeglius Aug 12, 2024
e0ed1bd
docs: add 'preview_translation' to Justfile
Zeglius Aug 13, 2024
00d6f9b
docs: add documentation translation guide
Zeglius Aug 13, 2024
25b860e
ci(docs): Add mdbook cache
Zeglius Aug 13, 2024
023d259
Merge remote-tracking branch 'upstream/main' into feat/mdbook
Zeglius Aug 13, 2024
0ad731e
ci(docs): Add i18n-report
Zeglius Aug 14, 2024
b1a2640
Merge remote-tracking branch 'upstream/main' into feat/mdbook
Zeglius Aug 14, 2024
772f7e5
ci(docs): tweak deploy_docs workflow triggers
Zeglius Aug 14, 2024
7a474c8
ci(docs): remove unnecessary slash at build.yml
Zeglius Aug 14, 2024
b100f60
ci(docs): remove unnecessary slash at deploy_docs.yml
Zeglius Aug 14, 2024
d91bb70
ci(docs): add docs/book.toml to deploy_docs trigger
Zeglius Aug 14, 2024
eaea38d
ci(docs): Add schedule trigger
Zeglius Aug 14, 2024
47b2ede
ci(docs): add github-pages cleaning
Zeglius Aug 14, 2024
fd7538d
ci(docs): Exclude docs from generate_changelog
Zeglius Aug 14, 2024
0f7d087
docs: Add dependencies installation script
Zeglius Aug 14, 2024
73e0fa7
ci(docs): Add mdbook pdf build
Zeglius Aug 15, 2024
15eac53
docs: Tweak Justfile to support pdf generation
Zeglius Aug 15, 2024
f5053b5
Revert "docs: Always fetch the highest quality image by fetch_discour…
Zeglius Aug 15, 2024
617f46d
ci(docs): Exclude deploy_docs.yml from cache-mdbook keys
Zeglius Aug 16, 2024
fafb234
docs: Add 'mdbook_build' to Justfile
Zeglius Aug 16, 2024
35ecbab
docs: Add 'mdbook_serve' to Justfile
Zeglius Aug 16, 2024
fa1069e
docs: Add debug flag to fetch_discourse_md
Zeglius Aug 16, 2024
d42a29c
docs: Automate discourse documentation scrapping
Zeglius Aug 16, 2024
6b1e215
docs: Add flock to fetch_discourse_md
Zeglius Aug 16, 2024
3f94944
docs: Add translation file generation with Justfile
Zeglius Aug 16, 2024
a685de4
docs: Prefix url replacements with site-url in replace-urls.py prepro…
Zeglius Aug 17, 2024
3483730
docs: Add installation guides
Zeglius Aug 17, 2024
777d805
Revert "docs: Prefix url replacements with site-url in replace-urls.p…
Zeglius Aug 17, 2024
1dd65ad
Reapply "docs: Prefix url replacements with site-url in replace-urls.…
Zeglius Aug 17, 2024
e8668d6
docs: fix replace-urls.py
Zeglius Aug 17, 2024
cda3246
Merge remote-tracking branch 'upstream/main' into feat/mdbook
Zeglius Aug 17, 2024
cadbbfe
docs: fix fetch_discourse_md.py hitting discourse ip_10_secs_limit
Zeglius Aug 18, 2024
aea8528
ci(docs): Remove duplicate '/' in build translation step
Zeglius Aug 18, 2024
fed53ae
ci(docs): Update actions/cache
Zeglius Aug 18, 2024
06bf7d2
ci(docs): Reduce deploy_docs schedule timespan between triggers
Zeglius Aug 18, 2024
7b4fda9
Merge remote-tracking branch 'upstream/main' into feat/mdbook
Zeglius Aug 18, 2024
02abbbd
docs: update install-deps.sh
Zeglius Aug 18, 2024
63f9897
docs: Update Advanced docs
Zeglius Aug 18, 2024
d371750
docs: Add favicon
Zeglius Aug 18, 2024
c197eb3
docs: Reword unstable documentation warning
Zeglius Aug 18, 2024
31ee415
docs: Change default theme to 'navy'
Zeglius Aug 18, 2024
48098a6
ci(docs): Move permisions to job scope
Zeglius Aug 19, 2024
2a5cb27
Merge remote-tracking branch 'upstream/main' into feat/mdbook
Zeglius Aug 19, 2024
84d89a0
docs: refactor fetch_discourse_md.py
Zeglius Aug 20, 2024
f337322
docs: Add mkdocs skeleton
Zeglius Aug 20, 2024
5d06798
docs: Add cmdrun hook
Zeglius Aug 20, 2024
e7a3b12
ci(docs): Migrade deploy_docs to use mkdocs
Zeglius Aug 20, 2024
d9b1e31
chore: remove mdbook leftover files
Zeglius Aug 20, 2024
7905e6b
docs: add support for markdown emojies
Zeglius Aug 20, 2024
9528b56
docs: add support for i18n translations to mkdocs
Zeglius Aug 21, 2024
d79db2b
docs: add resource prefetching
Zeglius Aug 22, 2024
5ac2618
docs: enable navigation indexes in toc
Zeglius Aug 22, 2024
ac37a98
docs: add unstable documentation warning
Zeglius Aug 22, 2024
12c6b0f
docs: normalize toc
Zeglius Aug 22, 2024
74f5da5
docs: remove unnecesary extensions
Zeglius Aug 22, 2024
d70fcd9
ci(docs): Separate docs build into its own action
Zeglius Aug 22, 2024
34a6bdf
ci(docs): fix build docs action
Zeglius Aug 22, 2024
efe2b48
ci(docs): Add default parameters to build_mkdocs action
Zeglius Aug 23, 2024
da3a392
Merge remote-tracking branch 'upstream/main' into mkdocs
Zeglius Aug 23, 2024
2071061
ci(docs): Clean up leftover mdbook files
Zeglius Aug 23, 2024
c0ac6ef
docs: remove leftover mkdocs-print-site-plugin
Zeglius Aug 23, 2024
2db3c3c
chore: add mkdocs offline documentation
Zeglius Aug 23, 2024
ac326d1
docs: fix list indentation
Zeglius Aug 24, 2024
63d6df1
ci(docs): Add github links to mkdocs
Zeglius Aug 24, 2024
e067bae
ci(docs): Add github authors to mkdocs
Zeglius Aug 24, 2024
965890f
docs: Update documentation guide and scripts to mkdocs
Zeglius Aug 24, 2024
66f5ac6
docs: Add cache capabilities to cmdrun hook
Zeglius Aug 24, 2024
c72e53e
docs: Enable instant loading
Zeglius Aug 24, 2024
cb9b634
docs: Update summary and add more posts
Zeglius Aug 24, 2024
65838b3
docs: Add mkdocs-material social plugin
Zeglius Aug 24, 2024
7ff0e73
docs: Disable instant loading
Zeglius Aug 26, 2024
f83c855
docs: Fix section url
Zeglius Aug 26, 2024
22ef331
docs: Fix fetch_discourse not fetching images properly
Zeglius Aug 27, 2024
d419945
Merge remote-tracking branch 'upstream/main' into mkdocs
Zeglius Aug 27, 2024
1bf27ab
docs: Disable warning for using absolute links
Zeglius Aug 27, 2024
f98ca62
docs: Add url replacement hook
Zeglius Aug 27, 2024
8806d96
docs: Restore 'General' section
Zeglius Aug 27, 2024
9ee3801
docs: Remove aditional languages for now
Zeglius Aug 27, 2024
4c23361
docs: Add missing page titles
Zeglius Aug 27, 2024
7657391
Merge remote-tracking branch 'upstream/main' into mkdocs
Zeglius Aug 27, 2024
aa50443
docs: move and rename index.md to docs/src/Handheld_and_HTPC_edition/…
Zeglius Aug 27, 2024
0be57a9
docs: remove leftover Bazzite_resources.md
Zeglius Aug 27, 2024
f6d2ee0
docs: Add time fallback to git-revision-date
Zeglius Aug 27, 2024
0a4bf2d
Merge remote-tracking branch 'upstream/main' into mkdocs
Zeglius Aug 27, 2024
e2e032f
docs: Add navigation tabs
Zeglius Aug 27, 2024
6bd48d9
docs: Clear cmdrun cache with Justfile
Zeglius Aug 27, 2024
a3aea1f
docs: Add missing dual-boot guide url
Zeglius Aug 27, 2024
67b1100
docs: Change to a shorter section name for handheld and HTPC
Zeglius Aug 27, 2024
4090587
docs: Add embed_youtube hook
Zeglius Aug 28, 2024
8f4219b
Merge remote-tracking branch 'upstream/main' into mkdocs
Zeglius Aug 28, 2024
b63a9b5
docs: Remove leftover resources entry in index
Zeglius Aug 28, 2024
45bb924
docs: Limit vertical image size
Zeglius Aug 28, 2024
b6078f7
docs: add more url replacements
Zeglius Aug 28, 2024
8d4f773
docs: Enable search features
Zeglius Aug 28, 2024
c351df4
Merge remote-tracking branch 'upstream/main' into mkdocs
Zeglius Aug 28, 2024
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
Prev Previous commit
Next Next commit
docs: Automate discourse documentation scrapping
  • Loading branch information
Zeglius committed Aug 16, 2024
commit d42a29cb902035b76778ec183f4ef8904240c251
19 changes: 19 additions & 0 deletions .github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ jobs:
with:
fetch-depth: 0

- uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install python dependencies
run: |
pip install --user requests

- name: Cache mdbook
id: cache-mdbook
uses: actions/cache@v3
Expand All @@ -83,6 +91,17 @@ jobs:
if: steps.cache-mdbook.outputs.cache-hit != 'true'
uses: ./.github/workflows/install-mdbook

# Necessary in order to have fetch_discourse_md.py available for mdbook-cmd
- name: Add docs/utils to PATH
run: |
echo $PWD/utils:$PATH >> $GITHUB_PATH

- name: Test fetch_discourse_md.py
run: |
echo "::group::Try fetching a post from discourse"
fetch_discourse_md.py -d "https://universal-blue.discourse.group/docs?topic=31" 2>&1 >/dev/null
echo "::endgroup::"

- name: Build book in English
env:
MDBOOK_output__html__site_url: ${{ env.SITE_URL }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/install-mdbook/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ runs:
- name: Install mdbook-pdf
run: cargo install mdbook-pdf --locked --version 0.1.10 --features fetch
shell: bash

- name: Install mdbook-cmdrun
run: cargo install mdbook-cmdrun --locked --version 0.6.0
shell: bash
16 changes: 10 additions & 6 deletions docs/book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,17 @@ command = "python ./preprocessors/youtube-embed.py"

[preprocessor.replace-urls]
command = "python ./preprocessors/replace-urls.py"
after = ["youtube-embed"]
after = ["youtube-embed", "links"]
ignore = ["Introduction*"]

[preprocessor.replace-urls.mappings]
"https://universal-blue.discourse.group/docs?topic=561" = "/Introduction.html"

[preprocessor.gettext]
after = ["links"]
after = ["links", "cmdrun"]

[preprocessor.cmdrun]
before = ["replace-urls"]

[output.pdf]
[output.pdf]

[preprocessor.replace-urls.mappings]
# Here we add urls to be overriden
"https://universal-blue.discourse.group/docs?topic=561" = "/Introduction"
258 changes: 1 addition & 257 deletions docs/src/Advanced/Auto-Mounting_Secondary_Drives.md
Original file line number Diff line number Diff line change
@@ -1,257 +1 @@
<div class="warning">

# WARNING!

> **Attention**: You may lose data on the drive(s) or result in an unbootable system if configured improperly.

> **Note:** MicroSD cards automatically mount without any manual intervention required on Bazzite.

> **Important**: Do **not** use the NTFS, exFAT, or FAT32 filesystems for game library storage.

Follow this guide **at your own discretion** and make sure to read the entire document relevant to your method, so you do not miss anything!

</div>

<hr>

# 1. Formatting a disk

> **Warning**: This will wipe all existing data on it

## Note when formatting in **KDE Partition Manager**

Make sure you set permissions to **everyone**.

Use a disk graphical user interface like KDE Plasma or GNOME Disks to format your drive. We recommend formatting secondary drives to **btrfs** or **ext4**.

### Creating a secondary drive directory and where to mount drives?

> **Note**: Drive directories should be **lowercase** with **no spaces** for best practice.

> **Attention**: `/var/mnt` should NOT be the path, but create a new **directory** in either `/var/mnt` or `/var/run/media/`.

- `/var/mnt/...` for **permanent** drives
- `/var/run/media/...` for **removable** drives

You can make a directory in `/var/mnt/` by opening a host terminal and **entering this command in a host terminal**:

```command
cd /var/mnt
```

```command
sudo mkdir /var/mnt/games
```

The drive will now be mounted in a directory known as `games`.

> **Note**: `games` can be named anything you desire that fits best practices.

#### Permissions for the drive

```command
sudo chown $USER:$USER /var/mnt/games
```

> **Note**: If you plan to reformat the partition, remember to edit the mount point and "Remove" the mount path before you reformat! If not you will have to manually edit `/etc/fstab`.

# 2. Graphical User Interface (GUI) Methods for Auto-Mounting

> **Warning**: Do not set up auto-mount, unmount then format a drive! It can confuse the software you are configuring drives with. Instead, **remove the auto-mount first before formatting the drive**.

## KDE Partition Manager

![KDE|48x48](../img/kde_partition_manager_icon.png)

**This is pre-installed on KDE images.**

### Instructions

![KDE Partition Manager|690x462, 75%](../img/KDE_Partition_Manager.png)
![Do not check the boxes!|690x197](../img/Do_not_check_the_boxes!.png)

1. Open KDE Partition Manager
2. Locate the disk and partition you want to mount
3. Right click on the partition and click "Edit Mount Point"
4. Select "Identify by: UUID" (This will guarantee you mount THIS partition instead of a different one if the device nodes change for some reason)
5. Select a mounting path:
5a. You would want to use `/var/mnt/games` or something similar for permanent mounts
6. **Untick all the boxes in the graphical application if they are checked**
7. Click "More..." and add extra options depending on what filesystem is on the partition (read the "Filesystem Arguments" section)
8. Click OK on both windows to save the mount points.
9. Open the terminal to test the mounts by running the **command**:

```command
sudo systemctl daemon-reload && sudo mount -a
```

10. **If no errors appeared then it should be safe to reboot.**

> **Note**: If errors occur, then research the error and undo what you did and try again. Redo the previous two steps in the terminal (see CLI method down below and research how to use fstab) as KDE Partition Manager might not give a good error to search for if the test mount fails.

Display Name should be added too. Name it whatever you want it to be identified as.

#### Required additional options depending on **filesystem**

Use the below generic options depending on your filesystem (these are just good defaults)
You can copy+paste these into the "More.." dialog and they will be valid

> **Note**: "Users can mount and unmount" is an **optional** setting.

#### Filesystem arguments

> **Warning**: If a drive is formatted, then do not remove it from `/etc/fstab`, so the "nofail" option is a must to avoid issues with booting.

![btrfs example|290x317](../img/btrfs_example.png)

> **Example: btrfs requires these additional options.**

##### **BTRFS**:

```command
defaults,compress-force=zstd:3,noatime,lazytime,commit=120,space_cache=v2,nofail
```

##### **Ext4**:

```command
defaults,noatime,errors=remount-ro,nofail,rw,users,exec
```

##### **NTFS**:

```command
defaults,noatime,nofail,rw,users,exec
```

> **Note**: Do not use the NTFS filesystem for game library storage in Bazzite, and it is not supported and you will get lots of issues with it. NTFS is **not** intended as a game drive for Bazzite.

#### Advanced Options (Not required for most setups)

##### Information about compression:

**3** is a good balance, older CPUs should use **1**.

##### Information about subvolumes:

use `subvol=name` as an option, KDE and GNOME Disks let you only mount 1 subvolume through the GUI, you can mount the root with `subvol=/` if a default subvolume is configured in the filesystem.

### Installing KDE Partition Manager on non-KDE images

If you would like to install this, then it can be layered to your system by entering in a terminal:

```
rpm-ostree install kde-partitionmanager
```

Reboot your system after it has finished installing the terminal.

## GNOME Disks

![GNOME|120x120, 50%](../img/GNOME_Disks_icon.png)

**This comes pre-installed on GNOME images.**

### Instructions

![GNOME_Disks|690x463, 75%](../img/GNOME_Disks.png)

1. Open GNOME Disks (`gnome-disk-utility`)
2. Locate the disk and partition you want to mount
3. Click the cog icon on the partition
4. Select "Edit Mount Options"
5. Turn off "User Session Default"
6. Check:
a) Mount at system startup
b) Show in user interface
7. In the space where this is no label: `nosuid,nodev,nofail,x-gvfs-show,` (refer to the correct filesystem below for more options)
8. `/var/mnt/games` (or whatever directory you made)
9. `auto`
10. Select "Take Ownership"
11. Open the terminal to test the mounts by running the **command**:

```command
sudo systemctl daemon-reload && sudo mount -a
```

12. **If no errors appeared then it should be safe to reboot.**

> **Note**: If errors occur, then research the error and undo what you did and try again. Redo the previous two steps in the terminal as GNOME Disks might not give a good error to search for if the test mount fails.

Display Name should be added too. Name it whatever you want it to be identified as.

#### Filesystem Arguments

> **Warning**: If a drive is formatted, then do not remove it from `/etc/fstab`, so the "nofail" option is a must to avoid issues with booting.

![GNOME_Edit_Mount_Options|690x465, 75%](../img/GNOME_Edit_Mount_Options.png)

![GNOME_Mount_Options|549x500, 75%](../img/GNOME_Mount_Options.png)

##### **BTRFS**:

```command
defaults,compress-force=zstd:3,noatime,lazytime,commit=120,space_cache=v2,nofail
```

##### **Ext4**:

```command
defaults,noatime,errors=remount-ro,nofail,rw,users,exec
```

##### **NTFS**:

```command
defaults,noatime,nofail,rw,users,exec
```

> **Note**: Do not use the NTFS filesystem for game library storage in Bazzite, and it is not supported and you will get lots of issues with it. NTFS is **not** intended as a game drive for Bazzite.

#### Permissions for the drive

```command
sudo chown $USER:$USER /mnt/games
```

#### Advanced Options (Not required for most setups)

##### Information about compression:

**3** is a good balance, older CPUs should use **1**.

##### Information about subvolumes:

use `subvol=name` as an option, KDE and GNOME Disks let you only mount 1 subvolume through the GUI, you can mount the root with `subvol=/` if a default subvolume is configured in the filesystem

### Installing GNOME Disks on non-GNOME images

If you would like to install this, then it can be layered to your system by entering in a terminal:

```
rpm-ostree install gnome-disk-utility
```

Reboot your system after it has finished installing the terminal.

# Alternative Methods (CLI)

There are also two command-line interface (CLI) methods.

1. Using `systemd.mount`

2. Editing the `/etc/fstab` file

CLI methods are intended for advanced users, and it is recommended to research one of the two methods elsewhere.

<hr>

# Emergency Mode After Following This Guide?

This video tutorial shows how to recover from your mounting mistakes.

<https://www.youtube.com/watch?v=-2wca_0CpXY>

<hr>

**Documentation Contributors**: [HikariKnight](https://github.com/HikariKnight) and [asen23](https://github.com/asen23)
<!-- cmdrun fetch_discourse_md.py "https://universal-blue.discourse.group/docs?topic=970" -->
58 changes: 1 addition & 57 deletions docs/src/Advanced/Reset_User_Password.md
Original file line number Diff line number Diff line change
@@ -1,57 +1 @@
nicknamenamenick | 2024-07-22 16:35:12 UTC | #1

> Follow this guide **at your own discretion** because you can break your system attempting any of this.

![Edit the command for the latest boot entry|690x351](../img/Edit_the_command_for_the_latest_boot_entry.png)

Reboot your device and edit the last deployment by presssing <kbd>E</kbd> on your keyboard.

![Boot with init=/bin/bash|689x359](../img/Boot_with_init_bin_bash.jpg)

Boot with `init=/bin/bash` on the kernel command line (e.g. edit GRUB prompt.)

![Reboot|689x359](../img/Reboot.jpg)

Continue boot process with <kbd>Ctrl</kbd>+<kbd>X</kbd>

Once you are in the GRUB command line:

1. Temporarily mount SELinux

```
mount -t selinuxfs selinuxfs /sys/fs/selinux
```

2. Load SELinux policy

```
/sbin/load_policy
```

3. Enter your new password (i.e. passwd nick)

```
passwd [INSERT USERNAME HERE]
```

4. Sync

```command
sync
```

5. Reboot

```
/sbin/reboot -ff
```

![Commands|690x334](../img/Commands.png)

Your user password should now be reset.

Thanks to [Colin Walters](https://github.com/cgwalters) for the [solution](https://github.com/ublue-os/main/issues/469#issuecomment-1885264886).

<hr>

**Documentation Contributors**: [Noel Miller](https://github.com/noelmiller)
<!-- cmdrun fetch_discourse_md.py "https://universal-blue.discourse.group/docs?topic=161" -->
Loading