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:
|
pull_request:
|
||||||
|
|
||||||
env:
|
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:
|
jobs:
|
||||||
|
|
@ -34,53 +37,46 @@ jobs:
|
||||||
rm -rf /host/usr/local/.ghcup || true
|
rm -rf /host/usr/local/.ghcup || true
|
||||||
df -h /host || true
|
df -h /host || true
|
||||||
|
|
||||||
- name: Install tools
|
- name: Install make and git
|
||||||
run: |
|
run: dnf install -y make git
|
||||||
dnf install -y \
|
|
||||||
lorax \
|
|
||||||
xorriso \
|
|
||||||
podman \
|
|
||||||
git \
|
|
||||||
rpm-ostree
|
|
||||||
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: make install-deps
|
||||||
|
|
||||||
- name: Download image
|
- name: Download image
|
||||||
run: |
|
run: |
|
||||||
podman pull ghcr.io/ublue-os/base-main:39
|
make ${IMAGE_NAME}-${IMAGE_VERSION} \
|
||||||
podman save --format oci-dir -o base-main-39 ghcr.io/ublue-os/base-main:39
|
arch=${IMAGE_ARCH} \
|
||||||
podman rmi ghcr.io/ublue-os/base-main:39
|
version=${IMAGE_VERSION} \
|
||||||
|
image_repo=${IMAGE_REPO} \
|
||||||
|
image_name=${IMAGE_NAME}
|
||||||
|
|
||||||
- name: Create boot.iso
|
- name: Create boot.iso
|
||||||
env:
|
|
||||||
version: "39"
|
|
||||||
arch: "x86_64"
|
|
||||||
run: |
|
run: |
|
||||||
lorax -p Fedora -v $version -r $version -t Server \
|
make boot.iso \
|
||||||
--isfinal --buildarch=${arch} --volid=Fedora-S-dvd-${arch}-${version} \
|
arch=${IMAGE_ARCH} \
|
||||||
--macboot --noupgrade \
|
version=${IMAGE_VERSION} \
|
||||||
--repo /etc/yum.repos.d/fedora.repo \
|
image_repo=${IMAGE_REPO} \
|
||||||
--repo /etc/yum.repos.d/fedora-updates.repo \
|
image_name=${IMAGE_NAME}
|
||||||
--add-template ${GITHUB_WORKSPACE}/lorax_templates/set_installer.tmpl \
|
|
||||||
--rootfs-size 2 \
|
|
||||||
./results/
|
|
||||||
|
|
||||||
- name: Generate xorriso input
|
- name: Create deploy.iso
|
||||||
run: |
|
run: |
|
||||||
bash xorriso/gen_input.sh | tee xorriso.txt
|
make deploy.iso \
|
||||||
|
arch=${IMAGE_ARCH} \
|
||||||
- name: Add additional files to ISO
|
version=${IMAGE_VERSION} \
|
||||||
run: |
|
image_repo=${IMAGE_REPO} \
|
||||||
xorriso -dialog on < xorriso.txt
|
image_name=${IMAGE_NAME}
|
||||||
|
|
||||||
- name: Upload ISO as artifact
|
- name: Upload ISO as artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ISOs
|
name: ISOs
|
||||||
path: results/images/deploy.iso
|
path: deploy.iso
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
retention-days: 0
|
retention-days: 0
|
||||||
compression-level: 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
|
#!/bin/bash
|
||||||
|
|
||||||
echo "-indev $(pwd)/results/images/boot.iso"
|
echo "-indev $(pwd)/boot.iso"
|
||||||
echo "-outdev $(pwd)/results/images/deploy.iso"
|
echo "-outdev $(pwd)/deploy.iso"
|
||||||
echo "-boot_image any replay"
|
echo "-boot_image any replay"
|
||||||
echo "-volid Fedora-S-dvd-x86_64-39"
|
echo "-volid Fedora-S-dvd-x86_64-39"
|
||||||
echo "-joliet on"
|
echo "-joliet on"
|
||||||
echo "-compliance joliet_long_names"
|
echo "-compliance joliet_long_names"
|
||||||
for file in $(find base-main-39)
|
for file in $(find @IMAGE_NAME@)
|
||||||
do
|
do
|
||||||
echo "-map $(pwd)/${file} ${file}"
|
echo "-map $(pwd)/${file} ${file}"
|
||||||
echo "-chmod 0444 ${file}"
|
echo "-chmod 0444 ${file}"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue