Skip to content

Commit

Permalink
Add initial changes for ublue-hdkv
Browse files Browse the repository at this point in the history
  • Loading branch information
fat0troll committed Jan 2, 2025
1 parent 868c027 commit ee4d24e
Show file tree
Hide file tree
Showing 44 changed files with 74 additions and 35 deletions.
6 changes: 4 additions & 2 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# - "base"
#
# "aurora", "bazzite", "bluefin" or "ucore" may also be used but have different suffixes.
ARG SOURCE_IMAGE="silverblue"
ARG SOURCE_IMAGE="bazzite"

## SOURCE_SUFFIX arg should include a hyphen and the appropriate suffix name
# These examples all work for silverblue/kinoite/sericea/onyx/lazurite/vauxite/base
Expand All @@ -33,7 +33,7 @@ ARG SOURCE_IMAGE="silverblue"
# - stable-zfs
# - stable-nvidia-zfs
# - (and the above with testing rather than stable)
ARG SOURCE_SUFFIX="-main"
ARG SOURCE_SUFFIX="-nvidia"

## SOURCE_TAG arg must be a version built for the specific image: eg, 39, 40, gts, latest
ARG SOURCE_TAG="latest"
Expand All @@ -50,6 +50,8 @@ FROM ghcr.io/ublue-os/${SOURCE_IMAGE}${SOURCE_SUFFIX}:${SOURCE_TAG}

COPY build.sh /tmp/build.sh

COPY system_files /

RUN mkdir -p /var/lib/alternatives && \
/tmp/build.sh && \
ostree container commit
Expand Down
44 changes: 28 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
# ublue-hdkv

Custom bazzite-nvidia-open image for my own use case. May be useful for you as an example, may be not.

I do not provide support for this image. Use upstream Bazzite or make your own forks of image-template if needed.

Below is the original README verbatim.

---

# image-template

# Purpose

This repository is meant to be a template for building your own custom Universal Blue image. This template is the recommended way to make customizations to any image published by the Universal Blue Project:

- [Aurora](https://getaurora.dev/)
- [Bazzite](https://bazzite.gg/)
- [Bluefin](https://projectbluefin.io/)
- [uCore](https://projectucore.io/)
- [main](https://github.com/ublue-os/main/)
- [hwe](https://github.com/ublue-os/hwe/)
- [hwe](https://github.com/ublue-os/hwe/)

This template includes a Containerfile and a Github workflow for building the container image. As soon as the workflow is enabled in your repository, it will build the container image and push it to the Github Container Registry.

Expand All @@ -35,6 +46,7 @@ Select `Use this Template` and create a new repository from it. To enable the wo
## Containerfile

This file defines the operations used to customize the selected image. It contains examples of possible modifications, including how to:

- change the upstream from which the custom image is derived
- add additional RPM packages
- add binaries as a layer from other images
Expand All @@ -47,40 +59,40 @@ This workflow creates your custom OCI image and publishes it to the Github Conta

#### Container Signing

Container signing is important for end-user security and is enabled on all Universal Blue images. It is recommended you set this up, and by default the image builds *will fail* if you don't.
Container signing is important for end-user security and is enabled on all Universal Blue images. It is recommended you set this up, and by default the image builds _will fail_ if you don't.

This provides users a method of verifying the image.

1. Install the [cosign CLI tool](https://edu.chainguard.dev/open-source/sigstore/cosign/how-to-install-cosign/#installing-cosign-with-the-cosign-binary)

2. Run inside your repo folder:

```bash
cosign generate-key-pair
```
```bash
cosign generate-key-pair
```


- Do NOT put in a password when it asks you to, just press enter. The signing key will be used in GitHub Actions and will not work if it is encrypted.
- Do NOT put in a password when it asks you to, just press enter. The signing key will be used in GitHub Actions and will not work if it is encrypted.

> [!WARNING]
> Be careful to *never* accidentally commit `cosign.key` into your git repo.
> Be careful to _never_ accidentally commit `cosign.key` into your git repo.
3. Add the private key to GitHub

- This can also be done manually. Go to your repository settings, under Secrets and Variables -> Actions
![image](https://user-images.githubusercontent.com/1264109/216735595-0ecf1b66-b9ee-439e-87d7-c8cc43c2110a.png)
Add a new secret and name it `SIGNING_SECRET`, then paste the contents of `cosign.key` into the secret and save it. Make sure it's the .key file and not the .pub file. Once done, it should look like this:
![image](https://user-images.githubusercontent.com/1264109/216735690-2d19271f-cee2-45ac-a039-23e6a4c16b34.png)
- This can also be done manually. Go to your repository settings, under Secrets and Variables -> Actions
![image](https://user-images.githubusercontent.com/1264109/216735595-0ecf1b66-b9ee-439e-87d7-c8cc43c2110a.png)
Add a new secret and name it `SIGNING_SECRET`, then paste the contents of `cosign.key` into the secret and save it. Make sure it's the .key file and not the .pub file. Once done, it should look like this:
![image](https://user-images.githubusercontent.com/1264109/216735690-2d19271f-cee2-45ac-a039-23e6a4c16b34.png)

- (CLI instructions) If you have the `github-cli` installed, run:
- (CLI instructions) If you have the `github-cli` installed, run:

```bash
gh secret set SIGNING_SECRET < cosign.key
```
```bash
gh secret set SIGNING_SECRET < cosign.key
```

4. Commit the `cosign.pub` file to the root of your git repository.

### Examples

- [m2os](https://github.com/m2giles/m2os)
- [bos](https://github.com/bsherman/bos)
- [homer](https://github.com/bketelsen/homer/)
47 changes: 30 additions & 17 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,33 @@ set -ouex pipefail

RELEASE="$(rpm -E %fedora)"


### Install packages

# Packages can be installed from any enabled yum repo on the image.
# RPMfusion repos are available by default in ublue main images
# List of rpmfusion packages can be found here:
# https://mirrors.rpmfusion.org/mirrorlist?path=free/fedora/updates/39/x86_64/repoview/index.html&protocol=https&redirect=1

# this installs a package from fedora repos
rpm-ostree install screen

# this would install a package from rpmfusion
# rpm-ostree install vlc

#### Example for enabling a System Unit File

systemctl enable podman.socket
# Install docker
rpm-ostree install docker-ce \
docker-ce-cli \
docker-buildx-plugin \
docker-compose-plugin \
containerd.io


# Install zsh and utilites for it
rpm-ostree install zsh \
zsh-autosuggestions

# Install flatpak builder
rpm-ostree install flatpak-builder

# Install dependencies for Toshy
rpm-ostree install cairo-devel \
cairo-gobject-devel \
dbus-devel \
evtest \
git \
gobject-introspection-devel \
python3-devel \
python3-tkinter \
systemd-devel \
wayland-devel \
xset

# Enable docker socket
systemctl enable docker.socket
4 changes: 4 additions & 0 deletions cosign.pub
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE2xhICZ3aV22LAIdAysBoc7zEGje2
ym39watXX3pdOyFWchwJz4i5OBW7ybuWcPJz/59dDfXNygNtQ+i2QG8PcQ==
-----END PUBLIC KEY-----
2 changes: 2 additions & 0 deletions system_files/etc/environment
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# macOS-alike font rendering.
FREETYPE_PROPERTIES="cff:no-stem-darkening=0 autofitter:no-stem-darkening=0"
6 changes: 6 additions & 0 deletions system_files/etc/yum.repos.d/docker-ce.repo
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[docker-ce-stable]
name=Docker CE Stable - $basearch
baseurl=https://download.docker.com/linux/fedora/$releasever/$basearch/stable
enabled=1
gpgcheck=1
gpgkey=https://download.docker.com/linux/fedora/gpg
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit ee4d24e

Please sign in to comment.