Skip to content

Commit

Permalink
Install duperemove and fix inconsistencies
Browse files Browse the repository at this point in the history
- We move users/groups from /etc to /usr/lib
- We use rpm-ostree cliwrap for kernel-install instead of
regen-initramfs.sh
- We prepare to write a custom libdnf5 script to do upgrades with
rpm-ostree.
  • Loading branch information
prydom committed Apr 19, 2024
1 parent bfafe4b commit 63fec95
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 18 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/snapshot-rawhide.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
name: snapshot-rawhide
on:
schedule:
- cron: "00 14 * * 1"
workflow_dispatch: # allow manually triggering builds
jobs:
snapshot-rawhide:
Expand Down
2 changes: 1 addition & 1 deletion config/scripts/regen-initramfs.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -oue pipefail

KVER="$(rpm -q kernel | sed -rn 's/^kernel-(.*)$/\1/p')"
KVER="$(rpm -q kernel-core --qf '%{version}-%{release}.%{arch}' | head -n1)"
ls -1 --zero /usr/lib/modules | grep -vz "^$KVER$" \
| sed -z 's/[[:space:]]*$//' \
| xargs -r -0 -- printf "/usr/lib/modules/%s\0" \
Expand Down
41 changes: 26 additions & 15 deletions recipes/fedora-kinoite-laptop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,12 @@ modules:
# We use a stable kernel instead of the one from rawhide
- type: script
snippets:
- rpm-ostree cliwrap install-to-root /
- rpm-ostree override replace kernel-modules-core kernel-modules-extra kernel-core kernel-modules kernel-headers kernel --experimental --from repo=fedora-40-kernel
- rm -f /usr/lib/modules/*/initramfs.img
- /tmp/config/scripts/regen-initramfs.sh
- rm -rf /boot
- mkdir -m 755 /boot
#- rm -f /usr/lib/modules/*/initramfs.img
#- /tmp/config/scripts/regen-initramfs.sh
#- rm -rf /boot
#- mkdir -m 755 /boot

# Package management
- type: rpm-ostree
Expand All @@ -60,7 +61,7 @@ modules:
- type: script
snippets:
- createrepo /usr/share/local-rpm-repo
- dnf5 '--exclude=kernel*' upgrade -y
#- dnf5 '--exclude=kernel*' upgrade -y

# Virtualization
- type: rpm-ostree
Expand Down Expand Up @@ -104,8 +105,8 @@ modules:
snippets:
# WORKAROUND: Create the group for 1Password with the a consistent GID
# Also, 1Password requires the GID to be > 1000
- groupadd -g 5001 "onepassword"
- groupadd -g 5002 "onepassword-cli"
- echo "onepassword:x:5001:" >> /usr/lib/group
- echo "onepassword-cli:x:5002:" >> /usr/lib/group

# Proprietary
- type: rpm-ostree
Expand All @@ -126,6 +127,7 @@ modules:
# CLI Utils
- type: rpm-ostree
install:
- duperemove
- htop
- mosh
- ncdu
Expand Down Expand Up @@ -164,20 +166,29 @@ modules:
# BUST LAYER CACHE IF THERE ARE UPDATES
# We still download packages from whatever repo is suggested by Fedora's metalink
# But we trust UWaterloo to be somewhat quickly up to date.
- type: containerfile
snippets:
- ADD https://mirror.csclub.uwaterloo.ca/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/repomd.xml /tmp/mirror-cache-bust
#- type: containerfile
# snippets:
# - ADD https://mirror.csclub.uwaterloo.ca/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/repomd.xml /tmp/mirror-cache-bust

# Upgrade all in one layer if there are any new packages
- type: script
snippets:
- dnf5 '--exclude=kernel*' upgrade -y
#- type: script
# snippets:
# - dnf5 '--exclude=kernel*' upgrade -y

- type: rpm-ostree
install:
# WORKAROUND: do last because my RPM depends on 1Password not ever being upgraded
- rpm-ostree install 1password-ostree-workaround
- 1password-ostree-workaround

# WORKAROUND: Put back /opt and merge /usr/etc into /etc
- type: script
snippets:
# WORKAROUND: Ensure all accounts are moved to altfiles
- grep -Ev "(^root:)" /etc/passwd >> /usr/lib/passwd
- grep -Ev "(^root:)|(^wheel:)" /etc/group >> /usr/lib/group
- echo "root:x:0:0:root:/root:/bin/bash" > /etc/passwd
- echo "root:x:0:" > /etc/group
- echo "wheel:x:10:" >> /etc/group
# Put back /opt and merge /usr/etc into /etc
- rm /opt
- ln -s var/opt /opt
- cp -fal /usr/etc /
Expand Down

0 comments on commit 63fec95

Please sign in to comment.