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

Prevent renaming at installation, this will make the process cleaner.
This commit is contained in:
Marek Marczykowski-Górecki 2015-03-09 13:38:09 +01:00
parent c9809c7d6e
commit f22a06d8ad
3 changed files with 12 additions and 12 deletions

View File

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

View File

@ -57,7 +57,8 @@ trap cleanup ERR
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# Mount qubeized_image # 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..." echo "--> Copying $CLEANIMG to $IMG..."
cp "$CLEANIMG" "$IMG" || exit 1 cp "$CLEANIMG" "$IMG" || exit 1

View File

@ -33,16 +33,16 @@ Obsoletes: %{name} > %{version}-%{release}
Qubes template for %{template_name} Qubes template for %{template_name}
%build %build
cd qubeized_images pushd qubeized_images/%{template_name}
rm -f root.img.part.* rm -f root.img.part.*
tar --sparse --dereference -cf - %{template_name}-root.img | split -d -b 1G - root.img.part. tar --sparse --dereference -cf - root.img | split -d -b 1G - root.img.part.
cd .. popd
%install %install
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/%{dest_dir} 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}/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}/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 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)" echo "--> Processing the root.img... (this might take a while)"
cat %{dest_dir}/root.img.part.* | tar --sparse -xf - -C %{dest_dir} cat %{dest_dir}/root.img.part.* | tar --sparse -xf - -C %{dest_dir}
rm -f %{dest_dir}/root.img.part.* 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 chown root.qubes %{dest_dir}/root.img
chmod 0660 %{dest_dir}/root.img chmod 0660 %{dest_dir}/root.img