From 81bcbb56ca7bd41164eb510c927a72bcb32d1fe0 Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Wed, 14 Feb 2024 19:07:28 +0000 Subject: [PATCH] add clean --- Makefile | 10 ++++++++++ lorax_templates/Makefile | 9 ++++++--- ...ure_upgrades.tmpl => configure_upgrades.tmpl.in} | 0 .../{set_installer.tmpl => set_installer.tmpl.in} | 0 xorriso/Makefile | 13 +++++++++---- xorriso/{gen_input.sh => gen_input.sh.in} | 1 + 6 files changed, 26 insertions(+), 7 deletions(-) rename lorax_templates/{configure_upgrades.tmpl => configure_upgrades.tmpl.in} (100%) rename lorax_templates/{set_installer.tmpl => set_installer.tmpl.in} (100%) rename xorriso/{gen_input.sh => gen_input.sh.in} (98%) diff --git a/Makefile b/Makefile index 1bd7762..ca841ef 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,7 @@ version = "39" base_dir = $(shell pwd) image_repo = "ghcr.io/ublue-os" image_name = "base-main" +subdir = "lorax_templates xorriso" deploy.iso: boot.iso xorriso/input.txt $(image_name)-$(version) xorriso -dialog on < xorriso/input.txt @@ -25,3 +26,12 @@ $(image_name)-$(version): install-deps: dnf install -y lorax xorriso podman git rpm-ostree + +clean: + rm -f boot.iso + rm -f deploy.iso + rm -Rf $(image_name)-$(version) + for dir in $(subdir) ; do \ + $(MAKE) -C $$dir clean ; \ + done + diff --git a/lorax_templates/Makefile b/lorax_templates/Makefile index 8607fe5..3e165b1 100644 --- a/lorax_templates/Makefile +++ b/lorax_templates/Makefile @@ -1,4 +1,7 @@ %.tmpl: - sed -i 's/@IMAGE_NAME@/$(image_name)' $* - sed -i 's/@IMAGE_REPO@/$(image_repo)' $* - sed -i 's/@VERSION@/$(version)' $* \ No newline at end of file + sed 's/@IMAGE_NAME@/$(image_name)' $*.in > $* + sed 's/@IMAGE_REPO@/$(image_repo)' $* > $* + sed 's/@VERSION@/$(version)' $* $* + +clean: + rm *.tmpl \ No newline at end of file diff --git a/lorax_templates/configure_upgrades.tmpl b/lorax_templates/configure_upgrades.tmpl.in similarity index 100% rename from lorax_templates/configure_upgrades.tmpl rename to lorax_templates/configure_upgrades.tmpl.in diff --git a/lorax_templates/set_installer.tmpl b/lorax_templates/set_installer.tmpl.in similarity index 100% rename from lorax_templates/set_installer.tmpl rename to lorax_templates/set_installer.tmpl.in diff --git a/xorriso/Makefile b/xorriso/Makefile index 7dbdba9..8d78fb3 100644 --- a/xorriso/Makefile +++ b/xorriso/Makefile @@ -1,4 +1,9 @@ -input.txt: - sed -i 's/@IMAGE_NAME@/$(image_name)-$(version)/' gen_input.sh - cd $(base_dir) - bash gen_input.sh > input.txt \ No newline at end of file +input.txt: gen_input.sh + bash gen_input.sh "$(base_dir)" > input.txt + +%.sh: + sed 's/@IMAGE_NAME@/$(image_name)-$(version)/' $*.in > $* + +clean: + rm input.txt + rm gen_input.sh \ No newline at end of file diff --git a/xorriso/gen_input.sh b/xorriso/gen_input.sh.in similarity index 98% rename from xorriso/gen_input.sh rename to xorriso/gen_input.sh.in index bf06031..e230ab7 100644 --- a/xorriso/gen_input.sh +++ b/xorriso/gen_input.sh.in @@ -6,6 +6,7 @@ echo "-boot_image any replay" echo "-volid Fedora-S-dvd-x86_64-39" echo "-joliet on" echo "-compliance joliet_long_names" +cd $1 for file in $(find @IMAGE_NAME@) do echo "-map $(pwd)/${file} ${file}"