Commit Graph

430 Commits

Author SHA1 Message Date
Aleix Pol Gonzalez
726264b4de Update .gitlab-ci.yml file 2025-02-28 00:32:26 +00:00
Aleix Pol Gonzalez
1506302424 Add lints to the gitlab ci 2025-02-28 01:31:18 +01:00
Aleix Pol
4da464e058 reuse: Fix issues
- Remove unused licences
- Set header in files
2025-02-28 01:31:13 +01:00
Nate Graham
83d492d918 Remove nvtop .desktop file
Amends 6341baed9d.

It's broken due to Konsole being in a Flatpak, which suffers from Bug
495551. Even if it were working, this is kind of useless since it just
launches the CLI command anyway. Let's remove it.
2025-02-22 15:12:03 -07:00
Nate Graham
6341baed9d Add a few more power user CI tools to the image
nvtop is basically the GPU companion to htop, which we do already
include.

ydotool is useful for basic automation, which enthusiasts and developers
often benefit from.

Relevant to #12
2025-02-20 03:49:40 +00:00
Hadi Chokr
854d69a0b5 Fix EFI boot entry permissions (Issue #146) 2025-02-19 20:16:18 +00:00
Harald Sitter
68f1857863 postinst: set image_id
prevents mkosi from adding one which is then not in our unified kernel
image
2025-01-27 15:12:58 +01:00
Nate Graham
88810855d4 Include Ufw
We currently include the firewall KCM but no firewall! Instead of
getting rid of the KCM, let's add a firewall. Ufw is sane enough, at
least until the KCM supports zones which is necessary to fully support
the competing firewalld firewall.

Resolves #112
2025-01-26 15:25:52 -07:00
Harald Sitter
629b26135e calamares: use /boot instead of /efi
/boot is where systemd auto mounts stuff these days
2025-01-26 18:03:17 +00:00
Harald Sitter
c6b95cf982 Revert "Refactor EFI directory structure creation"
This reverts commit b294a76309.

The template system was put in place to differentiate what is in the live
image and what needs to be in the target system. doing away with it
broke the installation
2025-01-26 18:03:17 +00:00
Harald Sitter
aaa81980ff update: ensure older systems can upgrade
/efi mounting would fall over and block the update, so make a better
effort finding it and mounting it
2025-01-26 16:43:49 +01:00
Nate Graham
8f93783339 Add Maliit to base image
In the past this has been requested as a Flatpak, but I believe that it
fits better as a pre-installed package because it's system enablement
for touch devices; without it, they simply don't work. As such, the user
shouldn't be able to remove it or swap it out for something else
(because it's the only thing we support right now anyway).
2025-01-23 20:37:13 +00:00
Ian Monroe
0b9dca0246 create a new update-local.py script
just pass it a directory and it will look for update images in it
2025-01-17 03:41:34 +00:00
Lasath Fernando
d7237822dc Fix error when building locally multiple times
If the mount directories are left over from a previous run, it currently tries to create them again and fails.

This fixes that.
2025-01-16 15:18:44 +00:00
Nate Graham
262ca17e3f Don't install KWalletManager from Flatpak
It isn't suitable for our use case since it's more than just an app; it
provides a KCM as well. This doesn't (and can't) come through in the
Flatpak packaging of it, so we're missing the KCM in System Settings,
and that's a problem.

Instead, let's let the software be built from source using kde-builder.
Depends on
https://invent.kde.org/kde-linux/kde-linux-packages/-/merge_requests/15
2025-01-14 03:55:08 +00:00
Harald Sitter
096cc653e1 Revert "finalize: trust our signing key very much"
This reverts commit 0b3b7ca074.

Turns out my command seems to have been bad :(

https://invent.kde.org/kde-linux/kde-linux/-/jobs/2445201
2025-01-07 23:15:08 +01:00
Harald Sitter
0b3b7ca074 finalize: trust our signing key very much 2025-01-07 12:31:24 +01:00
Harald Sitter
0f94a54d14 dev packages: install pip
python without it is rather sad
2025-01-07 12:30:47 +01:00
Harald Sitter
a90214e641 dev packages: install meson
needed to build glib stuff most of the time
2025-01-07 12:30:19 +01:00
Justin Zobel
804bd36b07 Update mkosi.conf - fix build 2025-01-03 22:14:23 +10:30
Nate Graham
f1cf413fe4 Add lsof to the base image
Common CLI tool useful for troubleshooting stuff.

Fixes #126
2024-12-23 10:35:42 -07:00
Ian Monroe
1921a0140c Revert "Use mkosi.output for build artifacts"
This reverts commit ea7ca55cd2.
2024-12-16 11:34:28 -08:00
Lasath Fernando
03a54244d3 Make zsh the default shell for new users
ZSH is (in many ways) the successor to BASH.

It looks/feels the same as bash, but with better tab-completion, better history management, typo-correction, etc.
People that care about their shell will customize it, but people that don't will just notice that the terminal in KDE Linux is faster/more responsive. We should aim to give the best user experience by default.

https://medium.com/@mattwinmill88/what-even-is-zsh-and-why-is-everyone-using-it-9695c869fbe4#0747

Note: This change only affects new accounts so it won't suddenly break anyone's setup.
2024-12-16 19:21:52 +00:00
Bruno Pajdek
0d12df74a3 Use .gitignores instead of .keeps
@fernando Mentioned this convention should be preferred.
2024-12-16 18:59:59 +00:00
Ian Monroe
6cbe5099cf move flatpak install from chroot to container
cleaner, allows caching
2024-12-15 14:29:44 -08:00
Ian Monroe
208b0c530d move ntfs-3g to sysinfo conf file 2024-12-15 22:29:08 +00:00
Ian Monroe
5c750c9918 only run reflector when needed 2024-12-15 22:29:08 +00:00
Ian Monroe
693deea64d add nfs-utils to image
seems to be required to mount NFS
2024-12-15 22:29:08 +00:00
Bruno Pajdek
9fab0a1f1d Make debug archive in build.sh 2024-12-15 22:17:58 +00:00
Bruno Pajdek
b71472666b Don't upload any CI artifacts
The only one we were uploading was `dmesg.log` and it no longer exists. Got lost in the rework of the image shrinking in !95. Avoids the `ERROR: No files to upload` at the end of every job.
2024-12-15 17:58:00 +00:00
Bruno Pajdek
621e723730 Fix mkosi deprecation warning
Moves the deprecated `@Environment` option under `[Content]` to `Environment` under `[Build]`.
2024-12-15 17:56:05 +00:00
Bruno Pajdek
ea7ca55cd2 Use mkosi.output for build artifacts
mkosi already provides us with a nice default directory it puts artifacts in called `mkosi.output` if `--output-directory` isn't explicitly set. For some reason, it _is_ explicitly set to `.`, so it puts them in the source tree itself which pollutes it and gets messy real quick.

After build, the contents of the source tree are now
```
drwxrwxrwx 1 root root  100 Dec 15 15:18 .git
-rw-rw-rw- 1 root root  226 Dec 15 15:18 .gitignore
-rw-rw-rw- 1 root root 1.1K Dec 15 15:18 .gitlab-ci.yml
drwxrwxrwx 1 root root  370 Dec 15 15:18 LICENSES
-rw-rw-rw- 1 root root  337 Dec 15 15:18 README.md
-rw-rw-rw- 1 root root  128 Dec 15 15:18 REUSE.toml
-rwxrwxrwx 1 root root  824 Dec 15 15:18 addons.sh
-rwxrwxrwx 1 root root 1.7K Dec 15 15:18 bootstrap.sh
-rwxrwxrwx 1 root root 6.1K Dec 15 15:18 build.sh
-rwxrwxrwx 1 root root 2.9K Dec 15 15:18 build_docker.sh
-rwxrwxrwx 1 root root  427 Dec 15 15:18 in_docker.sh
drwxrwxrwx 1 root root   96 Dec 15 15:25 kde-linux.cache
drwxrwxrwx 1 root root   20 Dec 15 15:18 mkosi.cache
-rw-rw-rw- 1 root root 1.8K Dec 15 15:18 mkosi.conf
drwxrwxrwx 1 root root  420 Dec 15 15:18 mkosi.conf.d
drwxrwxrwx 1 root root   20 Dec 15 15:18 mkosi.extra
-rwxrwxrwx 1 root root 3.6K Dec 15 15:18 mkosi.finalize.chroot
drwxr-xr-x 1 root root  500 Dec 15 15:37 mkosi.output
-rwxrwxrwx 1 root root 5.2K Dec 15 15:18 mkosi.postinst.chroot
-rwxrwxrwx 1 root root 1.3K Dec 15 15:18 mkosi.prepare.chroot
drwxrwxrwx 1 root root   46 Dec 15 15:18 mkosi.repart
drwxrwxrwx 1 root root    6 Dec 15 15:18 mkosi.skeleton
-rwxrwxrwx 1 root root  742 Dec 15 15:18 permission-fix.sh
drwxrwxrwx 1 root root   30 Dec 15 15:18 strip
-rwxrwxrwx 1 root root 1.4K Dec 15 15:18 torrent-create.rb
-rwxrwxrwx 1 root root  796 Dec 15 15:18 update.sh
drwxrwxrwx 1 root root   94 Dec 15 15:18 upload-vacuum
-rwxrwxrwx 1 root root 1.6K Dec 15 15:18 upload.sh
```

And the contents of `mkosi.output` are
```
drwxr-xr-x 1 root root  206 Dec 15 15:28 kde-linux_202412151518
-rw-r--r-- 1 root root 173M Dec 15 15:25 kde-linux_202412151518.efi
-rw-r--r-- 1 root root 5.2G Dec 15 15:36 kde-linux_202412151518.raw
-rw------- 1 root root  55K Dec 15 15:37 kde-linux_202412151518.torrent
-rw-r--r-- 1 root root  14M Dec 15 15:25 kde-linux_202412151518.vmlinuz
-rw-r--r-- 1 root root 1.6G Dec 15 15:23 kde-linux_202412151518_debug-x86-64.tar.zst
-rw-r--r-- 1 root root 173M Dec 15 15:24 kde-linux_202412151518_live.efi
-rw-r--r-- 1 root root 3.0G Dec 15 15:36 kde-linux_202412151518_root-x86-64.tar.zst
```
2024-12-15 17:55:10 +00:00
Ian Monroe
56ab41774d install all packages using mkosi.conf.d files
remove the call to --packages
Attempted to keep everything, with the exception of the redundant
systemd/systemd-git packages
2024-12-15 15:42:09 +00:00
Ian Monroe
9a3481e59e install all packages outside the chroot
use the mkosi sandbox to install, so now the arch linux packages
are all cached properly
2024-12-15 15:42:09 +00:00
Lasath Fernando
f228149332 Rename pacman to kde-linux-readonly-pacman
To make it clear to users that it won't work the way it does in Arch Linux.

Closes #106
2024-12-15 11:16:21 +00:00
Bruno Pajdek
b294a76309 Refactor EFI directory structure creation
Just a bit nicer and more readable.
2024-12-15 10:30:52 +00:00
Ian Monroe
2a7d44aba8 mount a btrfs subvolume on /var/lib/containers
this fixes rootful podman
tweak your container storage settings to use btrfs instead of overlay and you
can build the KDE Linux image with podman now
2024-12-09 02:52:06 +00:00
Ian Monroe
9a9a5640ff add crun back
it's the default for podman
2024-12-07 11:14:05 -08:00
Lasath Fernando
3d93221288 Re-add docker
There are just too many bugs to deal with in podman, whereas docker just works.

https://invent.kde.org/-/snippets/3274

https://github.com/89luca89/distrobox/issues/1624

https://github.com/89luca89/distrobox/issues/1401

and a ton more every time I try to do something.

This also gives docker permissions to the `wheel` group (instead of having to add users to a newly-created `docker` group). Since everyone in `wheel` are already root-equivalent, this makes more sense anyway.
2024-12-07 02:23:01 +00:00
Lasath Fernando
6a08c954bb Pass options from update.sh to sysupdated
Required to make `updatectl` work. Explained in inline comments.
2024-12-06 20:54:18 +00:00
Lasath Fernando
502a7a40aa Make zsh nice
ZSH core is actually quite barebones and needs a theme to make it decent.  
GRML is the one the Arch Live Image ships with and makes for a good default.

Also add a some better auto-completes.
2024-12-06 20:12:47 +00:00
Bruno Pajdek
2be5c59c92 Improve image populating/shrinking/building process.
Alright, this is the main set of changes done in `build.sh`. After this, as far as `build.sh` is concerned, it's mostly style and documentation changes I will write MRs for. There was no way for me to split this into smaller independent changes without leaving the tree in an inconsistent state, this is really the most "atomic" I can personally do. The changes may look scary at first, but I promise you they're not that major, breaking or hard to review. The MR focuses on how the image is created, populated and shrunk from the rootfs generated by mkosi.

Firstly, the variables that are set at the start of the program were simplified and refactored so they can be used in (in my opinion) a more elegant and useful way with the rest of the now-modified build process. They now focus more on simply the paths/filenames of the outputted artifacts, so they can be changed conveniently, with the internal naming now still staying a static `kde-linux`. As a result of this, the image ID (`kde-linux`) is now in `mkosi.conf`.

`OUTPUT_IS_BTRFS_SUBVOLUME` was dropped. This is a remnant of when we could populate the images without a btrfs'd build environment, but those times are now gone and if this variable was determined to be false, the build would fail pretty quickly anyways, so really, it should always be true in a properly configured build environment. Because of it being used as a condition in if-else statements (if $OUTPUT_IS_BTRFS_SUBVOLUME is true... else...), those statements were dropped and only their main branch was kept with their "else" branch (which, again, should never even run on a working build environment) discarded. One script that was only ever called from one of those discarded else-branches was `btrfs-copy.sh`, so it was deleted as it is now fully unused.

The way everything used to work after this was fairly convoluted, which is probably the result of piling new shrinking methods and the likes onto old existing code. I will drop some details for the sake of brevity. After mkosi finished, three btrfs subvolumes were created and the files from the mkosi-generated rootfs were copied to those (`/var/lib/flatpak` was copied to a flatpak subvolume, `/live` was copied to a live subvolume, and the rest to a kde-linux subvolume). These subvolumes were then all packed into three respective files. Using `systemd-repart` and the definitions inside `mkosi.repart`, a full disk image containing both a 260M ESP populated with files from `/efi-template` and a btrfs partition of a size large enough to house all of those subvolumes was created. Using `systemd-dissect`, only the btrfs partition from the full disk image was mounted, and the script `btrfs-send-receive.sh` was called inside of the mounted partition, which unpacked all of the previously packed subvolumes onto the filesystem. It then called `btrfs-shrink.py` which would try and shrink the filesystem to the minimum possible size and write that size into a file for future usage by `part-rebuild.py` after it's done. `part-rebuild.py` got called which extracted the btrfs partition and ESP from the full disk image separately using `dd` and shrunk the btrfs part of the image to the size that the actual inner filesystem was shrunk to by `btrfs-shrink.py`. Then `systemd-repart` was called AGAIN, this time with `--size=auto` instead of a fixed size and using definitions inside `mkosi.repart-rebuild`, which would merge the two part-rebuild.py-dd-separated partition images of the ESP and shrunk btrfs filesystem back into one full disk image.

The way it now works is the ESP (of 260M) and btrfs filesystem (of a size large enough, 8G) are created inside of two files using native tools (`fallocate` and `mkfs.btrfs`/`fat`). The ESP file is mounted, files from `/efi-template` are copied to it, and then it's unmounted. Then, the btrfs file is mounted, files from the mkosi-generated rootfs are copied to it (what `btrfs-send-receive.sh` effectively did), the filesystem is shrunk to the minimum possible size (what `btrfs-shrink.py` effectively did), and then it's unmounted. Since the underlying btrfs filesystem inside of the btrfs file was shrunk but the actual file is still 8G, the file is, using `truncate`, shrunk to the size of the actual btrfs filesystem inside (what `part-rebuild.py` effectively did). The two files are now ready to be merged into one full bootable disk image, so `systemd-repart` is called a single time right away with `--size=auto` using the definitions in `mkosi.repart` to do so. Everything is done in `build.sh`.

As a result, the files no longer necessary were deleted from the tree - `btrfs-copy.sh`, `btrfs-send-receive.sh`, `btrfs-shrink.py`, `part-rebuild.py`, and the definitions inside `mkosi.repart` were simplified to conform to the new direct disk image build method.

I'm pretty sure it's faster (30min build time down to 20min) because it's less convoluted, and generates smaller images (6ish G down to 5ish G). I'm not sure what the reasoning is behind the latter, but it's also a welcome change :)

!91 will also be updated to refer to this MR instead of the now-closed !90 and can then be merged to fully get rid of Python for now.
2024-12-05 19:46:32 +00:00
Ryan Brue
cb7d2e2c4a fix: enable nvidia-specific services for suspending/resuming
Fixes: https://invent.kde.org/kde-linux/kde-linux/-/issues/103

Shouldn't affect non-nvidia hardware (I tested on an Intel-only system)

If you'd like to test on non-nvidia hardware, enable the nvidia services like so:

```
systemctl enable nvidia-suspend.service nvidia-resume.service nvidia-hibernate.service
``` 

Let me know if you see any issues!

Signed-off-by: Ryan Brue <ryanbrue.dev@gmail.com>
2024-12-05 18:13:42 +00:00
Lasath Fernando
9ccf3abe07 Fix recent update issues
This fixes the recent issues of `cannot stat /efi/EFI/Linux` we get when using `update.sh`

systemd no longer auto-mounts the ESP at `/efi`. Reason is explained in a comment inline.
2024-12-05 08:56:14 +00:00
Justin Zobel
fea048bde0 README: Update name and expand text 2024-12-04 23:47:36 +00:00
Lasath Fernando
bf1836afa4 Add systemd-git
This is needed to get access to `systemd-sysupdated`, which is used by plasma/discover!957 to update KDE Linux.
2024-12-04 21:15:08 +00:00
Ryan Brue
2d04f81f59 Add splix and dnsmasq to 60-packages-hw-enablement
Supersedes: https://invent.kde.org/kde-linux/kde-linux/-/merge_requests/78
2024-12-04 00:00:49 -06:00
Bruno Pajdek
e6f3e4c3da Rewrite permission-fix to (ba)sh
If/when !95 merges, this will be the only Python script in the build process left. Rewrite to (ba)sh like the rest for consistency, then we can port everything to some other language if desired one day.
2024-12-03 09:58:04 +00:00
Nate Graham
3774740057 Re-alphabetize development packages list
It managed to drift out of alphabetical order, so let's fix that.
2024-12-02 12:44:49 +01:00
Harald Sitter
33736be041 pull in ninja in the development config
make is crusty and old. ninja is shiny and new. since kde linux is all about
embracing the future, ninja is the build tool of choice
2024-12-02 12:12:20 +01:00