Skip to content

Commit c6c88b8

Browse files
committed
completely reworks first-setup
This moves away from the recipe based approach since it was too inflexible.
1 parent f565fd0 commit c6c88b8

File tree

190 files changed

+24234
-15842
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+24234
-15842
lines changed

.github/workflows/build.yml

+6-9
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,26 @@ jobs:
1818
steps:
1919
- uses: actions/checkout@v4
2020

21-
- name: Get the version
22-
id: get_version
23-
run: echo "{VERSION}={$(cat VERSION)}" >> $GITHUB_OUTPUT
24-
2521
- name: Install build dependencies
2622
run: |
27-
apt install -y debhelper python3 gettext build-essential desktop-file-utils ninja-build meson libadwaita-1-dev make libnm-dev libnma-dev libnma-gtk4-dev
23+
apt-get update
24+
apt-get build-dep -y .
2825
2926
- name: Build .deb package
3027
run: |
3128
dpkg-buildpackage
32-
mv ../vanilla-first-setup_*.deb .
29+
mv ../vanilla-first-setup_*.deb vanilla-first-setup.deb
3330
3431
- name: Calculate and Save Checksums
3532
run: |
36-
sha256sum vanilla-first-setup_*.deb >> checksums.txt
33+
sha256sum vanilla-first-setup.deb >> checksums.txt
3734
3835
- uses: actions/upload-artifact@v4
3936
with:
4037
name: first-setup
4138
path: |
4239
checksums.txt
43-
vanilla-first-setup_*.deb
40+
vanilla-first-setup.deb
4441
4542
- uses: softprops/action-gh-release@v2
4643
if: github.ref == 'refs/heads/main'
@@ -51,4 +48,4 @@ jobs:
5148
name: "Continuous Build"
5249
files: |
5350
checksums.txt
54-
vanilla-first-setup_*.deb
51+
vanilla-first-setup.deb

.github/workflows/release.yml

+11-9
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,31 @@ jobs:
2020
steps:
2121
- uses: actions/checkout@v4
2222

23-
- name: Get the version
24-
id: get_version
25-
run: echo "{VERSION}={$(cat VERSION)}" >> $GITHUB_OUTPUT
23+
- name: Set meson version by tag
24+
id: set_version
25+
run: |
26+
sed -i 's/VTESTING/${{ github.ref_name }}/g' meson.build
2627
2728
- name: Install build dependencies
2829
run: |
29-
apt install -y debhelper python3 gettext build-essential desktop-file-utils ninja-build meson libadwaita-1-dev make libnm-dev libnma-dev libnma-gtk4-dev
30+
apt-get update
31+
apt-get build-dep -y .
3032
3133
- name: Build .deb package
3234
run: |
3335
dpkg-buildpackage
34-
mv ../vanilla-first-setup_*.deb .
36+
mv ../vanilla-first-setup_*.deb vanilla-first-setup.deb
3537
3638
- name: Calculate and Save Checksums
3739
run: |
38-
sha256sum vanilla-first-setup_*.deb >> checksums.txt
40+
sha256sum vanilla-first-setup.deb >> checksums.txt
3941
4042
- uses: actions/upload-artifact@v4
4143
with:
4244
name: first-setup
4345
path: |
4446
checksums.txt
45-
vanilla-first-setup_*.deb
47+
vanilla-first-setup.deb
4648
4749
release:
4850
runs-on: ubuntu-latest
@@ -66,10 +68,10 @@ jobs:
6668
- name: Create Release
6769
env:
6870
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69-
run: gh release create "${{ github.ref_name }}" --generate-notes *.deb checksums.txt
71+
run: gh release create "${{ github.ref_name }}" --generate-notes vanilla-first-setup.deb checksums.txt
7072

7173
- name: Attest Release Files
7274
id: attest
7375
uses: actions/attest-build-provenance@v1
7476
with:
75-
subject-path: '*.deb, *.txt'
77+
subject-path: 'vanilla-first-setup.deb, checksums.txt'

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ debian/vanilla-first-setup
77
debian/.debhelper
88
*/__pycache__
99
*.pyc
10-
/localbuild
10+
vanilla_first_setup/vanilla-first-setup.gresource
1111
.buildconfig
1212
install/
13+
localegen/

README.md

+93-32
Original file line numberDiff line numberDiff line change
@@ -3,67 +3,128 @@
33
<h1>Vanilla OS First Setup</h1>
44
<p>This utility is meant to be used in <a href="https://github.com/vanilla-os">Vanilla OS</a>
55
as a first-setup wizard. Its purpose is to help the user to configure the
6-
system to their needs, e.g. by configuring snap, flatpak, flathub, etc.</p>
6+
system to their needs, e.g. by configuring hostname, theme, flatpak apps, etc.</p>
77
<hr />
8-
<a href="https://hosted.weblate.org/engage/vanilla-os/">
8+
<a href="https://hosted.weblate.org/projects/vanilla-os/first-setup/#information">
99
<img src="https://hosted.weblate.org/widgets/vanilla-os/-/first-setup/svg-badge.svg" alt="Translation status" />
1010
</a>
1111
<br />
12-
<img src="data/screenshot-1.png">
12+
<img src="data/screenshots/welcome-page.png">
1313
</div>
1414

15+
## Run without building for Testing
16+
17+
> [!IMPORTANT]
18+
> You need to install all build and run dependencies first
19+
20+
```bash
21+
python3 test.py -d
22+
```
23+
24+
The "-d" option is the dry-run mode, without it, first-setup will make changes to your system.
25+
26+
Pass the "-c" flag to force the configure system mode.
27+
28+
### Test translations:
29+
30+
You can change the used language like this:
31+
```bash
32+
LANGUAGE=de python3 test.py -d
33+
```
34+
1535
## Build
1636

17-
### Build Dependencies
37+
### Installing build dependencies
38+
```bash
39+
sudo apt-get update
40+
sudo apt-get build-dep .
41+
```
42+
43+
If you want to install the build dependencies manually, have a look in:
44+
[debian/control](https://github.com/Vanilla-OS/first-setup/blob/main/debian/control)
45+
46+
### Building
47+
48+
> [!WARNING]
49+
> dpkg-buildpackage places it's output files (Like the .deb file) into the parent folder.
50+
1851
```bash
19-
sudo apt install -y build-essential debhelper \
20-
python3 meson \
21-
libadwaita-1-dev gettext \
22-
desktop-file-utils \
23-
libjpeg-dev libnm-dev \
24-
libnma-dev libnma-gtk4-dev \
25-
ninja-build
52+
dpkg-buildpackage
2653
```
2754

28-
### Runtime Dependencies
55+
or manually with meson:
56+
2957
```bash
30-
sudo apt install -y python3 python3-gi \
31-
python3-tz libadwaita-1-0 \
32-
gir1.2-gtk-4.0 gir1.2-adw-1 \
33-
gir1.2-vte-3.91 libnm0 \
34-
libnma0 libnma-gtk4-0
58+
meson setup build
59+
meson compile -C build
3560
```
3661

37-
#### Optional Dependencies
62+
Here you can change the install folder (default is /usr/local), for example:
3863
```bash
39-
sudo apt install python-requests # required for conn_check
40-
sudo apt install gir1.2-gweather-4.0 # required for timezones
41-
sudo apt install gir1.2-gnomedesktop-4.0 # required for languages, keyboard
42-
sudo apt install gir1.2-nma4-1.0 # required for network
43-
sudo apt install gir1.2-nm-1.0 # required for network
64+
meson setup --prefix="$(pwd)/install" build
4465
```
4566

46-
### Build
67+
## Install
68+
69+
### Installing runtime dependencies
70+
These can be found here:
71+
[debian/control](https://github.com/Vanilla-OS/first-setup/blob/main/debian/control)
72+
73+
> [!TIP]
74+
> If you use apt-get to install the .deb file it will automatically install the dependencies.
75+
76+
### Installing
4777

4878
```bash
49-
meson build
50-
ninja -C build
79+
sudo apt-get install ./vanilla-first-setup*.deb
5180
```
5281

53-
### Install
82+
or manually with meson:
5483

5584
```bash
56-
sudo ninja -C build install
85+
meson install -C build
5786
```
5887

5988
## Run
6089

90+
### Creating initial user
91+
92+
A special user is needed to run the initial setup for hostname, user-creation, locale, etc.
93+
94+
1. Create a user
95+
2. Create the group vanilla-first-setup (Changing the gid is recommended to avoid messing with user groups)
96+
3. Add the user to group vanilla-first-setup
97+
4. Create the file `/var/lib/AccountsService/users/your_user`
98+
```ini
99+
[User]
100+
Session=firstsetup
101+
```
102+
5. Create the file `/etc/gdm3/daemon.conf` (replace your_user)
103+
```ini
104+
[daemon]
105+
AutomaticLogin=your_user
106+
AutomaticLoginEnable=True
107+
```
108+
109+
> [!WARNING]
110+
> All users in this group will be deleted on the first reboot after a successful first setup.
111+
112+
### Running
61113
```bash
62114
vanilla-first-setup
63115
```
64116

65-
### Using custom recipes
117+
#### Flags:
118+
119+
- --dry-run (-d): Don't make any changes to the system.
120+
- --force-configure-mode (-c): Force the configure system mode, independant of group.
121+
- --force-regular-mode (-r): Force the regular mode, independant of group.
122+
- --oem-mode (-o): Use the original equipment manufacturer mode with language, keyboard and timezone selection.
66123

67-
Place a new recipe in `/etc/vanilla-first-setup/recipe.json` or launch the
68-
utility with the `VANILLA_CUSTOM_RECIPE` environment variable set to the path
69-
of the recipe.
124+
## Update translation file
125+
126+
To update the .pot file with newly added translation strings, run:
127+
128+
```bash
129+
meson compile -C build vanilla-first-setup-pot
130+
```

VERSION

-1
This file was deleted.

__first_setup_cleanup

-25
This file was deleted.

__first_setup_reset_session

-14
This file was deleted.

data/firstsetup-session.desktop

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
[Desktop Entry]
22
Name=FirstSetup
33
Comment=This session provides a First Setup interface
4-
Exec=env GNOME_SHELL_SESSION_MODE=firstsetup gnome-session --session=firstsetup
5-
TryExec=gnome-shell
6-
Icon=
4+
Exec=env GNOME_SHELL_SESSION_MODE=firstsetup /usr/bin/gnome-session
5+
TryExec=/usr/bin/gnome-session
76
Type=Application
87
DesktopNames=vanilla:GNOME
98
X-GDM-SessionRegisters=true

data/firstsetup.session

-3
This file was deleted.

data/firstsetup.session.conf

-19
This file was deleted.

data/icons/hicolor/symbolic/actions/background-app-ghost-symbolic.svg

-2
This file was deleted.

data/icons/hicolor/symbolic/actions/vanilla-container-terminal-symbolic.svg

-2
This file was deleted.

data/icons/hicolor/symbolic/actions/vanilla-history-undo-symbolic.svg

-2
This file was deleted.

data/icons/hicolor/symbolic/actions/vanilla-package-symbolic.svg

-2
This file was deleted.

0 commit comments

Comments
 (0)