Store root image named 'root.img' inside of tar archive

Prevent renaming at installation, this will make the process cleaner.
pull/1/head
Marek Marczykowski-Górecki 9 years ago
parent c9809c7d6e
commit f22a06d8ad

@ -15,7 +15,7 @@ TEMPLATE_NAME := $(TEMPLATE_NAME)-$(TEMPLATE_FLAVOR)
endif
endif
# Make sure names are < 32 characters
# Make sure names are < 32 characters, process aliases
fix_up := $(shell TEMPLATE_NAME=$(TEMPLATE_NAME) ./builder_fix_filenames)
TEMPLATE_NAME := $(word 1,$(fix_up))
@ -31,13 +31,13 @@ help:
@echo "make clean -- copy newly generated rpm to installer repo"
rpms:
prepare:
@echo $(TIMESTAMP) > build_timestamp_$(DIST)
rpms: prepare rootimg-build
@echo "Building template: $(TEMPLATE_NAME)"
sudo -E ./prepare_image prepared_images/$(TEMPLATE_NAME).img && \
sudo -E ./qubeize_image prepared_images/$(TEMPLATE_NAME).img $(TEMPLATE_NAME) && \
./build_template_rpm $(TEMPLATE_NAME) || exit 1; \
./create_template_list.sh || : \
./build_template_rpm $(TEMPLATE_NAME)
./create_template_list.sh || :
rootimg-build:
sudo -E ./prepare_image prepared_images/$(TEMPLATE_NAME).img && \

@ -57,7 +57,8 @@ trap cleanup ERR
# ------------------------------------------------------------------------------
# Mount qubeized_image
# ------------------------------------------------------------------------------
export IMG="qubeized_images/$NAME-root.img"
export IMG="qubeized_images/$NAME/root.img"
mkdir -p "qubeized_images/$NAME"
echo "--> Copying $CLEANIMG to $IMG..."
cp "$CLEANIMG" "$IMG" || exit 1

@ -33,16 +33,16 @@ Obsoletes: %{name} > %{version}-%{release}
Qubes template for %{template_name}
%build
cd qubeized_images
pushd qubeized_images/%{template_name}
rm -f root.img.part.*
tar --sparse --dereference -cf - %{template_name}-root.img | split -d -b 1G - root.img.part.
cd ..
tar --sparse --dereference -cf - root.img | split -d -b 1G - root.img.part.
popd
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/%{dest_dir}
for i in qubeized_images/root.img.part.* ; do ln $i $RPM_BUILD_ROOT/%{dest_dir}/`basename $i` ; done
for i in qubeized_images/%{template_name}/root.img.part.* ; do mv $i $RPM_BUILD_ROOT/%{dest_dir}/ ; done
touch $RPM_BUILD_ROOT/%{dest_dir}/root.img # we will create the real file in %post
touch $RPM_BUILD_ROOT/%{dest_dir}/private.img # we will create the real file in %post
touch $RPM_BUILD_ROOT/%{dest_dir}/volatile.img # we will create the real file in %post
@ -69,7 +69,6 @@ fi
echo "--> Processing the root.img... (this might take a while)"
cat %{dest_dir}/root.img.part.* | tar --sparse -xf - -C %{dest_dir}
rm -f %{dest_dir}/root.img.part.*
mv %{dest_dir}/%{template_name}-root.img %{dest_dir}/root.img
chown root.qubes %{dest_dir}/root.img
chmod 0660 %{dest_dir}/root.img

Loading…
Cancel
Save