Commit 9907fc4f authored by Christopher Spinrath's avatar Christopher Spinrath
Browse files

image_(u)mount_if: handle relative paths correctly

findmnt always returns the absolute path to a mount point, so
we have to compare the result with an absolute path.
But $(IMAGE_DIR) may be a relative path; thus, convert it to an
absolute path first.
parent 8cd04168
......@@ -97,6 +97,8 @@ define archdir =
$(WORKSPACE)/$(call to_arch,$1)
endef
IMAGE_DIR=$(WORKSPACE)/image_files
ARCH_DIR=$(call archdir,$(ARCH))
PRIMARY_ARCH_DIR=$(call archdir,$(PRIMARY_ARCH))
SECONDARY_ARCH_DIR=$(call archdir,$(SECONDARY_ARCH))
......@@ -511,12 +513,12 @@ $(IMAGE_DIR)$(GRUB_INSTALL_DIR)/lipinfo.cfg : | $(WORKSPACE)
image_mount_if : $(IMAGE_PART_FILE)
mkdir -p "$(IMAGE_DIR)"
[ "$$(findmnt --target "$(IMAGE_DIR)" -f -n --output=target)" = "$(IMAGE_DIR)" ] \
[ "$$(findmnt --target "$(IMAGE_DIR)" -f -n --output=target)" = "$(shell readlink -f "$(IMAGE_DIR)")" ] \
|| mount "$(IMAGE_PART_FILE)" "$(IMAGE_DIR)"
image_umount_if :
#if something is mounted then umount
[ "$$(findmnt --target "$(IMAGE_DIR)" -f -n --output=target)" != "$(IMAGE_DIR)" ] \
[ "$$(findmnt --target "$(IMAGE_DIR)" -f -n --output=target)" != "$(shell readlink -f "$(IMAGE_DIR)")" ] \
|| umount -d "$(IMAGE_DIR)"
$(call ensure_mount,image) : image_content $(GRUB_ASSEMBLE_DIR)/mbr.img
......
......@@ -29,7 +29,6 @@ ISO_PATTERN_FLAGS=
APT_SOURCE_URL_OVERRIDE=http://ftp.halifax.rwth-aachen.de/ubuntu/
IMAGE_DIR=$(WORKSPACE)/image_files
IMAGE_GIT_URL=https://www.fsmpi.rwth-aachen.de/git/lipstick
IMAGE_GIT_BRANCH=ss15
IMAGE_EXTRA_INFO=
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment