Skip to content

Commit c795993

Browse files
committed
Improve Qwen install fallback and clarify ISO licensing
1 parent 6126f33 commit c795993

3 files changed

Lines changed: 115 additions & 0 deletions

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ Layout contract used by madOS:
138138

139139
This project is licensed under `AGPL-3.0-only` (GNU Affero General Public License v3.0 only).
140140
See [LICENSE](LICENSE) for the full text.
141+
142+
madOS is licensed under `AGPL-3.0-only`; the ISO image may include third-party software subject to different licenses.
143+
144+
Third-party packages included in the ISO may use different licenses. See [THIRD_PARTY_LICENSES.md](THIRD_PARTY_LICENSES.md).
141145
## Resources
142146

143147
- [GitHub](https://github.com/madkoding/mad-os)

THIRD_PARTY_LICENSES.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Third-Party Licenses
2+
3+
This document summarizes the license status of third-party software included or installed by default in madOS builds.
4+
5+
## madOS License
6+
7+
- madOS project code (this repository): `AGPL-3.0-only`
8+
- File: `LICENSE`
9+
10+
The madOS repository license applies to madOS code and assets, not automatically to all third-party packages shipped in the ISO.
11+
12+
## Third-Party Components (Not Exhaustive)
13+
14+
### Components that are not fully free or are commonly treated as non-free
15+
16+
- `intel-ucode` (CPU microcode)
17+
- `amd-ucode` (CPU microcode)
18+
- `linux-firmware` (firmware blobs)
19+
- `alsa-firmware` (firmware blobs)
20+
- `sof-firmware` (firmware blobs)
21+
- `steam` (proprietary client/software distribution platform)
22+
- `code` (official Visual Studio Code build)
23+
24+
These components are included for hardware compatibility and user experience, but they may not satisfy strict "100% free software" criteria.
25+
26+
### Components with license/distribution status that should be reviewed periodically
27+
28+
- `opencode`
29+
- `ollama`
30+
- Tools installed by `airootfs/root/customize_airootfs.d/09-ai-tools.sh`:
31+
- `openclaw` (npm)
32+
- `forge` / `forgecode` (remote install script)
33+
- `qwen` (remote install script)
34+
35+
Because these tools can change distribution method, packaging, or terms over time, verify upstream license and redistribution terms before release.
36+
37+
## Upstream Sources in Build Scripts
38+
39+
madOS build scripts clone/install third-party projects from upstream repositories (for example, GitHub). Their licenses are defined by each upstream project and may differ from `AGPL-3.0-only`.
40+
41+
Examples include:
42+
43+
- madOS native app repos installed by `airootfs/root/customize_airootfs.d/03-apps.sh`
44+
- Qylock theme assets installed by `airootfs/root/customize_airootfs.d/04-sddm-qylock.sh`
45+
- Theme assets installed from `theme-imperative-dots`
46+
47+
## Policy Notes
48+
49+
- Keeping madOS under `AGPL-3.0-only` is compatible with distributing third-party software under different licenses.
50+
- For strict free-software distributions, create a separate package profile that removes non-free firmware, microcode, and proprietary apps.
51+
52+
## Maintainer Checklist Before Release
53+
54+
- Review `packages.x86_64` for proprietary/non-free packages.
55+
- Review `airootfs/root/customize_airootfs.d/09-ai-tools.sh` for external installers.
56+
- Confirm upstream licenses for dynamically cloned/installed projects.
57+
- Update this file if package selections change.

airootfs/root/customize_airootfs.d/09-ai-tools.sh

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,27 @@ install_qwen_fallback() {
3939
fi
4040
}
4141

42+
install_qwen_npm_fallback() {
43+
echo " Falling back to npm install..."
44+
if command -v npm &>/dev/null; then
45+
if npm install -g @qwen-code/qwen-code@latest 2>&1; then
46+
echo "✓ Qwen installed via npm (@qwen-code/qwen-code)"
47+
return 0
48+
fi
49+
50+
if npm install -g qwen-code@latest 2>&1; then
51+
echo "✓ Qwen installed via npm (qwen-code)"
52+
return 0
53+
fi
54+
55+
echo "WARNING: Qwen npm install also failed"
56+
echo " Users can install manually: npm install -g @qwen-code/qwen-code"
57+
else
58+
echo " npm not available, cannot fallback. Install manually after boot."
59+
fi
60+
return 1
61+
}
62+
4263
ensure_forge_global_command() {
4364
local forge_src=""
4465

@@ -63,6 +84,33 @@ ensure_forge_global_command() {
6384
return 0
6485
}
6586

87+
ensure_qwen_global_command() {
88+
local qwen_src=""
89+
90+
if command -v qwen &>/dev/null; then
91+
qwen_src="$(command -v qwen)"
92+
else
93+
for candidate in /root/.local/bin/qwen /home/liveuser/.local/bin/qwen /root/.qwen/bin/qwen /home/liveuser/.qwen/bin/qwen; do
94+
if [[ -x "$candidate" ]]; then
95+
qwen_src="$candidate"
96+
break
97+
fi
98+
done
99+
fi
100+
101+
if [[ -z "$qwen_src" ]]; then
102+
echo " WARNING: qwen binary not found after install"
103+
return 1
104+
fi
105+
106+
if [[ "$qwen_src" != "/usr/local/bin/qwen" ]]; then
107+
install -m 755 "$qwen_src" /usr/local/bin/qwen
108+
echo " → Installed global qwen wrapper: /usr/local/bin/qwen"
109+
fi
110+
111+
return 0
112+
}
113+
66114
install_openclaw() {
67115
echo "Installing OpenClaw..."
68116

@@ -95,6 +143,12 @@ install_qwen() {
95143
fi
96144

97145
install_qwen_fallback
146+
147+
if ! command -v qwen &>/dev/null; then
148+
install_qwen_npm_fallback || true
149+
fi
150+
151+
ensure_qwen_global_command || true
98152
}
99153

100154
configure_ai_tools_permissions() {

0 commit comments

Comments
 (0)