Skip to content

Commit 397a881

Browse files
author
MochiOS Team
committed
fix critical boot + installer bugs, add nightly branding
1 parent da12438 commit 397a881

21 files changed

Lines changed: 604 additions & 9 deletions

File tree

‎.github/workflows/build-iso.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ jobs:
5757
WORK_DIR=/tmp/mochios-work \
5858
GNUPGHOME=/home/mochi/.mochios-gnupg \
5959
SIGN_KEY=ci@mochios.dev \
60+
NIGHTLY=true \
6061
bash /tmp/mochios/build.sh 2>&1
6162
6263
- name: upload iso

‎.github/workflows/build.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
sudo \
3434
go \
3535
python \
36-
python-urwid \
36+
python-textual \
3737
squashfs-tools \
3838
dosfstools \
3939
mtools \

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ pkgbuilds/mochiinstall/*.tar.gz
3737
pkgbuilds/mochi-abroot/*.tar.gz
3838
pkgbuilds/mochios-defaults/*.tar.gz
3939
pkgbuilds/mochios-branding/*.tar.gz
40+
pkgbuilds/mochios-branding-nightly/*.tar.gz
4041
__pycache__/
4142
pkgbuilds/sober/*.tar.gz
4243
pkgbuilds/zen-browser/*.tar.gz
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
# mochios mkinitcpio preset
2-
MODULES=(ata_piix ahci nvme)
32
MODULES=(loop isofs sr_mod ahci ata_piix nvme)
43
HOOKS=(base udev autodetect modconf kms keyboard keymap consolefont block archiso archiso_loop_mnt filesystems fsck)

‎archiso-mochios/airootfs/home/mochi/.zshrc‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,10 @@ if [ -z "$MOCHI_LIVE_INIT" ]; then
33
export MOCHI_LIVE_INIT=1
44
echo "welcome to mochios live!"
55
echo "the installer should open shortly..."
6-
echo "if not, run: mochiinstall"
6+
7+
# if we're in a tty (no kde), launch installer directly
8+
if [ -z "$XDG_CURRENT_DESKTOP" ] && [ -z "$KDE_FULL_SESSION" ]; then
9+
sleep 2
10+
mochiinstall
11+
fi
712
fi

‎archiso-mochios/airootfs/usr/lib/mochiinstall/installer.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ def pacstrap_base(target, lfn, de="kde", bootloader="limine", kernels=None, extr
186186
"kde": ["plasma-desktop", "plasma-workspace", "kdeplasma-addons",
187187
"kwin", "konsole", "dolphin", "kate", "gwenview",
188188
"sddm", "kwallet-pam", "breeze", "breeze-gtk",
189-
"kpipewire", "networkmanager", "plasma-nm"],
189+
"pipewire", "pipewire-pulse", "wireplumber", "kpipewire",
190+
"plasma-nm"],
190191
"gnome": ["gnome", "gnome-extra", "gdm"],
191192
"none": [],
192193
}
@@ -244,7 +245,7 @@ def ch(cmd, to=120, check=True):
244245
ch(["systemctl", "daemon-reload"])
245246

246247
(t / "etc/abroot.conf").write_text(
247-
f"ROOT_PART=\"{root_dev}\"\n"
248+
f"ROOT_PART=\"UUID={root_uuid}\"\n"
248249
f"BTRFS_MOUNT=\"/mnt/btrfs\"\n"
249250
f"ACTIVE_ROOT=\"root_a\"\n"
250251
f"NEXT_ROOT=\"root_b\"\n"
@@ -269,6 +270,7 @@ def ch(cmd, to=120, check=True):
269270
dm = "sddm" if de == "kde" else "gdm" if de == "gnome" else None
270271
if dm:
271272
ch(["systemctl", "enable", dm])
273+
ch(["systemctl", "set-default", "graphical.target"])
272274

273275
lfn("importing mochios signing key...")
274276
key_src = "/usr/share/mochios/mochios-key.pub"
Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
import QtQuick 2.15
2+
import QtQuick.Controls 2.15
3+
import QtQuick.Layouts 1.15
4+
5+
Rectangle {
6+
width: 1920
7+
height: 1080
8+
color: "#0d0719"
9+
10+
Canvas {
11+
anchors.fill: parent
12+
onPaint: {
13+
var ctx = getContext("2d")
14+
if (!ctx) return
15+
16+
var stars = [
17+
[0.08, 0.05, 1.5, 0.9], [0.15, 0.12, 1.0, 0.6],
18+
[0.22, 0.03, 2.0, 1.0], [0.30, 0.18, 1.2, 0.7],
19+
[0.05, 0.25, 1.0, 0.5], [0.42, 0.08, 1.8, 0.8],
20+
[0.55, 0.15, 1.0, 0.4], [0.65, 0.05, 1.3, 0.7],
21+
[0.35, 0.22, 0.8, 0.5], [0.48, 0.28, 1.5, 0.9],
22+
[0.60, 0.20, 1.0, 0.6], [0.18, 0.32, 1.2, 0.8],
23+
[0.25, 0.08, 0.7, 0.4], [0.72, 0.12, 1.6, 0.7],
24+
[0.10, 0.18, 1.1, 0.5], [0.38, 0.15, 0.9, 0.6],
25+
[0.50, 0.10, 1.4, 0.8], [0.68, 0.25, 1.0, 0.5],
26+
[0.20, 0.28, 0.8, 0.7], [0.45, 0.05, 1.2, 0.9]
27+
]
28+
29+
for (var i = 0; i < stars.length; i++) {
30+
var s = stars[i]
31+
ctx.globalAlpha = s[3]
32+
ctx.fillStyle = "#ffffff"
33+
ctx.beginPath()
34+
ctx.arc(s[0] * width, s[1] * height, s[2], 0, Math.PI * 2)
35+
ctx.fill()
36+
}
37+
ctx.globalAlpha = 1.0
38+
}
39+
}
40+
41+
Canvas {
42+
anchors.fill: parent
43+
onPaint: {
44+
var ctx = getContext("2d")
45+
if (!ctx) return
46+
47+
var mx = width * 0.78
48+
var my = height * 0.15
49+
var gradient = ctx.createRadialGradient(mx, my, 10, mx, my, 200)
50+
gradient.addColorStop(0, "rgba(232, 216, 248, 0.12)")
51+
gradient.addColorStop(1, "rgba(232, 216, 248, 0)")
52+
ctx.fillStyle = gradient
53+
ctx.beginPath()
54+
ctx.arc(mx, my, 200, 0, Math.PI * 2)
55+
ctx.fill()
56+
}
57+
}
58+
59+
Canvas {
60+
anchors.fill: parent
61+
onPaint: {
62+
var ctx = getContext("2d")
63+
if (!ctx) return
64+
65+
var mx = width * 0.78
66+
var my = height * 0.15
67+
68+
ctx.beginPath()
69+
ctx.arc(mx, my, 70, 0, Math.PI * 2)
70+
ctx.fillStyle = "#f0e8ff"
71+
ctx.fill()
72+
73+
ctx.save()
74+
ctx.globalCompositeOperation = "destination-out"
75+
ctx.beginPath()
76+
ctx.arc(mx + 22, my - 16, 55, 0, Math.PI * 2)
77+
ctx.fill()
78+
ctx.restore()
79+
}
80+
}
81+
82+
Rectangle {
83+
anchors.centerIn: parent
84+
width: 420
85+
height: 420
86+
color: "#1a0f30"
87+
radius: 24
88+
border.color: "#3a2a5a"
89+
border.width: 1
90+
91+
ColumnLayout {
92+
anchors.centerIn: parent
93+
spacing: 20
94+
95+
Text {
96+
text: "mochios"
97+
color: "#e6dcf0"
98+
font.pixelSize: 52
99+
font.bold: true
100+
Layout.alignment: Qt.AlignHCenter
101+
}
102+
103+
Text {
104+
text: "NIGHTLY"
105+
color: "#9664c8"
106+
font.pixelSize: 18
107+
font.letterSpacing: 8
108+
Layout.alignment: Qt.AlignHCenter
109+
opacity: 0.7
110+
}
111+
112+
Item { width: 1; height: 10 }
113+
114+
TextField {
115+
id: username
116+
placeholderText: "username"
117+
Layout.preferredWidth: 280
118+
Layout.alignment: Qt.AlignHCenter
119+
background: Rectangle { color: "#0d0719"; radius: 8 }
120+
color: "#e6dcf0"
121+
placeholderTextColor: "#6a5a8a"
122+
Keys.onReturnPressed: password.forceActiveFocus()
123+
}
124+
125+
TextField {
126+
id: password
127+
placeholderText: "password"
128+
echoMode: TextInput.Password
129+
Layout.preferredWidth: 280
130+
Layout.alignment: Qt.AlignHCenter
131+
background: Rectangle { color: "#0d0719"; radius: 8 }
132+
color: "#e6dcf0"
133+
placeholderTextColor: "#6a5a8a"
134+
Keys.onReturnPressed: sddm.login(username.text, password.text)
135+
}
136+
137+
Button {
138+
text: "log in"
139+
Layout.preferredWidth: 280
140+
Layout.alignment: Qt.AlignHCenter
141+
onClicked: sddm.login(username.text, password.text)
142+
background: Rectangle { color: "#9664c8"; radius: 8 }
143+
contentItem: Text { text: "log in"; color: "#ffffff"; font.bold: true; horizontalAlignment: Text.AlignHCenter }
144+
}
145+
}
146+
}
147+
148+
Text {
149+
text: "NIGHTLY BUILD"
150+
color: "#9664c8"
151+
font.pixelSize: 13
152+
font.bold: true
153+
letterSpacing: 4
154+
opacity: 0.3
155+
anchors.right: parent.right
156+
anchors.bottom: parent.bottom
157+
anchors.margins: 24
158+
}
159+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[SddmTheme]
2+
Name=mochios-nightly
3+
Name[en]=mochios-nightly
4+
Comment=mochios Nightly SDDM login theme
5+
Type=X-SDDM-Theme
6+
Version=0.1.0

‎archiso-mochios/packages.x86_64‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ xdg-utils
3333
git
3434
go
3535
python
36-
python-urwid
36+
python-textual
3737
plasma-desktop
3838
plasma-nm
3939
plasma-pa

‎build.sh‎

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ WORK_DIR="${WORK_DIR:-/home/mochi/mochios-work}"
1717
SIGN_KEY="${SIGN_KEY:-signing@mochios.dev}"
1818
GNUPGHOME="${GNUPGHOME:-/home/mochi/.mochios-gnupg}"
1919
GNUPG() { gpg --homedir "$GNUPGHOME" "$@"; }
20+
NIGHTLY="${NIGHTLY:-false}"
2021

2122
sign_pkg() {
2223
local pkg="$1"
@@ -64,6 +65,22 @@ tar czf "mochios-branding-$pkgver.tar.gz" -C "$MOCHIOS_DIR/pkgbuilds/mochios-bra
6465
sudo -u mochi makepkg -cf --noconfirm --nodeps
6566
cp "$MOCHIOS_DIR/pkgbuilds/mochios-branding"/mochios-branding-[0-9]*.pkg.tar.zst "$REPO_DIR/os/x86_64/"
6667

68+
if [ "$NIGHTLY" = "true" ]; then
69+
echo "==> rebuilding mochios-branding-nightly pkg..."
70+
cd "$MOCHIOS_DIR/pkgbuilds/mochios-branding-nightly"
71+
pkgver=$(_get_pkgver PKGBUILD)
72+
tar czf "mochios-branding-nightly-$pkgver.tar.gz" -C "$MOCHIOS_DIR/pkgbuilds/mochios-branding-nightly" --exclude="mochios-branding-nightly-$pkgver.tar.gz" usr etc
73+
sudo -u mochi makepkg -cf --noconfirm --nodeps
74+
cp "$MOCHIOS_DIR/pkgbuilds/mochios-branding-nightly"/mochios-branding-nightly-[0-9]*.pkg.tar.zst "$REPO_DIR/os/x86_64/"
75+
76+
echo "==> switching sddm theme to mochios-nightly..."
77+
printf '[Theme]\nCurrent=mochios-nightly\n' > "$ISO_DIR/airootfs/etc/sddm.conf.d/mochios.conf"
78+
79+
echo "==> stamping nightly marker..."
80+
sed -i 's/^MOCHIOS_BUILD_ID=.*$/MOCHIOS_BUILD_ID="nightly"/' "$ISO_DIR/airootfs/etc/mochios-release"
81+
sed -i 's/^MOCHIOS_VERSION=.*$/MOCHIOS_VERSION="0.1.0-nightly"/' "$ISO_DIR/airootfs/etc/mochios-release"
82+
fi
83+
6784
echo "==> rebuilding mochi-abroot pkg..."
6885
cd "$MOCHIOS_DIR/pkgbuilds/mochi-abroot"
6986
pkgver=$(_get_pkgver PKGBUILD)
@@ -89,6 +106,7 @@ for pattern in \
89106
"$REPO_DIR/os/x86_64/"mochiinstall-[0-9]*.pkg.tar.zst \
90107
"$REPO_DIR/os/x86_64/"mochios-defaults-[0-9]*.pkg.tar.zst \
91108
"$REPO_DIR/os/x86_64/"mochios-branding-[0-9]*.pkg.tar.zst \
109+
"$REPO_DIR/os/x86_64/"mochios-branding-nightly-[0-9]*.pkg.tar.zst \
92110
"$REPO_DIR/os/x86_64/"mochi-abroot-[0-9]*.pkg.tar.zst \
93111
"$REPO_DIR/os/x86_64/"zen-browser-[0-9]*.pkg.tar.zst \
94112
"$REPO_DIR/os/x86_64/"sober-[0-9]*.pkg.tar.zst; do
@@ -105,6 +123,7 @@ GNUPGHOME="$GNUPGHOME" repo-add --sign os/x86_64/mochi.db.tar.zst os/x86_64/moch
105123
GNUPGHOME="$GNUPGHOME" repo-add --sign os/x86_64/mochi.db.tar.zst os/x86_64/mochiinstall-[0-9]*.pkg.tar.zst
106124
GNUPGHOME="$GNUPGHOME" repo-add --sign os/x86_64/mochi.db.tar.zst os/x86_64/mochios-defaults-[0-9]*.pkg.tar.zst
107125
GNUPGHOME="$GNUPGHOME" repo-add --sign os/x86_64/mochi.db.tar.zst os/x86_64/mochios-branding-[0-9]*.pkg.tar.zst
126+
GNUPGHOME="$GNUPGHOME" repo-add --sign os/x86_64/mochi.db.tar.zst os/x86_64/mochios-branding-nightly-[0-9]*.pkg.tar.zst
108127
GNUPGHOME="$GNUPGHOME" repo-add --sign os/x86_64/mochi.db.tar.zst os/x86_64/mochi-abroot-[0-9]*.pkg.tar.zst
109128
GNUPGHOME="$GNUPGHOME" repo-add --sign os/x86_64/mochi.db.tar.zst os/x86_64/zen-browser-[0-9]*.pkg.tar.zst
110129
GNUPGHOME="$GNUPGHOME" repo-add --sign os/x86_64/mochi.db.tar.zst os/x86_64/sober-[0-9]*.pkg.tar.zst
@@ -119,7 +138,12 @@ fi
119138

120139
echo "==> staging mochi packages for installer..."
121140
mkdir -p "$ISO_DIR/airootfs/opt/mochi-pkgs"
122-
for pkg in mochi mochiinstall mochios-defaults mochios-branding mochi-abroot zen-browser sober; do
141+
if [ "$NIGHTLY" = "true" ]; then
142+
STAGED_PKGS="mochi mochiinstall mochios-defaults mochios-branding-nightly mochi-abroot zen-browser sober"
143+
else
144+
STAGED_PKGS="mochi mochiinstall mochios-defaults mochios-branding mochi-abroot zen-browser sober"
145+
fi
146+
for pkg in $STAGED_PKGS; do
123147
cp "$REPO_DIR/os/x86_64/"$pkg-[0-9]*.pkg.tar.zst "$ISO_DIR/airootfs/opt/mochi-pkgs/"
124148
done
125149

@@ -140,6 +164,10 @@ else
140164
echo " [yellow]secure boot keys not found, sbctl will generate on first boot[/]"
141165
fi
142166

167+
echo "==> setting up systemd for live session..."
168+
ln -sf /usr/lib/systemd/system/sddm.service "$ISO_DIR/airootfs/etc/systemd/system/display-manager.service"
169+
ln -sf /usr/lib/systemd/system/sddm.service "$ISO_DIR/airootfs/etc/systemd/system/graphical.target.wants/display-manager.service"
170+
143171
echo "==> building iso..."
144172
mkdir -p "$OUT_DIR"
145173
mkarchiso -v -w "$WORK_DIR" -o "$OUT_DIR" "$ISO_DIR"

0 commit comments

Comments
 (0)