blue-build / modules

BlueBuild standard modules used for building your Atomic Images
Apache License 2.0
26 stars 4 forks source link

bug: Using optfix more than once in recipe causes error #365

Open gmpinder opened 1 day ago

gmpinder commented 1 day ago

I was doing some refactoring and decided to separate out some rpm-ostree module calls. I moved an optfix from one module call to another and I started to get this error:

l/jp-desktop-nvidia:latest => 0.557 ========================== Start 'rpm-ostree' Module ==========================
l/jp-desktop-nvidia:latest => 0.583 Creating symlinks to fix packages that install to /opt
l/jp-desktop-nvidia:latest => 0.584 ln: failed to create symbolic link '/opt/opt': File exists
l/jp-desktop-nvidia:latest => 0.586 ========================== Failed 'rpm-ostree' Module ==========================

It would appear that we aren't doing a check to make sure the symlink doesn't already exist

gmpinder commented 1 day ago

My recipe for context

name: jp-desktop-nvidia
description: The image of Wunker OS for JP's desktop gaming.
base_image: ghcr.io/ublue-os/kinoite-nvidia
image_version: '41'
stages:
- name: helix
  from: rust
  modules:
  - type: script
    scripts:
    - install-helix.sh
modules:
- type: files
  files:
  - source: desktop-audio
    destination: /
- type: signing
- type: files
  files:
  - source: pipewire-tweaks
    destination: /
- type: script
  snippets:
  - rpm --import https://brave-browser-rpm-release.s3.brave.com/brave-core.asc
- type: rpm-ostree
  optfix:
  - brave.com
  repos:
  - https://pkgs.tailscale.com/stable/fedora/tailscale.repo
  - https://brave-browser-rpm-release.s3.brave.com/brave-browser.repo
  install:
  - libadwaita
  - cronie
  - plasma-browser-integration
  - id3v2
  - xinput
  - ripgrep
  - tailscale
  - strawberry
  - xclip
  - bat
  - brave-browser
  - syncthing
- type: systemd
  user:
    enabled:
    - syncthing
- type: rpm-ostree
  install:
  - cabextract
  - xorg-x11-font-utils
  - fontconfig
  - https://downloads.sourceforge.net/project/mscorefonts2/rpms/msttcore-fonts-installer-2.6-1.noarch.rpm
- type: files
  files:
  - source: steam-firewall
    destination: /
- type: bling
  source: ghcr.io/blue-build/modules/bling:343-featbling-add-rpmfusion-install-script
  install:
  - negativo17
- type: script
  scripts:
  - install-steam.sh
- type: rpm-ostree
  optfix:
  - r2modman
  install:
  - https://github.com/ebkr/r2modmanPlus/releases/download/v3.1.49/r2modman-3.1.49.x86_64.rpm
- type: rpm-ostree
  repos:
  - https://download.docker.com/linux/fedora/docker-ce.repo
  install:
  - docker-ce
  - docker-ce-cli
  - containerd.io
  - docker-buildx-plugin
  - docker-compose-plugin
- type: systemd
  system:
    enabled:
    - docker.service
- type: rpm-ostree
  repos:
  - kubectl.repo
  - google-cloud-sdk.repo
  - https://pkg.earthly.dev/earthly.repo
  - https://cli.github.com/packages/rpm/gh-cli.repo
  install:
  - cmake
  - gcc-c++
  - earthly
  - kubectl
  - helm
  - pylsp
  - parallel
  - gcc-aarch64-linux-gnu
  - gcc-c++-aarch64-linux-gnu
  - musl-gcc
  - openssl-devel
  - bat
  - gh
  - go
  - git-lfs
  - google-cloud-cli
  - zlib-devel
  - glab
  - hugo
- type: script
  scripts:
  - install-mkcert.sh
  - install-codelldb.sh
- type: rpm-ostree
  install:
  - virt-manager
  - alacritty
  - gnome-boxes
- type: files
  files:
  - source: rpm-ostreed-conf
    destination: /etc
- type: systemd
  system:
    masked:
    - ublue-update.timer
    enabled:
    - rpm-ostreed-automatic.timer
- type: files
  files:
  - source: distrobox
    destination: /
- type: fonts
  fonts:
    nerd-fonts:
    - JetBrainsMono
    - NerdFontsSymbolsOnly
- type: files
  files:
  - source: bluebuild-logo
    destination: /
- type: script
  scripts:
  - initramfs.sh
- type: rpm-ostree
  repos:
  - https://copr.fedorainfracloud.org/coprs/ryanabx/cosmic-epoch/repo/fedora-%OS_VERSION%/ryanabx-cosmic-epoch-fedora-%OS_VERSION%.repo
  install:
  - cosmic-desktop
- type: copy
  from: helix
  src: /out/hx
  dest: /usr/bin/
- type: copy
  from: helix
  src: /out/runtime/
  dest: /usr/lib/helix/runtime