mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-22 07:13:37 +05:00
Compare commits
133 Commits
8547942986
...
v5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d0854c63ad | ||
|
|
8851bd68f8 | ||
|
|
9168ad88a6 | ||
|
|
03c0d46a2e | ||
|
|
8a8afc60ee | ||
|
|
5b68710b23 | ||
|
|
6cee0252ee | ||
|
|
aff63665de | ||
|
|
1ed1e0fc4c | ||
|
|
81ac102644 | ||
|
|
89b48168f4 | ||
|
|
195b7fa926 | ||
|
|
12919c7140 | ||
|
|
e590f668e6 | ||
|
|
075f2d384b | ||
|
|
afdde34721 | ||
|
|
393dd1d5bf | ||
|
|
8170057434 | ||
|
|
985b66d41f | ||
|
|
f95d2586bf | ||
|
|
f5141e7eff | ||
|
|
33113e72e9 | ||
|
|
6f59fd06aa | ||
|
|
56ea43ccb6 | ||
|
|
25e22c993f | ||
|
|
ead521b377 | ||
|
|
3c952ccc12 | ||
|
|
c8f713c00e | ||
|
|
95cf809378 | ||
|
|
c91816d13f | ||
|
|
1a6f06eaf2 | ||
|
|
ea8621af0c | ||
|
|
88742ab496 | ||
|
|
b99e6612e2 | ||
|
|
cf4e915430 | ||
|
|
c901cd1fdf | ||
|
|
da3c37a872 | ||
|
|
8f436646cd | ||
|
|
760f131d1c | ||
|
|
41804f0eaa | ||
|
|
d3c9bcc38c | ||
|
|
7fc36f3e68 | ||
|
|
a4942b9404 | ||
|
|
9e0a8a0081 | ||
|
|
6082528628 | ||
|
|
9e92e4a36a | ||
|
|
7e8f1f3d81 | ||
|
|
234cf2c751 | ||
|
|
3bc98eed13 | ||
|
|
777f5e45e7 | ||
|
|
acf0faf158 | ||
|
|
5c219ec544 | ||
|
|
70055e891e | ||
|
|
e3a0a9dec0 | ||
|
|
1cf81377ee | ||
|
|
aa4ea99c5c | ||
|
|
20ffc82a04 | ||
|
|
0becf9d574 | ||
|
|
ed1bfcdeb4 | ||
|
|
033916216c | ||
|
|
d8f47c0960 | ||
|
|
4978f22101 | ||
|
|
8330f90b56 | ||
|
|
2a08e3eb15 | ||
|
|
a2a3e92b50 | ||
|
|
a58288e7e3 | ||
|
|
3852464ab7 | ||
|
|
d9626adc98 | ||
|
|
4ae5a37ec6 | ||
|
|
935f81aab6 | ||
|
|
b02df9a1e0 | ||
|
|
dbbc87f18e | ||
|
|
243ea6582a | ||
|
|
91cba3637e | ||
|
|
3fc190ff25 | ||
|
|
6ff45aab41 | ||
|
|
b9c9feef3c | ||
|
|
d37d047aaa | ||
|
|
a3fb57aee3 | ||
|
|
8aee23830a | ||
|
|
dd14de9a41 | ||
|
|
1ca1e8ff6f | ||
|
|
12127efa21 | ||
|
|
66a5cdf9b1 | ||
|
|
9b1aba207c | ||
|
|
e274e3c00d | ||
|
|
dd99b0e1a6 | ||
|
|
a616876ace | ||
|
|
4925021aa8 | ||
|
|
e63d9d67ec | ||
|
|
106bf7675f | ||
|
|
a63cf8c9d9 | ||
|
|
02ed3e7da0 | ||
|
|
4427ae94af | ||
|
|
81b7b156b9 | ||
|
|
2df364512b | ||
|
|
dfa0036326 | ||
|
|
425d86a12f | ||
|
|
ff6162d799 | ||
|
|
674c174224 | ||
|
|
a368331693 | ||
|
|
406b64d1e5 | ||
|
|
1b5691f2f5 | ||
|
|
e7eae5a0d1 | ||
|
|
dc561a562c | ||
|
|
55cfe124b2 | ||
|
|
43d6598be6 | ||
|
|
dc026a7a2b | ||
|
|
ac54d04b40 | ||
|
|
c19364360c | ||
|
|
2e6c66e524 | ||
|
|
cd8003add9 | ||
|
|
1f75395063 | ||
|
|
6e1bffa975 | ||
|
|
a8a73249a5 | ||
|
|
4138c71920 | ||
|
|
ec3f93eeda | ||
|
|
afeb2bf02e | ||
|
|
4b17c68454 | ||
|
|
df414ce37e | ||
|
|
975629f097 | ||
|
|
fd2910ba67 | ||
|
|
6b6607c5ab | ||
|
|
b604d93d0c | ||
|
|
7e87f8af32 | ||
|
|
29b5ab00cd | ||
|
|
4cf523a758 | ||
|
|
694a4c20c5 | ||
|
|
a54514c400 | ||
|
|
1d06bf76f3 | ||
|
|
e438081c35 | ||
|
|
9f50f6fdd7 | ||
|
|
0ee0fa3325 |
15
.editorconfig
Normal file
15
.editorconfig
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 4
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
charset = utf-8
|
||||||
|
end_of_line = lf
|
||||||
|
|
||||||
|
[*.py]
|
||||||
|
max_line_length = 88
|
||||||
|
|
||||||
|
[*.{sh,yml,yaml,json}]
|
||||||
|
indent_size = 2
|
||||||
33
.github/workflows/release-ff-and-tag.yml
vendored
Normal file
33
.github/workflows/release-ff-and-tag.yml
vendored
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
name: Release - Fast-Forward and Tag
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
tag_name:
|
||||||
|
description: 'Provide a tag name (e.g. v1.0.0)'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ff-and-tag:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
ref: 'master'
|
||||||
|
- name: Merge Fast Forward
|
||||||
|
uses: MaximeHeckel/github-action-merge-fast-forward@v1.1.0
|
||||||
|
with:
|
||||||
|
branchtomerge: origin/develop
|
||||||
|
branch: master
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- name: Create and Push Tag
|
||||||
|
run: |
|
||||||
|
git tag ${{ inputs.tag_name }}
|
||||||
|
git push origin ${{ inputs.tag_name }}
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
9
.gitignore
vendored
9
.gitignore
vendored
@@ -1,4 +1,13 @@
|
|||||||
.idea
|
.idea
|
||||||
.vscode
|
.vscode
|
||||||
|
.pytest_cache
|
||||||
|
.jupyter
|
||||||
|
*.ipynb
|
||||||
|
*.ipynb_checkpoints
|
||||||
|
*.tmp
|
||||||
|
__pycache__
|
||||||
|
.kiauh-env
|
||||||
*.code-workspace
|
*.code-workspace
|
||||||
|
*.iml
|
||||||
|
kiauh.cfg
|
||||||
klipper_repos.txt
|
klipper_repos.txt
|
||||||
|
|||||||
120
README.md
120
README.md
@@ -101,81 +101,103 @@ prompt and confirm by hitting ENTER.
|
|||||||
|
|
||||||
<h2 align="center">🌐 Sources & Further Information</h2>
|
<h2 align="center">🌐 Sources & Further Information</h2>
|
||||||
|
|
||||||
<table>
|
<table align="center">
|
||||||
<tr>
|
<tr>
|
||||||
<th><h3><a href="https://github.com/Klipper3d/klipper">Klipper</a></h3></th>
|
<th><h3><a href="https://github.com/Klipper3d/klipper">Klipper</a></h3></th>
|
||||||
<th><h3><a href="https://github.com/Arksine/moonraker">Moonraker</a></h3></th>
|
<th><h3><a href="https://github.com/Arksine/moonraker">Moonraker</a></h3></th>
|
||||||
<th><h3><a href="https://github.com/mainsail-crew/mainsail">Mainsail</a></h3></th>
|
<th><h3><a href="https://github.com/mainsail-crew/mainsail">Mainsail</a></h3></th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th><img src="https://raw.githubusercontent.com/Klipper3d/klipper/master/docs/img/klipper-logo.png" alt="Klipper Logo" height="64"></th>
|
<th><img src="https://raw.githubusercontent.com/Klipper3d/klipper/master/docs/img/klipper-logo.png" alt="Klipper Logo" height="64"></th>
|
||||||
<th><img src="https://avatars.githubusercontent.com/u/9563098?v=4" alt="Arksine avatar" height="64"></th>
|
<th><img src="https://avatars.githubusercontent.com/u/9563098?v=4" alt="Arksine avatar" height="64"></th>
|
||||||
<th><img src="https://raw.githubusercontent.com/mainsail-crew/docs/master/assets/img/logo.png" alt="Mainsail Logo" height="64"></th>
|
<th><img src="https://raw.githubusercontent.com/mainsail-crew/docs/master/assets/img/logo.png" alt="Mainsail Logo" height="64"></th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>by <a href="https://github.com/KevinOConnor">KevinOConnor</a></th>
|
<th>by <a href="https://github.com/KevinOConnor">KevinOConnor</a></th>
|
||||||
<th>by <a href="https://github.com/Arksine">Arksine</a></th>
|
<th>by <a href="https://github.com/Arksine">Arksine</a></th>
|
||||||
<th>by <a href="https://github.com/mainsail-crew">mainsail-crew</a></th>
|
<th>by <a href="https://github.com/mainsail-crew">mainsail-crew</a></th>
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th><h3><a href="https://github.com/fluidd-core/fluidd">Fluidd</a></h3></th>
|
|
||||||
<th><h3><a href="https://github.com/jordanruthe/KlipperScreen">KlipperScreen</a></h3></th>
|
|
||||||
<th><h3><a href="https://github.com/OctoPrint/OctoPrint">OctoPrint</a></h3></th>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th><img src="https://raw.githubusercontent.com/fluidd-core/fluidd/master/docs/assets/images/logo.svg" alt="Fluidd Logo" height="64"></th>
|
|
||||||
<th><img src="https://avatars.githubusercontent.com/u/31575189?v=4" alt="jordanruthe avatar" height="64"></th>
|
|
||||||
<th><img src="https://raw.githubusercontent.com/OctoPrint/OctoPrint/master/docs/images/octoprint-logo.png" alt="OctoPrint Logo" height="64"></th>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th>by <a href="https://github.com/fluidd-core">fluidd-core</a></th>
|
|
||||||
<th>by <a href="https://github.com/jordanruthe">jordanruthe</a></th>
|
|
||||||
<th>by <a href="https://github.com/OctoPrint">OctoPrint</a></th>
|
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th><h3><a href="https://github.com/nlef/moonraker-telegram-bot">Moonraker-Telegram-Bot</a></h3></th>
|
<th><h3><a href="https://github.com/fluidd-core/fluidd">Fluidd</a></h3></th>
|
||||||
<th><h3><a href="https://github.com/Kragrathea/pgcode">PrettyGCode for Klipper</a></h3></th>
|
<th><h3><a href="https://github.com/jordanruthe/KlipperScreen">KlipperScreen</a></h3></th>
|
||||||
<th><h3><a href="https://github.com/TheSpaghettiDetective/moonraker-obico">Obico for Klipper</a></h3></th>
|
<th><h3><a href="https://github.com/OctoPrint/OctoPrint">OctoPrint</a></h3></th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><img src="https://raw.githubusercontent.com/fluidd-core/fluidd/master/docs/assets/images/logo.svg" alt="Fluidd Logo" height="64"></th>
|
||||||
|
<th><img src="https://avatars.githubusercontent.com/u/31575189?v=4" alt="jordanruthe avatar" height="64"></th>
|
||||||
|
<th><img src="https://raw.githubusercontent.com/OctoPrint/OctoPrint/master/docs/images/octoprint-logo.png" alt="OctoPrint Logo" height="64"></th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>by <a href="https://github.com/fluidd-core">fluidd-core</a></th>
|
||||||
|
<th>by <a href="https://github.com/jordanruthe">jordanruthe</a></th>
|
||||||
|
<th>by <a href="https://github.com/OctoPrint">OctoPrint</a></th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th><img src="https://avatars.githubusercontent.com/u/52351624?v=4" alt="nlef avatar" height="64"></th>
|
<th><h3><a href="https://github.com/nlef/moonraker-telegram-bot">Moonraker-Telegram-Bot</a></h3></th>
|
||||||
<th><img src="https://avatars.githubusercontent.com/u/5917231?v=4" alt="Kragrathea avatar" height="64"></th>
|
<th><h3><a href="https://github.com/Kragrathea/pgcode">PrettyGCode for Klipper</a></h3></th>
|
||||||
<th><img src="https://avatars.githubusercontent.com/u/46323662?s=200&v=4" alt="Obico logo" height="64"></th>
|
<th><h3><a href="https://github.com/TheSpaghettiDetective/moonraker-obico">Obico for Klipper</a></h3></th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><img src="https://avatars.githubusercontent.com/u/52351624?v=4" alt="nlef avatar" height="64"></th>
|
||||||
|
<th><img src="https://avatars.githubusercontent.com/u/5917231?v=4" alt="Kragrathea avatar" height="64"></th>
|
||||||
|
<th><img src="https://avatars.githubusercontent.com/u/46323662?s=200&v=4" alt="Obico logo" height="64"></th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>by <a href="https://github.com/nlef">nlef</a></th>
|
||||||
|
<th>by <a href="https://github.com/Kragrathea">Kragrathea</a></th>
|
||||||
|
<th>by <a href="https://github.com/TheSpaghettiDetective">Obico</a></th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th>by <a href="https://github.com/nlef">nlef</a></th>
|
<th><h3><a href="https://github.com/Clon1998/mobileraker_companion">Mobileraker's Companion</a></h3></th>
|
||||||
<th>by <a href="https://github.com/Kragrathea">Kragrathea</a></th>
|
<th><h3><a href="https://octoeverywhere.com/?source=kiauh_readme">OctoEverywhere For Klipper</a></h3></th>
|
||||||
<th>by <a href="https://github.com/TheSpaghettiDetective">Obico</a></th>
|
<th><h3><a href="https://github.com/crysxd/OctoApp-Plugin">OctoApp For Klipper</a></h3></th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><a href="https://github.com/Clon1998/mobileraker_companion"><img src="https://raw.githubusercontent.com/Clon1998/mobileraker/master/assets/icon/mr_appicon.png" alt="Mobileraker Logo" height="64"></a></th>
|
||||||
|
<th><a href="https://octoeverywhere.com/?source=kiauh_readme"><img src="https://octoeverywhere.com/img/logo.svg" alt="OctoEverywhere Logo" height="64"></a></th>
|
||||||
|
<th><a href="https://octoapp.eu/?source=kiauh_readme"><img src="https://octoapp.eu/octoapp.webp" alt="OctoApp Logo" height="64"></a></th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>by <a href="https://github.com/Clon1998">Patrick Schmidt</a></th>
|
||||||
|
<th>by <a href="https://github.com/QuinnDamerell">Quinn Damerell</a></th>
|
||||||
|
<th>by <a href="https://github.com/crysxd">Christian Würthner</a></th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th><h3><a href="https://github.com/Clon1998/mobileraker_companion">Mobileraker's Companion</a></h3></th>
|
<th><h3><a href="https://github.com/staubgeborener/klipper-backup">Klipper-Backup</a></h3></th>
|
||||||
<th><h3><a href="https://octoeverywhere.com/?source=kiauh_readme">OctoEverywhere For Klipper</a></h3></th>
|
<th><h3><a href="https://simplyprint.io/">SimplyPrint for Klipper</a></h3></th>
|
||||||
<th><h3><a href="https://github.com/crysxd/OctoApp-Plugin">OctoApp For Klipper</a></h3></th>
|
|
||||||
<th><h3></h3></th>
|
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th><a href="https://github.com/Clon1998/mobileraker_companion"><img src="https://raw.githubusercontent.com/Clon1998/mobileraker/master/assets/icon/mr_appicon.png" alt="OctoEverywhere Logo" height="64"></th>
|
<th><a href="https://github.com/staubgeborener/klipper-backup"><img src="https://avatars.githubusercontent.com/u/28908603?v=4" alt="Staubgeroner Avatar" height="64"></a></th>
|
||||||
<th><a href="https://octoeverywhere.com/?source=kiauh_readme"><img src="https://octoeverywhere.com/img/logo.svg" alt="OctoEverywhere Logo" height="64"></a></th>
|
<th><a href="https://github.com/SimplyPrint"><img src="https://avatars.githubusercontent.com/u/64896552?s=200&v=4" alt="" height="64"></a></th>
|
||||||
<th><a href="https://octoapp.eu/?source=kiauh_readme"><img src="https://octoapp.eu/octoapp.webp" alt="OctoApp Logo" height="64"></a></th>
|
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th>by <a href="https://github.com/Clon1998">Patrick Schmidt</a></th>
|
<th>by <a href="https://github.com/Staubgeborener">Staubgeborener</a></th>
|
||||||
<th>by <a href="https://github.com/QuinnDamerell">Quinn Damerell</a></th>
|
<th>by <a href="https://github.com/SimplyPrint">SimplyPrint</a></th>
|
||||||
<th>by <a href="https://github.com/crysxd">Christian Würthner</a></th>
|
|
||||||
<th></th>
|
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
|
<h2 align="center">🎖️ Contributors 🎖️</h2>
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
<a href="https://github.com/dw-0/kiauh/graphs/contributors">
|
||||||
|
<img src="https://contrib.rocks/image?repo=dw-0/kiauh" alt=""/>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
<img src="https://repobeats.axiom.co/api/embed/a1afbda9190c04a90cf4bd3061e5573bc836cb05.svg" alt="Repobeats analytics image"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
<h2 align="center">✨ Credits ✨</h2>
|
<h2 align="center">✨ Credits ✨</h2>
|
||||||
|
|
||||||
* A big thank you to [lixxbox](https://github.com/lixxbox) for that awesome KIAUH-Logo!
|
* A big thank you to [lixxbox](https://github.com/lixxbox) for that awesome KIAUH-Logo!
|
||||||
|
|||||||
206
README_zh.md
Normal file
206
README_zh.md
Normal file
@@ -0,0 +1,206 @@
|
|||||||
|
# KIAUH - Klipper 安装与更新助手
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<a>
|
||||||
|
<img src="https://raw.githubusercontent.com/dw-0/kiauh/master/resources/screenshots/kiauh.png" alt="KIAUH logo" height="181">
|
||||||
|
<h1 align="center">Klipper Installation And Update Helper</h1>
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
一个方便的安装脚本,让安装Klipper(以及更多组件)变得轻松!
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<a><img src="https://img.shields.io/github/license/dw-0/kiauh"></a>
|
||||||
|
<a><img src="https://img.shields.io/github/stars/dw-0/kiauh"></a>
|
||||||
|
<a><img src="https://img.shields.io/github/forks/dw-0/kiauh"></a>
|
||||||
|
<a><img src="https://img.shields.io/github/languages/top/dw-0/kiauh?logo=gnubash&logoColor=white"></a>
|
||||||
|
<a><img src="https://img.shields.io/github/v/tag/dw-0/kiauh"></a>
|
||||||
|
<br />
|
||||||
|
<a><img src="https://img.shields.io/github/last-commit/dw-0/kiauh"></a>
|
||||||
|
<a><img src="https://img.shields.io/github/contributors/dw-0/kiauh"></a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
## 📄 使用说明
|
||||||
|
|
||||||
|
### 📋 系统要求
|
||||||
|
KIAUH 是一个帮助您在 Linux 系统上安装 Klipper 的脚本工具,
|
||||||
|
它需要一个已经写入树莓派(或其他单板计算机)SD 卡的 Linux 系统。
|
||||||
|
如果您使用树莓派,推荐使用 `Raspberry Pi OS Lite (32位或64位)` 系统镜像。
|
||||||
|
[官方 Raspberry Pi Imager](https://www.raspberrypi.com/software/) 是将此类镜像写入 SD 卡的最简单方式。
|
||||||
|
|
||||||
|
* 下载、安装并启动 Raspberry Pi Imager 后,
|
||||||
|
选择 `Choose OS -> Raspberry Pi OS (other)`:
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<img src="https://raw.githubusercontent.com/dw-0/kiauh/master/resources/screenshots/rpi_imager1.png" alt="KIAUH logo" height="350">
|
||||||
|
</p>
|
||||||
|
|
||||||
|
* 然后选择 `Raspberry Pi OS Lite (32位)` (或如果您想使用64位版本):
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<img src="https://raw.githubusercontent.com/dw-0/kiauh/master/resources/screenshots/rpi_imager2.png" alt="KIAUH logo" height="350">
|
||||||
|
</p>
|
||||||
|
|
||||||
|
* 返回 Raspberry Pi Imager 主界面,选择对应的 SD 卡作为写入目标。
|
||||||
|
|
||||||
|
* 确保点击左下角的齿轮图标(在主菜单中)
|
||||||
|
启用 SSH 并配置 Wi-Fi。
|
||||||
|
|
||||||
|
* 如果您需要更多关于使用 Raspberry Pi Imager 的帮助,请访问 [官方文档](https://www.raspberrypi.com/documentation/computers/getting-started.html)。
|
||||||
|
|
||||||
|
这些步骤**仅适用于**您实际使用树莓派的情况。如果您想使用其他单板计算机(如香橙派或其他 Pi 衍生产品),
|
||||||
|
请查找如何将合适的 Linux 镜像写入 SD 卡(通常使用 Balena Etcher)。
|
||||||
|
同时确保 KIAUH 能够在您要安装的 Linux 发行版上运行。
|
||||||
|
您在使用基于 Debian 11 Bullseye 的系统时可能会获得最佳体验。
|
||||||
|
请阅读本文档下方的注意事项。
|
||||||
|
|
||||||
|
### 💾 下载并使用 KIAUH
|
||||||
|
|
||||||
|
**📢 免责声明:使用此脚本的风险由您自行承担!**
|
||||||
|
|
||||||
|
* **第一步:**
|
||||||
|
要下载此脚本,需要先安装 git。
|
||||||
|
如果您不确定是否已安装 git,请运行以下命令:
|
||||||
|
```shell
|
||||||
|
sudo apt-get update && sudo apt-get install git -y
|
||||||
|
```
|
||||||
|
|
||||||
|
* **第二步:**
|
||||||
|
安装完 git 后,
|
||||||
|
使用以下命令将 KIAUH 下载到您的主目录:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
cd ~ && git clone https://github.com/dw-0/kiauh.git
|
||||||
|
```
|
||||||
|
|
||||||
|
* **第三步:**
|
||||||
|
最后,通过运行以下命令启动 KIAUH:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
./kiauh/kiauh.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
* **第四步:**
|
||||||
|
您现在应该会看到 KIAUH 的主菜单。
|
||||||
|
根据您的选择,
|
||||||
|
您会看到几个可选操作。
|
||||||
|
要选择某个操作,只需在 "Perform action" 提示后输入对应的数字并按回车键确认。
|
||||||
|
|
||||||
|
## ❗ 注意事项
|
||||||
|
|
||||||
|
### **📋 请查看 [更新日志](docs/changelog.md) 以了解可能的重要更新!**
|
||||||
|
|
||||||
|
- 主要在 Raspberry Pi OS Lite (Debian 10 Buster / Debian 11 Bullseye) 上测试
|
||||||
|
- 其他基于 Debian 的发行版(如 Ubuntu 20 到 22)也可能正常工作
|
||||||
|
- 据报告在 Armbian 上也可用,但未进行详细测试
|
||||||
|
- 在使用此脚本的过程中,
|
||||||
|
您会被要求输入 sudo 密码。
|
||||||
|
因为有几个功能需要 sudo 权限。
|
||||||
|
|
||||||
|
## 🌐 相关资源与更多信息
|
||||||
|
|
||||||
|
<table align="center">
|
||||||
|
<tr>
|
||||||
|
<th><h3><a href="https://github.com/Klipper3d/klipper">Klipper</a></h3></th>
|
||||||
|
<th><h3><a href="https://github.com/Arksine/moonraker">Moonraker</a></h3></th>
|
||||||
|
<th><h3><a href="https://github.com/mainsail-crew/mainsail">Mainsail</a></h3></th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><img src="https://raw.githubusercontent.com/Klipper3d/klipper/master/docs/img/klipper-logo.png" alt="Klipper Logo" height="64"></th>
|
||||||
|
<th><img src="https://avatars.githubusercontent.com/u/9563098?v=4" alt="Arksine avatar" height="64"></th>
|
||||||
|
<th><img src="https://raw.githubusercontent.com/mainsail-crew/docs/master/assets/img/logo.png" alt="Mainsail Logo" height="64"></th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>由 <a href="https://github.com/KevinOConnor">KevinOConnor</a></th>
|
||||||
|
<th>由 <a href="https://github.com/Arksine">Arksine</a></th>
|
||||||
|
<th>由 <a href="https://github.com/mainsail-crew">mainsail-crew</a></th>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<th><h3><a href="https://github.com/fluidd-core/fluidd">Fluidd</a></h3></th>
|
||||||
|
<th><h3><a href="https://github.com/jordanruthe/KlipperScreen">KlipperScreen</a></h3></th>
|
||||||
|
<th><h3><a href="https://github.com/OctoPrint/OctoPrint">OctoPrint</a></h3></th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><img src="https://raw.githubusercontent.com/fluidd-core/fluidd/master/docs/assets/images/logo.svg" alt="Fluidd Logo" height="64"></th>
|
||||||
|
<th><img src="https://avatars.githubusercontent.com/u/31575189?v=4" alt="jordanruthe avatar" height="64"></th>
|
||||||
|
<th><img src="https://raw.githubusercontent.com/OctoPrint/OctoPrint/master/docs/images/octoprint-logo.png" alt="OctoPrint Logo" height="64"></th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>由 <a href="https://github.com/fluidd-core">fluidd-core</a></th>
|
||||||
|
<th>由 <a href="https://github.com/jordanruthe">jordanruthe</a></th>
|
||||||
|
<th>由 <a href="https://github.com/OctoPrint">OctoPrint</a></th>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<th><h3><a href="https://github.com/nlef/moonraker-telegram-bot">Moonraker-Telegram-Bot</a></h3></th>
|
||||||
|
<th><h3><a href="https://github.com/Kragrathea/pgcode">PrettyGCode for Klipper</a></h3></th>
|
||||||
|
<th><h3><a href="https://github.com/TheSpaghettiDetective/moonraker-obico">Obico for Klipper</a></h3></th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><img src="https://avatars.githubusercontent.com/u/52351624?v=4" alt="nlef avatar" height="64"></th>
|
||||||
|
<th><img src="https://avatars.githubusercontent.com/u/5917231?v=4" alt="Kragrathea avatar" height="64"></th>
|
||||||
|
<th><img src="https://avatars.githubusercontent.com/u/46323662?s=200&v=4" alt="Obico logo" height="64"></th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>由 <a href="https://github.com/nlef">nlef</a></th>
|
||||||
|
<th>由 <a href="https://github.com/Kragrathea">Kragrathea</a></th>
|
||||||
|
<th>由 <a href="https://github.com/TheSpaghettiDetective">Obico</a></th>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<th><h3><a href="https://github.com/Clon1998/mobileraker_companion">Mobileraker's Companion</a></h3></th>
|
||||||
|
<th><h3><a href="https://octoeverywhere.com/?source=kiauh_readme">OctoEverywhere For Klipper</a></h3></th>
|
||||||
|
<th><h3><a href="https://github.com/crysxd/OctoApp-Plugin">OctoApp For Klipper</a></h3></th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><a href="https://github.com/Clon1998/mobileraker_companion"><img src="https://raw.githubusercontent.com/Clon1998/mobileraker/master/assets/icon/mr_appicon.png" alt="Mobileraker Logo" height="64"></a></th>
|
||||||
|
<th><a href="https://octoeverywhere.com/?source=kiauh_readme"><img src="https://octoeverywhere.com/img/logo.svg" alt="OctoEverywhere Logo" height="64"></a></th>
|
||||||
|
<th><a href="https://octoapp.eu/?source=kiauh_readme"><img src="https://octoapp.eu/octoapp.webp" alt="OctoApp Logo" height="64"></a></th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>由 <a href="https://github.com/Clon1998">Patrick Schmidt</a></th>
|
||||||
|
<th>由 <a href="https://github.com/QuinnDamerell">Quinn Damerell</a></th>
|
||||||
|
<th>由 <a href="https://github.com/crysxd">Christian Würthner</a></th>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<th><h3><a href="https://github.com/staubgeborener/klipper-backup">Klipper-Backup</a></h3></th>
|
||||||
|
<th><h3><a href="https://simplyprint.io/">SimplyPrint for Klipper</a></h3></th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><a href="https://github.com/staubgeborener/klipper-backup"><img src="https://avatars.githubusercontent.com/u/28908603?v=4" alt="Staubgeroner Avatar" height="64"></a></th>
|
||||||
|
<th><a href="https://github.com/SimplyPrint"><img src="https://avatars.githubusercontent.com/u/64896552?s=200&v=4" alt="" height="64"></a></th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>由 <a href="https://github.com/Staubgeborener">Staubgeborener</a></th>
|
||||||
|
<th>由 <a href="https://github.com/SimplyPrint">SimplyPrint</a></th>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
## 🎖️ 贡献者
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
<a href="https://github.com/dw-0/kiauh/graphs/contributors">
|
||||||
|
<img src="https://contrib.rocks/image?repo=dw-0/kiauh" alt=""/>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
<img src="https://repobeats.axiom.co/api/embed/a1afbda9190c04a90cf4bd3061e5573bc836cb05.svg" alt="Repobeats analytics image"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
## ✨ 特别感谢
|
||||||
|
|
||||||
|
* 非常感谢 [lixxbox](https://github.com/lixxbox) 设计了如此出色的 KIAUH 标志!
|
||||||
|
* 同时,非常感谢所有通过 [Ko-fi](https://ko-fi.com/dw__0) 支持我的工作的人!
|
||||||
|
* 最后但同样重要的是:感谢所有为 Klipper 社区做出贡献的成员,以及喜欢和分享这个项目的朋友们!
|
||||||
|
|
||||||
|
<h4 align="center">特别感谢 JetBrains 为本项目提供其出色的软件赞助!</h4>
|
||||||
|
<p align="center">
|
||||||
|
<a href="https://www.jetbrains.com/community/opensource/#support" target="_blank">
|
||||||
|
<img src="https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.png" alt="JetBrains Logo (Main) logo." height="128">
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
@@ -2,6 +2,47 @@
|
|||||||
|
|
||||||
This document covers possible important changes to KIAUH.
|
This document covers possible important changes to KIAUH.
|
||||||
|
|
||||||
|
### 2024-08-31 (v6.0.0-alpha.1)
|
||||||
|
Long time no see, but here we are again!
|
||||||
|
A lot has happened in the background, but now it is time to take it out into the wild.
|
||||||
|
|
||||||
|
#### KIAUH has now reached version 6! Well, at least in an alpha state...
|
||||||
|
|
||||||
|
The project has seen a complete rewrite of the script from scratch in Python.
|
||||||
|
It requires Python 3.8 or newer to run. Because this update is still in an alpha state, bugs may or will occur.
|
||||||
|
During startup, you will be asked if you want to start the new version 6 or the old version 5.
|
||||||
|
As long as version 6 is in a pre-release state, version 5 will still be available. If there are any critical issues
|
||||||
|
with the new version that were overlooked, you can always switch back to the old version.
|
||||||
|
|
||||||
|
In case you selected not to get asked about which version to start (option 3 or 4 in the startup dialog) and you want to
|
||||||
|
revert that decision, you will find a line called `version_to_launch=` within the `.kiauh.ini` file in your home directory.
|
||||||
|
Just delete that line, save the file and restart KIAUH. KIAUH will then ask you again which version you want to start.
|
||||||
|
|
||||||
|
Here is a list of the most important changes to KIAUH in regard to version 6:
|
||||||
|
- The majority of features available in KIAUH v5 are still available; they just got migrated from Bash to Python.
|
||||||
|
- It is now possible to add new/remove instances to/from existing multi-instance installations of Klipper and Moonraker
|
||||||
|
- KIAUH now has an Extension-System. This allows contributors to add new installers to KIAUH without having to modify the main script.
|
||||||
|
- You will now find some of the features that were previously available in the Installer-Menu in the Extensions-Menu.
|
||||||
|
- The current extensions are:
|
||||||
|
- G-Code Shell Command (previously found in the Advanced-Menu)
|
||||||
|
- Mainsail Theme Installer (previously found in the Advanced-Menu)
|
||||||
|
- Klipper-Backup (new in v6!)
|
||||||
|
- Moonraker Telegram Bot (previously found in the Installer-Menu)
|
||||||
|
- PrettyGCode for Klipper (previously found in the Installer-Menu)
|
||||||
|
- Obico for Klipper (previously found in the Installer-Menu)
|
||||||
|
- The following additional extensions are planned, but not yet available:
|
||||||
|
- Spoolman (available in v5 in the Installer-Menu)
|
||||||
|
- OctoApp (available in v5 in the Installer-Menu)
|
||||||
|
- KIAUH has its own config file now
|
||||||
|
- The file has some default values for the currently supported options
|
||||||
|
- There might be more options in the future
|
||||||
|
- It is located in KIAUH's root directory and is called `default.kiauh.cfg`
|
||||||
|
- DO NOT EDIT the default file directly, instead make a copy of it and call it `kiauh.cfg`
|
||||||
|
- Settings changed via the Advanced-Menu will be written to the `kiauh.cfg`
|
||||||
|
- Support for OctoPrint was removed
|
||||||
|
|
||||||
|
Feel free to give version 6 a try and report any bugs or issues you encounter! Every feedback is appreciated.
|
||||||
|
|
||||||
### 2023-06-17
|
### 2023-06-17
|
||||||
KIAUH has now added support for installing Mobileraker's companion!
|
KIAUH has now added support for installing Mobileraker's companion!
|
||||||
Mobileraker is a free and Open Source Android and iOS App for Klipper, utilizing the Moonraker API, allowing you
|
Mobileraker is a free and Open Source Android and iOS App for Klipper, utilizing the Moonraker API, allowing you
|
||||||
|
|||||||
38
kiauh.sh
38
kiauh.sh
@@ -10,7 +10,10 @@
|
|||||||
#=======================================================================#
|
#=======================================================================#
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
clear
|
clear -x
|
||||||
|
|
||||||
|
# make sure we have the correct permissions while running the script
|
||||||
|
umask 022
|
||||||
|
|
||||||
### sourcing all additional scripts
|
### sourcing all additional scripts
|
||||||
KIAUH_SRCDIR="$(dirname -- "$(readlink -f "${BASH_SOURCE[0]}")")"
|
KIAUH_SRCDIR="$(dirname -- "$(readlink -f "${BASH_SOURCE[0]}")")"
|
||||||
@@ -54,36 +57,15 @@ function kiauh_update_avail() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function kiauh_update_dialog() {
|
function main() {
|
||||||
[[ ! $(kiauh_update_avail) == "true" ]] && return
|
read_kiauh_ini "${FUNCNAME[0]}"
|
||||||
top_border
|
main_menu
|
||||||
echo -e "|${green} New KIAUH update available! ${white}|"
|
|
||||||
hr
|
|
||||||
echo -e "|${green} View Changelog: https://git.io/JnmlX ${white}|"
|
|
||||||
blank_line
|
|
||||||
echo -e "|${yellow} It is recommended to keep KIAUH up to date. Updates ${white}|"
|
|
||||||
echo -e "|${yellow} usually contain bugfixes, important changes or new ${white}|"
|
|
||||||
echo -e "|${yellow} features. Please consider updating! ${white}|"
|
|
||||||
bottom_border
|
|
||||||
|
|
||||||
local yn
|
|
||||||
read -p "${cyan}###### Do you want to update now? (Y/n):${white} " yn
|
|
||||||
while true; do
|
|
||||||
case "${yn}" in
|
|
||||||
Y|y|Yes|yes|"")
|
|
||||||
do_action "update_kiauh"
|
|
||||||
break;;
|
|
||||||
N|n|No|no)
|
|
||||||
break;;
|
|
||||||
*)
|
|
||||||
deny_action "kiauh_update_dialog";;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
}
|
}
|
||||||
|
|
||||||
check_if_ratos
|
check_if_ratos
|
||||||
check_euid
|
check_euid
|
||||||
init_logfile
|
init_logfile
|
||||||
set_globals
|
set_globals
|
||||||
kiauh_update_dialog
|
read_kiauh_ini
|
||||||
main_menu
|
init_ini
|
||||||
|
main
|
||||||
|
|||||||
@@ -8,22 +8,26 @@ import shlex
|
|||||||
import subprocess
|
import subprocess
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
|
||||||
class ShellCommand:
|
class ShellCommand:
|
||||||
def __init__(self, config):
|
def __init__(self, config):
|
||||||
self.name = config.get_name().split()[-1]
|
self.name = config.get_name().split()[-1]
|
||||||
self.printer = config.get_printer()
|
self.printer = config.get_printer()
|
||||||
self.gcode = self.printer.lookup_object('gcode')
|
self.gcode = self.printer.lookup_object("gcode")
|
||||||
cmd = config.get('command')
|
cmd = config.get("command")
|
||||||
cmd = os.path.expanduser(cmd)
|
cmd = os.path.expanduser(cmd)
|
||||||
self.command = shlex.split(cmd)
|
self.command = shlex.split(cmd)
|
||||||
self.timeout = config.getfloat('timeout', 2., above=0.)
|
self.timeout = config.getfloat("timeout", 2.0, above=0.0)
|
||||||
self.verbose = config.getboolean('verbose', True)
|
self.verbose = config.getboolean("verbose", True)
|
||||||
self.proc_fd = None
|
self.proc_fd = None
|
||||||
self.partial_output = ""
|
self.partial_output = ""
|
||||||
self.gcode.register_mux_command(
|
self.gcode.register_mux_command(
|
||||||
"RUN_SHELL_COMMAND", "CMD", self.name,
|
"RUN_SHELL_COMMAND",
|
||||||
|
"CMD",
|
||||||
|
self.name,
|
||||||
self.cmd_RUN_SHELL_COMMAND,
|
self.cmd_RUN_SHELL_COMMAND,
|
||||||
desc=self.cmd_RUN_SHELL_COMMAND_help)
|
desc=self.cmd_RUN_SHELL_COMMAND_help,
|
||||||
|
)
|
||||||
|
|
||||||
def _process_output(self, eventime):
|
def _process_output(self, eventime):
|
||||||
if self.proc_fd is None:
|
if self.proc_fd is None:
|
||||||
@@ -33,11 +37,11 @@ class ShellCommand:
|
|||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
data = self.partial_output + data.decode()
|
data = self.partial_output + data.decode()
|
||||||
if '\n' not in data:
|
if "\n" not in data:
|
||||||
self.partial_output = data
|
self.partial_output = data
|
||||||
return
|
return
|
||||||
elif data[-1] != '\n':
|
elif data[-1] != "\n":
|
||||||
split = data.rfind('\n') + 1
|
split = data.rfind("\n") + 1
|
||||||
self.partial_output = data[split:]
|
self.partial_output = data[split:]
|
||||||
data = data[:split]
|
data = data[:split]
|
||||||
else:
|
else:
|
||||||
@@ -45,16 +49,19 @@ class ShellCommand:
|
|||||||
self.gcode.respond_info(data)
|
self.gcode.respond_info(data)
|
||||||
|
|
||||||
cmd_RUN_SHELL_COMMAND_help = "Run a linux shell command"
|
cmd_RUN_SHELL_COMMAND_help = "Run a linux shell command"
|
||||||
|
|
||||||
def cmd_RUN_SHELL_COMMAND(self, params):
|
def cmd_RUN_SHELL_COMMAND(self, params):
|
||||||
gcode_params = params.get('PARAMS','')
|
gcode_params = params.get("PARAMS", "")
|
||||||
gcode_params = shlex.split(gcode_params)
|
gcode_params = shlex.split(gcode_params)
|
||||||
reactor = self.printer.get_reactor()
|
reactor = self.printer.get_reactor()
|
||||||
try:
|
try:
|
||||||
proc = subprocess.Popen(
|
proc = subprocess.Popen(
|
||||||
self.command + gcode_params, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
self.command + gcode_params,
|
||||||
|
stdout=subprocess.PIPE,
|
||||||
|
stderr=subprocess.STDOUT,
|
||||||
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
logging.exception(
|
logging.exception("shell_command: Command {%s} failed" % (self.name))
|
||||||
"shell_command: Command {%s} failed" % (self.name))
|
|
||||||
raise self.gcode.error("Error running command {%s}" % (self.name))
|
raise self.gcode.error("Error running command {%s}" % (self.name))
|
||||||
if self.verbose:
|
if self.verbose:
|
||||||
self.proc_fd = proc.stdout.fileno()
|
self.proc_fd = proc.stdout.fileno()
|
||||||
@@ -64,7 +71,7 @@ class ShellCommand:
|
|||||||
endtime = eventtime + self.timeout
|
endtime = eventtime + self.timeout
|
||||||
complete = False
|
complete = False
|
||||||
while eventtime < endtime:
|
while eventtime < endtime:
|
||||||
eventtime = reactor.pause(eventtime + .05)
|
eventtime = reactor.pause(eventtime + 0.05)
|
||||||
if proc.poll() is not None:
|
if proc.poll() is not None:
|
||||||
complete = True
|
complete = True
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ trusted_clients:
|
|||||||
cors_domains:
|
cors_domains:
|
||||||
*.lan
|
*.lan
|
||||||
*.local
|
*.local
|
||||||
|
*.internal
|
||||||
*://localhost
|
*://localhost
|
||||||
*://localhost:*
|
*://localhost:*
|
||||||
*://my.mainsail.xyz
|
*://my.mainsail.xyz
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ function install_crowsnest(){
|
|||||||
pushd "${HOME}/crowsnest" &> /dev/null || exit 1
|
pushd "${HOME}/crowsnest" &> /dev/null || exit 1
|
||||||
title_msg "Installer will prompt you for sudo password!"
|
title_msg "Installer will prompt you for sudo password!"
|
||||||
status_msg "Launching crowsnest installer ..."
|
status_msg "Launching crowsnest installer ..."
|
||||||
if ! sudo make install BASE_USER=$USER; then
|
if ! sudo make install; then
|
||||||
error_msg "Something went wrong! Please try again..."
|
error_msg "Something went wrong! Please try again..."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -280,7 +280,6 @@ function create_klipper_virtualenv() {
|
|||||||
status_msg "Installing $("python${python_version}" -V) virtual environment..."
|
status_msg "Installing $("python${python_version}" -V) virtual environment..."
|
||||||
|
|
||||||
if virtualenv -p "python${python_version}" "${KLIPPY_ENV}"; then
|
if virtualenv -p "python${python_version}" "${KLIPPY_ENV}"; then
|
||||||
(( python_version == 3 )) && "${KLIPPY_ENV}"/bin/pip install -U pip
|
|
||||||
"${KLIPPY_ENV}"/bin/pip install -r "${KLIPPER_DIR}"/scripts/klippy-requirements.txt
|
"${KLIPPY_ENV}"/bin/pip install -r "${KLIPPER_DIR}"/scripts/klippy-requirements.txt
|
||||||
else
|
else
|
||||||
log_error "failure while creating python3 klippy-env"
|
log_error "failure while creating python3 klippy-env"
|
||||||
@@ -304,6 +303,8 @@ function install_klipper_packages() {
|
|||||||
packages=$(grep "PKGLIST=" "${install_script}" | cut -d'"' -f2 | sed 's/\${PKGLIST}//g' | tr -d '\n')
|
packages=$(grep "PKGLIST=" "${install_script}" | cut -d'"' -f2 | sed 's/\${PKGLIST}//g' | tr -d '\n')
|
||||||
### add dfu-util for octopi-images
|
### add dfu-util for octopi-images
|
||||||
packages+=" dfu-util"
|
packages+=" dfu-util"
|
||||||
|
### add pkg-config for rp2040 build
|
||||||
|
packages+=" pkg-config"
|
||||||
### add dbus requirement for DietPi distro
|
### add dbus requirement for DietPi distro
|
||||||
[[ -e "/boot/dietpi/.version" ]] && packages+=" dbus"
|
[[ -e "/boot/dietpi/.version" ]] && packages+=" dbus"
|
||||||
|
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ function update_klipperscreen() {
|
|||||||
git checkout -f master && ok_msg "Checkout successfull"
|
git checkout -f master && ok_msg "Checkout successfull"
|
||||||
|
|
||||||
if [[ $(md5sum "${KLIPPERSCREEN_DIR}/scripts/KlipperScreen-requirements.txt" | cut -d " " -f1) != "${old_md5}" ]]; then
|
if [[ $(md5sum "${KLIPPERSCREEN_DIR}/scripts/KlipperScreen-requirements.txt" | cut -d " " -f1) != "${old_md5}" ]]; then
|
||||||
status_msg "New dependecies detected..."
|
status_msg "New dependencies detected..."
|
||||||
"${KLIPPERSCREEN_ENV}"/bin/pip install -r "${KLIPPERSCREEN_DIR}/scripts/KlipperScreen-requirements.txt"
|
"${KLIPPERSCREEN_ENV}"/bin/pip install -r "${KLIPPERSCREEN_DIR}/scripts/KlipperScreen-requirements.txt"
|
||||||
ok_msg "Dependencies have been installed!"
|
ok_msg "Dependencies have been installed!"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ function update_mobileraker() {
|
|||||||
git checkout -f main && ok_msg "Checkout successfull"
|
git checkout -f main && ok_msg "Checkout successfull"
|
||||||
|
|
||||||
if [[ $(md5sum "${MOBILERAKER_DIR}/scripts/mobileraker-requirements.txt" | cut -d " " -f1) != "${old_md5}" ]]; then
|
if [[ $(md5sum "${MOBILERAKER_DIR}/scripts/mobileraker-requirements.txt" | cut -d " " -f1) != "${old_md5}" ]]; then
|
||||||
status_msg "New dependecies detected..."
|
status_msg "New dependencies detected..."
|
||||||
"${MOBILERAKER_ENV}"/bin/pip install -r "${MOBILERAKER_DIR}/scripts/mobileraker-requirements.txt"
|
"${MOBILERAKER_ENV}"/bin/pip install -r "${MOBILERAKER_DIR}/scripts/mobileraker-requirements.txt"
|
||||||
ok_msg "Dependencies have been installed!"
|
ok_msg "Dependencies have been installed!"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ function moonraker_systemd() {
|
|||||||
###
|
###
|
||||||
# any moonraker client that uses "moonraker" in its own name must be blacklisted using
|
# any moonraker client that uses "moonraker" in its own name must be blacklisted using
|
||||||
# this variable, otherwise they will be falsely recognized as moonraker instances
|
# this variable, otherwise they will be falsely recognized as moonraker instances
|
||||||
blacklist="obico"
|
blacklist="obico|hmi|telegram-bot"
|
||||||
|
|
||||||
ignore="${SYSTEMD}/moonraker-(${blacklist}).service"
|
ignore="${SYSTEMD}/moonraker-(${blacklist}).service"
|
||||||
match="${SYSTEMD}/moonraker(-[0-9a-zA-Z]+)?.service"
|
match="${SYSTEMD}/moonraker(-[0-9a-zA-Z]+)?.service"
|
||||||
@@ -147,7 +147,192 @@ function install_moonraker_dependencies() {
|
|||||||
### read PKGLIST from official install-script
|
### read PKGLIST from official install-script
|
||||||
status_msg "Reading dependencies..."
|
status_msg "Reading dependencies..."
|
||||||
# shellcheck disable=SC2016
|
# shellcheck disable=SC2016
|
||||||
packages=$(cat $package_json | tr -d ' \n{}' | cut -d "]" -f1 | cut -d":" -f2 | tr -d '"[' | sed 's/,/ /g')
|
packages=$(python3 - << EOF
|
||||||
|
from __future__ import annotations
|
||||||
|
import shlex
|
||||||
|
import re
|
||||||
|
import pathlib
|
||||||
|
import logging
|
||||||
|
|
||||||
|
from typing import Tuple, Dict, List, Any
|
||||||
|
|
||||||
|
def _get_distro_info() -> Dict[str, Any]:
|
||||||
|
try:
|
||||||
|
import distro
|
||||||
|
except ModuleNotFoundError:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
return dict(
|
||||||
|
distro_id=distro.id(),
|
||||||
|
distro_version=distro.version(),
|
||||||
|
aliases=distro.like().split()
|
||||||
|
)
|
||||||
|
release_file = pathlib.Path("/etc/os-release")
|
||||||
|
release_info: Dict[str, str] = {}
|
||||||
|
with release_file.open("r") as f:
|
||||||
|
lexer = shlex.shlex(f, posix=True)
|
||||||
|
lexer.whitespace_split = True
|
||||||
|
for item in list(lexer):
|
||||||
|
if "=" in item:
|
||||||
|
key, val = item.split("=", maxsplit=1)
|
||||||
|
release_info[key] = val
|
||||||
|
return dict(
|
||||||
|
distro_id=release_info.get("ID", ""),
|
||||||
|
distro_version=release_info.get("VERSION_ID", ""),
|
||||||
|
aliases=release_info.get("ID_LIKE", "").split()
|
||||||
|
)
|
||||||
|
|
||||||
|
def _convert_version(version: str) -> Tuple[str | int, ...]:
|
||||||
|
version = version.strip()
|
||||||
|
ver_match = re.match(r"\d+(\.\d+)*((?:-|\.).+)?", version)
|
||||||
|
if ver_match is not None:
|
||||||
|
return tuple([
|
||||||
|
int(part) if part.isdigit() else part
|
||||||
|
for part in re.split(r"\.|-", version)
|
||||||
|
])
|
||||||
|
return (version,)
|
||||||
|
|
||||||
|
class SysDepsParser:
|
||||||
|
def __init__(self, distro_info: Dict[str, Any] | None = None) -> None:
|
||||||
|
if distro_info is None:
|
||||||
|
distro_info = _get_distro_info()
|
||||||
|
self.distro_id: str = distro_info.get("distro_id", "")
|
||||||
|
self.aliases: List[str] = distro_info.get("aliases", [])
|
||||||
|
self.distro_version: Tuple[int | str, ...] = tuple()
|
||||||
|
version = distro_info.get("distro_version")
|
||||||
|
if version:
|
||||||
|
self.distro_version = _convert_version(version)
|
||||||
|
self.vendor: str = ""
|
||||||
|
if pathlib.Path("/etc/rpi-issue").is_file():
|
||||||
|
self.vendor = "raspberry-pi"
|
||||||
|
|
||||||
|
def _parse_spec(self, full_spec: str) -> str | None:
|
||||||
|
parts = full_spec.split(";", maxsplit=1)
|
||||||
|
if len(parts) == 1:
|
||||||
|
return full_spec
|
||||||
|
pkg_name = parts[0].strip()
|
||||||
|
expressions = re.split(r"( and | or )", parts[1].strip())
|
||||||
|
if not len(expressions) & 1:
|
||||||
|
logging.info(
|
||||||
|
f"Requirement specifier is missing an expression "
|
||||||
|
f"between logical operators : {full_spec}"
|
||||||
|
)
|
||||||
|
return None
|
||||||
|
last_result: bool = True
|
||||||
|
last_logical_op: str | None = "and"
|
||||||
|
for idx, exp in enumerate(expressions):
|
||||||
|
if idx & 1:
|
||||||
|
if last_logical_op is not None:
|
||||||
|
logging.info(
|
||||||
|
"Requirement specifier contains sequential logical "
|
||||||
|
f"operators: {full_spec}"
|
||||||
|
)
|
||||||
|
return None
|
||||||
|
logical_op = exp.strip()
|
||||||
|
if logical_op not in ("and", "or"):
|
||||||
|
logging.info(
|
||||||
|
f"Invalid logical operator {logical_op} in requirement "
|
||||||
|
f"specifier: {full_spec}")
|
||||||
|
return None
|
||||||
|
last_logical_op = logical_op
|
||||||
|
continue
|
||||||
|
elif last_logical_op is None:
|
||||||
|
logging.info(
|
||||||
|
f"Requirement specifier contains two seqential expressions "
|
||||||
|
f"without a logical operator: {full_spec}")
|
||||||
|
return None
|
||||||
|
dep_parts = re.split(r"(==|!=|<=|>=|<|>)", exp.strip())
|
||||||
|
req_var = dep_parts[0].strip().lower()
|
||||||
|
if len(dep_parts) != 3:
|
||||||
|
logging.info(f"Invalid comparison, must be 3 parts: {full_spec}")
|
||||||
|
return None
|
||||||
|
elif req_var == "distro_id":
|
||||||
|
left_op: str | Tuple[int | str, ...] = self.distro_id
|
||||||
|
right_op = dep_parts[2].strip().strip("\"'")
|
||||||
|
elif req_var == "vendor":
|
||||||
|
left_op = self.vendor
|
||||||
|
right_op = dep_parts[2].strip().strip("\"'")
|
||||||
|
elif req_var == "distro_version":
|
||||||
|
if not self.distro_version:
|
||||||
|
logging.info(
|
||||||
|
"Distro Version not detected, cannot satisfy requirement: "
|
||||||
|
f"{full_spec}"
|
||||||
|
)
|
||||||
|
return None
|
||||||
|
left_op = self.distro_version
|
||||||
|
right_op = _convert_version(dep_parts[2].strip().strip("\"'"))
|
||||||
|
else:
|
||||||
|
logging.info(f"Invalid requirement specifier: {full_spec}")
|
||||||
|
return None
|
||||||
|
operator = dep_parts[1].strip()
|
||||||
|
try:
|
||||||
|
compfunc = {
|
||||||
|
"<": lambda x, y: x < y,
|
||||||
|
">": lambda x, y: x > y,
|
||||||
|
"==": lambda x, y: x == y,
|
||||||
|
"!=": lambda x, y: x != y,
|
||||||
|
">=": lambda x, y: x >= y,
|
||||||
|
"<=": lambda x, y: x <= y
|
||||||
|
}.get(operator, lambda x, y: False)
|
||||||
|
result = compfunc(left_op, right_op)
|
||||||
|
if last_logical_op == "and":
|
||||||
|
last_result &= result
|
||||||
|
else:
|
||||||
|
last_result |= result
|
||||||
|
last_logical_op = None
|
||||||
|
except Exception:
|
||||||
|
logging.exception(f"Error comparing requirements: {full_spec}")
|
||||||
|
return None
|
||||||
|
if last_result:
|
||||||
|
return pkg_name
|
||||||
|
return None
|
||||||
|
|
||||||
|
def parse_dependencies(self, sys_deps: Dict[str, List[str]]) -> List[str]:
|
||||||
|
if not self.distro_id:
|
||||||
|
logging.info(
|
||||||
|
"Failed to detect current distro ID, cannot parse dependencies"
|
||||||
|
)
|
||||||
|
return []
|
||||||
|
all_ids = [self.distro_id] + self.aliases
|
||||||
|
for distro_id in all_ids:
|
||||||
|
if distro_id in sys_deps:
|
||||||
|
if not sys_deps[distro_id]:
|
||||||
|
logging.info(
|
||||||
|
f"Dependency data contains an empty package definition "
|
||||||
|
f"for linux distro '{distro_id}'"
|
||||||
|
)
|
||||||
|
continue
|
||||||
|
processed_deps: List[str] = []
|
||||||
|
for dep in sys_deps[distro_id]:
|
||||||
|
parsed_dep = self._parse_spec(dep)
|
||||||
|
if parsed_dep is not None:
|
||||||
|
processed_deps.append(parsed_dep)
|
||||||
|
return processed_deps
|
||||||
|
else:
|
||||||
|
logging.info(
|
||||||
|
f"Dependency data has no package definition for linux "
|
||||||
|
f"distro '{self.distro_id}'"
|
||||||
|
)
|
||||||
|
return []
|
||||||
|
# *** SYSTEM DEPENDENCIES START ***
|
||||||
|
system_deps = {
|
||||||
|
"debian": [
|
||||||
|
"python3-virtualenv", "python3-dev", "libopenjp2-7", "libsodium-dev",
|
||||||
|
"zlib1g-dev", "libjpeg-dev", "packagekit",
|
||||||
|
"wireless-tools; distro_id != 'ubuntu' or distro_version <= '24.04'",
|
||||||
|
"iw; distro_id == 'ubuntu' and distro_version >= '24.10'",
|
||||||
|
"python3-libcamera; vendor == 'raspberry-pi' and distro_version >= '11'",
|
||||||
|
"curl", "build-essential"
|
||||||
|
],
|
||||||
|
}
|
||||||
|
# *** SYSTEM DEPENDENCIES END ***
|
||||||
|
parser = SysDepsParser()
|
||||||
|
pkgs = parser.parse_dependencies(system_deps)
|
||||||
|
if pkgs:
|
||||||
|
print(' '.join(pkgs), end="")
|
||||||
|
exit(0)
|
||||||
|
EOF
|
||||||
|
)
|
||||||
|
|
||||||
echo "${cyan}${packages}${white}" | tr '[:space:]' '\n'
|
echo "${cyan}${packages}${white}" | tr '[:space:]' '\n'
|
||||||
read -r -a packages <<< "${packages}"
|
read -r -a packages <<< "${packages}"
|
||||||
@@ -166,7 +351,6 @@ function create_moonraker_virtualenv() {
|
|||||||
[[ -d ${MOONRAKER_ENV} ]] && rm -rf "${MOONRAKER_ENV}"
|
[[ -d ${MOONRAKER_ENV} ]] && rm -rf "${MOONRAKER_ENV}"
|
||||||
|
|
||||||
if virtualenv -p /usr/bin/python3 "${MOONRAKER_ENV}"; then
|
if virtualenv -p /usr/bin/python3 "${MOONRAKER_ENV}"; then
|
||||||
"${MOONRAKER_ENV}"/bin/pip install -U pip
|
|
||||||
"${MOONRAKER_ENV}"/bin/pip install -r "${MOONRAKER_DIR}/scripts/moonraker-requirements.txt"
|
"${MOONRAKER_ENV}"/bin/pip install -r "${MOONRAKER_DIR}/scripts/moonraker-requirements.txt"
|
||||||
else
|
else
|
||||||
log_error "failure while creating python3 moonraker-env"
|
log_error "failure while creating python3 moonraker-env"
|
||||||
|
|||||||
@@ -127,9 +127,9 @@ managed_services: Spoolman
|
|||||||
regex="${HOME//\//\\/}\/([A-Za-z0-9_]+)\/moonraker\.asvc"
|
regex="${HOME//\//\\/}\/([A-Za-z0-9_]+)\/moonraker\.asvc"
|
||||||
moonraker_asvc=$(find "${HOME}" -maxdepth 2 -type f -regextype posix-extended -regex "${regex}" | sort)
|
moonraker_asvc=$(find "${HOME}" -maxdepth 2 -type f -regextype posix-extended -regex "${regex}" | sort)
|
||||||
|
|
||||||
if [[ -n ${moonraker_asvc} ]]; then
|
if ! grep -q "^Spoolman$" "${moonraker_asvc}"; then
|
||||||
status_msg "Adding Spoolman service to moonraker.asvc..."
|
status_msg "Adding Spoolman service to moonraker.asvc..."
|
||||||
/bin/sh -c "echo 'Spoolman' >> ${moonraker_asvc}"
|
sed -i '$a''Spoolman' "${moonraker_asvc}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ function main_ui() {
|
|||||||
function get_kiauh_version() {
|
function get_kiauh_version() {
|
||||||
local version
|
local version
|
||||||
cd "${KIAUH_SRCDIR}"
|
cd "${KIAUH_SRCDIR}"
|
||||||
version="$(git describe HEAD --always --tags | cut -d "-" -f 1,2)"
|
version="$(git tag -l 'v5*' | tail -1)"
|
||||||
echo "${version}"
|
echo "${version}"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,9 +93,6 @@ function main_menu() {
|
|||||||
clear && print_header
|
clear && print_header
|
||||||
main_ui
|
main_ui
|
||||||
|
|
||||||
### initialize kiauh.ini
|
|
||||||
init_ini
|
|
||||||
|
|
||||||
local action
|
local action
|
||||||
while true; do
|
while true; do
|
||||||
read -p "${cyan}####### Perform action:${white} " action
|
read -p "${cyan}####### Perform action:${white} " action
|
||||||
|
|||||||
@@ -193,6 +193,10 @@ function init_ini() {
|
|||||||
echo -e "\nmulti_instance_names=\c" >> "${INI_FILE}"
|
echo -e "\nmulti_instance_names=\c" >> "${INI_FILE}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if ! grep -Eq "^version_to_launch=" "${INI_FILE}"; then
|
||||||
|
echo -e "\nversion_to_launch=\n\c" >> "${INI_FILE}"
|
||||||
|
fi
|
||||||
|
|
||||||
### strip all empty lines out of the file
|
### strip all empty lines out of the file
|
||||||
sed -i "/^[[:blank:]]*$/ d" "${INI_FILE}"
|
sed -i "/^[[:blank:]]*$/ d" "${INI_FILE}"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user