mirror of
https://github.com/JasonN3/build-container-installer.git
synced 2025-12-25 10:57:55 +01:00
use makefiles
This commit is contained in:
parent
7e1143c0a5
commit
8b9e474a67
6 changed files with 65 additions and 34 deletions
56
.github/workflows/iso.yml
vendored
56
.github/workflows/iso.yml
vendored
|
|
@ -9,7 +9,10 @@ on:
|
|||
pull_request:
|
||||
|
||||
env:
|
||||
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}
|
||||
IMAGE_VERSION: 39
|
||||
IMAGE_ARCH: x86_64
|
||||
IMAGE_NAME: base-main
|
||||
IMAGE_REPO: ghcr.io/ublue-os
|
||||
|
||||
|
||||
jobs:
|
||||
|
|
@ -34,53 +37,46 @@ jobs:
|
|||
rm -rf /host/usr/local/.ghcup || true
|
||||
df -h /host || true
|
||||
|
||||
- name: Install tools
|
||||
run: |
|
||||
dnf install -y \
|
||||
lorax \
|
||||
xorriso \
|
||||
podman \
|
||||
git \
|
||||
rpm-ostree
|
||||
- name: Install make and git
|
||||
run: dnf install -y make git
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Install dependencies
|
||||
run: make install-deps
|
||||
|
||||
- name: Download image
|
||||
run: |
|
||||
podman pull ghcr.io/ublue-os/base-main:39
|
||||
podman save --format oci-dir -o base-main-39 ghcr.io/ublue-os/base-main:39
|
||||
podman rmi ghcr.io/ublue-os/base-main:39
|
||||
make ${IMAGE_NAME}-${IMAGE_VERSION} \
|
||||
arch=${IMAGE_ARCH} \
|
||||
version=${IMAGE_VERSION} \
|
||||
image_repo=${IMAGE_REPO} \
|
||||
image_name=${IMAGE_NAME}
|
||||
|
||||
- name: Create boot.iso
|
||||
env:
|
||||
version: "39"
|
||||
arch: "x86_64"
|
||||
run: |
|
||||
lorax -p Fedora -v $version -r $version -t Server \
|
||||
--isfinal --buildarch=${arch} --volid=Fedora-S-dvd-${arch}-${version} \
|
||||
--macboot --noupgrade \
|
||||
--repo /etc/yum.repos.d/fedora.repo \
|
||||
--repo /etc/yum.repos.d/fedora-updates.repo \
|
||||
--add-template ${GITHUB_WORKSPACE}/lorax_templates/set_installer.tmpl \
|
||||
--rootfs-size 2 \
|
||||
./results/
|
||||
make boot.iso \
|
||||
arch=${IMAGE_ARCH} \
|
||||
version=${IMAGE_VERSION} \
|
||||
image_repo=${IMAGE_REPO} \
|
||||
image_name=${IMAGE_NAME}
|
||||
|
||||
- name: Generate xorriso input
|
||||
- name: Create deploy.iso
|
||||
run: |
|
||||
bash xorriso/gen_input.sh | tee xorriso.txt
|
||||
|
||||
- name: Add additional files to ISO
|
||||
run: |
|
||||
xorriso -dialog on < xorriso.txt
|
||||
make deploy.iso \
|
||||
arch=${IMAGE_ARCH} \
|
||||
version=${IMAGE_VERSION} \
|
||||
image_repo=${IMAGE_REPO} \
|
||||
image_name=${IMAGE_NAME}
|
||||
|
||||
- name: Upload ISO as artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ISOs
|
||||
path: results/images/deploy.iso
|
||||
path: deploy.iso
|
||||
if-no-files-found: error
|
||||
retention-days: 0
|
||||
compression-level: 0
|
||||
|
|
|
|||
27
Makefile
Normal file
27
Makefile
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
arch = "x86_64"
|
||||
version = "39"
|
||||
base_dir = $(shell pwd)
|
||||
image_repo = "ghcr.io/ublue-os"
|
||||
image_name = "base-main"
|
||||
|
||||
deploy.iso: boot.iso xorriso/input.txt $(image_name)-$(version)
|
||||
xorriso -dialog on < xorriso/input.txt
|
||||
|
||||
boot.iso: lorax_templates/set_installer.tmpl
|
||||
lorax -p Fedora -v $(version) -r $(version) -t Server \
|
||||
--isfinal --buildarch=$(arch) --volid=Fedora-S-dvd-$(arch)-$(version) \
|
||||
--macboot --noupgrade \
|
||||
--repo /etc/yum.repos.d/fedora.repo \
|
||||
--repo /etc/yum.repos.d/fedora-updates.repo \
|
||||
--add-template $(base_dir)/lorax_templates/set_installer.tmpl \
|
||||
--rootfs-size 2 \
|
||||
./results/
|
||||
mv results/images/boot.iso $(base_dir)/
|
||||
|
||||
$(image_name)-$(version):
|
||||
podman pull $(image_repo)/$(image_name):$(version)
|
||||
podman save --format oci-dir -o $(image_name)-$(version) $(image_repo)/$(image_name):$(version)
|
||||
podman rmi $(image_repo/$(image_name):$(version)
|
||||
|
||||
install-deps:
|
||||
dnf install -y lorax xorriso podman git rpm-ostree
|
||||
4
lorax_templates/Makefile
Normal file
4
lorax_templates/Makefile
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
%.tmpl:
|
||||
sed -i 's/@IMAGE_NAME@/$(image_name)' $*
|
||||
sed -i 's/@IMAGE_REPO@/$(image_repo)' $*
|
||||
sed -i 's/@VERSION@/$(version)' $*
|
||||
|
|
@ -1 +1 @@
|
|||
append usr/share/anaconda/interactive-defaults.ks "ostreecontainer --remote='ostree-unverified-image:docker://ghcr.io/ublue-os/base-main:39' --url=/run/install/repo/base-main-39 --transport=oci --no-signature-verification"
|
||||
append usr/share/anaconda/interactive-defaults.ks "ostreecontainer --remote='ostree-unverified-image:docker://@IMAGE_REPO@/@IMAGE_NAME@:@VERSION@' --url=/run/install/repo/@IMAGE_NAME@-@VERSION@ --transport=oci --no-signature-verification"
|
||||
4
xorriso/Makefile
Normal file
4
xorriso/Makefile
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
input.txt:
|
||||
sed -i 's/@IMAGE_NAME@/$(image_name)-$(version)/' gen_input.sh
|
||||
cd $(base_dir)
|
||||
bash gen_input.sh > input.txt
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
echo "-indev $(pwd)/results/images/boot.iso"
|
||||
echo "-outdev $(pwd)/results/images/deploy.iso"
|
||||
echo "-indev $(pwd)/boot.iso"
|
||||
echo "-outdev $(pwd)/deploy.iso"
|
||||
echo "-boot_image any replay"
|
||||
echo "-volid Fedora-S-dvd-x86_64-39"
|
||||
echo "-joliet on"
|
||||
echo "-compliance joliet_long_names"
|
||||
for file in $(find base-main-39)
|
||||
for file in $(find @IMAGE_NAME@)
|
||||
do
|
||||
echo "-map $(pwd)/${file} ${file}"
|
||||
echo "-chmod 0444 ${file}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue