1
0
Fork 0
mirror of https://github.com/JasonN3/build-container-installer.git synced 2025-12-25 02:47:56 +01:00

use squashfs-only when not rhel

This commit is contained in:
Jason N. 2024-04-09 15:20:14 -04:00
parent 40e0d375b2
commit 8c15653a75
4 changed files with 8 additions and 7 deletions

View file

@ -36,7 +36,7 @@ _VOLID := $(firstword $(subst -, ,$(IMAGE_NAME)))-$(ARCH)-$(
ifeq ($(findstring redhat.repo,$(REPOS)),redhat.repo) ifeq ($(findstring redhat.repo,$(REPOS)),redhat.repo)
export _RHEL := true export _RHEL := true
else else
export _RHEL := false undefine _RHEL
endif endif
ifeq ($(_RHEL),true) ifeq ($(_RHEL),true)
@ -109,8 +109,8 @@ results/images/boot.iso: external/lorax/branch-$(VERSION) $(filter lorax_templat
$(if $(wildcard results), rm -Rf results) $(if $(wildcard results), rm -Rf results)
$(if $(wildcard /etc/rpm/macros.image-language-conf),mv /etc/rpm/macros.image-language-conf $(_TEMP_DIR)/macros.image-language-conf) $(if $(wildcard /etc/rpm/macros.image-language-conf),mv /etc/rpm/macros.image-language-conf $(_TEMP_DIR)/macros.image-language-conf)
lorax -p $(if $(findstring true,$(_RHEL)),RHEL,$(IMAGE_NAME)) -v $(VERSION) -r $(VERSION) $($(VARIANT),-t $(VARIANT)) \ lorax -p $(if $(_RHEL),RHEL,$(IMAGE_NAME)) -v $(VERSION) -r $(VERSION) $($(VARIANT),-t $(VARIANT)) \
--isfinal --buildarch=$(ARCH) --volid=$(_VOLID) --sharedir $(PWD)/external/lorax/share/templates.d/99-generic \ --isfinal $(if $(_RHEL),,--squashfs-only) --buildarch=$(ARCH) --volid=$(_VOLID) --sharedir $(PWD)/external/lorax/share/templates.d/99-generic \
$(_LORAX_ARGS) \ $(_LORAX_ARGS) \
$(foreach file,$(_REPO_FILES),--repo $(PWD)/$(file)) \ $(foreach file,$(_REPO_FILES),--repo $(PWD)/$(file)) \
$(foreach file,$(_LORAX_TEMPLATES),--add-template $(PWD)/$(file)) \ $(foreach file,$(_LORAX_TEMPLATES),--add-template $(PWD)/$(file)) \

2
external/Makefile vendored
View file

@ -1,6 +1,6 @@
lorax/branch-$(VERSION): lorax/branch-$(VERSION):
git config advice.detachedHead false git config advice.detachedHead false
cd lorax && git reset --hard HEAD && git checkout $(if $(findstring true,$(_RHEL)),rhel$(VERSION)-branch,tags/$(shell cd lorax && git tag -l lorax-$(VERSION).* --sort=creatordate | tail -n 1)) cd lorax && git reset --hard HEAD && git checkout $(if $(_RHEL),rhel$(VERSION)-branch,tags/$(shell cd lorax && git tag -l lorax-$(VERSION).* --sort=creatordate | tail -n 1))
touch lorax/branch-$(VERSION) touch lorax/branch-$(VERSION)
install-deps: install-deps:

View file

@ -1,5 +1,5 @@
<%page args="image_repo, _image_repo_double_escaped, image_name, image_tag, _rhel, version"/> <%page args="image_repo, _image_repo_double_escaped, image_name, image_tag, _rhel, version"/>
if (which bootc &> /dev/null) && [ ${_rhel} == 'false' && ${version} -ge 39 ] if (which bootc &> /dev/null) && [ "${_rhel}" != 'true' && ${version} -ge 39 ]
then then
bootc switch --mutate-in-place --enforce-container-sigpolicy --transport registry ${image_repo}/${image_name}:${image_tag} bootc switch --mutate-in-place --enforce-container-sigpolicy --transport registry ${image_repo}/${image_name}:${image_tag}
else else

View file

@ -10,9 +10,10 @@ $(ISO_TESTS): mnt/iso
mnt/iso: mnt/iso:
sudo modprobe loop sudo modprobe loop
sudo mkdir -p mnt/iso mnt/install sudo mkdir -p mnt/iso mnt/live mnt/install
sudo mount -o loop ../../$(ISO_NAME) mnt/iso sudo mount -o loop ../../$(ISO_NAME) mnt/iso
sudo mount -t squashfs -o loop mnt/iso/images/install.img mnt/install sudo mount -t squashfs -o loop mnt/iso/images/install.img $(if $(_RHEL),mnt/live,mnt/install)
$(if $(_RHEL),sudo mount mnt/live/LiveOS/rootfs.img mnt/install)
clean: clean:
sudo umount mnt/install || true sudo umount mnt/install || true